Slides for the ARIA WG meeting at TPAC 2026. To start the slide show, press ‘A’. Return to the index with ‘A’ or ‘Esc’. In slide mode, press ‘?’ for a list of commands. Notes like this one are shown between slides in the index and on the second screen.

Leaving slide mode.

Menu elements: repairing invalid content

David Grogan Google · Chrome Web Platform Lucas Radaelli Google · Chrome Accessibility

Follow-up to w3c/aria#2782.

We are adding menu elements to HTML

ElementImplicit role
<menubar>menubar
<menulist> (a popover)menu
<menuitem>menuitem
<menuitemcheckbox>, <menuitemradio> menuitemcheckbox, menuitemradio
<submenu>none (display: contents)

Keyboard model follows the APG menu / menubar pattern. Explainer · whatwg/html#12011

Arrow keys move between menuitems, one tab stop for the whole menu, Esc closes the current menulist and returns focus to its invoker.

Application menus, not navigation menus

These

  • File / Edit / View menubars
  • “Actions ▾” buttons
  • Table column menus
  • Video player settings

Not these

  • Site navigation
  • Links in a <nav>
  • Disclosure navigation

<a> isn’t allowed in a menu.

Navigation menus will get a separate proposal (OpenUI #1193).

Video player settings: Chrome’s own built-in video controls use menu roles. The ⋮ overflow menu is role=menu, and its items are <label role=menuitem> elements wrapping a <button>. The Playback speed and Captions submenus are role=menu with menuitemcheckbox items, and a “Back to options” header that is role=button, i.e. a button directly inside a menu (see blink/renderer/modules/media_controls/elements/).

Example markup

<menubar>
  <submenu>
    <menuitem>File</menuitem>
    <menulist>
      <menuitem>New</menuitem>
      <menuitem>Share…</menuitem>
      <menuitem>Open…</menuitem>
      <hr>
      <menuitem>Save</menuitem>
      …
    </menulist>
  </submenu>
</menubar>
<!-- Or from any button: -->
<button commandfor=file
        command=toggle-popover>
  File
</button>

<menulist id=file>
  <menuitem>New</menuitem>
  …
</menulist>

No ARIA, no JS. The accessibility tree is the interesting part.

Go quickly. The button gets implicit aria-haspopup=menu and aria-expanded.

Changed since we presented to ARIA in May: submenus used to be connected with ID references (command=toggle-menu commandfor=…). Now they’re nested in the DOM with <submenu>, and the toggle-menu command is gone; a button opens a standalone menulist with toggle-popover or popovertarget.

When things go well

Press → to step through. NVDA doesn’t say “menu item” when arrowing through these menus (checked with the real elements).

Soft disabling IF NECESSARY: we talked about this at Open UI a lot with Scott O'Hara. Conclusion: we don’t want to add soft disabling just for menus. It should be a platform feature that works for any disableable element. We have an open issue for this.

The content model

Allowed

  • Menu items: <menuitem> and its checkbox and radio versions
  • <submenu> = menuitem + menulist
  • Separators and groups: <hr>, <fieldset>, <div>

Not allowed

  • Other interactive elements: <button>, <input>, …
  • <a> (hidden by default)
  • Text outside a <menuitem> or <legend>

Text and images go inside a menuitem. The arrow keys only stop on menuitems.

This content model is stricter than ARIA’s. The big difference: HTML forbids interactive content inside a menuitem (no button, link, input or tabindex inside it), while ARIA allows it. The menuitem role puts no limits on its children, and its children aren’t presentational.

Anchors get a default display: none in menus.

When authors ignore the content model

What would happen if the browser did no repair:

Same menu, but Share… is a <button> instead of a <menuitem>. Arrow keys only stop on menuitems, so the button gets skipped. A sighted mouse user can still click it. A sighted keyboard user can see it and get frustrated, but a screen-reader user never learns it exists.

Improving the broken experience

Like <select>, which falls back when it has interactive content.

Three options

  1. Change the keyboard and roles so everything is reachable
    • Modeled on customizable <select>: its picker becomes a dialog and Tab reaches everything
    • Menus nest, so not a straight copy. Which roles? (attempts 1–5)
  2. Let arrow keys reach non-menuitems; keep the menu roles
    • Smallest change, but a menu then owns things it isn’t allowed to own
  3. Do nothing: keep the broken experience
    • As in the “no repair” demo: the button stays unreachable

We’ve been working on (a). All three are where we want feedback.

(c) is here because someone may argue the browser shouldn’t guess at all: leave the menu as the author wrote it, and rely on the DevTools warning to get it fixed.

Why not a straight copy of <select>: a select has one popup, so one dialog. Menus nest, so “dialog everywhere” gives nested dialogs (attempt 1).

If someone suggests hiding the menu or the invalid content (display: none): we decided against that for customizable select in openui#540 (2022), and we’re following that precedent.

The goal: less confusing, not fixed

Success means screen-reader users can find and use everything. It won’t be a great menu.

Set expectations before the attempts: none of them produce a good experience.

Devtools: the Blink web platform team recently, last few years, convinced the chrome devtools team to show console warnings when pages use new primitives in an a11y-unfriendly manner. That unblocked us to do the same here.

Attempt 1: dialog role everywhere

menubar          → dialog
  menuitem File
  menulist       → dialog
    menuitem New
    button Share
    …
  • One violation anywhere switches the whole menu tree, so users don't have to mix Tab and arrows navigating a single menu structure
  • Discussed in #2782
  • Tab replaces arrow keys
  • ✗ Every submenu became a nested dialog

Menuitems kept their menuitem role in attempts 1 and 2.

Lucas said he has never run into nested dialogs in the wild.

Attempt 2: dialog outside, lists inside

menubar          → dialog
  menuitem File
  menulist       → list
    menuitem New
    button Share
    …
  • No more nested dialogs
  • X of Y (posInSet / setSize) counts the invalid content too
  • ✗ Esc doesn’t “close” the dialog

Focus stays on the menubar. SR users expect a dialog to close and focus to move, but a menubar can’t close.

With the button counted, the broken File menu is “X of 6” again (New 1, Share… 2, Open… 3, …) instead of “X of 5” with the button left out.

But can't CLOSE the outer dialog / menubar because a menubar always takes up space in the page

Scott hinted at this back in May (at OpenUI, not in the ARIA discussion): when a menu tree has invalid content, probably leave the top-level menubar as something other than a dialog.

Attempt 3: lists everywhere

menubar              → list
  menuitem File      → listitem
  menulist           → list
    menuitem New     → listitem
    button Share
    menuitem Open…   → listitem
    …
  • Menuitems become listitems too: left as menuitems, NVDA kept saying “menu”
  • Checkable items: checkbox/radio
  • ✗ listitem can’t be expanded or collapsed
  • ✗ NVDA still said “submenu” on list items, mixing menu and list language

This is what Chromium does today (Oct 2026). NVDA seemed confused. TODO: add the exact NVDA output.

Why checkbox/radio: ARIA’s listitem supports only aria-posinset and aria-setsize, so it can’t be checked. For the same reason it can’t be expanded or collapsed, so “File” loses its submenu state. NVDA still sometimes said “submenu”. We first thought it was reading the HTML tag name, but it may instead come from aria-haspopup=menu: Chromium sets that on a menuitem with a submenu, and it may survive the change to listitem. NVDA says “submenu” for any menu item with a popup, e.g. “File submenu 1 of 4” in a valid menubar.

Attempt 4: tree

menubar              → tree
  menuitem File      → treeitem
  menulist           → group
    menuitem New     → treeitem
    button Share
    menuitem Open…   → treeitem
    …
  • treeitem supports aria-expanded and aria-checked
  • Tab key reached everything in NVDA focus mode, great
  • But we only tested NVDA so far, and noticed this is non-compliant.

Promising results in initial testing, but we're far from positive.

Attempt 5: tree, with the group owned

menubar              → tree
  menuitem File      → treeitem
    menulist         → group
      menuitem New   → treeitem
      button Share
      menuitem Open… → treeitem
      …
  • Same roles as attempt 4
  • New: while a menulist is open, the menuitem next to it in the <submenu> gets an implicit aria-owns pointing at it
  • So the group is the treeitem’s child, as ARIA requires
  • ⚠ UNTESTED

Fixes what was non-compliant in attempt 4. ARIA says a treeitem’s parent must be a tree or a “group with accessibility parent treeitem”, so a submenu’s group has to be a child of the treeitem that opens it, not its sibling. The DOM has them as siblings inside <submenu>, so the treeitem implicitly owns the group.

Only while the menulist is open: a closed menulist is a hidden popover, so it isn’t in the accessibility tree anyway.

The same rule applies at every level, e.g. a submenu inside File.

Caveat: invalid content placed directly in the <menubar> (not inside a submenu) is still non-compliant in attempts 4 and 5. It would be a child of the tree, and ARIA only allows treeitem children in a tree. The example on the slide has the button inside a submenu, so it’s compliant.

OR, should we just let arrow keys reach everything?

That's option (b) from earlier. This is the main question for the group.

NVDA + Chrome test (ARIA mock-up: role=menu with a <button> between menuitems, arrow keys reaching it): NVDA stayed in focus mode on the button, so the arrow keys kept working. It said “New 1 of 4”, “Share button”, “Open Recent 2 of 4”, “Save 3 of 4”. So the button is announced, but the count skips it (4 items, 5 arrow stops). Counting it would need a position on a button, which ARIA doesn’t list as supported for that role. Only NVDA tested so far.

Will users be better served, across all the screen readers that you're familiar with, by menu elements falling back to some set of non-menu roles when there's interactive content (option a), or by trying to treat that interactive content as a menuitem? (option B)

Wrap violations in menuitems would not be good for SR users -- what would TAB do if they were focused on one of these menuitems with interactive descendants? The expect it would jump to the next form control (or something) on the page, not to a different place inside the menu.

What about standardization?

ARIA, Handling author errors:

User agents are not responsible for logical validation, such as the following: […]

4. Elements that do not correctly observe required child / parent role relationships or that appear elsewhere than in their required parent.

So any repair is currently up to each browser.

Or just document the repair?

ARIA already has a page, Browser accessibility heuristics, that documents stuff like:

Where should menu repair go? HTML? HTML-AAM? ARIA? That documentation page?

Data vs. layout tables: browsers guess whether a <table> holds data or is only used for page layout. A data table is exposed as a table, with headers and cells a screen reader can navigate; a layout table is flattened so its cells read as ordinary content. Every major engine guesses from clues like <th>, <caption>, borders, size and nesting, the rules differ between engines, and none of it is specified. Menu repair would be the same kind of thing.

if Chromium repairs to trees and another engine repairs differently, screen-reader users get vastly different experiences on the same page.

Maybe if we find a good repair solution, we standardize, but if it's not great, we'll just document it, so as to not lock in other implementers?

Questions for the group

  1. Change roles (a), let arrows reach everything (b), or leave it broken (c)?
  2. If (a): which roles?
  3. Where should the repair be specified?

Links