User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:126.96.36.199) Gecko/20101012 Firefox/3.6.11
Currently mozMatchesSelector returns false when called with an invalid selector, this is the wrong behavior. Here is what the W3C draft says:
"If the given group of selectors is invalid ([SELECT], section 13), the implementation must raise a SYNTAX_ERR exception ([DOM-LEVEL-3-CORE], section 1.4)."
The webkit and ie implementations of this method correctly raise the exception.
Steps to Reproduce:
1. Call mozMatchesSelector with an invalid selector.
raises SYNTAX_ERR exception
Compatibility concern, content/base/src/nsGenericElement.cpp looks easy to fix even for someone not really familiar with the code, should address for this release, I think.
Created attachment 484864 [details] [diff] [review]
I'm wondering if we shouldn't add the tests to content/base/test/file_bug416317.xhtml?
By the way, thank you for your report, Matt :)
Comment on attachment 484864 [details] [diff] [review]
I'm fine either way on the test, but you should be propagating out the actual error from ParseSelectorList instead of assuming it's always SYNTAX_ERR.
Created attachment 485006 [details] [diff] [review]
Comment on attachment 485006 [details] [diff] [review]
Thank you for your report Matt :)
Noted on Firefox 4 for developers.