WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
276658
AX: role="menu" elements should allow child groups with menuitem children
https://bugs.webkit.org/show_bug.cgi?id=276658
Summary
AX: role="menu" elements should allow child groups with menuitem children
Westbrook
Reported
2024-07-16 07:30:05 PDT
With the following JS: ```js class Menu extends HTMLElement { constructor() { super(); this.internals_ = this.attachInternals(); this.internals_.role = 'menu'; this.internals_.ariaOrientation = 'vertical'; } } customElements.define('axe-menu', Menu); class Group extends HTMLElement { constructor() { super(); this.internals_ = this.attachInternals(); this.internals_.role = 'group'; } } customElements.define('axe-group', Group); class MenuItem extends HTMLElement { constructor() { super(); this.internals_ = this.attachInternals(); this.internals_.role = 'menuitem'; } } customElements.define('axe-menuitem', MenuItem); ``` And the following HTML: ```html <div> <style> axe-menuitem { display: list-item; } </style> <axe-menu aria-label="Test menu"> <axe-group aria-label="Test group 1"> <axe-menuitem>Inbox</axe-menuitem> <axe-menuitem>Archive</axe-menuitem> <axe-menuitem>Trash</axe-menuitem> </axe-group> <axe-group aria-label="Test group 2"> <axe-menuitem>Custom Folder 1</axe-menuitem> <axe-menuitem>Custom Folder 2</axe-menuitem> <axe-menuitem>Custom Folder 3</axe-menuitem> </axe-group> <axe-group aria-label="Test group 3"> <axe-menuitem>New Folder</axe-menuitem> </axe-group> </axe-menu> </div> ``` It would be expected the WebKit would populate a "menu" node in the Accessibility Tree with the name of "Test menu". However, the node is excluded all together. Chrome and Firefox both recognize this nodes present and present it to the OS via the AT. This can be experienced via
https://codepen.io/Westbrook/pen/mdZeQPJ
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-07-16 07:30:15 PDT
<
rdar://problem/131838275
>
Tyler Wilcock
Comment 2
2024-07-27 13:54:32 PDT
This actually isn't related to element internals at all. It's that WebKit requires direct menu item children for a role="menu" element to compute a final role of menu. But the example is spec compliant (
https://w3c.github.io/aria/#menu
) — WebKit also needs to allow groups with menuitem children.
Tyler Wilcock
Comment 3
2024-07-27 13:57:45 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/31353
Westbrook
Comment 4
2024-07-27 19:56:06 PDT
Awesome! Glad to see there's a clear path to resolving this. Just for reference, I submitted these related tests to WPT:
https://github.com/web-platform-tests/wpt/pull/47233
EWS
Comment 5
2024-07-28 21:52:42 PDT
Committed
281481@main
(82f243e3dea5): <
https://commits.webkit.org/281481@main
> Reviewed commits have been landed. Closing PR #31353 and removing active labels.
EWS
Comment 6
2024-08-15 14:15:48 PDT
Committed
280938.233@safari-7619-branch
(e3ebd6e68061): <
https://commits.webkit.org/280938.233@safari-7619-branch
> Reviewed commits have been landed. Closing PR #1600 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug