Re: [counter-styles] At-risk list

On Tue, Oct 29, 2013 at 6:37 PM, Reece Dunn <> wrote:
> On 30 October 2013 01:02, fantasai <> wrote:
>> I think we should add 'pad' and 'speak-as' to the at-risk list.
>> Not that I think 'speak-as' is unworthy, but we don't really
>> have much in the way of CSS speech implementations. :/
> FWIW, I have an experimental implementation of a slightly older draft
> of the CSS Counter Styles spec (dated 2012-10-09) that I am using in
> my text-to-speech project (
> This does not currently support 'speak-as' (the property was not
> introduced in the revision I used). However, I intend to improve and
> update the implementation to the current version of the Counter Styles
> spec. When I do this, I can provide feedback on the 'speak-as'
> property.
> A cursory inspection of the property looks ok.
> I have 2 comments regarding named style lookup:
> 1. Is that handling recursive counter style lookup is undefined -- for example:
>     @counter-style foo {
>         speak-as: foo;
>     }
> Should the style be treated as not existing (i.e. default to auto) in this case?

Ah, thanks for catching that.  Cycle detection is currently defined
for the 'fallback' descriptor, so I'll just copy that behavior over to
'speak-as'.  In the case of cycles, yes, it'll default to 'auto'.

> 2. When should counter style resolution take place? That is, given:
>     @counter-style abc { speak-as: def; }
>     @counter-style def { ... }
> Will abc use def or auto as the speak-as value?

CSS doesn't care about ordering constraints except when explicitly
noted.  (That is, stylesheets aren't considered to be processed
eagerly in a particular order; it's a declarative language, so
references can be to things earlier or later in the document, or in
earlier or later documents.)

> If this is valid, speak-as cycles with more than one item are possible
> (e.g. a -> b -> c -> a). Thus, should there be a maximum depth to
> resolve these chains before defaulting to auto?

Resolving 'fallback' chains requires arbitrary-depth cycle detection
already, so resolving 'speak-as' won't be any more difficult.  In
general, there are a few features in CSS now that require
arbitrary-depth cycle detection, such as detecting cycles in Custom
Properties/Variables, so if you're doing a CSS implementation you need
a good cycle detector anyway.  There are appropriate and efficient
algorithms in the literature for this.


Received on Wednesday, 30 October 2013 17:39:21 UTC