Closed
Bug 475198
Opened 15 years ago
Closed 12 years ago
cssRule's selectorText and cssText don't preserve parentheses
Categories
(Core :: DOM: CSS Object Model, defect)
Core
DOM: CSS Object Model
Tracking
()
RESOLVED
FIXED
People
(Reporter: benjamin.lerner, Unassigned)
Details
Attachments
(1 file)
454 bytes,
text/html
|
Details |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2008120122 Firefox/3.0.5 Build Identifier: Firefox 3.0.5 -- Shiretoko nightly For selectors containing parentheses--e.g. treechildren::-moz-tree-row( foo bar )--syntax as indicated at https://developer.mozilla.org/en/CSS/:-moz-tree-row, getting the cssText or selectorText returns the text without parentheses or spaces--e.g. treechildren:--moz-tree-rowfoobar--which is of course not the intended result. Reproducible: Always Steps to Reproduce: See the attached file. The particular project I'm working on involves Firefox extensions and requires parsing CSS files and extracting their declarations. Since it's an extension project, I'm going to encounter CSS rules like this containing Mozilla proprietary extensions to the CSS syntax, so I need to use Mozilla's parser... If there's a workaround for this bug, I'd be happy to use that instead, but until then this blocks my project somewhat.
Reporter | ||
Comment 1•15 years ago
|
||
I can get the raw text of the entire CSS file using the innerHTML property of the style tag, but that doesn't help me find the legal CSS declarations in the file, or what the cssText of those declarations is.
Reporter | ||
Comment 2•15 years ago
|
||
If this helps -- it does not matter whether I use an HTML IFrame or a XUL IFrame, with CSS included from web content or chrome or a style tag. So it's not likely to be a chrome/web permissions problem (since the example I cited was a Mozilla-private property for a XUL element)
Updated•15 years ago
|
Version: unspecified → 1.9.1 Branch
Comment 3•15 years ago
|
||
Confirmed on mozilla-central. I'll teach my CSS parser fuzzer to look for more bugs like this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 4•15 years ago
|
||
That got me bug 475214, bug 475215, and bug 475216. Thanks for the inspiration, Ben ;)
Updated•15 years ago
|
OS: Windows XP → All
Hardware: x86 → All
Version: 1.9.1 Branch → Trunk
Sounds like nsCSSSelector::ToStringInternal needs to be taught to serialize this correctly. If any instances of this selector were tested in layout/style/tests/test_selectors.html we would have caught this...
Reporter | ||
Comment 6•15 years ago
|
||
A (tangential) documentation & parsing question: which is the correct syntax? a) treechildren::-moz-tree-line(selected focus) <<-- sans comma b) treechildren::-moz-tree-line(selected, focus) <<-- with comma It appears that (a) is correct according to the W3C spec, (b) is properly rejected by Firefox when I try it, (a) is recommended by https://developer.mozilla.org/en/CSS/:-moz-tree-row, and (b) is recommended by http://www.xulplanet.com/tutorials/xultu/treestyle.html (linked to from the first page), and (b) is used by e.g. AdBlock Plus. I recognize this bug is about the CSS printing issue I raised above; I seem to have lost the link to filing MDC bugs, though. If some kind someone could provide an answer and/or the link, I'll redirect this as appropriate :)
Comment 7•15 years ago
|
||
https://bugzilla.mozilla.org/enter_bug.cgi?product=Mozilla%20Developer%20Center
QA Contact: general → style-system
Comment 8•12 years ago
|
||
I think this was fixed by bug 602341.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•