aria-label, aria-labelledby and aria-describedby: very unforeseeable behaviour #5398

Closed
nvaccessAuto opened this Issue Oct 5, 2015 · 2 comments

Projects

None yet

1 participant

@nvaccessAuto

Reported by jmuheim on 2015-10-05 14:35
I just noticed that although the aria-label, aria-labelledby and aria-describedby attributes are said to work on every element (see http://www.w3.org/TR/wai-aria/states_and_properties#aria-describedby), they only seem to work for a few elements like a, and not for e.g. div or p in NVDA and JAWS.

I have created a small codepen to demonstrate the issue (browse it using browse and focus mode):

http://codepen.io/jmuheim/pen/avWbPe

For example, in NVDA, on the a element, the aria-label and aria-labelledby seem to work in both browse and focus mode. But aria-describedby is only announced in focus mode, not in browse mode.

For the input element, none of the attributes seem to work in browse mode, but all work in focus mode.

For "bare" text elements like p or div, none of the attributes seem to work.

In JAWS, it's quite similar behaviour, but at least for the p element, when there is an aria-describedby, it announces that a description can be read by pressing "JAWS + alt + r".

I don't really see a clear pattern for this, so I wonder what are the general rules in NVDA on how to use these attributes? Or better: why don't they simply work for every element, as the spec proposes?

@nvaccessAuto

Comment 1 by jteh on 2015-10-05 23:51
They do in fact "work" on every element. However, "work" means that they label/describe an element. The spec does not say anything about whether/how they should affect the content that is rendered in browse mode or equivalent. I've already covered this on several occasions (e.g.e #1354), but here are a few quick points as to why we don't want to do this unconditionally:

  • It does make sense to override the content of a link or button with its label; e.g. +
  • If we overrode the content of a div with its label, labelled landmarks, sections, etc. would completely replace the content with their label; e.g.
    This content would be overridden
  • A description is secondary information. The closest visual representation is a tool tip, which only appears when a sighted user mouses over the element; i.e. they explicitly show interest. Similarly, NVDA reads the description when a user focuses, navigates using single letter navigation or specifically queries the element.
    Changes:
    Added labels: invalid
    State: closed
@nvaccessAuto

Comment 2 by jmuheim on 2015-10-21 09:05
Thanks for explaining. I asked the same question on StackOverflow, there's some non-screenreader-speicific information, too:

http://stackoverflow.com/questions/32951169

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment