Closed Bug 948540 Opened 11 years ago Closed 6 years ago

aria-hidden ignored by VoiceOver

Categories

(Core :: Disability Access APIs, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1123248

People

(Reporter: zachleatherman, Unassigned)

References

(Blocks 1 open bug)

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.63 Safari/537.36

Steps to reproduce:

<button><span aria-hidden="true">This text should not be read aloud</span> Submit</button>

Test case here: http://jsbin.com/urAfuREt


Actual results:

The aria-hidden span was read aloud by VoiceOver, read as “This text should not be read aloud Submit button”


Expected results:

The aria-hidden span should have been ignored by VoiceOver, should read “Submit button”
After a little additional research, it seems like aria-hidden is ignored by Firefox?

    More extensive test case: http://jsbin.com/Idunaruq/1

Orthogonal to the aria-hidden, there is a wrinkle in this test case:

    <span><span class="icon-star" aria-hidden="true"></span> Favorite</span>

is read as "Favorite" and 

    <button><span class="icon-star" aria-hidden="true"></span> Favorite</button>

is read as "Black Star Favorite"
Summary: aria-hidden ignored by VoiceOver on children of button → aria-hidden ignored by VoiceOver
I suspect that nsTextEquivUtils::GetNameFromSubtree doesn't take aria-hidden into account.

http://mxr.mozilla.org/mozilla-central/source/accessible/src/base/RoleMap.h#363
http://mxr.mozilla.org/mozilla-central/source/accessible/src/base/nsTextEquivUtils.cpp#28
Component: Untriaged → Disability Access APIs
Product: Firefox → Core
Version: 26 Branch → unspecified
There has been a lot of debate over the years about aria-hidden implementation. An example from last year is bug 780888.
It is insane that aria-hidden="true" doesn't actually do anything useful in Mozilla. It is an incredibly useful thing in other UAs. Maybe one of the most useful of all the aria attributes, for all kinds of reasons. The insults to authors over in bug 780888 is bristling. This really seems like unbridled animus towards authors, to force them to do things in much harder ways. Mozilla/Firefox seems to be working hard here towards being the IE6 of a11y, where we all have to spend ten times as much effort towards getting things to work right in one particular browser. Welcome to the bad old days of browser compatibility for accessibility.

I now have to use this workaround:

<h4 aria-hidden="true" hidden>
    Content that should not be selected or read aloud, only useful to the sighted, or cannot be display:none for presentational reasons (CSS exists for presentation, after all), or because of redundancy when read aloud.
</h4>

<style>
    [hidden] { display:block; }
</style>
The failure of the original test case in this bug (comment 0) was due to aria-hidden elements being included in name from subtree calculation. That's a duplicate of bug 1123248, now fixed by bug 1349223.

aria-hidden was probably broken for other cases on Mac as well. That's also fixed by bug 1349223, since we now prune aria-hidden elements from the tree altogether, consistent with other browsers.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.