Conversation
✅ Deploy Preview for wai-aria ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Tagging F2FCandidate because if this third-attempt PR (or maybe it’s the fifth?) hasn't merged by TPAC, we should lock the doors until it is. |
|
@cookiecrook i had done this work as well for html aam #2215 |
|
Taking a note from the WG call today to double-check the history for |
|
Discussed during triage today: https://www.w3.org/2025/10/09-aria-minutes.html#31d8 I believe @cookiecrook has some follow up tasks and we are primarily waiting for a second implementation or stronger implementation commitment. |
|
Confirmed |
|
Both |
…ined in the PR comment thread
cookiecrook
left a comment
There was a problem hiding this comment.
Adding comments to make review easier.
| </tr> | ||
| <tr> | ||
| <th class="role-namefrom-head" scope="row">Name From:</th> | ||
| <td class="role-namefrom">author</td> |
There was a problem hiding this comment.
Reviewer context: this is on the dialog role
| </tr> | ||
| <tr> | ||
| <th class="role-namefrom-head" scope="row">Name From:</th> | ||
| <td class="role-namefrom">author</td> |
There was a problem hiding this comment.
Reviewer context: this is on the article role
| </tr> | ||
| <tr> | ||
| <th class="role-namefrom-head" scope="row">Name From:</th> | ||
| <td class="role-namefrom">author</td> |
There was a problem hiding this comment.
Reviewer context: this is on the alertdialog role
| modal dialog design patterns. | ||
| </p> | ||
| <p>Authors SHOULD provide an accessible name for a dialog, which can be done with the <pref>aria-label</pref> or <pref>aria-labelledby</pref> attribute.</p> | ||
| <p>Authors SHOULD provide an accessible name for a dialog, using either <a href="#namecalculation">namefrom</a>: author or <a href="#namecalculation">namefrom</a>: heading.</p> |
There was a problem hiding this comment.
Given a dialog that contains an <h2> for example, would it be preferable for authors to use aria-labelledby or rely on nameFrom: heading? Should nameFrom: author be preferred over nameFrom: heading?
There was a problem hiding this comment.
Yes, the AccName computation prioritizes namefrom:author first... namefrom:heading is only used as a fallback.
There was a problem hiding this comment.
The direct author reference is probably slightly more performant, but I don't think a change is needed here unless you have one to suggest.
There was a problem hiding this comment.
Just a personal clarification to make sure I'm using this new nameFrom technique properly 😄
|
@cookiecrook One thought that came to mind during implementation was around the descendant element with |
|
Lucas, in this comment, indicated potential Q4 2025 support for Chromium/Edge. |
Co-authored-by: Rahim Abdi <abdi.abdirahim@gmail.com>
Co-authored-by: Rahim Abdi <abdi.abdirahim@gmail.com>
|
@rahimabdi wrote:
What's special about a heading containing a an image or link that would not also apply to some other type of content? The label derived for the element that supports |
This commit supersedes PR #2215
|
In general, this makes sense to me. However, I'm wondering if there has been any discussion anywhere regarding mutations, events and the performance thereof. When the name of anything changes, the browser should ideally fire a name change event. The importance of this differs between operating systems and browser implementations, but it's still generally the right thing to do. For Firefox (and I assume Chromium), failure to fire an event could result in a stale cross-process cache, so it's particularly important there. However, clients may depend on the event as well. There are two particular challenges here:
@rahimabdi, does WebKit fire name change events for these cases? Did you run into any issues implementing those? I'd also be curious as to whether anyone has done any design thinking on this for Chromium and considered these issues. Thanks! |
| </li> | ||
| <li> | ||
| If the <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a> is still empty, then: if the `dialog` element has a | ||
| <a href="https://dom.spec.whatwg.org/#concept-tree-descendant">descendant</a> element with a role of `heading`, then use the |
There was a problem hiding this comment.
This refers explicitly to a DOM descendant. Does this mean aria-owns content should explicitly be excluded from this check? For example, should we skip NameFrom: heading in this case?
data:text/html,<article aria-owns="content"></article><div id="content"><h1>Some heading</h1>
Does that also mean we shouldn't consider aria-owns content when doing name computation for a dialog? For example, in this case, do we take first or second as the label of the dialog?
data:text/html,<article aria-owns="first second"><h1 id="second">second</h1></article><h1 id="first">first</h1>
I think we should respect aria-owns for consistency. That means we should be using accessibility descendants.
Co-authored-by: James Teh <jamie@jantrid.net>
|
The ARIA Working Group just discussed The full IRC log of that discussion<jamesn> topic: Add namefrom: heading. https://github.com//pull/2650<jamesn> github: https://github.com//pull/2650 <pkra> spectranaut_: we didn't get to finalize this at TPAC <pkra> ... in particular with Feedback from Jamie Teh. <pkra> jcraig: I think Jamie is right and we need to think about it some more. <scott> q+ <spectranaut_> ack scott <pkra> scott: what was the issue? <pkra> jcraig: essentially dom mutations. <pkra> ... for performance and author reasons this poses some difficulties. <pkra> scott: right. Jamie mentioned DOM vs accessibility tree as well. <pkra> jcraig: some of that leads to mutations as well. |
|
As a status update, this stalled due to a comment at W3C TPAC (Nov 2025) from @jcsteh pointing out that we haven't fully considered what happens in the case of DOM mutations. |
Just in case this isn't clear, I documented my concerns shortly prior to TPAC in #2650 (comment). My comment at TPAC was just flagging this comment. |
|
🚀 Deployed on https://deploy-preview-2650--wai-aria.netlify.app |
I feel like we already have plenty of similar issues, where we need to fire a name change event because an element uses aria-labelledby and the target ID changes its effective name, sometimes in some roundabout way like a descendant changing. Chromium and WebKit have both fixed bugs along those lines before. They both already keep track of reverse maps for all IDREF relations to make that sort of thing more efficient. I'm not arguing that this sort of thing is easy; some of those fixes are tricky. Rather, I'm just arguing that it's already the status quo that browsers have to keep track of a lot of complex relationships in order to implement accessible names and to keep them updated as the DOM mutates. My feeling is that these scenarios don't actually come up that often in the real world - or rather, that most accessibility bugs we spend time fixing aren't of this variety. However, when they do they're treated as bugs and fixed. |
That's true. However, existing "name from subtree" cases are for roles which are expected to have relatively few descendants; e.g. button, link, heading, etc. In contrast, things like dialogs will very possibly have many, many descendants. That makes the cost of calculating (and maintaining) name from subtree potentially much more expensive.
Fair. On the other hand, I think we should be cautious about introducing things into the spec where the probability of hitting a performance cliff which is difficult to mitigate might be quite high. |
|
@jcsteh wrote:
The only scenarios I anticipate where the perf would be bad would be scenarios where web authors have made multiple mistakes... e.g. a dialog, with no label, no labelled-by, no nearby included heading, with excessively long contents... so the cost would only be on sites where that dialog was already unlabeled... maybe there's a lazy-load label compromise, where after some reasonable delay trying to find the fallback heading (500ms? 700ms?), NVDA or VO would just speak "dialog" (as if it's unlabeled) and then update that assumption for the user later when or if the label search comes back before the user moves on to another element. |
As you mentioned, the existing "name from subtree" cases are supposed to have few descendants, but in obscure cases there might be lots, so I know some browsers already enforce a limit that's not in the spec, for performance reasons. In this particular case, would a limit on how far to search for a heading descendant mitigate it? |
🚀 Netlify Preview:
🔄 this PR updates the following sspecs:
Closes w3c/accname#138
Closes #1018
Closes #1860
Closes #2209
Closes w3c/accname#182
Closes w3c/accname#229
Related to #2215
Add namefrom: heading again; Will year 6 be the year?
Roles that are affected: now
namefrom: author, heading:History and Readiness:
I was worried this might never make it into the spec, but we now have:
Please re-review and merge this ASAP before this layered PR stagnates again... Thanks!
Implementation tracking
Preview | Diff