Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Expose the correct role, subrole and role description properties for …
…the <dialog> element. https://bugs.webkit.org/show_bug.cgi?id=236359 Reviewed by Chris Fleizach. Source/WebCore: Test: accessibility/dialog-properties.html Elements with role="dialog" are exposed to accessibility clients with role AXGroup, subrole AXApplicationDialog and role description "web dialog". This patch implements this behavior for the <dialog> element. * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::defaultObjectInclusion const): LayoutTests: Tests that these AX properties have the expected values both when the dialog is shown modal or modeless. * accessibility/dialog-properties-expected.txt: Added. * accessibility/dialog-properties.html: Added. Canonical link: https://commits.webkit.org/247198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
85de703
commit f5e42d63fc9dc2dd7b369877125d977c3d2059cd
Showing
8 changed files
with
110 additions
and
4 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
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
@@ -0,0 +1,15 @@ | ||
This test verifies several AX properties of the dialog element. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
Modal dialog: | ||
AXRole: AXGroup AXSubrole: AXApplicationDialog AXRoleDescription: web dialog | ||
Modeless dialog: | ||
AXRole: AXGroup AXSubrole: AXApplicationDialog AXRoleDescription: web dialog | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Just a dialog. | ||
|
||
OK Cancel |
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
@@ -0,0 +1,50 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test.js"></script> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body id="body"> | ||
|
||
<dialog id="dialog"> | ||
<h3>Just a dialog.</h3> | ||
<button id="ok" onclick="document.getElementById('dialog').close();" class="close-button">OK</button> | ||
<button onclick="document.getElementById('dialog').close();" class="close-button">Cancel</button> | ||
</dialog> | ||
|
||
<script> | ||
description("This test verifies several AX properties of the dialog element."); | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
setTimeout(async () => { | ||
// Show the dialog as modal. | ||
debug("Modal dialog:"); | ||
document.getElementById("dialog").showModal(); | ||
let dialog = null; | ||
await waitFor(() => { | ||
dialog = accessibilityController.accessibleElementById("dialog"); | ||
return dialog; | ||
}); | ||
let properties = `${dialog.role} ${dialog.subrole} ${dialog.roleDescription}`; | ||
debug(properties); | ||
|
||
// Dismiss the modal and show the dialog as modeless. | ||
document.getElementById("dialog").close(); | ||
debug("Modeless dialog:"); | ||
document.getElementById("dialog").show(); | ||
dialog = null; | ||
await waitFor(() => { | ||
dialog = accessibilityController.accessibleElementById("dialog"); | ||
return dialog; | ||
}); | ||
properties = `${dialog.role} ${dialog.subrole} ${dialog.roleDescription}`; | ||
debug(properties); | ||
|
||
finishJSTest(); | ||
}, 0); | ||
} | ||
</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
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
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