-
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: Accessibility tree not updated in response to aria-owns removal
https://bugs.webkit.org/show_bug.cgi?id=261645 rdar://problem/115607658 Reviewed by Chris Fleizach. This patch also fixes a bug where AXPropertyName::SupportsARIAOwns was not updated in response to dynamic aria-owns changes (additions or removals). * LayoutTests/accessibility/aria-owns-expected.txt: * LayoutTests/accessibility/aria-owns.html: * Source/WebCore/accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::handleAttributeChange): (WebCore::AXObjectCache::updateIsolatedTree const): * Source/WebCore/accessibility/AXObjectCache.h: * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateNodeProperties): Canonical link: https://commits.webkit.org/268170@main
- Loading branch information
Showing
6 changed files
with
93 additions
and
26 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 |
---|---|---|
@@ -1,19 +1,25 @@ | ||
Item 1 | ||
Item 2 | ||
Item 3 | ||
BUTTON | ||
RADIO BUTTON | ||
This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS: group.isAttributeSupported('AXOwns') === true | ||
PASS: group.ariaOwnsElementAtIndex(0).role === 'AXRole: AXButton' | ||
PASS: group.ariaOwnsElementAtIndex(0).title === 'AXTitle: BUTTON' | ||
PASS: group.ariaOwnsElementAtIndex(1).role === 'AXRole: AXRadioButton' | ||
PASS: group.ariaOwnsElementAtIndex(1).title === 'AXTitle: RADIO BUTTON' | ||
PASS: group.childrenCount === 5 | ||
PASS: group.childAtIndex(4).title === 'AXTitle: RADIO BUTTON' | ||
document.getElementById('group').removeAttribute('aria-owns') | ||
PASS: group.childrenCount === 3 | ||
PASS: group.isAttributeSupported('AXOwns') === false | ||
document.getElementById('group').setAttribute('aria-owns', 'extra') | ||
PASS: group.childrenCount === 4 | ||
PASS: group.isAttributeSupported('AXOwns') === true | ||
PASS: group.childAtIndex(3).title === 'AXTitle: BUTTON' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
||
Item 1 | ||
Item 2 | ||
Item 3 | ||
BUTTON | ||
RADIO BUTTON |
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,45 +1,55 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test.js"></script> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
<script src="../resources/js-test.js"></script> | ||
</head> | ||
<body id="body"> | ||
<body> | ||
|
||
<div tabindex=0 id="group" role="group" aria-owns="extra extra2"> | ||
<div>Item 1</div> | ||
<div>Item 2</div> | ||
<div>Item 3</div> | ||
<div>Item 1</div> | ||
<div>Item 2</div> | ||
<div>Item 3</div> | ||
</div> | ||
|
||
<div id="extra" role="button">BUTTON</div> | ||
<div id="extra2" role="radio">RADIO BUTTON</div> | ||
|
||
<p id="description"></p> | ||
<div id="console"></div> | ||
|
||
<script> | ||
|
||
description("This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements"); | ||
var output = "This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
var output = ""; | ||
var group; | ||
document.getElementById("group").focus(); | ||
setTimeout(function() { | ||
group = accessibilityController.focusedElement; | ||
setTimeout(async () => { | ||
group = accessibilityController.accessibleElementById("group"); | ||
if (accessibilityController.platformName === "mac") | ||
output += expect("group.isAttributeSupported('AXOwns')", "true"); | ||
output += expect("group.ariaOwnsElementAtIndex(0).role", "'AXRole: AXButton'"); | ||
output += expect("group.ariaOwnsElementAtIndex(0).title", "'AXTitle: BUTTON'"); | ||
output += expect("group.ariaOwnsElementAtIndex(1).role", "'AXRole: AXRadioButton'"); | ||
output += expect("group.ariaOwnsElementAtIndex(1).title", "'AXTitle: RADIO BUTTON'"); | ||
output += expect("group.childrenCount", "5"); | ||
output += expect("group.childAtIndex(4).title", "'AXTitle: RADIO BUTTON'"); | ||
|
||
// Remove aria-owns and confirm children count has updated. | ||
output += evalAndReturn("document.getElementById('group').removeAttribute('aria-owns')"); | ||
output += await expectAsync("group.childrenCount", "3"); | ||
if (accessibilityController.platformName === "mac") | ||
output += await expectAsync("group.isAttributeSupported('AXOwns')", "false"); | ||
|
||
// Add one ARIA child back. | ||
output += evalAndReturn("document.getElementById('group').setAttribute('aria-owns', 'extra')"); | ||
output += await expectAsync("group.childrenCount", "4"); | ||
if (accessibilityController.platformName === "mac") | ||
output += await expectAsync("group.isAttributeSupported('AXOwns')", "true"); | ||
output += expect("group.childAtIndex(3).title", "'AXTitle: BUTTON'"); | ||
|
||
debug(output); | ||
finishJSTest(); | ||
}, 0); | ||
}); | ||
} | ||
|
||
</script> | ||
|
||
</body> | ||
</html> |
22 changes: 22 additions & 0 deletions
22
LayoutTests/platform/glib/accessibility/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,22 @@ | ||
This tests that aria-owns correctly exposes AXOwns and correctly returns the right elements | ||
|
||
PASS: group.ariaOwnsElementAtIndex(0).role === 'AXRole: AXButton' | ||
PASS: group.ariaOwnsElementAtIndex(0).title === 'AXTitle: BUTTON' | ||
PASS: group.ariaOwnsElementAtIndex(1).role === 'AXRole: AXRadioButton' | ||
PASS: group.ariaOwnsElementAtIndex(1).title === 'AXTitle: RADIO BUTTON' | ||
PASS: group.childrenCount === 5 | ||
PASS: group.childAtIndex(4).title === 'AXTitle: RADIO BUTTON' | ||
document.getElementById('group').removeAttribute('aria-owns') | ||
PASS: group.childrenCount === 3 | ||
document.getElementById('group').setAttribute('aria-owns', 'extra') | ||
PASS: group.childrenCount === 4 | ||
PASS: group.childAtIndex(3).title === 'AXTitle: BUTTON' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Item 1 | ||
Item 2 | ||
Item 3 | ||
BUTTON | ||
RADIO BUTTON |
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