w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
181 stars 48 forks source link

`img` element says `role=img` should not be used #228

Closed dd8 closed 4 years ago

dd8 commented 4 years ago

Given the long-standing problem with VoiceOver / Safari which requires role=img on img elements this is potentially harmful.

For example, validator.w3.org/nu warns about this:

<img src='file.svg' alt='Image description' role='img' >

Fixing the warning makes the image less accessible to VO users.

Yes, VoiceOver / Safari shouldn't be doing this, but it has for at least 3 years and Apple seem resistant to changing this.

LJWatson commented 4 years ago

The problem with making a change like this to a specification is that it enables the browser and/or AT vendor to say they no longer have a bug in their software, and that forever condemns everyone to implementing a hack for the sake of a single implementation.

scottaohara commented 4 years ago

agreed. and upon further reflection I'm concerned we made the wrong choice in moving forward with #165

changing specifications to cater to a single implementor doing things differently, or not fixing long standing bugs is a very slippery slope and I think we need to make sure we don't fall further down it.

dd8 commented 4 years ago

I'm not suggesting changing the browser/AT requirements in html-aam.

Apple obviously disagree with the mapping in html-aam spec, so are unlikely to fix this: https://lists.w3.org/Archives/Public/wai-xtech/2014Feb/0024.html

I'm suggesting a change here in the document conformance requirements in html-aria for authors to remove "should not use role=img on img" - that's the bit that's causing harm.

LJWatson commented 4 years ago

I'm not convinced it's the HTML mapping that is the problem. If VoiceOver announces "group" for an <img> with an SVG source file, it suggests that the old role for the <svg> element is being announced. If that's the case, it's the SVG mapping that is incorrect in WebKit/Safari.

dd8 commented 4 years ago

The VO SVG img issue pre-dates the introduction of the new SVG roles by several years:

VO should use the new SVG roles, but that's a different issue.

Looking at the email from James Craig what they were trying to do was expose accessibility info from SVG referenced by an img src in the same way as inline <svg> elements. That seems more important with a touch interface (e.g. read out the number from this graph under my finger) which might explain their reluctance to change this.

I'll do some digging in the WebKit source to figure out exactly what the code does.

scottaohara commented 4 years ago

closed by added into about NOT RECOMMENDED / examples added in #237