Skip to content

Commit 1a7be3c

Browse files
committed
Address comments and fix spelling
1 parent 31de8fa commit 1a7be3c

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

aria-practices.html

+8-8
Original file line numberDiff line numberDiff line change
@@ -4074,7 +4074,7 @@ <h5>Naming Tables and Figures with Captions</h5>
40744074
&lt;/figure></code></pre>
40754075
<p>
40764076
Like with <code>table</code> elements, if a <code>figure</code> is not named using <code>aria-label</code> or <code>aria-labelledby</code>, the content of the <code>figcaption</code> element will be used as the accessible name.
4077-
However unlike <code>table</code> elements, if the <code>figcaption</code> element is not used for the name, it does not become an accessible description unless it is referenced by <code>aria-describedby</code>.
4077+
However, unlike <code>table</code> elements, if the <code>figcaption</code> element is not used for the name, it does not become an accessible description unless it is referenced by <code>aria-describedby</code>.
40784078
Nevertheless, assistive technologies will render the content of a <code>figcaption</code> regardless of whether it is used as a name, description, or neither.
40794079
</p>
40804080
<p>Using the <code>caption</code> element to name a <code>table</code> element, or a <code>figcaption</code> element to name a <code>figure</code> element, satisfies <a href="#naming_rule_visible_text">Rule 2: Prefer Visible Text</a> and <a href="#naming_rule_native_techniques">Rule 3: Prefer Native Techniques</a>.</p>
@@ -6282,7 +6282,7 @@ <h3>Indicating sort order with <code>aria-sort</code></h3>
62826282
<section id="aria-level">
62836283
<h2>Describing Hierarchical Structure with <code>aria-level</code></h2>
62846284
<p>When elements have a hierarchical relationship, such as headers of sections or data in tree structures, <code>aria-level</code> is used to communicate the hierarchy between elements to assistive technologies. The value of <code>aria-level</code> is numeric, with <code>1</code> indicating the top level of the structure. The number increases for each level of nesting.</p>
6285-
<p>Do not use <code>aria-level</code> when the DOM structure already accurately represents the elements' hierarchical relationships.</p>
6285+
<p>Do not use <code>aria-level</code> when the DOM structure already accurately represents the elements' hierarchical relationships. For example, a nested <code>ul</code> list structure does not need explicit <code>aria-level</code>.</p>
62866286
<p>The <code>aria-level</code> attribute can be used on the following roles:</p>
62876287
<ul>
62886288
<li><code>heading</code></li>
@@ -6292,7 +6292,7 @@ <h2>Describing Hierarchical Structure with <code>aria-level</code></h2>
62926292
</ul>
62936293
<section id="aria-level_heading_role">
62946294
<h3><code>heading</code> Role</h3>
6295-
<p>Used together, the <code>aria-level</code> attribute and <code>heading</code> role will be treated the same by assistive technologies as the native HTML header elements: <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code> and <code>h6</code>. Do not use attribute <code>aria-level</code> and <code>heading</code> when a native HTML element can be used.</p>
6295+
<p>Used together, the <code>aria-level</code> attribute and <code>heading</code> role will be treated the same by assistive technologies as the native HTML heading elements: <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code> and <code>h6</code>. Do not use the <code>aria-level</code> attribute and the <code>heading</code> role when a native HTML element can be used.</p>
62966296
<p>This example uses the <code>heading</code> role and <code>aria-level</code> attribute to communicate levels of headings for a graph created with an SVG. The headings "Deciduous Trees" and "Evergreen Trees" are both subheadings to "Total Trees".</p>
62976297
<pre><code>&lt;svg width="1000" height="1000"&gt;
62986298
&lt;text x="10" y="10" role="header" aria-level="1"&gt;Total Trees:&lt;/text&gt;
@@ -6304,7 +6304,7 @@ <h3><code>heading</code> Role</h3>
63046304

63056305
<section id="aria-level_heading_role_remediation">
63066306
<h4>Remediation Uses Cases</h4>
6307-
<p>In rare scenarios, legacy code cannot be converted to using HTML header elements. In these cases, the <code>aria-level</code> attribute and the <code>heading</code> role can be added to the website's header elements to communicate to assitive technologies that those elements should be treated like a native HTML section heading element.</p>
6307+
<p>In rare scenarios, legacy code cannot be converted to using HTML header elements. In these cases, the <code>aria-level</code> attribute and the <code>heading</code> role can be added to the web site's heading elements to communicate to assistive technologies that those elements should be treated like a native HTML section heading element.</p>
63086308
<p>For example, "Definition of a Room" is a subsection of "Housing Specification":</p>
63096309
<pre><code>&lt;div role="heading" aria-level="1" class="header-big"&gt;Housing Specification&lt;/div&gt;
63106310
&lt;div role="section" aria-labelledby="room-definition"&gt;
@@ -6324,7 +6324,7 @@ <h4>Remediation Uses Cases</h4>
63246324

63256325
<section id="aria-level_listitem_role">
63266326
<h3><code>listitem</code> role</h3>
6327-
<p>The <code>aria-level</code> attribute can be used on elements with <code>listitem</code> role to represent list subitems when the structure of the DOM tree does not imply the intended level of nesting. For example, to quote a item in a nested to-do list, use the 'aria-level' attribute on the list items.</p>
6327+
<p>The <code>aria-level</code> attribute can be used on elements with <code>listitem</code> role to represent list subitems when the structure of the DOM tree does not imply the intended level of nesting. This is a rare scenario, however. For example, consider that you want to <em>quote</em> a single item from a large nested to-do list. Instead of using nested <code>ul</code> elements until the right level of nesting is reached, the <code>aria-level</code> attribute on the list item can be used, as follows:</p>
63286328
<pre><code>&lt;blockquote&gt;
63296329
&lt;ul&gt;
63306330
&lt;li aria-level="2"&gt;Wash Dishes&lt;/li&gt;
@@ -6336,8 +6336,8 @@ <h3><code>listitem</code> role</h3>
63366336

63376337
<section id="aria-level_treeitem_role">
63386338
<h3><code>treeitem</code> role</h3>
6339-
<p>The attribute <code>aria-level</code> can be used on elements with role <code>treeitem</code> to explicitly set the level of items within the <a href="#TreeView">Tree View Design Pattern</a>.</p>
6340-
<p>The computed <code>aria-level</code> of a <code>treeitem</code> within a tree is based on the number of 'group' role elements in the ancestor chain between the treeitem and the tree role, where the top level <code>treeitems</code> are <code>aria-level</code> 1. In the following example of a discussion board with nested replies, the top level post "What color should we paint the bike shed?" has an implicit <code>aria-level='1'</code>. The first reply has an implicit <code>aria-level='2'</code>, the response to that first reply has an implicit <code>aria-level='3'</code>.</p>
6339+
<p>In some implementations of the <a href="#TreeView">Tree View Design Pattern</a>, authors might need to explicitly declare the <code>aria-level</code> attribute.</p>
6340+
<p>The computed <code>aria-level</code> of a <code>treeitem</code> within a tree is based on the number of <code>group</code> role elements in the ancestor chain between the <code>treeitem</code> and the <code>tree</code> role, where the top-level <code>treeitem</code>s are <code>aria-level</code> 1. In the following example of a discussion board with nested replies, the top-level post "What color should we paint the bike shed?" has an implicit <code>aria-level='1'</code>. The first reply has an implicit <code>aria-level='2'</code>, the response to that first reply has an implicit <code>aria-level='3'</code>.</p>
63416341
<pre><code>&lt;ul role='tree'&gt;
63426342
&lt;li role='treeitem'&gt;
63436343
What color should we paint the bike shed?
@@ -6354,7 +6354,7 @@ <h3><code>treeitem</code> role</h3>
63546354
&lt;/li&gt;
63556355
&lt;/ul&gt;
63566356
</code></pre>
6357-
<p>To override the <code>aria-level</code> calculated from the number of <code>group</code> role parents, set <code>aria-level</code> explicitly. Setting <code>aria-level</code> explictly might be necessary if only part of a tree is loaded and the implicity calculations cannot account for the missing part of the tree.</p>
6357+
<p>To override the <code>aria-level</code> calculated from the number of <code>group</code> role parents, set <code>aria-level</code> explicitly. Setting <code>aria-level</code> explicitly might be necessary if only part of a tree is loaded and the implicit calculations cannot account for the missing part of the tree.</p>
63586358
<pre><code>&lt;ul role='tree'&gt;
63596359
&lt;li role='treeitem' aria-level='1'&gt;
63606360
What color should we paint the bike shed?

0 commit comments

Comments
 (0)