-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
https://bugs.webkit.org/show_bug.cgi?id=261457 rdar://problem/115336495 Reviewed by Tyler Wilcock. Currently, some of the WPT menu-roles tests[1] have failed. According to the ARIA spec[2], if a menuitem has a group as first parent and a menu or menubar as the second parent, it must be a menuitem role. [1]: https://wpt.fyi/results/wai-aria/role/menu-roles.html [2]: https://w3c.github.io/aria/#menu * LayoutTests/accessibility/roles-computedRoleString.html: * LayoutTests/platform/mac/accessibility/roles-computedRoleString-expected.txt: * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::remapAriaRoleDueToParent const): Canonical link: https://commits.webkit.org/267955@main
- Loading branch information
Showing
5 changed files
with
126 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
LayoutTests/imported/w3c/web-platform-tests/wai-aria/role/menu-roles-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Tests menu and related roles. | ||
|
||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
x | ||
|
||
PASS role is menu | ||
PASS role is menuitem (in menu) | ||
PASS role is group (in menu) | ||
PASS role is menuitem (in group, in menu) | ||
PASS role is menuitemradio (in group, in menu) | ||
PASS role is menuitemcheckbox (in group, in menu) | ||
PASS role is menubar | ||
PASS role is menuitem (in menubar) | ||
PASS role is group (in menubar) | ||
PASS role is menuitem (in group, in menubar) | ||
PASS role is menuitemradio (in group, in menubar) | ||
PASS role is menuitemcheckbox (in group, in menubar) | ||
FAIL orphaned menuitem outside the context of menu/menubar assert_equals: <nav role="menuitem" data-testname="orphaned menuitem outside the context of menu/menubar" data-expectedrole="navigation" class="ex">x | ||
</nav> expected "navigation" but got "menuitem" | ||
FAIL orphaned menuitemradio outside the context of menu/menubar assert_equals: <nav role="menuitemradio" data-testname="orphaned menuitemradio outside the context of menu/menubar" data-expectedrole="navigation" class="ex">x | ||
</nav> expected "navigation" but got "menuitemradio" | ||
FAIL orphaned menuitemcheckbox outside the context of menu/menubar assert_equals: <nav role="menuitemcheckbox" data-testname="orphaned menuitemcheckbox outside the context of menu/menubar" data-expectedrole="navigation" class="ex">x | ||
</nav> expected "navigation" but got "menuitemcheckbox" | ||
|
73 changes: 73 additions & 0 deletions
73
LayoutTests/imported/w3c/web-platform-tests/wai-aria/role/menu-roles.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<title>Menu-related Role Verification Tests</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/resources/testdriver.js"></script> | ||
<script src="/resources/testdriver-vendor.js"></script> | ||
<script src="/resources/testdriver-actions.js"></script> | ||
<script src="/wai-aria/scripts/aria-utils.js"></script> | ||
</head> | ||
<style> | ||
/* Typically horizontal */ | ||
[role="menubar"] { | ||
display: flex; | ||
} | ||
</style> | ||
<body> | ||
|
||
<p>Tests <a href="https://w3c.github.io/aria/#menu">menu</a> and related roles.</p> | ||
|
||
<div role="menu" data-testname="role is menu" data-expectedrole="menu" class="ex"> | ||
<div role="menuitem" data-testname="role is menuitem (in menu)" data-expectedrole="menuitem" class="ex">x</div> | ||
<div role="menuitem">x</div> | ||
<div role="menuitem">x</div> | ||
<div role="group" data-testname="role is group (in menu)" data-expectedrole="group" class="ex"> | ||
<div role="menuitem" data-testname="role is menuitem (in group, in menu)" data-expectedrole="menuitem" class="ex">x</div> | ||
<div role="menuitem">x</div> | ||
</div> | ||
<div role="group"> | ||
<div role="menuitemradio" aria-checked="true" data-testname="role is menuitemradio (in group, in menu)" data-expectedrole="menuitemradio" class="ex">x</div> | ||
<div role="menuitemradio">x</div> | ||
</div> | ||
<div role="group"> | ||
<div role="menuitemcheckbox" aria-checked="true" data-testname="role is menuitemcheckbox (in group, in menu)" data-expectedrole="menuitemcheckbox" class="ex">x</div> | ||
<div role="menuitemcheckbox">x</div> | ||
</div> | ||
</div> | ||
|
||
<div role="menubar" data-testname="role is menubar" data-expectedrole="menubar" class="ex"> | ||
<div role="menuitem" data-testname="role is menuitem (in menubar)" data-expectedrole="menuitem" class="ex">x</div> | ||
<div role="menuitem">x</div> | ||
<div role="menuitem">x</div> | ||
<div role="group" data-testname="role is group (in menubar)" data-expectedrole="group" class="ex"> | ||
<div role="menuitem" data-testname="role is menuitem (in group, in menubar)" data-expectedrole="menuitem" class="ex">x</div> | ||
<div role="menuitem">x</div> | ||
</div> | ||
<div role="group"> | ||
<div role="menuitemradio" aria-checked="true" data-testname="role is menuitemradio (in group, in menubar)" data-expectedrole="menuitemradio" class="ex">x</div> | ||
<div role="menuitemradio">x</div> | ||
</div> | ||
<div role="group"> | ||
<div role="menuitemcheckbox" aria-checked="true" data-testname="role is menuitemcheckbox (in group, in menubar)" data-expectedrole="menuitemcheckbox" class="ex">x</div> | ||
<div role="menuitemcheckbox">x</div> | ||
</div> | ||
</div> | ||
|
||
<nav role="menuitem" data-testname="orphaned menuitem outside the context of menu/menubar" data-expectedrole="navigation" | ||
class="ex">x | ||
</nav> | ||
<nav role="menuitemradio" data-testname="orphaned menuitemradio outside the context of menu/menubar" data-expectedrole="navigation" | ||
class="ex">x | ||
</nav> | ||
<nav role="menuitemcheckbox" data-testname="orphaned menuitemcheckbox outside the context of menu/menubar" data-expectedrole="navigation" | ||
class="ex">x | ||
</nav> | ||
|
||
<script> | ||
AriaUtils.verifyRolesBySelector(".ex"); | ||
</script> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters