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
AX: Include AXKeyShortcutsValue in accessibilityAttributeNames when t…
…here is an aria-keyshortcuts attribute https://bugs.webkit.org/show_bug.cgi?id=248572 rdar://problem/102834471 Reviewed by Andres Gonzalez. WebAccessibilityObjectWrapper supports returning the value of aria-keyshortcuts through the AXKeyShortcutsValue accessibility attribute, but does not return the attribute name in accessibilityAttributeNames if it is a supported attribute. Additionally, this attribute is not updated in the isolated tree if it is changed. This patch fixes that by including AXKeyShortcutsValue in accessibilityAttributeNames if it is supported through AccessibilityObject::supportsKeyShortcutsValue and updates the AXIsolatedTree value for AXPropertyName::KeyShortcutsValue if aria-keyshortcuts attribute is changed. * LayoutTests/accessibility/aria-keyshortcuts-expected.txt: Added. * LayoutTests/accessibility/aria-keyshortcuts.html: Added. * LayoutTests/platform/win/TestExpectations: * Source/WebCore/accessibility/AXLogger.cpp: (WebCore::operator<<): * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsKeyShortcuts const): (WebCore::AccessibilityObject::keyShortcuts const): (WebCore::AccessibilityObject::keyShortcutsValue const): Deleted. * Source/WebCore/accessibility/AccessibilityObject.h: * Source/WebCore/accessibility/AccessibilityObjectInterface.h: * Source/WebCore/accessibility/atspi/AccessibilityObjectAtspi.cpp: (WebCore::AccessibilityObjectAtspi::attributes const): * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeProperties): * Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperties): * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h: * Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper additionalAccessibilityAttributeNames]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): Canonical link: https://commits.webkit.org/257274@main
- Loading branch information
1 parent
21e76d2
commit f7a887f4c25742af054956aec6cf2ef5c2512e14
Showing
16 changed files
with
120 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
This test ensures aria-keyshortcuts is exposed to accessibility correctly. | ||
|
||
PASS: axItem1.isAttributeSupported('AXKeyShortcutsValue') === false | ||
PASS: axItem2.isAttributeSupported('AXKeyShortcutsValue') === true | ||
PASS: axItem3.isAttributeSupported('AXKeyShortcutsValue') === true | ||
PASS: axItem1.stringAttributeValue('AXKeyShortcutsValue') === '' | ||
PASS: axItem2.stringAttributeValue('AXKeyShortcutsValue') === 'Shift+2' | ||
PASS: axItem3.stringAttributeValue('AXKeyShortcutsValue') === 'Shift+3 Option+4' | ||
Update aria-keyshortcuts to Command+5 for #test1 | ||
PASS: axItem1.isAttributeSupported('AXKeyShortcutsValue') === true | ||
PASS: axItem1.stringAttributeValue('AXKeyShortcutsValue') === 'Command+5' | ||
Remove aria-keyshortcuts for #test2 | ||
PASS: axItem2.isAttributeSupported('AXKeyShortcutsValue') === false | ||
PASS: axItem2.stringAttributeValue('AXKeyShortcutsValue') === '' | ||
Update aria-keyshortcuts to Shift+Command+1 for #test3 | ||
PASS: axItem3.isAttributeSupported('AXKeyShortcutsValue') === true | ||
PASS: axItem3.stringAttributeValue('AXKeyShortcutsValue') === 'Shift+Command+1' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
X | ||
X | ||
X |
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,55 @@ | ||
<!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> | ||
<div id="content"> | ||
<div id="test1" role="button">X</div> | ||
<div id="test2" role="button" aria-keyshortcuts="Shift+2">X</div> | ||
<div id="test3" role="button" aria-keyshortcuts="Shift+3 Option+4">X</div> | ||
</div> | ||
|
||
<script> | ||
let output = "This test ensures aria-keyshortcuts is exposed to accessibility correctly.\n\n"; | ||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var axItem1 = accessibilityController.accessibleElementById("test1"); | ||
var axItem2 = accessibilityController.accessibleElementById("test2"); | ||
var axItem3 = accessibilityController.accessibleElementById("test3"); | ||
output += expect("axItem1.isAttributeSupported('AXKeyShortcutsValue')", "false"); | ||
output += expect("axItem2.isAttributeSupported('AXKeyShortcutsValue')", "true"); | ||
output += expect("axItem3.isAttributeSupported('AXKeyShortcutsValue')", "true"); | ||
|
||
output += expect("axItem1.stringAttributeValue('AXKeyShortcutsValue')", "''"); | ||
output += expect("axItem2.stringAttributeValue('AXKeyShortcutsValue')", "'Shift+2'"); | ||
output += expect("axItem3.stringAttributeValue('AXKeyShortcutsValue')", "'Shift+3 Option+4'"); | ||
|
||
output += "Update aria-keyshortcuts to Command+5 for #test1\n"; | ||
document.getElementById("test1").setAttribute("aria-keyshortcuts", "Command+5"); | ||
setTimeout(async function() { | ||
await waitFor(() => axItem1.stringAttributeValue('AXKeyShortcutsValue') === "Command+5"); | ||
output += expect("axItem1.isAttributeSupported('AXKeyShortcutsValue')", "true"); | ||
output += expect("axItem1.stringAttributeValue('AXKeyShortcutsValue')", "'Command+5'"); | ||
|
||
output += "Remove aria-keyshortcuts for #test2\n"; | ||
document.getElementById("test2").removeAttribute("aria-keyshortcuts"); | ||
await waitFor(() => axItem2.stringAttributeValue('AXKeyShortcutsValue') === ""); | ||
output += expect("axItem2.isAttributeSupported('AXKeyShortcutsValue')", "false"); | ||
output += expect("axItem2.stringAttributeValue('AXKeyShortcutsValue')", "''"); | ||
|
||
output += "Update aria-keyshortcuts to Shift+Command+1 for #test3\n"; | ||
document.getElementById("test3").setAttribute("aria-keyshortcuts", "Shift+Command+1"); | ||
await waitFor(() => axItem3.stringAttributeValue('AXKeyShortcutsValue') === "Shift+Command+1"); | ||
output += expect("axItem3.isAttributeSupported('AXKeyShortcutsValue')", "true"); | ||
output += expect("axItem3.stringAttributeValue('AXKeyShortcutsValue')", "'Shift+Command+1'"); | ||
|
||
debug(output); | ||
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
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
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