Skip to content
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

Update from PR #1018 for nameFrom: heading #1860

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

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

index.html Outdated Show resolved Hide resolved
@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

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Good catch by @scottaohara in review

Co-authored-by: Scott O'Hara <[email protected]>
@spectranaut
Copy link
Contributor

I added the "waiting for implementations" tag but I was wrong, this isn't ready for implementation -- I didn't look close enough. This change still needs the following before it can be implemented:

  • three approving reviews
  • accname changes
  • tests

This new process is a work in progress, so let me know if there are questions/concerns!

@jcsteh
Copy link

jcsteh commented Dec 12, 2023

My only concern here is performance. The content of container elements like these can be potentially massive, and because of potential mutations, it's not even as simple as just caching the first heading when we build the tree. Is it reasonable for UAs to impose some limit on how many nodes we check? If so, I wonder if that needs to be specified somehow?

@cookiecrook
Copy link
Contributor Author

@jcsteh wrote:

Is it reasonable for UAs to impose some limit on how many nodes we check?

Certainly possible, but where to draw the line? Some web dev will hit an arbitrary depth limit. Do we tie it to DOM or rendering heuristics? My original issue was intended to allow some spec permissiveness so that implementations could account for this as best they could, which may eventually inform a best path forward... AS of now, some of those heuristics are explicitly disallowed by the spec.

What modification do you propose?

index.html Outdated Show resolved Hide resolved
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?

index.html Outdated Show resolved Hide resolved
@@ -662,9 +662,11 @@ <h3>Accessible Name Calculation</h3>
<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

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

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
None yet
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