Skip to content

Commit 8cb25c3

Browse files
committed
Editorial: Apply semantic line feeds to new text (pull #1109)
1 parent 4dcd209 commit 8cb25c3

File tree

1 file changed

+33
-9
lines changed

1 file changed

+33
-9
lines changed

aria-practices.html

+33-9
Original file line numberDiff line numberDiff line change
@@ -3742,7 +3742,7 @@ <h3>What ARE Accessible Names and Descriptions?</h3>
37423742
For example, a switch button named <q>Mute Conversation</q> in the <q>off</q> state could be announced as <q>Mute Conversation switch button off</q>.
37433743
Because descriptions are optional strings that are usually significantly longer than names, they are presented last, sometimes after a slight delay.
37443744
For example, <q>Mute Conversation Switch button off, Silences alerts and notifications about activity in this conversation.</q>
3745-
To reduce verbosity, some screen readers do not announce descriptions by default but instead inform users of their presence so that users can press a key that will announce the description.
3745+
To reduce verbosity, some screen readers do not announce descriptions by default but instead inform users of their presence so that users can press a key that will announce the description.
37463746
</p>
37473747
</section>
37483748

@@ -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>
@@ -6281,7 +6281,11 @@ <h3>Indicating sort order with <code>aria-sort</code></h3>
62816281

62826282
<section id="aria-level">
62836283
<h2>Describing Hierarchical Structure with <code>aria-level</code></h2>
6284-
<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>
6284+
<p>
6285+
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.
6286+
The value of <code>aria-level</code> is numeric, with <code>1</code> indicating the top level of the structure.
6287+
The number increases for each level of nesting.
6288+
</p>
62856289
<p>Do not use <code>aria-level</code> when the DOM structure already accurately represents the elements' hierarchical relationships.</p>
62866290
<p>The <code>aria-level</code> attribute can be used on the following roles:</p>
62876291
<ul>
@@ -6293,8 +6297,14 @@ <h2>Describing Hierarchical Structure with <code>aria-level</code></h2>
62936297
</ul>
62946298
<section id="aria-level_heading_role">
62956299
<h3><code>heading</code> Role</h3>
6296-
<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>
6297-
<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>
6300+
<p>
6301+
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>.
6302+
Do not use attribute <code>aria-level</code> and <code>heading</code> when a native HTML element can be used.
6303+
</p>
6304+
<p>
6305+
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.
6306+
The headings "Deciduous Trees" and "Evergreen Trees" are both subheadings to "Total Trees".
6307+
</p>
62986308
<pre><code>&lt;svg width="1000" height="1000"&gt;
62996309
&lt;text x="10" y="10" role="header" aria-level="1"&gt;Total Trees:&lt;/text&gt;
63006310
&lt;text x="10" y="100" role="header" aria-level="2"&gt;Deciduous Trees:&lt;/text&gt;
@@ -6305,7 +6315,10 @@ <h3><code>heading</code> Role</h3>
63056315

63066316
<section id="aria-level_heading_role_remediation">
63076317
<h4>Remediation Uses Cases</h4>
6308-
<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>
6318+
<p>
6319+
In rare scenarios, legacy code cannot be converted to using HTML header elements.
6320+
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.
6321+
</p>
63096322
<p>For example, "Definition of a Room" is a subsection of "Housing Specification":</p>
63106323
<pre><code>&lt;div role="heading" aria-level="1" class="header-big"&gt;Housing Specification&lt;/div&gt;
63116324
&lt;div role="section" aria-labelledby="room-definition"&gt;
@@ -6325,7 +6338,10 @@ <h4>Remediation Uses Cases</h4>
63256338

63266339
<section id="aria-level_listitem_role">
63276340
<h3><code>listitem</code> role</h3>
6328-
<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>
6341+
<p>
6342+
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.
6343+
For example, to quote a item in a nested to-do list, use the 'aria-level' attribute on the list items.
6344+
</p>
63296345
<pre><code>&lt;blockquote&gt;
63306346
&lt;ul&gt;
63316347
&lt;li aria-level="2"&gt;Wash Dishes&lt;/li&gt;
@@ -6338,7 +6354,11 @@ <h3><code>listitem</code> role</h3>
63386354
<section id="aria-level_treeitem_role">
63396355
<h3><code>treeitem</code> role</h3>
63406356
<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>
6341-
<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>
6357+
<p>
6358+
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.
6359+
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>.
6360+
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>.
6361+
</p>
63426362
<pre><code>&lt;ul role='tree'&gt;
63436363
&lt;li role='treeitem'&gt;
63446364
What color should we paint the bike shed?
@@ -6372,7 +6392,11 @@ <h3><code>treeitem</code> role</h3>
63726392

63736393
<section id="aria-level_row_role">
63746394
<h3><code>row</code> Role</h3>
6375-
<p>The <code>aria-level</code> attribute can be used on an element with <code>row</code> role to describe nesting of rows in a <code>treegrid</code>, as is explained in the <a href="#treegrid">treegrid pattern</a>. In this example, the DOM tree does not represent the hierarchical relationship between rows. Each email is in a <code>tr</code> element, which are siblings in the DOM tree, therefore <code>aria-level</code> is necessary to communicate that the emails form a tree structure.</p>
6395+
<p>
6396+
The <code>aria-level</code> attribute can be used on an element with <code>row</code> role to describe nesting of rows in a <code>treegrid</code>, as is explained in the <a href="#treegrid">treegrid pattern</a>.
6397+
In this example, the DOM tree does not represent the hierarchical relationship between rows.
6398+
Each email is in a <code>tr</code> element, which are siblings in the DOM tree, therefore <code>aria-level</code> is necessary to communicate that the emails form a tree structure.
6399+
</p>
63766400
<pre><code>&lt;table role='treegrid'&gt;
63776401
&lt;tr&gt;
63786402
&lt;th&gt;From:&lt;/th&gt;

0 commit comments

Comments
 (0)