W3C home > Mailing lists > Public > www-style@w3.org > February 2014

Re: [css-counter-styles] About override loop

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Fri, 21 Feb 2014 16:46:08 -0800
Message-ID: <CAAWBYDD=36mkL9F3KVJe87MN5Pr3QN-NS6u9dt13zEiqVhR06g@mail.gmail.com>
To: Xidorn Quan <quanxunzhen@gmail.com>
Cc: www-style list <www-style@w3.org>
On Fri, Feb 21, 2014 at 2:26 PM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> On Sat, Feb 22, 2014 at 8:33 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> Is it easier to handle it in the way you suggest?  I would think it's
>> easier to just detect a cycle and then adjust the internal 'system'
>> value of all of the offending counter styles to override decimal
>> instead.  Then there's no special behavior.
>
> Yes, I think it is easier to implement in the way I suggested. For
> that way, recursive call can still be used with some tricks, like
> temporarily specifying the overridden style to decimal, to avoid
> infinite loop. But if all styles in loop has to be treated as
> overriding decimal, it is necessary to add an explicit loop detection,
> and a specific procedure for styles in cycle.
>
> In addition, I think doing a minimal failure is more intuitive, isn't it?

Depends.  CSS walks a balancing act between failing minimally and
failing usefully - if you try to be too smart in error-handling, it
becomes harder to debug (as something *mostly* works right, except for
some weird bits), and harder to extend in the future.

That's why we simply reject properties that don't conform to their
grammar, but reject *only* the property, not the whole rule or the
whole stylesheet.  That's a good level of "ignoring" in practice.

~TJ
Received on Saturday, 22 February 2014 00:46:54 UTC

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