thorium-reader icon indicating copy to clipboard operation
thorium-reader copied to clipboard

TTS readaloud: aria-label on generic elements with overridden ARIA role, still speaks element textual content

Open danielweck opened this issue 2 years ago • 4 comments

(aria-label should take precedence, just as AT/screen readers do)

danielweck avatar Jul 04 '22 07:07 danielweck

(aria-label should take precedence, just as AT/screen readers do)

But please be aware that aria-label is not allowed for all roles, cf. the exclude list at https://w3c.github.io/aria/#aria-label. It's a common authoring error ito add aria-label attributes when they aren't allowed.

In that case, browsers should ignore aria-label when building the accessibility tree and thus AT would not have access to it. (And the reality is much more complicated still.)

pkra avatar Jul 07 '22 08:07 pkra

Ha ha, sounds like a sweet rabbit hole. Thanks for letting us know :)

danielweck avatar Jul 07 '22 11:07 danielweck

Indeed. There are a couple of JS libraries that effectively implement the accname spec. IIRC none of them are perfect, e.g. I don't think anyone tries to figure out the "true" role since browsers have no getComputedRole API (yet).

pkra avatar Jul 07 '22 12:07 pkra

Related issue: https://github.com/readium/r2-navigator-js/issues/76

danielweck avatar Aug 02 '23 10:08 danielweck