nvaccess / nvda

NVDA, the free and open source Screen Reader for Microsoft Windows
Other
2.08k stars 626 forks source link

Img with aria-hidden="true" cannot be used as target for aria-describedby in IE and Firefox #9443

Open SilvioJeschofnik opened 5 years ago

SilvioJeschofnik commented 5 years ago

When using an aria-hidden image as description for a link, NVDA ignores it in Firefox. In Chrome it behaves as expected.

Having the following code:

`

Document `

NVDA announces

The expected behavior would be, that the image is always announced when referenced using aria-describedby.

LeonarddeR commented 5 years ago

Firefox no longer renders aria-hidden content in the accessibility tree, so NVDA doesn't know about the hidden image at all I believe. Why do you actually want to set aria-hidden on the image?

SilvioJeschofnik commented 5 years ago

When I use a separate hidden span (which will be the way to go for now), it works, even if it is aria-hidden.

I don't want the descriptive content to be read before the actual content, but the image should be rendered before the text. When using the separate span, I need to render the text "PDF" a third time, what I wanted to circumvent.

MichaelKetting commented 5 years ago

@leonardder yes, aria-hidden removes the elements from the accessiblity tree, similiar to HTML hidden=hidden attribute, just only for the AT instead of UI and AT. The thing is, content referenced via aria-describedby and aria-labelledby will be read even if it's not part of the AT. And it works in Firefox 66 for other places, e.g. wenn you use a hidden or aria-hidden element as a label or description for an input field. It's just the alt-text of the image that's causing problems.

LeonarddeR commented 5 years ago

cc @jcsteh

Adriani90 commented 4 years ago

I saw a similar issue with aria describedby in a span. Actually, NVDA reports this in Crome, Edge and IE as expected, but only in focus mode or when pressing nvda+tab or nvda+shift+o. In Firefox this is not reported in browse mode, nor in focus mode. Since users mostly navigate websites in browse mode, I would suggest to find a workaroung in NVDA to report this in browse mode as well. Otherwise users would miss information which might be important. @MarcoZehe, @jcsteh what do you think?

jcsteh commented 4 years ago

In Firefox this is not reported in browse mode, nor in focus mode.

Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1631695

Since users mostly navigate websites in browse mode, I would suggest to find a workaroung in NVDA to report this in browse mode as well.

This is a broader issue and should be considered separately from this one. Briefly, you can get this on demand with NVDA+numpad5/NVDA+shift+o as you've noted, but that obviously assumes you know it's there. We don't always want to report descriptions though because they're secondary information. I suspect there's already another issue covering this, but I don't have it off the top of my head.

Adriani90 commented 4 years ago

I agree with the laast point in your comment Jamie, I think this could be optional, for example a checkbox in browse mode settings called "report element descriptions".