Re: [css3-lists] minor issues

On Tue, Dec 6, 2011 at 2:39 AM, Simon Sapin <simon.sapin@kozea.fr> wrote:
> Le 06/12/2011 00:42, Tab Atkins Jr. a écrit :
>>>
>>> 3. (Ok this one is not so minor and could be worth its own thread.)
>>> >  What is the scope for @counter-type rules and how are name conflicts
>>> >  handled? I’d guess they are global to the document being rendered and
>>> > that
>>> >  specified last wins, but some kind of cascade needs to be defined for
>>> > rule
>>> >  of different origin (UA, author, user).
>>
>> Ah, indeed.  I largely just copied the boilerplate from @font-face,
>> and didn't realize the omission.  It works in the way you'd expect -
>> the styles are global, and name conflicts are handled with standard
>> cascade rules.  I've specified this now.
>
>
> This could be made more explicit: counter styles cascade "atomically".
> Unlike properties in normal style rules, counter descriptors do not cascade.
> For example:
>
> @counter-style my-counter { type: repeating; symbols: a b; }
> @counter-style my-counter { symbols: c d; }
>
> The second rule completely masks the first one and is of type symbolic, the
> initial value. It does not merge descriptors with the previous rules as
> other types of rule do with properties:
>
> @page { margin: 2cm }
> @page { padding: 1cm }

Sure.  I've added language to this effect.


> Also, for the 'override' type:
>
> """
> If the specified counter style name isn't the name of any currently-defined
> counter style, it must be treated as if it was overriding the decimal
> counter style.
> """
>
> Does "currently-defined" means "before in cascade order"? Example:
>
> /* 'bar' is not defined before */
> @counter-style foo { type: override bar; }
> @counter-style bar { type: repeating; symbols: "-"; }

No, CSS is a declarative language, and only cares about ordering to
the minimal extent possible needed to drive the cascade.  All things
defined in the entire document are considered available at the same
time.  The point of "currently-defined" is that if you later (through
JS or something) define a counter-style with the given name, the
override style will take that style.


> Finally, does 'override' take the current algorithm at this point of the
> cascade, or the one that eventually wins?
>
> @counter-style bar { type: repeating; symbols: "*"; }
> @counter-style foo { type: override bar; } /*which is it?*/
> @counter-style bar { type: repeating; symbols: "-"; }

Same as above - ordering doesn't matter.  In this example, there is a
*single* counter style named bar, and that's the one that foo
overrides.

~TJ

Received on Tuesday, 6 December 2011 18:53:06 UTC