-
Notifications
You must be signed in to change notification settings - Fork 26
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
Changes from 7 commits
c8435a9
7e79d76
ba08486
f7ae361
b199e67
5b7534a
1627ee1
314e3b6
5229325
e65fc2b
cadfcf4
fec393a
11aa6ce
7654f7a
6599662
f6aa7a5
4f13392
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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> | ||||||||||
<p> | ||||||||||
An element with a <STRONG>contextual role</STRONG> is one whose implicit WAI-ARIA role semantics are based on its ancestral <a>accessibility tree</a> relationship to | ||||||||||
another element or elements. Or, an element whose computed role is reliant on whether the element has been provided an accessible name. | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
</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 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. | ||||||||||
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. Word-smithing plus a few simple inline examples.
Suggested change
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. 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. @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". 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. @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 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. 🤷 I could go either way. I don't think most authors give much thought to |
||||||||||
</p> | ||||||||||
<p> | ||||||||||
When the conditions for an element's contextual role are not met, it will commonly expose a computed role of `generic` or with a <STRONG>minimum role</STRONG>, if applicable. | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
</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> <!-- role=listitem --> | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
</ul> | ||||||||||
<article> | ||||||||||
... | ||||||||||
<li>...</li> <!-- not role=listitem --> | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
...</code></pre> | ||||||||||
</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> <!-- not role=complementary --> | ||||||||||
... | ||||||||||
<aside aria-label=named>...</aside> <!-- role=complementary --> | ||||||||||
</article> | ||||||||||
... | ||||||||||
<aside>...</aside> <!-- role=complementary --> | ||||||||||
</main> | ||||||||||
<aside>...</aside> <!-- role=complementary --> | ||||||||||
... | ||||||||||
<footer> | ||||||||||
... | ||||||||||
<aside>...</aside> <!-- not role=complementary --> | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
</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> <!-- role=region --> | ||||||||||
... | ||||||||||
<section aria-label="accessible name">...</section> <!-- role=region --> | ||||||||||
... | ||||||||||
<section>...</section> <!-- not role=region --></code></pre> | ||||||||||
scottaohara marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||
</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.
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