-
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.
AX: VoiceOver highlight does not move to Shadow DOM button when using…
… aria-modal and role https://bugs.webkit.org/show_bug.cgi?id=247134 rdar://problem/101637934 Reviewed by Andres Gonzalez. AccessibilityObject::isModalDescendant eroneuously returned false for shadow hosts inside the modal because the template code is outside the modal. This patch fixes that by using Node::isDescendantOrShadowDescendantOf to properly consider shadow DOM elements. * LayoutTests/accessibility/shadow-dom-element-in-aria-modal-expected.txt: Added. * LayoutTests/accessibility/shadow-dom-element-in-aria-modal.html: Added. * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isModalDescendant const): Canonical link: https://commits.webkit.org/256531@main
- Loading branch information
1 parent
1abd935
commit cbf7509
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LayoutTests/accessibility/shadow-dom-element-in-aria-modal-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,11 @@ | ||
This test ensures shadow DOM descendants of something that is aria-modal are accessible. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS button.isIgnored is false | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Button One | ||
Button Two Before Button Button Three After Button |
38 changes: 38 additions & 0 deletions
38
LayoutTests/accessibility/shadow-dom-element-in-aria-modal.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,38 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<button>Button One</button> | ||
<div aria-modal="true" role="dialog"> | ||
<button>Button Two</button> | ||
Before Button | ||
<my-button>Button Three</my-button> | ||
After Button | ||
</div> | ||
|
||
<script> | ||
class MyButton extends HTMLElement { | ||
constructor() { | ||
super(); | ||
|
||
const root = this.attachShadow({ mode: 'open' }); | ||
root.innerHTML = '<button id="my-button"><slot></slot></button>'; | ||
} | ||
} | ||
customElements.define('my-button', MyButton); | ||
|
||
description("This test ensures shadow DOM descendants of something that is aria-modal are accessible."); | ||
|
||
if (window.accessibilityController) { | ||
var button = accessibilityController.accessibleElementById("my-button"); | ||
shouldBeFalse("button.isIgnored"); | ||
} | ||
</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