Skip to content

Conversation

cookiecrook
Copy link
Contributor

@cookiecrook cookiecrook commented Jan 26, 2023

Part of #w3c/accname/issues/138

Adds nameFrom: heading (this overcomes PR #1018)

Will update these along the way after further discussion and review.

Implementation tracking


Preview | Diff

@cookiecrook cookiecrook requested a review from jnurthen January 26, 2023 03:04
@cookiecrook
Copy link
Contributor Author

Adding three reviewers that were prior contributors to #1018.

Copy link
Member

@scottaohara scottaohara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a quick list of the roles that will get name from heading

  • alertdialog
  • article
  • complementary
  • dialog
  • form
  • region (with HTML caveat)

My initial review:

complementary may need a caveat added per the conditional complementary role for the aside element.

similarly, I think form would need a host language caveat mentioned as well, as while I think this update works since ARIA requires role=form have an accName, I don't think every HTML form element should automatically get an accName. That'd have the potential to add extra and unnecessary landmark verbosity to many web pages

should we consider adding group to this as well? Esp. since it's more likely for AT to even expose an element with role=group if it's named. If there's a heading there, it could be done for authors without the need to use aria-labelling. But per my comment above, maybe this would have the inverse impact of creating too much verbosity where things were already "fine" from the user's perspective?

additionally, navigation should be considered for naming by heading. many instances of people using headings (visible or not) to name navigation landmarks via aria-labelledby.

i'm quite a fan of all other aspects of this PR.

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Feb 13, 2023

@scottaohara wrote:

Thanks.

complementary may need a caveat added per the conditional complementary role for the aside element.

To clarify, are you suggesting nameFrom: heading be removed from both <aside> and role="complementary" or only from the contexts where aside is not complementary?

similarly, I think form would need a host language caveat mentioned as well, as while I think this update works since ARIA requires role=form have an accName, I don't think every HTML form element should automatically get an accName. That'd have the potential to add extra and unnecessary landmark verbosity to many web pages

I don't have a strong opinion either way, so I'll remove it in the PR unless there are objections. To clarify, are you suggesting nameFrom: heading be removed from both <form> and role="form" or something else?

should we consider adding group to this as well? Esp. since it's more likely for AT to even expose an element with role=group if it's named. If there's a heading there, it could be done for authors without the need to use aria-labelling. But per my comment above, maybe this would have the inverse impact of creating too much verbosity where things were already "fine" from the user's perspective?

I think group should remain explicitly named, for the verbosity risk you've outlined.... but I could be convinced if you and others have strong opinions for it.

additionally, navigation should be considered for naming by heading. many instances of people using headings (visible or not) to name navigation landmarks via aria-labelledby.

I support this.

Copy link
Member

@jnurthen jnurthen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

common/script/aria.js needs moving to aria-common but otherwise looks good.

I like the scope of the other changes being limited to

  • alertdialog
  • article
  • complementary
  • dialog
  • region (with caveats)
    as it is now. We can always add more later if folks think that is desired.

@scottaohara
Copy link
Member

@cookiecrook
Re: complementary and form, yes would need to be clear that while these ARIA roles can get name from heading, the equivalent HTML elements may not (aside) or would not (form) get name from headings.

re: group, agreed. i felt icky suggesting it, and your response didn't wash the ick away. so let's forget it..

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Feb 15, 2023

Re: complementary and form, yes would need to be clear that while these ARIA roles can get name from heading, the equivalent HTML elements may not (aside) or would not (form) get name from headings.

Maybe we should consider taking complementary and region out of the list because of these caveats? We can always add them back in with separate issues.

Especially since we're now working on automated AccName tests...

@scottaohara
Copy link
Member

sounds like a good idea to me.

cookiecrook added a commit to w3c/aria-common that referenced this pull request Feb 16, 2023
…cussion, these will be taken up as separate issues
@cookiecrook
Copy link
Contributor Author

Recycling reviews because I think this addresses all the feedback now.

Affected roles now limited to the following for this PR.

  • alertdialog
  • article
  • dialog

Others that are no longer in this diff, but should be taken as separate PRs due to editorial and host language caveats are:

  • complementary
  • region

Also @jnurthen I have filed the script changes as w3c/aria-common#89 I wasn't sure how to mark that PR as blocking this one. FYI @scottaohara

Good catch by @scottaohara in review

Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
scottaohara added a commit to w3c/html-aam that referenced this pull request Feb 6, 2024
closes #457

Related to the following:
- w3c/aria#1860
- w3c/accname#229 (this needs to be merged so the new links to 'accName: name from heading' will work
@jnurthen jnurthen added the waiting for implementations Cannot be merged until there are two browser impls or one impl + impl commit label Apr 16, 2024
pkra pushed a commit that referenced this pull request May 23, 2024
closes #457

Related to the following:
- #1860
- w3c/accname#229 (this needs to be merged so the new links to 'accName: name from heading' will work
@pkra pkra added the spec:aria label Jun 14, 2024
@aleventhal
Copy link
Contributor

I'm no longer blocking this, so @jnurthen you're up next and then this can finally land.

@aleventhal
Copy link
Contributor

aleventhal commented Jul 9, 2024

Ah, this is "waiting for implementations", which means we should land the changes in Blink and not wait for it to be merged into the spec, right?

<dd>One of the following values:
<ol>
<li>author: name comes from values provided by the author in explicit markup features such as the <pref>aria-label</pref> attribute, the <pref>aria-labelledby</pref> attribute, or the host language labeling mechanism, such as the <code>alt</code> or <code>title</code> attributes in HTML, with HTML <code>title</code> attribute having the lowest precedence for specifying a text alternative.</li>
<li>heading: name comes from the text alternative of the first descendant <a>element</a> node (depth first search) matching the role of <code>heading</code> as defined in the AccName computation algorithm for <a href="https://w3c.github.io/accname/#comp_name_from_heading"><code>nameFrom: heading</code></a>. Although "heading" is allowed in addition to "author" in some <a>roles</a>, "heading" is used in content only if higher priority "author" features are not provided.</li>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for other reviewers, the only recent change is "(depth first search)" to clarify the markup test the WG discussed since I posted the original PR.

Copy link

netlify bot commented Feb 5, 2025

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit bf43418
🔍 Latest deploy log https://app.netlify.com/sites/wai-aria/deploys/67a2d8a899dbd200084314d4
😎 Deploy Preview https://deploy-preview-1860--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@cookiecrook
Copy link
Contributor Author

@aleventhal wrote:

Ah, this is "waiting for implementations", which means we should land the changes in Blink and not wait for it to be merged into the spec, right?

Sorry I missed this... I think the test was supposed to land first... but there was some discussion of DFS vs IDS which hadn't landed yet... See the last test in:

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Feb 5, 2025

Oh good... looks like that Chrome change wasn't merged into shipping yet. All browsers still align...

https://wpt.fyi/results/accname/name/comp_name_from_heading.tentative.html?label=pr_head&max-count=1&pr=50507

[Update Feb 28, 2025] this is merged now so live results will be here soon:
https://wpt.fyi/results/accname/name/comp_name_from_heading.tentative.html?label=experimental&label=master&aligned

@cookiecrook
Copy link
Contributor Author

PR has been open for over 2 years... I'm no longer sure how many times I've re-resolved git conflicts that came in later.

@cookiecrook
Copy link
Contributor Author

@aleventhal wrote:

I'm no longer blocking this

@aleventhal @tranjocelyn See above comment on Feb 4... If you've landed this already, there is more to be done.
https://wpt.fyi/results/accname/name/comp_name_from_heading.tentative.html?label=experimental&label=master&aligned

@pkra
Copy link
Member

pkra commented Apr 4, 2025

@cookiecrook @aleventhal the current process requires 1 implementation and another intent-to-implement. So I think if webkit merges WebKit/WebKit#43080, we should be able to merge here (and update accname).

If that's not in the cards, then I would suggest to split this PR into two: the piece which introduces name-from-heading and the piece that allows name-from-heading on specific roles.

The first part is the lengthier one but wouldn't technically need implementations, so I think we could merge that. The second part is then just adding things to the name-from table rows.

(I would also split out the the editorial changes - they should be separate.)

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Apr 18, 2025

@pkra wrote:

we should be able to merge here (and update accname).

Agreed. I will wait for @rahimabdi to merge the WebKit update and then resolve the conflicts here. I don't see a reason to split the PRs into separate algo and attributes PRs. That's an academic distinction that I can't see providing any benefit.

(I would also split out the the editorial changes - they should be separate.)

Are you talking about the tabs vs space correction that was on either side of my new nameFromHeading section? Normally I'd agree with not introducing whitespace changes in a substantive to different parts of the document, but these are related adjacent sections. That's always been fair-game with ARIA editorial practices as far as I am aware. Otherwise, you're asking me to introduce a new inconsistency to the leading whitespace within my new section. Right? (Please reconsider? 🙏🏼)

PS. I called this out and the reason for it two years ago.

@cookiecrook
Copy link
Contributor Author

cookiecrook commented Apr 18, 2025

Otherwise, you're asking me to introduce a new inconsistency to the leading whitespace within my new section.

For clarity, my choices are:

  1. keep it the way it is, which is what we ultimately want, or…
  2. Add my new section with leading chars that are inconsistent with the file conventions (will need to be changed later, reducing the usability of git blame), or…
  3. Add my new section with leading chars that are inconsistent with the surrounding text (will reduce readability until the other surround whitespace errors are corrected).

@pkra
Copy link
Member

pkra commented Apr 19, 2025

(I would also split out the the editorial changes - they should be separate.)

Are you talking about the tabs vs space correction that was on either side of my new nameFromHeading section?

No, I meant the two removals. I primarily suggested them to simplify a merge. (FYI prettier formatting is done automatically by CI).

@cookiecrook
Copy link
Contributor Author

Working on this again... Merge conflicts plus the monorepo change that has happened in the meantime make it impractical to fix the existing PRs in the old repos.

Working on another. Fourth times the charm. At least the implementations are no longer the bottleneck???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spec:aria waiting for implementations Cannot be merged until there are two browser impls or one impl + impl commit
Projects
Status: Waiting For Implementation
Development

Successfully merging this pull request may close these issues.

ARIA Spec could be more flexible when elements with "nameFrom:author" are left unlabeled by the author
9 participants