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

Re: [counter-styles] At-risk list

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Wed, 30 Oct 2013 16:13:26 -0700
Message-ID: <CAAWBYDDAKUKhEMkGr6pAfdfkrk2_1hoYyAaes8Mc=eMUxKXREw@mail.gmail.com>
To: Reece Dunn <msclrhd@googlemail.com>
Cc: fantasai <fantasai.lists@inkedblade.net>, "www-style@w3.org" <www-style@w3.org>
On Wed, Oct 30, 2013 at 11:11 AM, Reece Dunn <msclrhd@googlemail.com> wrote:
> On 30 October 2013 17:38, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> On Tue, Oct 29, 2013 at 6:37 PM, Reece Dunn <msclrhd@googlemail.com> wrote:
>>> On 30 October 2013 01:02, fantasai <fantasai.lists@inkedblade.net> 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 (http://reecedunn.co.uk/cainteoir/engine).
>>> 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'.
> The note in the fallback descriptor mentions that cycles are not
> strictly an error. The example given is an odd/even counter style
> pair. It is not clear in the note when a cycle constitutes an error --
> is it that if no matching value is found after walking the graph a
> complete cycle, then there is an error? That would make sense.

Yeah.  The note is just a warning against deciding that there's a
cycle based on a naive check of 'fallback' values on the counter
styles themselves, as you're supposed to do fallback on a per-value
basis, and each individual value might be cycle-free.

> So if I am reading the spec correctly, the traversal be something like:
> 1.  traverse the counter styles via the speak-as property, resolving
> cycles and default values accordingly;
> 2.  traverse the fallback chain as done for resolving the presentation
> counter style from the counter style resolved in (1).


> Thus, if you have:
> @counter-style odd_even { speak-as: 'odd_even_speak'; }
> @counter-style odd_even_speak { speak-as: 'odd_speak'; }
> @counter-style odd_speak { symbols: 'odd'; fallback: 'even_speak'; ... }
> @counter-style even_speak { symbols: 'even'; fallback: 'odd_speak'; ... }
> Then the text being spoken will resolve as 'odd', 'even', 'odd', ...
> as the fallback chain is resolved.


> NOTE: I am not sure exactly how you
> would specify an alternating fallback chain as described in the note
> within the fallback property description.

You can't, actually, at least not through to infinity.  Any additive
style that can produce a representation for 1 can produce a
representation for *any* positive value.  But you can produce
something that produces *some* of the odd numbers: for example, if you
provide symbols for 4, 3, and 2, it'll produce all numbers except for
those that are 4n+1 (1, 5, 9, 13, etc.).

Don't worry too much about it. ^_^

Received on Wednesday, 30 October 2013 23:14:19 UTC

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