-
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: aria-describedby text can become stale after the targeted element…
… changes its subtree https://bugs.webkit.org/show_bug.cgi?id=273584 rdar://problem/127390465 Reviewed by Andres Gonzalez. When an object targeted by aria-describedby changes its subtree, we need to re-compute AXPropertyName::{AccessibilityText, ExtendedDescription} for the described object. We already did this for aria-labelledby relationships, so this patch hooks into the same method to check for describedby relationships too. * LayoutTests/accessibility/dynamic-aria-describedby-subtree-expected.txt: Added. * LayoutTests/accessibility/dynamic-aria-describedby-subtree.html: Added. * LayoutTests/platform/glib/TestExpectations: Skip new test. * LayoutTests/platform/ios/TestExpectations: Enable new test. * Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp: (WebCore::AXIsolatedTree::updateDependentProperties): Canonical link: https://commits.webkit.org/278318@main
- Loading branch information
Showing
5 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
LayoutTests/accessibility/dynamic-aria-describedby-subtree-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,11 @@ | ||
This test ensures that we update an element's description when it's described-by changes subtree dynamically. | ||
|
||
PASS: accessibilityController.accessibleElementById('button').customContent === 'description: Always' | ||
PASS: accessibilityController.accessibleElementById('button').customContent === 'description: Sometimes Always' | ||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
Sometimes | ||
Always | ||
Press |
32 changes: 32 additions & 0 deletions
32
LayoutTests/accessibility/dynamic-aria-describedby-subtree.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
<!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="tooltip" role="tooltip"> | ||
<div id="initially-hidden" style="display:none">Sometimes</div>Always | ||
</div> | ||
<button id="button" aria-describedby="tooltip">Press</button> | ||
|
||
<script> | ||
var output = "This test ensures that we update an element's description when it's described-by changes subtree dynamically.\n\n"; | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
|
||
output += expect("accessibilityController.accessibleElementById('button').customContent", "'description: Always'"); | ||
document.getElementById("initially-hidden").style.display = "block"; | ||
setTimeout(async function() { | ||
output += await expectAsync("accessibilityController.accessibleElementById('button').customContent", "'description: Sometimes Always'"); | ||
|
||
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