Skip to content

Commit ff0b869

Browse files
committed
Editor Menubar Example: Improve Editorial Consistency and Fix Broken Links
For issue #144, made the following changes to the editor menubar example in examples/menubar/menubar-2/menubar-2.html. 1. Clarified and simplified introduction. 2. Moved Notes from example section in to a separate accessibility features section to be consistent with the example template. 3. Removed use of term "popup" and used "submenu" as agreed in issue #268. 4. Editorial revisions to keyboard tables. 5. Editorial revisions to role, state, and property tables. 6. Fix broken links to source files.
1 parent 0c8582a commit ff0b869

File tree

1 file changed

+50
-76
lines changed

1 file changed

+50
-76
lines changed

examples/menubar/menubar-2/menubar-2.html

Lines changed: 50 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
<script src="../../js/highlight.pack.js"></script>
1212
<script src="../../js/app.js"></script>
1313

14+
<!-- CSS and javascript for this example. -->
1415
<link href="css/menubarAction.css" rel="stylesheet">
15-
1616
<script src="js/styleManager.js" type="text/javascript"></script>
17-
1817
<script src="js/MenubarAction.js" type="text/javascript"></script>
1918
<script src="js/MenubarItemAction.js" type="text/javascript"></script>
2019
<script src="js/PopupMenuAction.js" type="text/javascript"></script>
@@ -32,14 +31,12 @@ <h1>Editor Menubar Example</h1>
3231
The following example demonstrates using the
3332
<a href="../../../#menu">menubar design pattern</a>
3433
to provide access to sets of actions.
35-
Each item in this example menubar represents a category of text
36-
formatting commands. The formatting commands are revealed in popup menus that can be opened from
37-
items in the menubar. This example also demonstrates <code>menuitemradio</code> and <code>menuitemcheckbox</code> elements.
34+
Each item in the below menubar identifies a category of text formatting actions that can be executed from its submenu.
35+
The submenus also demonstrate <code>menuitemradio</code> and <code>menuitemcheckbox</code> elements.
3836
</p>
39-
4037
<p>Similar examples include: </p>
4138
<ul>
42-
<li><a href="../menubar-1/menubar-1.html">Navigation Menubar Example</a>: Example of a menubar with popup menus with navigational links.</li>
39+
<li><a href="../menubar-1/menubar-1.html">Navigation Menubar Example</a>: A menubar that presents site navigation menus.</li>
4340
</ul>
4441

4542
<section id="code-ex-1">
@@ -126,18 +123,19 @@ <h2 id="ex1_label">Example</h2>
126123

127124
</div>
128125
<div role="separator" id="ex1_end_sep" aria-labelledby="ex1_end_sep ex1_label" aria-label="End of" ></div>
129-
<h4>Notes</h4>
126+
</section>
127+
128+
<section>
129+
<h2>Accessibility Features</h2>
130130
<ol>
131-
<li>Menu radio buttons and checkboxes indicate the current format settings.</li>
131+
<li>Users of assistive technologies can identify which format settings are selected because they are represented by menu item radio and menu item checkbox elements that have a checked state.</li>
132132
<li>Disabled menu items are demonstrated in the font size menu, which includes two disabled menuitems .</li>
133-
<li>CSS <code>:after</code> is used to render the down arrow in a menubar item using the CSS <code>content</code> property string using entity values.</li>
134-
<li>CSS <code>:before</code> is used to render checks using the CSS <code>content</code> property string using entity values on <code>menuritemadio</code> and <code>menuitemcheckbox</code> items.</li>
133+
<li>The down arrow and checked icons are made compatible with high contrast mode and hidden from screen readers by using the CSS <code>content</code> property to render images.</li>
135134
</ol>
136135
</section>
137-
136+
138137
<section>
139138
<h2 id="kbd_label">Keyboard Support</h2>
140-
141139
<h3 id="kbd1_label">Menubar</h3>
142140
<table aria-labelledby="kbd1_label kbd_label" class="def">
143141
<thead>
@@ -149,9 +147,9 @@ <h3 id="kbd1_label">Menubar</h3>
149147
<tbody>
150148
<tr>
151149
<th>
152-
<kbd>Space or Enter</kbd>
150+
<kbd>Space</kbd><br><kbd>Enter</kbd>
153151
</th>
154-
<td>Opens popup menu and places focus on the first item in the popup.</td>
152+
<td>Opens submenu and moves focus to first item in the submenu.</td>
155153
</tr>
156154
<tr>
157155
<th>
@@ -179,13 +177,13 @@ <h3 id="kbd1_label">Menubar</h3>
179177
<th>
180178
<kbd>Down Arrow</kbd>
181179
</th>
182-
<td>Opens popup menu and places focus on the first item in the popup.</td>
180+
<td>Opens submenu and moves focus to first item in the submenu.</td>
183181
</tr>
184182
<tr>
185183
<th>
186184
<kbd>Up Arrow</kbd>
187185
</th>
188-
<td>Opens popup menu and places focus on the last item in the popup.</td>
186+
<td>Opens submenu and moves focus to last item in the submenu.</td>
189187
</tr>
190188
<tr>
191189
<th>
@@ -213,7 +211,7 @@ <h3 id="kbd1_label">Menubar</h3>
213211
</tbody>
214212
</table>
215213

216-
<h3 id="kbd2_label">Popup</h3>
214+
<h3 id="kbd2_label">Submenu</h3>
217215
<table aria-labelledby="kbd2_label kbd_label" class="def">
218216
<thead>
219217
<tr>
@@ -224,23 +222,18 @@ <h3 id="kbd2_label">Popup</h3>
224222
<tbody>
225223
<tr>
226224
<th>
227-
<kbd>Space or Enter</kbd>
225+
<kbd>Space</kbd><br><kbd>Enter</kbd>
228226
</th>
229-
<td>
230-
<ul>
231-
<li>Executes action or command, e.g., bolds text, change font.</li>
232-
<li>Implements optional behavior of a popup menu staying open after activating a <code>menuitemradio</code> or <code>menuitemcheckbox</code>. This allows for users to visually see the change in state before they close the popup menu with an additional keyboard command.</li>
233-
</ul>
234-
</td>
227+
<td>Activates menu item, causing action to be executed, e.g., bold text, change font. </td>
235228
</tr>
236229
<tr>
237230
<th>
238231
<kbd>Escape</kbd>
239232
</th>
240233
<td>
241234
<ul>
242-
<li>Closes popup menu.</li>
243-
<li>Places focus on parent menubar item.</li>
235+
<li>Closes submenu.</li>
236+
<li>Moves focus to parent menubar item.</li>
244237
</ul>
245238
</td>
246239
</tr>
@@ -250,9 +243,9 @@ <h3 id="kbd2_label">Popup</h3>
250243
</th>
251244
<td>
252245
<ul>
253-
<li>Closes popup menu.</li>
246+
<li>Closes submenu.</li>
254247
<li>Moves focus to next item in the menubar.</li>
255-
<li>Opens popup menu for newly focused item, leaving focus in the menubar.</li>
248+
<li>Opens submenu of newly focused menubar item, keeping focus on that parent menubar item.</li>
256249
</ul>
257250
</td>
258251
</tr>
@@ -262,9 +255,9 @@ <h3 id="kbd2_label">Popup</h3>
262255
</th>
263256
<td>
264257
<ul>
265-
<li>Closes popup menu.</li>
258+
<li>Closes submenu.</li>
266259
<li>Moves focus to previous item in the menubar.</li>
267-
<li>Opens popup menu for newly focused item, leaving focus in the menubar.</li>
260+
<li>Opens submenu of newly focused menubar item, keeping focus on that parent menubar item.</li>
268261
</ul>
269262
</td>
270263
</tr>
@@ -274,7 +267,7 @@ <h3 id="kbd2_label">Popup</h3>
274267
</th>
275268
<td>
276269
<ul>
277-
<li>Moves focus to the next item in the popup.</li>
270+
<li>Moves focus to the next item in the submenu.</li>
278271
<li>If focus is on the last item, moves focus to the first item.</li>
279272
</ul>
280273
</td>
@@ -285,7 +278,7 @@ <h3 id="kbd2_label">Popup</h3>
285278
</th>
286279
<td>
287280
<ul>
288-
<li>Moves focus to previous item in the popup.</li>
281+
<li>Moves focus to previous item in the submenu.</li>
289282
<li>If focus is on the first item, moves focus to the last item.</li>
290283
</ul>
291284
</td>
@@ -294,13 +287,13 @@ <h3 id="kbd2_label">Popup</h3>
294287
<th>
295288
<kbd>Home</kbd>
296289
</th>
297-
<td>Moves focus to the first item in the popup.</td>
290+
<td>Moves focus to the first item in the submenu.</td>
298291
</tr>
299292
<tr>
300293
<th>
301294
<kbd>End</kbd>
302295
</th>
303-
<td>Moves focus to the last item in the popup.</td>
296+
<td>Moves focus to the last item in the submenu.</td>
304297
</tr>
305298
<tr>
306299
<th>
@@ -319,7 +312,6 @@ <h3 id="kbd2_label">Popup</h3>
319312

320313
<section>
321314
<h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
322-
323315
<h3 id="rps1_label">Menubar</h3>
324316
<table aria-labelledby="rps1_label rps_label" class="data attributes">
325317
<thead>
@@ -341,12 +333,8 @@ <h3 id="rps1_label">Menubar</h3>
341333
</td>
342334
<td>
343335
<ul>
344-
<li>
345-
Identifies the <code>ul</code> element as a container for set of <code>menuitem</code> widgets associated with the menubar.
346-
</li>
347-
<li>
348-
Is not focusable because focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex</a>,
349-
</li>
336+
<li>Identifies the element as a <code>menubar</code> container for a set of <code>menuitem</code> elements.</li>
337+
<li>Is not focusable because focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex.</a></li>
350338
</ul>
351339
</td>
352340
</tr>
@@ -378,7 +366,7 @@ <h3 id="rps1_label">Menubar</h3>
378366
<code>li</code>
379367
</td>
380368
<td>
381-
Identifies the <code>li</code> element as a menu item within the menubar widget.
369+
Identifies the element as a menu item within the menubar.
382370
</td>
383371
</tr>
384372
<tr>
@@ -415,8 +403,7 @@ <h3 id="rps1_label">Menubar</h3>
415403
When the page loads, the first item in the menubar has <code>tabindex=&quot;0&quot;</code>.
416404
</li>
417405
<li>
418-
Focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex</a>,
419-
so the most recently focused item will be in the page <kbd>Tab</kbd> sequence.
406+
Focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex</a>.
420407
</li>
421408
</ul>
422409
</td>
@@ -430,7 +417,7 @@ <h3 id="rps1_label">Menubar</h3>
430417
<code>li</code>
431418
</td>
432419
<td>
433-
Identifies the <code>menuitem</code> as having a child popup menu.
420+
Indicates that the <code>menuitem</code> has a submenu.
434421
</td>
435422
</tr>
436423
<tr>
@@ -442,7 +429,7 @@ <h3 id="rps1_label">Menubar</h3>
442429
<code>li</code>
443430
</td>
444431
<td>
445-
Indicates the child popup menu is open.
432+
Indicates the submenu is open.
446433
</td>
447434
</tr>
448435
<tr>
@@ -454,13 +441,12 @@ <h3 id="rps1_label">Menubar</h3>
454441
<code>li</code>
455442
</td>
456443
<td>
457-
Indicates the child popup menu is closed.
444+
Indicates the submenu is closed.
458445
</td>
459446
</tr>
460447
</tbody>
461448
</table>
462-
463-
<h3 id="rps2_label">Popup Menu</h3>
449+
<h3 id="rps2_label">Submenu</h3>
464450
<table aria-labelledby="rps2_label rps_label" class="data attributes">
465451
<thead>
466452
<tr>
@@ -482,10 +468,10 @@ <h3 id="rps2_label">Popup Menu</h3>
482468
<td>
483469
<ul>
484470
<li>
485-
Identifies the <code>ul</code> element as a container for set of <code>menuitem</code> widgets associated with the menu.
471+
Identifies the element as a menu container for a set of <code>menuitem</code> elements.
486472
</li>
487473
<li>
488-
Is not focusable because focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex</a>,
474+
Is not focusable because focus is managed using <a href="../../../#kbd_roving_tabindex">roving tabindex.</a>
489475
</li>
490476
</ul>
491477
</td>
@@ -511,7 +497,7 @@ <h3 id="rps2_label">Popup Menu</h3>
511497
<code>li</code>
512498
</td>
513499
<td>
514-
Identifies the <code>li</code> element as a menu item in the popup menu.
500+
Identifies the element as an item in the submenu.
515501
</td>
516502
</tr>
517503
<tr>
@@ -535,7 +521,7 @@ <h3 id="rps2_label">Popup Menu</h3>
535521
<code>li</code>
536522
</td>
537523
<td>
538-
Identifies the <code>li</code> element as a menuitemcheckbox widget.
524+
Identifies the element as a <code>menuitemcheckbox</code>.
539525
</td>
540526
</tr>
541527
<tr>
@@ -564,10 +550,7 @@ <h3 id="rps2_label">Popup Menu</h3>
564550
Indicates that the <code>menuitemcheckbox</code> is checked.
565551
</li>
566552
<li>
567-
The visual state of the selection is synchronized with the <code>aria-checked</code>
568-
value using CSS attribute selectors, e.g., [aria-checked=&quot;true&quot;],
569-
the CSS pseudo selector <code>:before</code>,
570-
and the <code>content</code> property.
553+
The visual appearance of the selected state is synchronized with the <code>aria-checked</code> value using CSS attribute selectors.
571554
</li>
572555
</ul>
573556
</td>
@@ -586,10 +569,7 @@ <h3 id="rps2_label">Popup Menu</h3>
586569
Indicates that the <code>menuitemcheckbox</code> is <strong>NOT</strong> checked.
587570
</li>
588571
<li>
589-
The visual state of the selection is synchronized with the <code>aria-checked</code>
590-
value using CSS attribute selectors, e.g., [aria-checked=&quot;true&quot;],
591-
the CSS pseudo selector <code>:before</code>,
592-
and the <code>content</code> property.
572+
The visual appearance of the selected state is synchronized with the <code>aria-checked</code> value using CSS attribute selectors.
593573
</li>
594574
</ul>
595575
</td>
@@ -605,7 +585,7 @@ <h3 id="rps2_label">Popup Menu</h3>
605585
<td>
606586
<ul>
607587
<li>
608-
Identifies the <code>ul</code> element as a container for a set of <code>menuitemradio</code> widgets.
588+
Identifies the element as a container for a set of <code>menuitemradio</code> elements.
609589
</li>
610590
<li>
611591
Enables browsers to compute values of <code>aria-setsize</code> and <code>aria-posinset</code>.
@@ -624,11 +604,11 @@ <h3 id="rps2_label">Popup Menu</h3>
624604
<td>
625605
<ul>
626606
<li>
627-
Identifies the <code>li</code> element as a <code>menuitemradio</code> widget.
607+
Identifies the element as a <code>menuitemradio</code> element.
628608
</li>
629609
<li>
630-
In this example the menuitemradio group is defined by either <code>ul[role=&quot;menu&quot;]</code>
631-
or <code>[role=&quot;group&quot;]</code>.
610+
When all items in a submenu are members of the same radio group,
611+
the group is defined by the <code>menu</code> element; a <code>group</code> element is not necessary.
632612
</li>
633613
</ul>
634614
</td>
@@ -659,10 +639,7 @@ <h3 id="rps2_label">Popup Menu</h3>
659639
Indicates the <code>menuitemradio</code> is checked.
660640
</li>
661641
<li>
662-
The visual state of the selection is synchronized with the <code>aria-checked</code>
663-
value using CSS attribute selectors, e.g., [aria-checked=&quot;true&quot;],
664-
the CSS pseudo selector <code>:before</code>,
665-
and the <code>content</code> property.
642+
The visual appearance of the selected state is synchronized with the <code>aria-checked</code> value using CSS attribute selectors.
666643
</li>
667644
</ul>
668645
</td>
@@ -681,10 +658,7 @@ <h3 id="rps2_label">Popup Menu</h3>
681658
Indicates that the <code>menuitemradio</code> is <strong>NOT</strong> checked.
682659
</li>
683660
<li>
684-
The visual state of the selection is synchronized with the <code>aria-checked</code>
685-
value using CSS attribute selectors, e.g., [aria-checked=&quot;true&quot;],
686-
the CSS pseudo selector <code>:before</code>,
687-
and the <code>content</code> property.
661+
The visual appearance of the selected state is synchronized with the <code>aria-checked</code> value using CSS attribute selectors.
688662
</li>
689663
</ul>
690664
</td>
@@ -710,10 +684,10 @@ <h2>Javascript and CSS Source Code</h2>
710684
Javascript: <a href="js/PopupMenuAction.js" type="text/javascript">PopupMenuAction.js</a>
711685
</li>
712686
<li>
713-
Javascript: <a href="js/MenuItemAction.js" type="text/javascript">MenuItemAction.js</a>
687+
Javascript: <a href="js/PopupMenuItemAction.js" type="text/javascript">PopupMenuItemAction.js</a>
714688
</li>
715689
<li>
716-
Javascript: <a href="js/TextStyling.js" type="text/javascript">TextStyling.js</a>
690+
Javascript: <a href="js/styleManager.js" type="text/javascript">styleManager.js</a>
717691
</li>
718692
</ul>
719693
</section>

0 commit comments

Comments
 (0)