Coder Social home page Coder Social logo

Comments (4)

sideshowbarker avatar sideshowbarker commented on August 12, 2024 1

Upon further reflection, I realize this could well be a copypasta spec bug in the AAM spec — so I raised w3c/html-aam#335 over there to get clarification.

from encoding.

annevk avatar annevk commented on August 12, 2024

cc @hsivonen

from encoding.

sideshowbarker avatar sideshowbarker commented on August 12, 2024

<td class=unmapped aria-label=Unmapped><dl><dt>U+0000<dd>�<dd> </dl>

My reading of the relevant best-practice guidance and relevant spec requirements lead me to believe a warning for that is appropriate, and so the aria-label attributes should be dropped from those td elements.

As far as the spec requirements go, https://w3c.github.io/html-aam/#other-tabular-data-elements says that for “tr, td, th Elements Accessible Name Computation”, the step that implementations must start with is:

If the table element has an aria-label or an aria-labelledby attribute the accessible name is to be calculated using the algorithm defined in Accessible Name and Description: Computation and API Mappings 1.1.

Notice it says “the table element”. So I take that to mean that implementations must essentially ignore whatever aria-label attribute a td, th, or tr element might have, and instead look back up the tree and use whatever aria-label attribute the ancestor table element has.

Does my reading of that seem correct?

If my reading of that is in fact correct, then as far as the checker behavior goes, doesn’t that mean it’s appropriate for the checker to warn about not using aria-label with td, th, or tr elements?

As far as the related best-practice guidance, the source I have been following for that is https://html5accessibility.com/stuff/2020/11/07/not-so-short-note-on-aria-label-usage-big-table-edition/, which explicitly recommends not using aria-label with td, th, or tr elements. For those, it notes “aria-label use not well supported” (meaning, not well supported in UAs/AT).

from encoding.

sideshowbarker avatar sideshowbarker commented on August 12, 2024

Update: @scottaohara has updated the relevant language in the AAM spec to make it more clear. So I think it now unambiguously states the relevant implementation requirements. (Thanks Scott!)

However, at w3c/html-aam#335 (comment), Scott points out:

That said, while using aria-label on these elements is valid and is meant to be respected when determining the name of the elements by browsers, as Steve noted in his html5accessibility post, support for aria-label with AT is rather spotty.

For instance with this table NVDA with Firefox and Chromium ignore the aria-label when navigating the list. So none of the coloring of the table will be accessible for people using this browser/AT combo.

With VoiceOver, on macOS (but not iOS) the aria-label is respected but that makes all cells initially announce as the aria-label value (e.g., "Two bytes"), requiring a user to navigate into the cell to determine what the actual value presented is.

tldr; these tables are valid, but the legend information is either not going to be announced, or it is but it will create an extra step for AT users to hear the actual content of the table cell.

Therefore, I think having the checker not emit a warning for a td element with aria-label would be not be helpful for accessibility. Therefore, I think the right fix here is to change the markup.

@scottaohara, can you suggest any alternative ARIA markup for the https://encoding.spec.whatwg.org/windows-1252.html table, or is it in fact the case that those table cells shouldn’t have any ARIA markup at all?

And to be clear, replacing aria-label with title would not be an improvement, right? (I assume that if UAs/AT don’t end up getting the aria-label text announced usefully, they also must not get the title text announced usefully either…)

from encoding.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.