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

Re: [css-syntax] string to number feedback

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 22 Jul 2013 09:24:08 -0700
Message-ID: <CAAWBYDAZ-R_-Pc_BiUrLDjdcdb7_UjcTFq3dXS3DcPAG7SJb1A@mail.gmail.com>
To: Zack Weinberg <zackw@panix.com>
Cc: "Marc O'Morain" <marc@marcomorain.com>, www-style list <www-style@w3.org>
On Sat, Jul 20, 2013 at 9:54 AM, Zack Weinberg <zackw@panix.com> wrote:
> On Sat, Jul 20, 2013 at 12:46 PM, Marc O'Morain <marc@marcomorain.com> wrote:
>>> {
>>>   width: 100%;
>>> }
>>
>> This input would be accepted by the railroad diagrams (stylesheet =>
>> qualified rule => declaration list, bypassing the 'component value' in
>> the 'qualified rule' diagram). There should not be a route around the
>> 'component value' in 'qualified rule'.
>
> You may have tripped over the less-than-obvious distinction between
> grammar productions that accept valid CSS and grammar productions that
> arrange for predictable error recovery.  If I remember correctly, the
> example you show is indeed invalid, but error recovery is supposed to
> resynchronize at the close brace; in other words, if there were a
> valid rule immediately after the close brace, it would not be
> discarded.  The way Syntax 3 expresses this (or did the last time I
> looked at it anyway) is to say that this does match the qualified-rule
> production but then it's invalid because the selector is empty.

Syntax does not judge the validity of a qualified rule with an empty
prelude - it leaves that to the individual rule grammars.

But otherwise, yes, you're right - Syntax is concerned with producing
a stylesheet out of its input while honoring the error-recovery rules,
and the current algorithms do that exactly.  What a validator thinks
of the CSS is irrelevant to this purpose.

~TJ
Received on Monday, 22 July 2013 16:24:58 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:32 UTC