Re: Proposal: ALT attribute for text

25.8.2011 9:32, Charles Pritchard wrote:

>> So I'm afraid [ARIA] will be used by a small minority of authors and
>> developers only.
>
> We're in the same situation with alt: only a small minority of authors
> and developers use it,

Let's not be _that_ pessimistic. Authors widely use it, though partly 
without clue and just forced to do so, and authoring tools and browsers 
have reasonable though incomplete support to alt attribute. It's more 
like "why don't all authors use alt for all images?" rather than "why 
doesn't anyone ever use it?" issue.

My point is that when it takes years and years to make a significant 
number of documents use a simple attribute like alt even in cases where 
the proper use should be obvious, it will _much_ harder to make authors 
use ARIA.

>> In some use cases, it would suffice to define as follows: an alt
>> attribute on a <span> element or other phrase element indicates the
>> text to be used in place of the element content, if the content cannot
>> be presented as graphic characters; for example:
>> <span alt="diameter">&#x2300;</span>
>> or
>> <span alt="ΓΈ">&#x2300;</span>
>> (A browser would be expected to use the alt fallback if it cannot
>> render the content as the diameter sign, probably due to lack of such
>> character in available fonts. And maybe the idea could be extended to
>> rendering content non-visually; in that case, only the former fallback
>> would make sense.)
>>
> I think that font fallback is a different issue, widely handled by
> Unicode related standards.

This isn't about font fallback (which is not a Unicode issue and which 
is not handled in any standards). It's about what happens when font 
fallback fails (or just isn't applied). What currently happens is that 
the browser renders a small rectangle, a question-mark-like symbol or 
something equally cryptic. What else _could_ it do? Technically it could 
render the code of the character, but would that be useful?

This is comparable to <img> when the image cannot be presented, e.g. 
because the image data is corrupted or the browser just doesn't receive 
it at all.

> Wouldn't something like this work out?:
> <span role="img" aria-label="diameter">&#x2300;</span>
>
> May not be the best example, but it's certainly something I can pick up
> with the scripting environment, and post-process, to get additional
> compatibility out of legacy browsers.

But how would you know when to do that? This is something that the 
browser needs to do, just as it needs to decide that oh well, I didn't 
get the picture, so let me show the alt text. Besides, using
<span title="diameter">&#x2300;</span>
would do the job easier, and would additionally give users access to the 
string "diameter" in _existing_ browsing environments (graphic and 
non-graphic). But it's not suitable for the purpose of telling the 
browser what to do when the character cannot be displayed.

(Besides, is role="img" adequate when the content is a _character_ of 
written language, not an image?)

-- 
Yucca, http://www.cs.tut.fi/~jkorpela/

Received on Thursday, 25 August 2011 07:58:15 UTC