Closed
Bug 827642
Opened 11 years ago
Closed 11 years ago
CSS parser rearranges selector text into canonical format
Categories
(Core :: CSS Parsing and Computation, defect)
Core
CSS Parsing and Computation
Tracking
()
RESOLVED
INVALID
People
(Reporter: fryn, Unassigned)
Details
I discovered while debugging a patch for bug 821859 that the CSS parser rearranges selector text into its own preferred canonical format and then returns this for the selectorText property of the CSSRule interface. This can lead to unexpected failures when trying to loop through style sheets to match rules by selector text. Is this behavior intended?
Reporter | ||
Comment 1•11 years ago
|
||
For example, a:not([c])[b] becomes a[b]:not([c])
Comment 2•11 years ago
|
||
This happens with any object model. The DOM does similar things. So insofar as there's an object model involved, yes this is intended. We don't store the text; we store an object with some fields; when you ask for .cssText we serialize the object.
Reporter | ||
Comment 3•11 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #2) > This happens with any object model. The DOM does similar things. Good point. That makes sense. Thanks for the concise explanation. :)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•