Re: [css-counter-styles] allow use of CSS4 "alt" property with @counter-style/symbols

On Thu, May 15, 2014 at 8:50 PM, Reece Dunn <msclrhd@googlemail.com> wrote:

> On 15 May 2014 10:34, James Craig <jcraig@apple.com> wrote:
> > Inline. cc Alex and David for the Firefox Accessibility question.
> >
> > On May 15, 2014, at 1:47 AM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> >
> >> On Thu, May 15, 2014 at 11:36 AM, James Craig <jcraig@apple.com> wrote:
> >>> Speak-as may account for some simple cases (like the numeric example
> below), but does not allow authors to designate alternative text for the
> symbol-based markers. If you just want numeric markers, there's no reason
> to use "symbols" at all.
> >>>
> >>> The following example is admittedly contrived, but is a better
> illustration of what cannot be accomplished with the "speak-as" property.
> >>>
> >>>     symbols: ◰ ◳ ◲ ◱;
> >>>     alt: 'foo' 'bar' 'baz' 'bop';
> >>>
> >>> "speak-as" provides pretty good coverage of CSS 2's "list-style-type"
> property, but AFAICT it doesn't provide sufficient coverage of CSS3's
> "symbols" property.
> >>
> >> Actually, it can do what you want it to do. Consider this:
> >>
> >> @counter-style a {
> >>   system: fixed;
> >>   symbols: ◰ ◳ ◲ ◱;
> >>   speak-as: b;
> >> }
> >>
> >> @counter-style b {
> >>   system: fixed;
> >>   symbols: foo bar baz bop;
> >>   speak-as: alphabetic;
> >> }
> >
> > That's interesting, if somewhat convoluted. Do others in the group think
> this is preferable to extending CSS4 alt? The single block seems much more
> elegant to me.
> >
> > @counter-style a {
> >   system: fixed;
> >   symbols: ◰ ◳ ◲ ◱;
> >   alt: "foo" "bar" "baz" "bop";
> > }
>
> How would that work with additive-symbols (e.g. roman numerals,
> armenian and hebrew)? For example:
>
> @counter-style unicode-upper-roman {
>     system: additive;
>     additive-symbols: 5 Ⅴ, 4 Ⅳ, 1 Ⅰ;
>     alt: "a", "b", "c";
> }
>
> Would alt apply (Ⅴ => "a", Ⅳ => "b", Ⅰ => "c") in this case? Would
> that make sense in this case? If it is equivalent to symbols, it would
> be invalid in this case as the additive system does not use symbols.
> Compare to:
>
> @counter-style unicode-upper-roman {
>     system: additive;
>     additive-symbols: 5 Ⅴ, 4 Ⅳ, 1 Ⅰ;
>     speak-as: upper-roman;
> }
>
> Here, there is a clear chain of meaning in how to interpret the
> counter style. The same applies for using number-like styling, e.g.:
>
> @counter-style counting-rod {
>     system: numeric;
>     /* NOTE: This example does not account for the tens counting rod
> symbols. */
>     symbols: 〇 𝍠 𝍡 𝍢 𝍣 𝍤 𝍥 𝍦 𝍧 𝍨;
>     speak-as: numeric;
> }
>
> This will speak the counting-rod style as numbers in the correct language.
>
> Anything you can do with counter styles can be used to express
> speak-as rules, so is more flexible than a single alt property.
>
> It also allows you to specify the context of the counter style -- e.g.
> as the unicode-upper-roman references the upper-roman counter style, a
> screen reader/text-to-speech program could read them as "roman numeral
> 14", etc.. With the alt property, the screen reader does not have this
> information.
>
> Given:
>
> @counter-style counting-rod {
>     system: numeric;
>     symbols: 〇 𝍠 𝍡 𝍢 𝍣 𝍤 𝍥 𝍦 𝍧 𝍨;
>     alt: "0", "1", "2", "3", "4", "5", "6", "7", "8", "9";
> }
>
> The screen reader would be forced to read digit by digit, as it does
> not know from the context that this is a number system and can use the
> document's language (e.g. my hexadecimal example below, or an octal or
> binary counter-style).
>
> The counter style system also allows for things like:
>
> @counter-style hexadecimal-spoken {
>     system: override decimal;
>     prefix: "hexadecimal ";
> }
>
> @counter-style hexadecimal {
>     system: numeric;
>     symbols: 0 1 2 3 4 5 6 7 8 9 A B C D E F;
>     speak-as: hexadecimal-spoken;
> }
>
> So you get things like "hexadecimal 24". NOTE: In this example, you
> would still need to be able to localize the prefix string, which is
> not currently supported by counter-styles.
>

Hmmm... I don't think the prefix here makes any sense considering the
current spec.

The spec says:
> the prefix and suffix are added by the algorithm that constructs the
value of the content property for the ::marker pseudo-element

So obviously, they plays no role in the algorithm of counter-style itself,
hence they should play no role in generating the number part of alternative
text as well. They should only be added to the alternative text by the
content of ::marker.

But it reminds me that, it might be useful to make speak-as accept a more
versatile syntax, for example, allow prepending or appending string to wrap
the represent.

- Xidorn

Received on Thursday, 15 May 2014 11:10:42 UTC