User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) 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.
Created attachment 358654 [details] Short test case demonstrating the problem 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.
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)
Confirmed on mozilla-central. I'll teach my CSS parser fuzzer to look for more bugs like this.
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...
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 :)
I think this was fixed by bug 602341.