argument to :dir() and :-moz-locale-dir() is treated case-sensitively; should be case-insensitive

RESOLVED FIXED in mozilla17

Status

()

Core
CSS Parsing and Computation
P3
normal
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: jtd, Assigned: dbaron)

Tracking

Trunk
mozilla17
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

6 years ago
The code in CSSParserImpl::ParsePseudoClassWithIdentArg contains:

  // -moz-locale-dir can only have values of 'ltr' or 'rtl'.
  if (aType == nsCSSPseudoClasses::ePseudoClass_mozLocaleDir) {
    if (!mToken.mIdent.EqualsLiteral("ltr") &&
        !mToken.mIdent.EqualsLiteral("rtl")) {
      return eSelectorParsingStatus_Error; // our caller calls SkipUntil(')')
    }
  }

http://mxr.mozilla.org/mozilla-central/source/layout/style/nsCSSParser.cpp#3419

Those comparisons need to be case-insensitive.
(Assignee)

Comment 1

6 years ago
Yep, should be LowerCaseEqualsLiteral.
Blocks: 478416
(Assignee)

Updated

6 years ago
Summary: minor case-sensitivity error in parsing of -moz-locale → argument to :-moz-locale-dir() is treated case-sensitively; should be case-insensitive
(Assignee)

Comment 2

6 years ago
Created attachment 611465 [details] [diff] [review]
patch
Attachment #611465 - Flags: review?(enndeakin)
(Assignee)

Comment 3

6 years ago
Comment on attachment 611465 [details] [diff] [review]
patch

Er, wait, that's not quite sufficient; need to lowercase what we store too.
Attachment #611465 - Flags: review?(enndeakin)
(Assignee)

Comment 4

6 years ago
(If someone else wants to finish this that's fine with me.)
(Assignee)

Comment 5

5 years ago
This is higher priority now that bug 562169 landed.  We need to get it in the same release as bug 562169.  Patch coming, once I make sure the tests pass.
Assignee: nobody → dbaron
Blocks: 562169
Status: NEW → ASSIGNED
Summary: argument to :-moz-locale-dir() is treated case-sensitively; should be case-insensitive → argument to :dir() and :-moz-locale-dir() is treated case-sensitively; should be case-insensitive
(Assignee)

Comment 6

5 years ago
Created attachment 653549 [details] [diff] [review]
Treat argument of :-moz-locale-dir() case-insensitively.  ()
Attachment #653549 - Flags: review?(smontagu)
(Assignee)

Updated

5 years ago
Attachment #611465 - Attachment is obsolete: true
Attachment #653549 - Flags: review?(smontagu) → review+
(Assignee)

Comment 7

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/d086edab3616
Priority: -- → P3

Comment 8

5 years ago
https://hg.mozilla.org/mozilla-central/rev/d086edab3616
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.