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

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.

James

On May 14, 2014, at 6:09 PM, Reece Dunn <msclrhd@googlemail.com> wrote:

> On 15 May 2014 01:51, James Craig <jcraig@apple.com> wrote:
>> The current Counter Styles draft <http://www.w3.org/TR/css-counter-styles-3/> has an accessibility problem. It allows use of meaningful symbol-based list markers, without the ability to declare alternative text for the list markers. List markers are currently spoken by many screen readers, but the spec's example would be meaningless or mispronounced at best.
>> 
>> @counter-style box-corner {
>>    system: fixed;
>>    symbols: ◰ ◳ ◲ ◱;
>>    suffix: ':';
>> }
>> 
>> I think this could possible be resolved by extending the CSS4 "alt" property [1].
>> Previous discussion only allowed its use on pseudo elements. E.g.
>> 
>> li::before {
>>    content: counter(box-corner);
>>    alt: counter(numbered);
>> }
> 
> This is supported by the speak-as property on the counter-style itself:
> 
> @counter-style box-corner {
>    system: fixed;
>    symbols: ◰ ◳ ◲ ◱;
>    suffix: ':';
>    speak-as: numeric;
> }
> 
> However, the |speak-as| property is optional here as it defaults to
> |auto|, and as |system| is |fixed|, the |speak-as| property is
> computed to |numeric|.
> 
> Screen readers and similar products should respect the |speak-as|
> property. Also, web browsers should expose enough information to allow
> screen readers to achieve this (or expose the |speak-as| text via the
> a11y interfaces, so the screen readers will read lists using these
> constructs as numbers). However, that is a quality of implementation
> issue.
> 
> Thanks,
> - Reece H. Dunn [http://www.reecedunn.co.uk]
> 
>> But I think the "alt property could be extended to be part of the counter declaration so that each use of the counter style would get it by default:
>> 
>> @counter-style box-corner {
>>    system: fixed;
>>    symbols: ◰ ◳ ◲ ◱;
>>    alt: '1' '2' '3' '4';  /* or alt: decimal; ? */
>>    suffix: ':';
>> }
>> 
>> Cheers,
>> James Craig
>> 
>> [1] Alt in CSS4 on generated content pseudo elements:
>> http://lists.w3.org/Archives/Public/www-style/2012Nov/0318.html
>> 
>> PS. I'm aware ◰ ◳ ◲ ◱ means 5, 3, 5, 7 in some number sets, not 1, 2, 3, 4. ;-)
>> 
>> 
> 

Received on Thursday, 15 May 2014 01:37:08 UTC