Re: Default role of <IMG> should be "img"

On 12 Sep 2010, at 19:33, Leif Halvard Silli wrote:
>> I find the spec for role="presentation" fairly hard to follow (and I 
>> fear it's going to be impenetrable to your average HTML author), but 
>> I don't think so.
> 
> ARIA says that an element which does have role="presentation", should 
> not be mapped to the accessibility API.

Well, it says "[a]n element whose implicit native role semantics will not be mapped to the accessibility API".

http://www.w3.org/WAI.new/PF/aria/complete#presentation

> I don't know how an <img> that is not mapped to the a11y API is treated. Can someone tell?

UAs MUST not include "elements with role='presentation' that are not focusable" in the accessibility tree.

http://www.w3.org/WAI.new/PF/aria-implementation/#mapping_general

But consider the following markup:

   <button><img role="presentation" src="pencil.png" alt="Edit"></button>

The button /is/ included in the accessibility tree, and ARIA instructs UAs to determine its name using a recursive algorithm extracting text from attributes, child nodes, and CSS generated content. This algorithm includes this check:

"If aria-labelledby and aria-label are both empty or undefined, check for the presence of an equivalent host language attribute or element for associating a label, and use those mechanisms to determine a text alternative. For example, in HTML, the img element's alt attribute defines a label string …"

http://www.w3.org/WAI.new/PF/aria/complete#namecalculation

HTML's mechanisms clearly make "alt" provide the text alternative for the "img", which is why I think the "alt" text would still be exposed to the accessibility tree as part of the name for other elements.

The ARIA spec should probably be clarified to say whether or not role="presentation" affects the application of such host language mechanisms in the calculation of text equivalents.

--
Benjamin Hawkes-Lewis

Received on Sunday, 12 September 2010 18:57:47 UTC