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 14:24:08 +0100
Cc: Steven Faulkner <faulkner.steve@gmail.com>, public-html-a11y@w3.org
Message-Id: <98231216-2C34-4FE4-88FF-253255206290@googlemail.com>
To: Maciej Stachowiak <mjs@apple.com>
On 12 Sep 2010, at 13:27, Maciej Stachowiak wrote:
> ARIA roles only affect what is reported to AT, so opening this broader question isn't particularly relevant to the default role of the <img> element (if any).
> 
> It's important to realize that the ARIA role is a construct that exists solely for assistive technologies.

Are you really saying that it's okay if default accessibility API mappings differ from what elements communicate generally? I think that would be fairly incoherent.

In any case, the use of "role" semantics is *explicitly* not restricted to accessibility API mappings or even assistive technologies more generally:

"The WAI-ARIA specification neither requires or forbids user agents from enhancing native presentation and interaction behaviors on the basis of WAI-ARIA markup. Mainstream user agents might expose WAI-ARIA navigational landmarks (for example, as a dialog box or through a keyboard command) with the intention to facilitate navigation for all users. User agents are encouraged to maximize their usefulness to users, including users without disabilities."

http://www.w3.org/WAI.new/PF/aria/complete#ua-support

Repeating that ARIA is only for assistive technologies over and over doesn't change what the spec says.

>> If we're serious about saying the accessibility tree must expose graphical UI components as graphics, then we must confront an elephant in the room: the UI graphics people see are increasing added by CSS.
> 
> The fact that particular elements are graphics does need to be exposed to assistive technologies so they can make the right choice in context.

Does this hold true for CSS-generated graphics? If not, why not?

> However, many will treat specially the case of an image that is the sole content of an <a> element or <button>, since in that case it's clearly a graphical UI component.

Is it? What about:

<a href="long-description.html"><img src="chart.png" alt="{Short text alternative}"></a>

> WebKit will go so far as to detect "click" event listeners and will treat things that have them as buttons if they are not already interactive and don't have a more specific role.

This sounds like WebKit is *not* always presenting "img" with non-empty "alt" as if it had 'role="img"', but sometimes presenting it as "img" and sometimes as "button" on the basis of heuristics?

> In some other cases, it's impossible to distinguish content images from UI components. That's unfortunate, but a little excess identification of graphics is probably better than failing to identify content images as such. Or at least, users should have that option.

Yep, I totally agree. That's why I agreed with that "img" should default to role "img" in Bug 10481, and why I've been arguing the need to identify (content) images as images even to blind users for three years 

http://krijnhoetmer.nl/irc-logs/whatwg/20070826#l-118

http://krijnhoetmer.nl/irc-logs/whatwg/20080512#l-462

> If the spec requires not identifying images as such through accessibility APIs, then the spec is simply wrong, and that aspect will not be implemented.

Good. But the spec should be adjusted to say that the default role is "img".

> (It's not clear to me what results from the somewhat convoluted definition of what an image represents, but if it's meant to lead to this conclusion it is wrong.)

IIRC Hixie's original definition of "img" was that it represents its text alternative, but complaints from others caused him to change the definition to "img" representing an image.

>> Consider the icon for an "Edit" button (typically a pencil). Today there are two common patterns for icons:
>> 
>> Pattern 1: "img" element
>> 
>>   <button><img alt="Edit" src="pencil.png"></button>
> 
> Is this pattern actually common? I don't see it very often when debugging web pages. I see buttons that are CSS styled in various ways a lot though.

I don't have data on that - Hixie might - but in my experience it's not uncommon. Perhaps it's more common for navigation menus than toolbars, though, e.g.:

    <a href="contact.html"><img src="contact.png" alt="Contact"></a>

>> Everyone agrees "appropriate" mappings should not be forbidden. (There's some disagreement about what is appropriate.)
> 
> Is there really? Does anyone sincerely think that it's wrong to map an <img> element to the image role in native accessibility APIs by default?
 
Hasn't Hixie *repeatedly* stated he thinks this?

> It seems obviously correct to do this, and it's up to the specific assistive technology to decide whether to specifically identify the image as such, depending on context. Certainly we wouldn't want to encode the appropriate heuristics in the spec.

If we could actually agree on such heuristics and they actually worked (both big ifs), I don't see why not.

--
Benjamin Hawkes-Lewis
Received on Sunday, 12 September 2010 13:24:45 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:14 UTC