W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: [css3-syntax] EOF and } in at-rule preludes and selectors

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 29 Jan 2013 19:51:26 -0800
Message-ID: <CAAWBYDC8_uLbO6rc=JUu7CWPHDTX0OhjjNPJogiYok3JNDCT7Q@mail.gmail.com>
To: Simon Sapin <simon.sapin@kozea.fr>
Cc: "www-style@w3.org" <www-style@w3.org>
On Tue, Jan 29, 2013 at 2:32 PM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> A few edge cases:
>
> * EOF in selector mode should be a parse error (a {} block is missing)
> * EOF in at-rule prelude should be like ';'. A parse error for
> declarations-filled or rule-filled at-rules, but not for other at-rules:
>
> data:text/html,<style>@import "data:text/css,body{background:green"
>
> In the example above the @import rule is valid even though it ends with EOF
> rather than ';'
>
> * '}' in either mode should be like EOF, but *only* if this is nested in a
> matching '{' block such as @media {
> * An unpaired '}' in a top-level selector or at-rule prelude should be like
> ']'. It’s preserved token as far as Syntax is concerned, it’s only invalid
> in Selectors, MQ, etc.
>
>
> Maybe this last distinction is what "If the stack of open rules has three or
> more items on it, …" was about?

Ah, that makes sense!  Yes, yes, "@keyframes { 0% } }" should throw
away the style rule and close the at-rule when it sees the first }
token.

I just added, as part of another edit, an explicit term for "top-level
rule", so I'll put the stuff back and invoke that term so it's more
easily understandable now.

Thanks so much for figuring out what that clause was for.  I knew I
had a reason for putting it in.  I should have defined a term, though,
rather than relying on stupid constructions like "if the stack has at
least three rules".

~TJ
Received on Wednesday, 30 January 2013 03:52:14 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT