Re: [CSS21][css-syntax] Does selector+EOF create an empty rule?

On 6/14/13 7:41 PM, Simon Sapin wrote:
> Hi,
>
> The "Unexpected end of style sheet" rule of CSS 2.1 says " User agents 
> must close all open constructs (for example: blocks, parentheses, 
> brackets, rules, strings, and comments) at the end of the style sheet."
>
> Does this apply to rules that are (in Syntax 3 terms) in their 
> "prelude"? For example:
>
> 1. @import "foo.css"/* No semicolon */<EOF>
> 2. @media print/* No block */<EOF>
> 3. h1, h2/* No block */<EOF>
>
> Only 1. has an effect on the cascade, but all three examples are 
> testable in CSS OM.
>
> In the Syntax 3 ED as current written, EOF in the middle of an 
> at-rule’s prelude, it implies a semicolon:
>
> 1. is assumed to be @import "foo.css"; and is valid
> 2. is assumed to be @media print; which is not a valid @media rule
>
> In a qualified rule prelude (as in 3.) EOF is an error and the rule is 
> dropped. In other words, EOF in the middle of a selector does *not* 
> create a style rule in the OM.
>
> Mozilla issue: https://bugzilla.mozilla.org/show_bug.cgi?id=446226
>
>
> I think that this Syntax 3 behavior makes the most sense, and would 
> like to check WG consensus.
>
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/2325

Presto/Blink/WebKit/Gecko/IE10 all drop the rule.

-- 
Simon Pieters
Opera Software

Received on Monday, 17 June 2013 11:25:39 UTC