-
Notifications
You must be signed in to change notification settings - Fork 125
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
base: main
Are you sure you want to change the base?
Conversation
Closes #899
Adding three reviewers that were prior contributors to #1018. |
There was a problem hiding this 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.
@scottaohara wrote: Thanks.
To clarify, are you suggesting
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
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.
I support this. |
There was a problem hiding this 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.
@cookiecrook re: group, agreed. i felt icky suggesting it, and your response didn't wash the ick away. so let's forget it.. |
Maybe we should consider taking Especially since we're now working on automated AccName tests... |
sounds like a good idea to me. |
…cussion, these will be taken up as separate issues
Recycling reviews because I think this addresses all the feedback now. Affected roles now limited to the following for this PR.
Others that are no longer in this diff, but should be taken as separate PRs due to editorial and host language caveats are:
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 <[email protected]>
@cookiecrook This change is a step in the right direction in my opinion. I don't have any issues with it. Merge it, and we'll build it in Chromium eventually! |
@spectranaut @jnurthen perhaps we should have labels for the new process requirements, e.g., something for each step in https://github.com/w3c/aria/blob/main/documentation/process.md#normative-changes). Then PRs / features like this could also easily be looked up. |
common/script/aria.js
Outdated
var fromContent = ''; | ||
var fromEncapsulation = ''; | ||
var fromLegend = ''; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, the script diff looks jumbled below, but it's just that I removed the stale encapsulation
and legend
blocks, and added nameFrom heading
before contents
and prohibited
. Although I did not touch contents
and prohibited
, the GitHub diff viewer is intertwining those sections with the removed encapsulation
and legend
sections.
</div> | ||
<section id="namefromauthor"> | ||
<h4>Roles Supporting Name from Author</h4> | ||
<div id="index_fromauthor"></div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is whitespace correction, which I would normally be opposed to in a substantive diff, but the spaces vs tab inconsistency was in a section that I had to modify anyway. I claim editorial discretion.
@@ -3018,7 +3036,6 @@ <h2>Definition of Roles</h2> | |||
<div class="role-description"> | |||
<p>A dialog is a descendant window of the primary window of a web application. For <abbr title="Hypertext Markup Language">HTML</abbr> pages, the primary application window is the entire web document, i.e., the <code>body</code> element.</p> | |||
<p>Dialogs are most often used to prompt the user to enter or respond to information. A dialog that is designed to interrupt workflow is usually modal. See related <rref>alertdialog</rref>.</p> | |||
<p>Authors MUST provide an accessible name for a dialog, which can be done with the <pref>aria-label</pref> or <pref>aria-labelledby</pref> attribute.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is an editorial removal. Not substantive.
Accessible Name Required is defined as True below, so this normative requirement remains. I'm removing excessive duplication that will be resolved in the AccName spec with w3c/accname/issues/182.
index.html
Outdated
@@ -6802,7 +6824,7 @@ <h5>Presentational Role Inheritance</h5> | |||
<div class="role-description"> | |||
<p>A <rref>landmark</rref> containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.</p> | |||
<p>Authors SHOULD limit use of the region role to sections containing content with a purpose that is not accurately described by one of the other <a href="#landmark_roles">landmark roles</a>, such as <rref>main</rref>, <rref>complementary</rref>, or <rref>navigation</rref>.</p> | |||
<p>Authors MUST give each element with role region a brief label that describes the purpose of the content in the region. Authors SHOULD reference a visible label with <pref>aria-labelledby</pref> if a visible label is present. Authors SHOULD include the label inside of a heading whenever possible. The heading MAY be an instance of the standard host language heading element or an instance of an element with role <rref>heading</rref>.</p> | |||
<p>Authors MUST give each element with a region role a brief label that describes the purpose of the region. For host languages that support elements with the default role of region (e.g., HTML <code>section</code>), authors would need to specify an explicit <code>role="region"</code> on the element to enable the nameFrom: heading technique.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This diff was originally authored by Jon Gunderson in #1018 and further edited by @scottaohara.
@@ -3554,7 +3571,6 @@ <h2>Definition of Roles</h2> | |||
<div class="role-description"> | |||
<p>A <rref>landmark</rref> region that contains a collection of items and objects that, as a whole, combine to create a form. See related <rref>search</rref>.</p> | |||
<p>A form can contain a mix of host language form controls, scripted controls, and hyperlinks. Authors are reminded to use native host language semantics to create form controls whenever possible. If the purpose of a form is to submit search criteria, authors SHOULD use the <rref>search</rref> role instead of the generic <code>form</code> role.</p> | |||
<p>Authors MUST give each element with role <code>form</code> a brief label that describes the purpose of the form. Authors SHOULD reference a visible label with <pref>aria-labelledby</pref> if a visible label is present. Authors SHOULD include the label inside of a heading whenever possible. The heading MAY be an instance of the standard host language heading element or an instance of an element with role <rref>heading</rref>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is an editorial removal. Not substantive.
Accessible Name Required is defined as True below, so this normative requirement remains. I'm removing excessive duplication that will be resolved in the AccName spec with w3c/accname#182.
@@ -6879,7 +6895,6 @@ <h5>Presentational Role Inheritance</h5> | |||
<div class="role-description"> | |||
<p>A <rref>landmark</rref> containing content that is relevant to a specific, author-specified purpose and sufficiently important that users will likely want to be able to navigate to the section easily and to have it listed in a summary of the page. Such a page summary could be generated dynamically by a user agent or assistive technology.</p> | |||
<p>Authors SHOULD limit use of the region role to sections containing content with a purpose that is not accurately described by one of the other <a href="#landmark_roles">landmark roles</a>, such as <rref>main</rref>, <rref>complementary</rref>, or <rref>navigation</rref>.</p> | |||
<p>Authors MUST give each element with role region a brief label that describes the purpose of the content in the region. Authors SHOULD reference a visible label with <pref>aria-labelledby</pref> if a visible label is present. Authors SHOULD include the label inside of a heading whenever possible. The heading MAY be an instance of the standard host language heading element or an instance of an element with role <rref>heading</rref>.</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This is an editorial removal. Not substantive.
Accessible Name Required is defined as True below, so this normative requirement remains. I'm removing excessive duplication that will be resolved in the AccName spec with w3c/accname#182.
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:
This new process is a work in progress, so let me know if there are questions/concerns! |
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? |
@jcsteh wrote:
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? |
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
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
I'm no longer blocking this, so @jnurthen you're up next and then this can finally land. |
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? |
Part of #w3c/accname/issues/138
Adds
nameFrom: heading
(this overcomes PR #1018)Will update these along the way after further discussion and review.
nameFrom: heading
steps to computation after spec addition ARIA PR #1860 is reviewed. accname#182Implementation tracking
Preview | Diff