W3C home > Mailing lists > Public > public-html-a11y@w3.org > September 2010

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

From: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>
Date: Sun, 12 Sep 2010 19:57:10 +0100
Cc: Maciej Stachowiak <mjs@apple.com>, Steven Faulkner <faulkner.steve@gmail.com>, public-html-a11y@w3.org
Message-Id: <9B86AFF3-5EF5-4E9F-8449-1AC2A4D8225B@googlemail.com>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
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".


> 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.


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 "


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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:55:44 UTC