Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
AX: CSS speak-as, AXAccessKey, aria-owns, and URL AX APIs don't work …
…for display:contents elements https://bugs.webkit.org/show_bug.cgi?id=255707 rdar://problem/108301432 Reviewed by Chris Fleizach and Andres Gonzalez. Move implementations from AccessibilityRenderObject to the appropriate base class. This patch also removes unused MSAA functions. This patch also fixes a bug where AXPropertyName::AccessKey was not updated for isolated objects when the accesskey attribute changed. * LayoutTests/accessibility/display-contents-aria-owns-expected.txt: Added. * LayoutTests/accessibility/display-contents-aria-owns.html: Added. * LayoutTests/accessibility/mac/accesskey-expected.txt: * LayoutTests/accessibility/mac/accesskey.html: Add display:contents testcase. Add dynamic attribute change testcase. * LayoutTests/accessibility/mac/css-speech-speak-expected.txt: * LayoutTests/accessibility/mac/css-speech-speak.html: * LayoutTests/accessibility/url-test-expected.txt: * LayoutTests/accessibility/url-test.html: Add display:contents testcase. * 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/AccessibilityImageMapLink.cpp: (WebCore::AccessibilityImageMapLink::stringValueForMSAA const): Deleted. (WebCore::AccessibilityImageMapLink::nameForMSAA const): Deleted. * Source/WebCore/accessibility/AccessibilityImageMapLink.h: * Source/WebCore/accessibility/AccessibilityMenuListOption.cpp: (WebCore::AccessibilityMenuListOption::nameForMSAA const): Deleted. * Source/WebCore/accessibility/AccessibilityMenuListOption.h: * Source/WebCore/accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::url const): * Source/WebCore/accessibility/AccessibilityNodeObject.h: * Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessKey const): (WebCore::AccessibilityObject::speakAsProperty const): (WebCore::AccessibilityObject::supportsARIAOwns const): (WebCore::AccessibilityObject::loadingProgress const): * Source/WebCore/accessibility/AccessibilityObject.h: (WebCore::AccessibilityObject::stringValueForMSAA const): Deleted. (WebCore::AccessibilityObject::stringRoleForMSAA const): Deleted. (WebCore::AccessibilityObject::nameForMSAA const): Deleted. (WebCore::AccessibilityObject::descriptionForMSAA const): Deleted. (WebCore::AccessibilityObject::roleValueForMSAA const): Deleted. (WebCore::AccessibilityObject::speakAsProperty const): Deleted. * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::url const): (WebCore::AccessibilityRenderObject::speakAsProperty const): Deleted. (WebCore::AccessibilityRenderObject::loadingProgress const): Deleted. (WebCore::AccessibilityRenderObject::accessKey const): Deleted. (WebCore::AccessibilityRenderObject::supportsARIAOwns const): Deleted. (WebCore::isLinkable): Deleted. (WebCore::AccessibilityRenderObject::stringValueForMSAA const): Deleted. (WebCore::AccessibilityRenderObject::nameForMSAA const): Deleted. (WebCore::shouldReturnTagNameAsRoleForMSAA): Deleted. (WebCore::AccessibilityRenderObject::stringRoleForMSAA const): Deleted. (WebCore::AccessibilityRenderObject::positionalDescriptionForMSAA const): Deleted. (WebCore::AccessibilityRenderObject::descriptionForMSAA const): Deleted. (WebCore::msaaRoleForRenderer): Deleted. (WebCore::AccessibilityRenderObject::roleValueForMSAA const): Deleted. * Source/WebCore/accessibility/AccessibilityRenderObject.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperties): Canonical link: https://commits.webkit.org/263205@main
- Loading branch information
Showing
24 changed files
with
179 additions
and
238 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
LayoutTests/accessibility/display-contents-aria-owns-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,14 @@ | ||
This test ensures aria-owns works for display:contents elements. | ||
|
||
#list role: AXRole: AXList | ||
#list supports AXOwns: true | ||
Child 1 #item1 AXRole: AXGroup | ||
Child 2 #item2 AXRole: AXGroup | ||
Child 3 #item3 AXRole: AXGroup | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
1 | ||
2 | ||
3 |
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,36 @@ | ||
<!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="list" role="list" aria-owns="item3" style="display:contents"> | ||
<div id="item1" role="listitem">1</div> | ||
<div id="item2" role="listitem">2</div> | ||
</div> | ||
|
||
<div id="item3" role="listitem">3</div> | ||
|
||
<script> | ||
var output = "This test ensures aria-owns works for display:contents elements.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
const axList = accessibilityController.accessibleElementById('list'); | ||
output += `#list role: ${axList.role}\n`; | ||
if (accessibilityController.platformName === "mac") | ||
output += `#list supports AXOwns: ${axList.isAttributeSupported('AXOwns')}\n`; | ||
|
||
const count = axList.childrenCount; | ||
for (let i = 0; i < count; i++) { | ||
const child = axList.childAtIndex(i); | ||
output += `Child ${i + 1} #${child.domIdentifier} ${child.role}\n`; | ||
} | ||
debug(output); | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
webkit | ||
|
||
This test makes sure that elements return their accesskeys. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
PASS: link.allAttributes().indexOf('AXAccessKey: w') !== -1 === true | ||
PASS: linkDisplayContents.allAttributes().indexOf('AXAccessKey: z') !== -1 === true | ||
PASS: input.allAttributes().indexOf('AXAccessKey: q') !== -1 === true | ||
|
||
Updating #link accesskey to 'u'. | ||
PASS: accesskey AX attribute was updated correctly. | ||
|
||
PASS link.allAttributes().indexOf(linkAccessKey) != -1 is true | ||
PASS text.allAttributes().indexOf(inputAccessKey) != -1 is true | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
webkit | ||
webkit | ||
|
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 |
---|---|---|
@@ -1,28 +1,41 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../../resources/js-test-pre.js"></script> | ||
<script src="../../resources/accessibility-helper.js"></script> | ||
<script src="../../resources/js-test.js"></script> | ||
</head> | ||
<body> | ||
|
||
<a href="http://www.webkit.org" id='link1' accesskey="w">webkit</a><br> | ||
<input type='text' id='text1' accesskey='q'> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
<a href="http://www.webkit.org" id="link" accesskey="w">webkit</a><br> | ||
<a href="http://www.webkit.org" id="link-display-contents" accesskey="z" style="display:contents">webkit</a><br> | ||
<input type="text" id="input" accesskey="q"> | ||
|
||
<script> | ||
description("This test makes sure that elements return their accesskeys."); | ||
var output = "This test makes sure that elements return their accesskeys.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var link = accessibilityController.accessibleElementById("link"); | ||
output += expect("link.allAttributes().indexOf('AXAccessKey: w') !== -1", "true"); | ||
|
||
if (window.accessibilityController) { | ||
var link = window.accessibilityController.accessibleElementById("link1"); | ||
var linkAccessKey = "AXAccessKey: w"; | ||
shouldBeTrue("link.allAttributes().indexOf(linkAccessKey) != -1") | ||
var linkDisplayContents = accessibilityController.accessibleElementById("link-display-contents"); | ||
output += expect("linkDisplayContents.allAttributes().indexOf('AXAccessKey: z') !== -1", "true"); | ||
|
||
var text = window.accessibilityController.accessibleElementById("text1"); | ||
var inputAccessKey = "AXAccessKey: q"; | ||
shouldBeTrue("text.allAttributes().indexOf(inputAccessKey) != -1"); | ||
} | ||
var input = accessibilityController.accessibleElementById("input"); | ||
output += expect("input.allAttributes().indexOf('AXAccessKey: q') !== -1", "true"); | ||
|
||
output += "\nUpdating #link accesskey to 'u'.\n"; | ||
document.getElementById("link").setAttribute("accesskey", "u"); | ||
setTimeout(async function() { | ||
await waitFor(() => link.allAttributes().indexOf("AXAccessKey: u") !== -1); | ||
output += "PASS: accesskey AX attribute was updated correctly.\n"; | ||
|
||
debug(output); | ||
finishJSTest(); | ||
}, 0); | ||
} | ||
</script> | ||
<script src="../../resources/js-test-post.js"></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
13 changes: 13 additions & 0 deletions
13
LayoutTests/platform/glib/accessibility/display-contents-aria-owns-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,13 @@ | ||
This test ensures aria-owns works for display:contents elements. | ||
|
||
#list role: AXRole: AXList | ||
Child 1 #item1 AXRole: AXListItem | ||
Child 2 #item2 AXRole: AXListItem | ||
Child 3 #item3 AXRole: AXListItem | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
1 | ||
2 | ||
3 |
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
Oops, something went wrong.