-
-
Notifications
You must be signed in to change notification settings - Fork 626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aria-labelledby does not work to provide accessible name for tables (in Firefox), aria-describedby does #5183
Comments
Comment 1 by jteh on 2015-06-25 23:17 |
Comment 2 by paulbohman on 2015-09-25 03:12 So really there are separate issues here:
|
Comment 3 by paulbohman on 2015-09-25 03:16 |
Comment 4 by jteh on 2015-09-25 04:58 One concern I have is that if we render the name (as calculated by the browser) in all cases and ignore the caption element, we'll lose any formatting in the caption. Even if we manage to work around that, there's another problem: if the element(s) referenced by aria-labelledby are visible, rendering them in the table may cause duplication. |
@bramd: I'd be good to know your thoughts about this |
@bramd TL;DR: Sources:
ARIA spec: aria-label (property) That confirms that
AccName AAM: Text Alternative Computation Basically, if there’s no I suggest you read through the “Compute the text alternative for the |
cc: @MarcoZehe, @jcsteh |
I have found aria-labelledby on table cells to not work as expected on NVDA Chrome and Firefox. I used the following Codepen for testing - Table with Select all checkbox in table header cell NVDA output copied from Speech Viewer.
JAWS output
CHROME: Version 114.0.5735.199 Expectation: |
@LaurenceRLewis, your comment does not seem to be related to the issue at hand. Please create a new issue. |
I can't reproduce this issue; labelling a table with a |
@SaschaCowley I ca nreproduce this with the following minimal example:
Note that you can get the name by using NVDA's navigator/review cursor, but it is not exposed when reading in browse mode. Based on earlier comments I can't say if this has always been the case. So the real issue might be that a table gets named, but the name is not exposed in browse mode. However, that is the same from an end-users' point of view and matches this issue. In short, I think this should be reopened. |
Urgh. The difference between Firefox and Chromium appears to be that Firefox returns the empty string for an empty description, whereas Chromium returns null. NVDA seems to specifically look for null. I could change that in Firefox, but I'm not really sure why NVDA enforces this. I think this was regressed in #12888, but this issue is obviously older than that, so maybe we've had various fixes and regressions of this bug over the years. |
Apologies, I think I misunderstood the issue. Is the expected behaviour here that a line get inserted into the table where a |
@SaschaCowley I think the text from aria-labelledby should be reported in browse and focus mode, something like that seems to be the expected behavior. However, comming back to the discussion about prioritizing aria labelledby over aria-label over caption, I don't know what the consensus is in web design nowadays. We should try to stick to what most web developers do and what the spec recommends. If most people use aria-labelleby to give tables a title, we should honnor that in the virtual document and in focus mode. But I agree with Jamie here, we should be careful which one we support on the fly in order to avoid double speech. And I kind of understand that aria-labelledby might make sense to give a table its title. But aria-label should actually be used as a text alternative for something that otherwise doesn't have a visible text on the screen (e.g. a button which appears as an icon on the screen. What is the advantage of using aria-label over caption for tables? Why should we support that in this case? |
So my proposal would be as follows, not sure whether it is technically possible:
|
…irefox (#16588) Fixes #5183 Summary of the issue: In Firefox, tables labelled with aria-label or aria-labelledby (where the referenced element is not visible) do not have a virtual buffer node inserted with the accessible name of the table. Description of user facing changes Tables now have this node inserted in Firefox, as they already do in Chrome. Description of development approach Since Firefox returns the empty string if no description is given (rather than null as returned by Chrome), update gecko_ia2.cpp to check for the empty string as well as null.
Reported by Wildebrew on 2015-06-25 16:50
NVDA does not read an accessible name for a table when provided using aria-labelledby.
The text was updated successfully, but these errors were encountered: