Closed Bug 286010 Opened 20 years ago Closed 20 years ago

[FIX]Attribute selector rewrites selectorText so that element[attribute] looks like element[attribute=""]

Categories

(Core :: DOM: CSS Object Model, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla1.8beta2

People

(Reporter: ldavismead, Assigned: bzbarsky)

Details

(Keywords: testcase)

Attachments

(3 files)

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

When accessing style rules through document.styleSheets, a rule that looks like
foo[bar]
{
}
in the CSS will have a selectorText property that looks like
foo[bar=""]

Reproducible: Always

Steps to Reproduce:
Open attachment.
Actual Results:  
When the loop alerts the selectorText of each rule, notice that the second
selector alerted (Rule 1: foo[bar=""]) is identical to the third selector
alerted (rule 2).  The third selector matches its CSS source (foo[bar=""]), but
the second selector has been modified.

Expected Results:  
The selector given for rule 1 should be foo[bar].

Notice that the rules are applied to the document correctly.  If the second
selector (foo[bar]) had _really_ been modified to foo[bar=""], the red element
(with a bar value of "quux") would be black.
Keywords: testcase
Attached patch Same as diff -wSplinter Review
Assignee: general → bzbarsky
Status: UNCONFIRMED → ASSIGNED
Attachment #178627 - Flags: superreview?(dbaron)
Attachment #178627 - Flags: review?(dbaron)
OS: Windows XP → All
Priority: -- → P3
Hardware: PC → All
Summary: Attribute selector rewrites selectorText so that element[attribute] looks like element[attribute=""] → [FIX]Attribute selector rewrites selectorText so that element[attribute] looks like element[attribute=""]
Target Milestone: --- → mozilla1.8beta2
Attachment #178627 - Flags: superreview?(dbaron)
Attachment #178627 - Flags: superreview+
Attachment #178627 - Flags: review?(dbaron)
Attachment #178627 - Flags: review+
Fixed.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: