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

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

> On 15 May 2014 09:47, 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;
> > }
> >
> > The spec seems to be ambiguous by saying alphabetic is "spell it out
> > letter-by-letter", but in my current implementation for Firefox, this
> should
> > give you exactly what you want.
>
> The spell out "letter-by-letter" note is for e.g. lower-alpha that
> will generate things like "aa", "ab", ..., "bq", "aaaabvg". Speaking
> these as words will result in nonsensical pronunciations.
>
> However, I do see a case for words like you have written above (as per
> this case). So maybe there needs to be a "speak-as: words;" to cover
> this case.


I think it might be better to rename the "alphabetic" to "symbol", and let
the reader read it symbol-by-symbol instead of letter-by-letter or
word-by-word. In fact, letter-by-letter is itself ambiguous, since the word
"letter" is not defined anywhere in the spec. (Though it could be an
impl-defined behavior)

However, if we use symbol-by-symbol, there is one more consideration, which
is the complex builtin counter styles - they even have no symbol.


> You could also have:
>
> @counter-style box-corner-spoken {
>   system: fixed;
>   symbols: "top left", "top right", "bottom right", "bottom left";
>   speak-as: words;
> }
>
> Given a modification of the original example:
>
> @counter-style box-corner {
>     system: fixed;
>     symbols: ◰ ◳ ◲ ◱;
>     suffix: ':';
>     speak-as: alphabetic; /* force reading the Unicode characters */
> }
>
> I would expect the screen reader to use an appropriate pronunciation
> of those symbols (this is a quality of implementation issue). For
> number-like symbols (fractions, roman numerals, counting rod numerals,
> etc.), a screen reader could interpret this as numbers (e.g. "roman
> numeral 145" or "counting rod 67").
>
> The alphabetic speak-as form specifies that the codepoints are read in
> the document's language. An issue with using "speak-as: words;" is
> that the language may be different. Therefore, you should be able to
> use the language specifier, e.g.:
>
> @counter-style box-corner-spoken:lang(de) {
>   system: fixed;
>   symbols: "oben links", "oben rechts", "unten rechts", "unten links";
>   speak-as: words;
> }
>
> I am not sure if this is valid in the current spec (:lang() can be
> used on element selectors (e.g. `p:lang(gd)`), but I am not sure if
> they can be used on at-rules).
>

I don't think it is valid as :lang() is a part of selector while
@counter-style is an at-rule which does not accept a selector.

- Xidorn

Received on Thursday, 15 May 2014 10:36:22 UTC