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

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

From: Steven Faulkner <faulkner.steve@gmail.com>
Date: Mon, 13 Sep 2010 12:26:07 +0100
Message-ID: <AANLkTinZ92VCZ0fJ1ptgQdujc_=2U=kse4odrDqv_J9d@mail.gmail.com>
To: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
Cc: Benjamin Hawkes-Lewis <bhawkeslewis@googlemail.com>, public-html-a11y@w3.org
Hi leif, I must admit that i tend to stop responding to your responses
because I get fatigued by the myriad directions in which a discussion is

but anyway, my understanding of role="presentation" is that when it talks
about element content, it is not talking about states and properties of the
element, but content enclosed in it:

when you look at the accessible tree for this in firefox
<h1 role="presentation">



it just show a 'text leaf' with the accessible name "content"

I am pretty sure this is correct as per WAI-ARIA since the implementors of
ARIA in firefox have worked closely with Rich S and others who
developed WAI-ARIA to implement it.

So due to the way <img> is defined the alt is a property of the <img>
element and aria says

"the user agent *MUST NOT* expose the implicit native semantics of the
element (the role and its states and properties)"

if <img> was like this:

alt text
then it would work , but its not.


On 13 September 2010 11:59, Leif Halvard Silli <
xn--mlform-iua@xn--mlform-iua.no> wrote:

> Steven Faulkner, Mon, 13 Sep 2010 11:04:47 +0100:
> >> "Better questions for getting screen reader user views on UI images
> >> might be:..."
> >
> > yes many better questions could be asked, but I am fairly certain the
> > screen reader users who responded (included a screen reader
> > developer, yahoo accessibility evangelist, a developer working on
> > drupal accessibility),  understood the intent of the question.
> One of them said "unless it's a spacer or other * purely * stylistic
> image". I don't know was meant by "stylistic image". But I would think
> that an image that only represents text in a certain font, would fall
> into that category.
> >> "<button><img alt="Edit" src="pencil.png"></button>"
> >> "because the button text would be represented as just button text in
> >> the accessibility tree rather than as an image with a text
> >> alternative?"
> >
> > NO I would argue for the current behaviour:
> > The accessible tree (can be viewed using firefox DOM inspector) looks
> > like this:
> >
> > - pushbutton > name > bottle
> > -- graphic > name > bottle
> > When an AT such as JAWS encounters the button announces the button
> > role and its accessble name value (from the image alt text) it does
> > not announce the image. BUT the image is not removed by the browser
> > from the accessible tree.
> I don't think this is perfect answer: The author could provide the text
> inside an visually hidden adjacent <span> element and give the <img>
> role="presentation" via alt=<emptystring>. Voila. The benefit of the
> not-removed image would then be gone, since the image would in fact be
> removed.
> It is also backwards that one can set an image *with* empty alt to
> role="img" - without getting a error. Wheras role="presentation" is
> suitable as "validation godsend", as long as we are dealing with <img>
> ... [1]
> It is nice, when it works, that the image role isn't announced. But who
> knows how the AT works? E.g. you said that <a><img alt=foo></a> is
> typically announced as "link graphic foo", but that "link foo" would
> usually be better. [2] (As a matter of fact, VoiceOver does what you
> suggest!)
> Meanwhile, ARIA says that role="presentation": [3] ]] does not cause
> the content contained within the element to be removed from the
> accessible tree [[.
> So isn't the @alt text "content"? Yes it is. It is just as much content
> as the graphic itself. So it shouldn't be removed. After all: the
> reason alt="<empty>" causes role="presentatioN" is because the @alt is
> so significant w.r.t. to what the IMG represents! Bug 10614.
> But, regardless, if the intention is that role="presentation" hides the
> image, are the other workarounds? Yes,  this works (but the @alt text
> shoudl, according to Richard [1], be flagged an error):
> <button role="button" aria-labelledby="pencil" >
>    <img id="pencil" role="presentation" alt="Edit" src="pencil.png">
> </button>
> [1] http://lists.w3.org/Archives/Public/wai-xtech/2010Aug/0073
> [2] http://lists.w3.org/Archives/Public/wai-xtech/2010Aug/0014
> [3] http://www.w3.org/WAI.new/PF/aria/complete#presentation
> [4] http://www.w3.org/Bugs/Public/show_bug.cgi?id=10614
> --
> leif halvard silli

with regards

Steve Faulkner
Technical Director - TPG Europe
Director - Web Accessibility Tools Consortium

www.paciellogroup.com | www.wat-c.org
Web Accessibility Toolbar -
Received on Monday, 13 September 2010 11:27:01 UTC

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