Re: [selectors4][css3-syntax] should document.querySelector("html /* ") throw? (and some editorial comments)

On 2/3/12 8:52 PM, Kang-Hao (Kenny) Lu wrote:
>    # Unexpected end of style sheet. User agents must close all open
>    # constructs (for example: blocks, parentheses, brackets, rules,
>    # strings, and comments) at the end of the style sheet. For example:
...

> IE9, FF9.0.1, Opera12alpha don't throw in this case, but Chromium 18 and
> Safari 5.1 do throw.

That's presumably because WebKit generally doesn't implement the 
above-quoted provision about end-of-stylesheet.  Trivial testcase:

   <style>div::before { content: "PASS</style>
   <div></div>

which everyone but WebKit passes.

> I don't have an opinion as to which is more correct
> as this example is contrived anyway, but I think the spec should say
> something about it, even if it's an "undefined".

Agreed, but it shoul also be made clear how the Selectors API parsing 
does or doesn't coincide with CSS parsing.  Especially because Selectors 
API wants to change the parsing rules for its arguments so they no 
longer quite match the CSS ones... Putting webapps back on the cc list 
for that reason.

-Boris

Received on Saturday, 4 February 2012 02:51:02 UTC