-
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
[html-aam PR 484] contextual role concept proposal #2218
base: main
Are you sure you want to change the base?
Changes from all commits
0efae20
3a79bf5
1eac627
57e27f4
310dd87
cc4bb80
b271e35
33e5dfa
1ebbfc5
da0865d
b1c7a8c
75b9bdd
4f54274
ea6a784
8dadb65
5a05613
b6997fb
15ec08e
0cca193
5ab29b0
b4d9fac
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,6 +191,69 @@ <h3>Exposing HTML Features That Do Not Directly Map to Accessibility APIs</h3> | |
the [[core-aam-1.2]]. | ||
</p> | ||
</section> | ||
<section id="mapping_contextual"> | ||
<h3>Exposing HTML Features With Contextual Roles</h3> | ||
<p> | ||
An element with a <strong>contextual role</strong> is one whose computed role semantics are based on its ancestral <a>accessibility tree</a> relationship to another element or elements. Or, | ||
an element whose computed role is dependent upon whether it has other associated accessibility information, such as an author-provided accessible name. | ||
</p> | ||
<p> | ||
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 (`li` element) within an unordered list (`ul` element). However, the same element might be used within a different markup pattern and could therefore expose different | ||
contextually-dependent computed roles, such as a `section` element with an author-provided accessible name (role `region`) versus an unnamed `section` element (role `generic`). | ||
</p> | ||
<p>When the conditions for an element's contextual role are not met, it will commonly be exposed with a computed role of `generic` or with a <strong>minimum role</strong>, if applicable.</p> | ||
<div class="note"> | ||
<p>Previously, the concept of a contextual role was loosely referred to as an element's "scoped" relationship to another element.</p> | ||
</div> | ||
<div class="example"> | ||
<p> | ||
A <code>li</code> element has an implicit WAI-ARIA role mapping of <code>listitem</code> only when the element is an <strong>accessibility child</strong> of a <code>menu</code>, | ||
<code>ol</code> or <code>ul</code> element that has not had its `list` role mapping suppressed. | ||
</p> | ||
<pre><code><ul> | ||
<li>...</li> <!-- computed role `listitem` --> | ||
</ul> | ||
<article> | ||
... | ||
<li>...</li> <!-- computed role `generic`, not `listitem` --> | ||
...</code></pre> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should use a different example than listitem, here and above, given the push back on the orphan roles tests which is partially being discussed here: #2166 But started with the roll back of orphan There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. orphan There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As an FYI for related WPT files, any time you're tempted to add an orphaned role test, please add a comment that points to the appropriate orphaned-roles-specific test file. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
As I understand it, it's still the same issue whether the role is implicit or explicit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tried to message you this in slack, but i'm thinking of closing this PR down, and instead taking the approach of just clarifying the few elements that do have contextual roles mapping tables |
||
</div> | ||
<div class="example"> | ||
<p> | ||
An <code>aside</code> element has an implicit WAI-ARIA role mapping of <code>complementary</code> only when the element is an <strong>accessibility child</strong> of the | ||
<code>body</code> or <code>main</code> elements, or if the <code>aside</code> has been provided an accessible name. | ||
</p> | ||
<pre><code><body> | ||
... | ||
<main> | ||
... | ||
<article> | ||
<aside>...</aside> <!-- computed role `generic`, not `complementary` --> | ||
... | ||
<aside aria-label=named>...</aside> <!-- computed role `complementary` --> | ||
</article> | ||
... | ||
<aside>...</aside> <!-- computed role `complementary` --> | ||
</main> | ||
<aside>...</aside> <!-- computed role `complementary` --> | ||
... | ||
<footer> | ||
... | ||
<aside>...</aside> <!-- computed role `generic`, not `complementary` --> | ||
</footer> | ||
...</code></pre> | ||
</div> | ||
|
||
<div class="example"> | ||
<p>A <code>section</code> element has an implicit WAI-ARIA role mapping of <code>region</code> only when the element is provided an <strong>accessible name</strong>.</p> | ||
<pre><code><section title="accessible name">...</section> <!-- computed role `region` --> | ||
... | ||
<section aria-label="accessible name">...</section> <!-- computed role `region` --> | ||
... | ||
<section>...</section> <!-- computed role `generic`, not `region` --></code></pre> | ||
</div> | ||
</section> | ||
<section> | ||
<h3>HTML Element Role Mappings</h3> | ||
<ul> | ||
|
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.
I recall we agreed to get rid of the expectation to computed orphaned generics, since doing it in the engine was sometimes costly and always irrelevant to the user.