This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26149 - should img alt="" be mapped to role=presentation?
Summary: should img alt="" be mapped to role=presentation?
Status: RESOLVED DUPLICATE of bug 28751
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords: a11y
Depends on:
Blocks:
 
Reported: 2014-06-19 19:27 UTC by steve faulkner
Modified: 2015-06-04 10:33 UTC (History)
10 users (show)

See Also:


Attachments

Description steve faulkner 2014-06-19 19:27:30 UTC
The HTML spec[1] requires an img element with an empty alt (alt="") to be mapped to role=presentation[3]


 Firefox/IE/Chrome does not currently implement this (webkit does)[2]

[1]http://www.w3.org/html/wg/drafts/html/master/dom.html#sec-strong-native-semantics
[2]http://stevefaulkner.github.io/html-mapping-tests/
[3] effect of role=presentation http://www.w3.org/TR/wai-aria-implementation/#mapping_general

from bug opened on firefox there is pushback 
https://bugzilla.mozilla.org/show_bug.cgi?id=1027018
Comment 1 James Craig 2014-06-20 16:12:34 UTC
You wrote:

> webkit does (...map img[alt=""] to [role="presentation"])

Where are you seeing this? On brief glance, it looks as though WebKit doesn't actually map these images to the internal PresentationRole. These images just get ignored, so they don't have an accessible render object. We only expose the presentation role if the presentation node has none-presentational children.

https://github.com/WebKit/webkit/blob/master/LayoutTests/inspector-protocol/dom/getAccessibilityPropertiesForNode-expected.txt#L171
Comment 2 James Craig 2014-06-20 16:14:03 UTC
This bug seems like an implementation detail to me. The mapping could be either role="presentation", or hidden/ignored, or potentially whatever Firefox is doing.
Comment 3 James Craig 2014-06-20 16:14:53 UTC
s/none-presentational/non-presentational/
Comment 4 steve faulkner 2014-06-20 16:29:55 UTC
(In reply to James Craig from comment #1)
> You wrote:
> 
> > webkit does (...map img[alt=""] to [role="presentation"])
> 
> Where are you seeing this? On brief glance, it looks as though WebKit
> doesn't actually map these images to the internal PresentationRole. These
> images just get ignored, so they don't have an accessible render object. We
> only expose the presentation role if the presentation node has
> none-presentational children.
> 
> https://github.com/WebKit/webkit/blob/master/LayoutTests/inspector-protocol/
> dom/getAccessibilityPropertiesForNode-expected.txt#L171

I am probably incorrect


>These images just get ignored, so they don't have an accessible render object." this equates to what (I think) it should do looking at the aria mapping guide it says for Mac role=presentation equates to "Not mapped"

The HTML spec uses ARIA roles states and properties as an abstract indicator when it says img alt="" it does not mean that role=presentation must be exposed it means do whatever you do for role=presentation in the OS/browser.

does that clarify?

see this post for more detail: http://blog.paciellogroup.com/2014/06/html5-accessibility-implementation-support-browsers/
Comment 5 James Craig 2014-06-20 17:21:52 UTC
That clarifies it but I think it may be wrong. The important part in this situation is that the image is not exposed to AT, and that it's an implementation detail of how to do that. Perhaps you need an "ignored" boolean column or need to put the role as "img (ignored)"

WebKit does that by leaving the ImageRole internally and marking it AccessibilityIsIgnored. The platform mappings do not expose ignored views to the plaform APIs (like the AX API on OS X). So in our case these images aren't exposed in the Accessibility tree at all. 

IIRC, Firefox takes a different approach, which is to expose the node but mark it with a property that indicates it's hidden or ignored. 

I think both implementation approaches are legitimate. 

Note that the WebKit automated test example I linked to lists the role retained as "img" b/c it's still an image. The "ignored" flag is the important piece of the puzzle here.

WebKit's internal accessibility model, not the platform API.
<img src="data:image/gif..." alt="">
    exists: true
    label: 
    role: img
    ignored: true
Comment 6 James Craig 2014-06-20 17:31:23 UTC
(In reply to James Craig from comment #1)
> These images just get ignored, so they don't have an accessible render object.

This isn't entirely accurate, but the key piece is that it's marked as ignored in the user agent's accessibility model, and not exposed to the platform accessibility API (WebKit). It would also be fine to expose it to the platform as ignored (Mozilla), but that is a platform-specific implementation detail.
Comment 7 steve faulkner 2014-06-20 19:02:45 UTC
(In reply to James Craig from comment #6)
> (In reply to James Craig from comment #1)
> > These images just get ignored, so they don't have an accessible render object.
> 
> This isn't entirely accurate, but the key piece is that it's marked as
> ignored in the user agent's accessibility model, and not exposed to the
> platform accessibility API (WebKit). It would also be fine to expose it to
> the platform as ignored (Mozilla), but that is a platform-specific
> implementation detail.

so how about we change the mapping to 'no role', must be marked as ignored or omitted from the acc tree?

note: no role= "the user agent has no default mapping to ARIA roles. (However, it could have its own mappings to the accessibility layer.) "
http://www.w3.org/html/wg/drafts/html/master/dom.html#concept-role-none
Comment 8 alexander surkov 2014-06-24 16:37:09 UTC
no role sounds good with me, you might want to have "closest match" that doesn't entails any implementation specifics.
Comment 9 steve faulkner 2014-09-29 09:18:29 UTC
I have updated definition:

 <td><span data-x="concept-role-none">No role</span>. User Agents must identify the <code>img</code> as ignored or omit it from the accessibility tree.
Comment 10 steve faulkner 2015-06-04 10:33:46 UTC

*** This bug has been marked as a duplicate of bug 28751 ***