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: Update the isolated tree in response to dynamic aria-grabbed and …
…aria-posinset changes https://bugs.webkit.org/show_bug.cgi?id=240844 Reviewed by Chris Fleizach. Added test cases to accessibility/aria-setsize-posinset.html and accessibility/mac/aria-drag-drop.html. * 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/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperty): * LayoutTests/accessibility/aria-setsize-posinset-expected.txt: * LayoutTests/accessibility/aria-setsize-posinset.html: * LayoutTests/accessibility/mac/aria-drag-drop-expected.txt: * LayoutTests/accessibility/mac/aria-drag-drop.html: Canonical link: https://commits.webkit.org/250995@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294863 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
8 changed files
with
102 additions
and
65 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
@@ -1,43 +1,49 @@ | ||
<!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 id="body"> | ||
<body> | ||
|
||
<ul id="list"> | ||
<li aria-setsize="100" aria-posinset="3">3</li> | ||
<li>4</li> | ||
<li id="first-list-item" aria-setsize="100" aria-posinset="3">3</li> | ||
<li id="second-list-item">4</li> | ||
</ul> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<script> | ||
|
||
description("This tests verifies that aria-posinset and aria-setsize are exposed to accessibility correctly."); | ||
var testOutput = "This tests verifies that aria-posinset and aria-setsize are exposed to accessibility correctly.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var list = accessibilityController.accessibleElementById("list"); | ||
var firstListItem = accessibilityController.accessibleElementById("first-list-item"); | ||
var secondListItem = accessibilityController.accessibleElementById("second-list-item"); | ||
|
||
debug("Verify that the first item in the list exposes setsize and posinset attributes."); | ||
shouldBeTrue("list.childAtIndex(0).isAttributeSupported('AXARIASetSize')"); | ||
shouldBeTrue("list.childAtIndex(0).isAttributeSupported('AXARIAPosInSet')"); | ||
testOutput += "\nVerify that the first item in the list exposes setsize and posinset attributes.\n"; | ||
testOutput += expect("firstListItem.isAttributeSupported('AXARIASetSize')", "true"); | ||
testOutput += expect("firstListItem.isAttributeSupported('AXARIAPosInSet')", "true"); | ||
|
||
debug("Verify that the first item in the list returns the correct value for setsize and posinset."); | ||
shouldBe("list.childAtIndex(0).numberAttributeValue('AXARIASetSize')", "100"); | ||
shouldBe("list.childAtIndex(0).numberAttributeValue('AXARIAPosInSet')", "3"); | ||
testOutput += "\nVerify that the first item in the list returns the correct value for setsize and posinset.\n"; | ||
testOutput += expect("firstListItem.numberAttributeValue('AXARIASetSize')", "100"); | ||
testOutput += expect("firstListItem.numberAttributeValue('AXARIAPosInSet')", "3"); | ||
|
||
debug("Verify that the second item in the list does not support setsize and posinset."); | ||
shouldBeFalse("list.childAtIndex(1).isAttributeSupported('AXARIASetSize')"); | ||
shouldBeFalse("list.childAtIndex(1).isAttributeSupported('AXARIAPosInSet')"); | ||
testOutput += "\nVerify that the second item in the list does not support setsize and posinset.\n"; | ||
testOutput += expect("secondListItem.isAttributeSupported('AXARIASetSize')", "false"); | ||
testOutput += expect("secondListItem.isAttributeSupported('AXARIAPosInSet')", "false"); | ||
|
||
document.getElementById("list").style.visibility = 'hidden'; | ||
} | ||
testOutput += "\nUpdating aria-posinset to 4 for element #first-list-item.\n"; | ||
document.getElementById("first-list-item").ariaPosInSet = "4"; | ||
setTimeout(async function() { | ||
await waitFor(() => firstListItem.numberAttributeValue('AXARIAPosInSet') === 4); | ||
testOutput += expect("firstListItem.numberAttributeValue('AXARIAPosInSet')", "4"); | ||
|
||
document.getElementById("list").style.visibility = 'hidden'; | ||
debug(testOutput); | ||
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
@@ -1,17 +1,17 @@ | ||
drop | ||
grab | ||
grab | ||
This tests that the ARIA drag and drop attributes work as intended. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
PASS: accessibilityController.accessibleElementById('dropeffect-div').ariaDropEffects === 'copy,move' | ||
PASS: initiallyGrabbedDiv.ariaIsGrabbed === true | ||
PASS: initiallyUngrabbedDiv.ariaIsGrabbed === false | ||
PASS: initiallyGrabbedDiv.isAttributeSettable('AXGrabbed') === true | ||
PASS: initiallyUngrabbedDiv.isAttributeSettable('AXGrabbed') === true | ||
|
||
Setting aria-grabbed false for element #initially-grabbed-div. | ||
PASS: initiallyGrabbedDiv.ariaIsGrabbed === false | ||
|
||
PASS body.childAtIndex(0).ariaDropEffects is 'copy,move' | ||
PASS body.childAtIndex(1).ariaIsGrabbed is true | ||
PASS body.childAtIndex(2).ariaIsGrabbed is false | ||
PASS body.childAtIndex(1).isAttributeSettable('AXGrabbed') is true | ||
PASS body.childAtIndex(2).isAttributeSettable('AXGrabbed') is true | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
||
drop | ||
grab | ||
grab |
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
@@ -1,37 +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 id="body"> | ||
<body> | ||
|
||
<div tabindex=0 aria-dropeffect="copy move" role="button" aria-label="drop">drop</div> | ||
<div tabindex=0 aria-grabbed=true role="button" aria-label="grab1">grab</div> | ||
<div tabindex=0 aria-grabbed=false role="button" aria-label="grab2">grab</div> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
<div id="dropeffect-div" tabindex=0 aria-dropeffect="copy move" role="button" aria-label="drop">drop</div> | ||
<div id="initially-grabbed-div" tabindex=0 aria-grabbed=true role="button" aria-label="grab1">grab</div> | ||
<div id="initially-ungrabbed-div" tabindex=0 aria-grabbed=false role="button" aria-label="grab2">grab</div> | ||
|
||
<script> | ||
|
||
description("This tests that the ARIA drag and drop attributes work as intended."); | ||
var testOutput = "This tests that the ARIA drag and drop attributes work as intended.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
|
||
var body = document.getElementById("body"); | ||
body.focus(); | ||
body = accessibilityController.focusedElement; | ||
|
||
shouldBe("body.childAtIndex(0).ariaDropEffects", "'copy,move'"); | ||
|
||
shouldBe("body.childAtIndex(1).ariaIsGrabbed", "true"); | ||
shouldBe("body.childAtIndex(2).ariaIsGrabbed", "false"); | ||
shouldBe("body.childAtIndex(1).isAttributeSettable('AXGrabbed')", "true"); | ||
shouldBe("body.childAtIndex(2).isAttributeSettable('AXGrabbed')", "true"); | ||
window.jsTestIsAsync = true; | ||
|
||
testOutput += expect("accessibilityController.accessibleElementById('dropeffect-div').ariaDropEffects", "'copy,move'"); | ||
|
||
var initiallyGrabbedDiv = accessibilityController.accessibleElementById("initially-grabbed-div"); | ||
var initiallyUngrabbedDiv = accessibilityController.accessibleElementById("initially-ungrabbed-div"); | ||
testOutput += expect("initiallyGrabbedDiv.ariaIsGrabbed", "true"); | ||
testOutput += expect("initiallyUngrabbedDiv.ariaIsGrabbed", "false"); | ||
testOutput += expect("initiallyGrabbedDiv.isAttributeSettable('AXGrabbed')", "true"); | ||
testOutput += expect("initiallyUngrabbedDiv.isAttributeSettable('AXGrabbed')", "true"); | ||
|
||
testOutput += "\nSetting aria-grabbed false for element #initially-grabbed-div.\n"; | ||
document.getElementById("initially-grabbed-div").setAttribute("aria-grabbed", "false"); | ||
setTimeout(async function() { | ||
await waitFor(() => !initiallyGrabbedDiv.ariaIsGrabbed ); | ||
testOutput += expect("initiallyGrabbedDiv.ariaIsGrabbed", "false"); | ||
|
||
debug(testOutput); | ||
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