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

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

From: Simon Sapin <simon.sapin@exyr.org>
Date: Sat, 15 Jun 2013 08:39:23 +0100
Message-ID: <51BC1A2B.90401@exyr.org>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
CC: "www-style@gtalbot.org" <www-style@gtalbot.org>, W3C www-style mailing list <www-style@w3.org>
Le 15/06/2013 07:05, Tab Atkins Jr. a écrit :
> On Fri, Jun 14, 2013 at 10:01 PM, "Gérard Talbot"<www-style@gtalbot.org>  wrote:
>> Le Ven 14 juin 2013 13:41, Simon Sapin a écrit :
>>> 3. h1, h2/* No block */<EOF>
>>
>> No opening curly brace "{" either here. There is no declaration block
>> which could or would have to be applied anyway. I don't see how this sort
>> of code can be tested.
> You can use the CSSOM to observe whether a rule is created or not.
>
> Simon, I think the "throw away the rule" behavior was probably from my
> early over-zealous error-handling in the parser, and I'd be fine going
> either way - keeping it as an error which throws away the rule, or
> making it valid and just create an empty rule.

To clarify: my proposal is to keep the current Syntax 3 behavior. I just 
want to check that there is no objection, since it seems to be a corner 
case that nobody thought about. (Although I admittedly didn’t search the 
list’s archives.)

Adding some examples to the "Error handling" section could also be good.


> I'm perfectly okay with your examples #2 ending up as an error, since
> fixing it would require reintroducing the
> "rule-filled/declaration-filled/neither" concept that I'm glad we got
> rid of.

Syntax is perfectly happy with "@media print<EOF>", it’s just an at-rule 
without a block (the ending semicolon is implied.) It’s at the 
Conditional Rule level that a block is expected for @media and this rule 
is deemed invalid.

-- 
Simon Sapin
Received on Saturday, 15 June 2013 07:39:50 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:12 UTC