Closed Bug 279377 Opened 20 years ago Closed 20 years ago

Selector for attribute with periods in its name doesn't seem to work

Categories

(Core :: CSS Parsing and Computation, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: lpb+moz, Assigned: dbaron)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

CSS file or <style> element with the following styles:

[attr.name.display = "false"] { display: none; }
[attr-name-display = "false"] { display: none; }

Only the second will work in Firefox/1.0 even though both are valid attribute names.

Reproducible: Always

Steps to Reproduce:
1.Create CSS file or <style> element with the following styles:

elem[attr.name.display = "false"] { display: none; }
elem[attr-name-display = "false"] { display: none; }

2. Create a page with the following elements:
        <elem attr.name.display="false" style="color: red; ">this should not
show</elem>
        <elem attr-name-display="false" style="color: green; ">this should not
show</elem>



Actual Results:  
You will see the red text and not the green text.

Expected Results:  
You should not see either text.

See http://www.w3.org/TR/xml11/#NT-Name for the definition of Name for attributes.
See http://www.w3.org/TR/CSS21/grammar.html for what's valid in a CSS
identifier.  The periods must be escaped, e.g., [attr\.name\.display = "false"]
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
And that works like a charm. I've bookmarked the grammar page for future reference.
You need to log in before you can comment on or make changes to this bug.