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

contextual role concept proposal #484

Draft
wants to merge 17 commits into
base: gh-pages
Choose a base branch
from

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented May 11, 2023

closes #375

The purpose of this proposal is both to resolve the issue that "scoped" was an undefined term that was used to indicate when certain elements would expose particular ARIA roles or not. However, in the year of noodling on this, other activities to revise what "owned" means in ARIA, the idea of a minimum role, as well as the fact there were other elements in HTML that have "scoped" or "contextual roles" that are based on heuristics, rather than defined standards, became relevant.

A change to hopefully help simplify the implementations of contextual roles is that this proposal is aiming to tie the role of an element based on its a11y tree ancestry, rather than based on specific HTML elements in the DOM.

This PR represents the initial draft of the proposal. Other work to explicitly call out the elements that have contextual roles, what roles they need to adjust to, and other wording revisions to replace "scoped" with the new term would still need to be made.

Implementation

  • WPT tests: LINK
  • Implementations (link to issue or when done, link to commit):

Preview | Diff

closes #375

The purpose of this proposal is both to resolve the issue that "scoped" was an undefined term that was used to indicate when certain elements would expose particular ARIA roles or not.  However, in the year of noodling on this, other activities to revise what "owned" means in ARIA, the idea of a minimum role, as well as the fact there were other elements in HTML that have "scoped" or "contextual roles" that are based on heuristics, rather than defined standards, became relevant.

A change to hopefully help simplify the implementations of contextual roles is that this proposal is aiming to tie the role of an element based on its a11y tree ancestry, rather than based on specific HTML elements in the DOM.

This PR represents the initial draft of the proposal.  Other work to explicitly call out the elements that have contextual roles, what roles they need to adjust to, and other wording revisions to replace "scoped" with the new term would still need to be made.
still working on the exact wording.  also changing some placeholder short code so as to hopefully not get more build errors for presently undefined terms
Copy link
Member Author

@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.

following quick commits are additional instances of converting undefined terms to temporary STRONG elements. fix of a typo

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
Copy link
Contributor

@spectranaut spectranaut left a comment

Choose a reason for hiding this comment

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

I think it would be nice to see at lease one example of the new "contextual role" term being used in the mapping tables.

I really think this is the right direction!! I can help nit pick the specific wording ad infinitum though.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated
Comment on lines 220 to 222
For instance, an element that is an <STRONG>accessibility child</STRONG> of its required <STRONG>accessibility parent</STRONG> would expose a computed role that was
appropriate for its related context. Where the same element with a contextual role might be used within another markup pattern and have a different accessibility parent,
and would therefore expose a computed role appropriate for that context.
Copy link
Collaborator

@cookiecrook cookiecrook May 17, 2023

Choose a reason for hiding this comment

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

Word-smithing plus a few simple inline examples.

Suggested change
For instance, an element that is an <STRONG>accessibility child</STRONG> of its required <STRONG>accessibility parent</STRONG> would expose a computed role that was
appropriate for its related context. Where the same element with a contextual role might be used within another markup pattern and have a different accessibility parent,
and would therefore expose a computed role appropriate for that context.
For instance, an element that is an <STRONG>accessibility child</STRONG> of its required <STRONG>accessibility parent</STRONG> would expose a computed role for its given context, such as a list item (<code>li</code>) within an unordered list (<code>ul</code>). However, the same element might be used within a different markup pattern and could therefore expose different contextually-dependent computed roles, such as a labeled <code>section</code> element (role <code>region</code>) versus an unlabeled <code>section</code> element (role <code>generic</code>).

Can we think of a specific example that works for both? If so that'd be better than the sectioning content examples, which are less easy to understand and care about than a simple list.

Copy link
Member Author

Choose a reason for hiding this comment

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

@cookiecrook I like these suggestions so i'm going to largely pull them in - but I'm going to be changing the use of "accessible label" back to "name".

Copy link
Member Author

Choose a reason for hiding this comment

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

@cookiecrook re: other examples.

What do you think about mentioning tbody here, per the whole rowgroup conversation? That'd be an example of a contextual role where it can be ignored until it is given a name or focusable.

Another example we could use in lieu of / in combination with the list item example is the summary of a details, where only under specific conditions is the summary an html-summary, and otherwise it would need to be a role=generic

Copy link
Collaborator

Choose a reason for hiding this comment

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

🤷 I could go either way. I don't think most authors give much thought to <tbody> etc, so I'm not sure it'd be super helpful as an example, but I also don't think it'd be harmful.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
scottaohara and others added 9 commits May 18, 2023 08:09
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
use computed role in both sentences, rather than switching between terms
Co-authored-by: James Craig <cookiecrook@users.noreply.github.com>
index.html Outdated
@@ -210,6 +210,71 @@ <h3>Exposing HTML Features That Do Not Directly Map to Accessibility APIs</h3>
<abbr title="application programming interface">API</abbr> properties</a> in the [[core-aam-1.2]].
</p>
</section>
<section id="mapping_contextual">
<h3>Exposing HTML Features With Contextual Roles</h3>
Copy link
Contributor

Choose a reason for hiding this comment

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

This heading may not accurately capture the intent of the section; particularly, the words "HTML Features" used to describe contextual roles and how they're treated. I don't know the best way to describe the new section but if you agree, some alternatives for your consideration: Contextual Roles, Treatment of Contextual Roles, Understanding Contextual Roles, Understanding Contextual Roles and Accessibility Ancestry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define "scoped" or reuse another existing term?
4 participants