Skip to content

Commit eed0ef0

Browse files
aleventhalcarmacleodmcking65
authored
Add comment role (#1135)
Refers to issue #749 Co-Authored-By: Carolyn MacLeod <[email protected]> Co-Authored-By: Matt King <[email protected]>
1 parent 050387c commit eed0ef0

File tree

1 file changed

+102
-0
lines changed

1 file changed

+102
-0
lines changed

index.html

+102
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ <h3>Document Structure Roles</h3>
640640
<li><rref>caption</rref></li>
641641
<li><rref>cell</rref></li>
642642
<li><rref>columnheader</rref></li>
643+
<li><rref>comment</rref></li>
643644
<li><rref>definition</rref></li>
644645
<li><rref>deletion</rref></li>
645646
<li><rref>directory</rref></li>
@@ -2327,6 +2328,107 @@ <h2>Definition of Roles</h2>
23272328
</tbody>
23282329
</table>
23292330
</div>
2331+
<div class="role" id="comment">
2332+
<rdef>comment</rdef>
2333+
<div class="role-description">
2334+
<p>A comment contains content expressing reaction to other content.</p>
2335+
<p>Comments can annotate any visible content, from small spans of text, to other comments, to entire articles. Authors SHOULD identify the relationships between comments and the commented content, as follows:</p>
2336+
<ol>
2337+
<li>If the comment is a reply to another <code>comment</code>:
2338+
<ul>
2339+
<li>If all ancestor comments are available in the DOM, make each reply <code>comment</code> a semantic descendant of the <code>comment</code> to which it is replying, either by making it a DOM descendant element or by using <pref>aria-owns</pref>.</li>
2340+
<li>Alternatively, if all ancestor comments are not in the DOM, such as when comments are paginated, the hierarchical
2341+
level MAY be indicated via <pref>aria-level</pref>. Additional group positional information MAY be indicated via <pref>aria-posinset</pref> and <pref>aria-setsize</pref>.</li>
2342+
</ul>
2343+
</li>
2344+
<li>Otherwise, if the comment relates to other content in the page:
2345+
<ul>
2346+
<li>Provide <pref>aria-details</pref> on the element containing the commented content with a value refering to the element with role <code>comment</code>.</li>
2347+
<li>If there are multiple comments related to the same commented content, either provide a value for <pref>aria-details</pref> on the commented content that refers to each individual comment, or use <pref>aria-details</pref> to refer to a parent container of the comments. If <pref>aria-details</pref> refers to an element containing comments rather than <code>comment</code> elements, authors SHOULD assign a role of <rref>group</rref> or <rref>region</rref> to the referenced container.</li>
2348+
</ul>
2349+
</li>
2350+
</ol>
2351+
<p>If the author has not explicitly declared <pref>aria-level</pref>, <pref>aria-posinset</pref>, or <pref>aria-setsize</pref> for a <code>comment</code> element, user agents MUST automatically compute the missing values and expose them to assistive technologies.</p>
2352+
</div>
2353+
<table class="role-features">
2354+
<caption>Characteristics:</caption>
2355+
<thead>
2356+
<tr>
2357+
<th scope="col">Characteristic</th>
2358+
<th scope="col">Value</th>
2359+
</tr>
2360+
</thead>
2361+
<tbody>
2362+
<tr>
2363+
<th class="role-abstract-head" scope="row">Is Abstract:</th>
2364+
<td class="role-abstract"> </td>
2365+
</tr>
2366+
<tr>
2367+
<th class="role-parent-head" scope="row">Superclass Role:</th>
2368+
<td class="role-parent"><rref>article</rref></td>
2369+
</tr>
2370+
<tr>
2371+
<th class="role-base-head" scope="row">Base Concept:</th>
2372+
<td class="role-base"> </td>
2373+
</tr>
2374+
<tr>
2375+
<th class="role-related-head" scope="row">Related Concepts:</th>
2376+
<td class="role-related"> </td>
2377+
</tr>
2378+
<tr>
2379+
<th class="role-scope-head" scope="row">Required Context Role:</th>
2380+
<td class="role-scope"> </td>
2381+
</tr>
2382+
<tr>
2383+
<th class="role-mustcontain-head" scope="row">Required Owned Elements:</th>
2384+
<td class="role-mustcontain"> </td>
2385+
</tr>
2386+
<tr>
2387+
<th class="role-required-properties-head">Required States and Properties:</th>
2388+
<td class="role-required-properties"> </td>
2389+
</tr>
2390+
<tr>
2391+
<th class="role-properties-head" scope="row">Supported States and Properties:</th>
2392+
<td class="role-properties">
2393+
<ul>
2394+
<li><pref>aria-level</pref></li>
2395+
<li><pref>aria-posinset</pref></li>
2396+
<li><pref>aria-setsize</pref></li>
2397+
</ul>
2398+
</td>
2399+
</tr>
2400+
<tr>
2401+
<th class="role-inherited-head" scope="row">Inherited States and Properties:</th>
2402+
<td class="role-inherited">Placeholder</td>
2403+
</tr>
2404+
<tr>
2405+
<th class="role-namefrom-head" scope="row">Name From:</th>
2406+
<td class="role-namefrom">
2407+
<ul>
2408+
<li>contents</li>
2409+
<li>author</li>
2410+
</ul>
2411+
</td>
2412+
</tr>
2413+
<tr>
2414+
<th class="role-namerequired-head" scope="row">Accessible Name Required:</th>
2415+
<td class="role-namerequired"> </td>
2416+
</tr>
2417+
<tr>
2418+
<th class="role-namerequired-inherited-head" scope="row">Inherits Name Required:</th>
2419+
<td class="role-namerequired-inherited"> </td>
2420+
</tr>
2421+
<tr>
2422+
<th class="role-childpresentational-head" scope="row">Children Presentational:</th>
2423+
<td class="role-childpresentational"> </td>
2424+
</tr>
2425+
<tr>
2426+
<th class="role-presentational-inherited-head" scope="row">Inherits Presentational:</th>
2427+
<td class="role-presentational-inherited"> </td>
2428+
</tr>
2429+
</tbody>
2430+
</table>
2431+
</div>
23302432
<div class="role" id="complementary">
23312433
<rdef>complementary</rdef>
23322434
<div class="role-description">

0 commit comments

Comments
 (0)