|
3 | 3 | <meta charset="UTF-8"> |
4 | 4 | <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
5 | 5 | <title>Menu Elements Test Page</title> |
6 | | - |
7 | | -<style> |
8 | | - body { |
9 | | - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; |
10 | | - } |
11 | 6 |
|
| 7 | +<style> |
12 | 8 | menuitem { |
13 | 9 | justify-content: space-between; |
14 | 10 | padding: 6px 10px; |
|
21 | 17 | </style> |
22 | 18 |
|
23 | 19 | <h1>Menu Element Test Page</h1> |
| 20 | +<section> |
| 21 | + <h2>Menubar with Submenus</h2> |
| 22 | + <p>This is a horizontal menubar containing several top-level submenus (File, Edit, View, Help). Clicking these opens a dropdown list of menu items.</p> |
| 23 | + |
| 24 | + <h3>Nested Submenus</h3> |
| 25 | + <p>The "File" menu contains an "Open Recent" submenu, and the "View" menu contains a "Zoom" submenu. These should open secondary dropdown lists when activated.</p> |
| 26 | + |
| 27 | + <h3>Disabled Menu Items</h3> |
| 28 | + <p>The "File" menu contains a disabled "Print" item, and the "View" menu contains a disabled but checked "Show Comments" item.</p> |
| 29 | + |
| 30 | + <h3>Single Checkable Items (Radio behavior)</h3> |
| 31 | + <p>The "Zoom" submenu under "View" has mutually exclusive options. Like radio buttons, checking one should deselect all others. '100%' is initially checked. |
| 32 | + </p> |
| 33 | + |
| 34 | + <h3>Multiple Checkable Items (Checkbox behavior)</h3> |
| 35 | + <p>The last three items in the "View" menu are checkable. They should behave like checkboxes where multiple items can be toggled on or off independently, except for the aforementioned "Show Comments", which is checked by default and not modifiable by the user.</p> |
| 36 | + |
| 37 | + <h3>Separators</h3> |
| 38 | + <p>Some menus use horizontal lines (<code><hr></code> elements) to visually group related items. There are 2 separators in the "File" menu, 1 in the "Open Recent" submenu, 1 in the "Edit" menu, and 1 in the "View" menu.</p> |
| 39 | + |
| 40 | + <p>Without further ado:</p> |
24 | 41 |
|
25 | 42 | <menubar> |
26 | 43 | <!-- File Menu --> |
@@ -97,8 +114,19 @@ <h1>Menu Element Test Page</h1> |
97 | 114 | </menulist> |
98 | 115 | </submenu> |
99 | 116 | </menubar> |
| 117 | +</section> |
| 118 | + |
| 119 | +<section> |
| 120 | + <h2>Menu Button</h2> |
| 121 | + <p>This is a standalone button that triggers a menulist popover. It does not use a <code><menubar></code>.</p> |
100 | 122 |
|
101 | | -<p>This is the main content of the application. The menu above should be fully interactive.</p> |
| 123 | + <button command="toggle-popover" commandfor="actions-menu">Actions</button> |
| 124 | + <menulist id="actions-menu"> |
| 125 | + <menuitem>Reply</menuitem> |
| 126 | + <menuitem>Forward</menuitem> |
| 127 | + <menuitem>Delete</menuitem> |
| 128 | + </menulist> |
| 129 | +</section> |
102 | 130 |
|
103 | 131 | <script> |
104 | 132 | const supported = 'HTMLMenuListElement' in window; |
|
0 commit comments