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 changes to aria-l…
…ive, aria-relevant, and aria-atomic https://bugs.webkit.org/show_bug.cgi?id=241444 Reviewed by Chris Fleizach. With this patch, we now update the isolated tree in response to dynamic aria-live, aria-relevant, and aria-atomic changes. This patch also makes liveRegionStatus, liveRegionRelevant, and liveRegionAtomic work on node-only objects (like those with display:contents). * LayoutTests/accessibility/aria-busy-updates-after-dynamic-change-expected.txt: Removed. * LayoutTests/accessibility/aria-busy-updates-after-dynamic-change.html: Removed. * LayoutTests/accessibility/live-region-attributes-update-after-dynamic-change-expected.txt: Added. * LayoutTests/accessibility/live-region-attributes-update-after-dynamic-change.html: Added. * LayoutTests/platform/glib/TestExpectations: * LayoutTests/platform/ios/TestExpectations: * 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/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::liveRegionStatus const): (WebCore::AccessibilityNodeObject::liveRegionRelevant const): (WebCore::AccessibilityNodeObject::liveRegionAtomic const): * Source/WebCore/accessibility/AccessibilityNodeObject.h: * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::liveRegionStatus const): Deleted. (WebCore::AccessibilityRenderObject::liveRegionRelevant const): Deleted. (WebCore::AccessibilityRenderObject::liveRegionAtomic const): Deleted. * Source/WebCore/accessibility/AccessibilityRenderObject.h: * Source/WebCore/accessibility/atspi/AXObjectCacheAtspi.cpp: (WebCore::AXObjectCache::postPlatformNotification): * Tools/DumpRenderTree/AccessibilityUIElement.cpp: (getLiveRegionRelevantCallback): (getLiveRegionStatusCallback): (getIsAtomicLiveRegionCallback): (AccessibilityUIElement::getJSClass): * Tools/DumpRenderTree/AccessibilityUIElement.h: * Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm: (AccessibilityUIElement::liveRegionRelevant const): (AccessibilityUIElement::liveRegionStatus const): (AccessibilityUIElement::isAtomicLiveRegion const): * Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp (AccessibilityUIElement::liveRegionRelevant const): (AccessibilityUIElement::liveRegionStatus const): (AccessibilityUIElement::isAtomicLiveRegion const): * Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm: (AccessibilityUIElement::liveRegionRelevant const): (AccessibilityUIElement::liveRegionStatus const): (AccessibilityUIElement::isAtomicLiveRegion const): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: * Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: * Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::liveRegionRelevant const): (WTR::AccessibilityUIElement::liveRegionStatus const): (WTR::AccessibilityUIElement::isAtomicLiveRegion const): * Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: (WTR::AccessibilityUIElement::liveRegionStatus const): (WTR::AccessibilityUIElement::liveRegionRelevant const): (WTR::AccessibilityUIElement::isAtomicLiveRegion const): * Tools/WebKitTestRunner/InjectedBundle/atspi/AccessibilityUIElementAtspi.cpp * Tools/WebKitTestRunner/InjectedBundle/win/AccessibilityUIElementWin.cpp Canonical link: https://commits.webkit.org/251452@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295446 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
Showing
26 changed files
with
349 additions
and
125 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,48 @@ | ||
This test ensures that an element's busy state updates aria-busy changes. | ||
|
||
Verifying initial states: | ||
|
||
#clock is atomic: true | ||
#clock-display-contents is atomic: true | ||
|
||
#clock is busy: false | ||
#clock-display-contents is busy: false | ||
|
||
#clock relevant: additions text | ||
#clock-display-contents relevant: additions text | ||
|
||
#clock live region status: polite | ||
#clock-display-contents live region status: polite | ||
|
||
Setting aria-busy to true. | ||
|
||
#clock is busy: true | ||
#clock-display-contents is busy: true | ||
|
||
Setting aria-busy to false. | ||
|
||
#clock is busy: false | ||
#clock-display-contents is busy: false | ||
|
||
Setting aria-atomic to false. | ||
|
||
#clock is atomic: false | ||
#clock-display-contents is atomic: false | ||
|
||
Setting aria-relevant to removals. | ||
|
||
#clock relevant: removals | ||
#clock-display-contents relevant: removals | ||
|
||
Setting aria-live to assertive. | ||
|
||
#clock live region status: assertive | ||
#clock-display-contents live region status: assertive | ||
|
||
|
||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
2:30pm | ||
4:30pm | ||
|
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,85 @@ | ||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | ||
<html> | ||
<head> | ||
<script src="../resources/js-test.js"></script> | ||
<script src="../resources/accessibility-helper.js"></script> | ||
</head> | ||
<body> | ||
|
||
<div id="clock" role="timer" aria-live="polite" aria-atomic="true" aria-relevant="additions text">2:30pm</div> | ||
<div id="clock-display-contents" style="display: contents" role="timer" aria-live="polite" aria-atomic="true" aria-relevant="additions text">4:30pm</div> | ||
|
||
<script> | ||
var testOutput = "This test ensures that an element's busy state updates aria-busy changes.\n\n"; | ||
|
||
var axClock, axClockWithDisplayContents; | ||
function verifyIsBusy() { | ||
testOutput += `#clock is busy: ${axClock.isBusy}\n`; | ||
testOutput += `#clock-display-contents is busy: ${axClockWithDisplayContents.isBusy}\n\n`; | ||
} | ||
function verifyIsAtomic() { | ||
testOutput += `#clock is atomic: ${axClock.isAtomicLiveRegion}\n`; | ||
testOutput += `#clock-display-contents is atomic: ${axClockWithDisplayContents.isAtomicLiveRegion}\n\n`; | ||
} | ||
function verifyLiveRegionRelevant() { | ||
testOutput += `#clock relevant: ${axClock.liveRegionRelevant}\n`; | ||
testOutput += `#clock-display-contents relevant: ${axClockWithDisplayContents.liveRegionRelevant}\n\n`; | ||
} | ||
function verifyLiveRegionStatus() { | ||
testOutput += `#clock live region status: ${axClock.liveRegionStatus}\n`; | ||
testOutput += `#clock-display-contents live region status: ${axClockWithDisplayContents.liveRegionStatus}\n\n`; | ||
} | ||
|
||
if (window.accessibilityController) { | ||
window.jsTestIsAsync = true; | ||
axClock = accessibilityController.accessibleElementById("clock"); | ||
axClockWithDisplayContents = accessibilityController.accessibleElementById("clock-display-contents"); | ||
|
||
testOutput += "Verifying initial states:\n\n"; | ||
verifyIsAtomic(); | ||
verifyIsBusy(); | ||
verifyLiveRegionRelevant(); | ||
verifyLiveRegionStatus(); | ||
|
||
const clock = document.getElementById("clock"); | ||
const clockWithDisplayContents = document.getElementById("clock-display-contents"); | ||
|
||
testOutput += "Setting aria-busy to true.\n\n"; | ||
clock.ariaBusy = "true"; | ||
clockWithDisplayContents.ariaBusy = "true"; | ||
setTimeout(async function() { | ||
await waitFor(() => axClock.isBusy && axClockWithDisplayContents.isBusy); | ||
verifyIsBusy(); | ||
|
||
testOutput += "Setting aria-busy to false.\n\n"; | ||
clock.ariaBusy = "false"; | ||
clockWithDisplayContents.ariaBusy = "false"; | ||
await waitFor(() => !axClock.isBusy && !axClockWithDisplayContents.isBusy); | ||
verifyIsBusy(); | ||
|
||
testOutput += "Setting aria-atomic to false.\n\n"; | ||
clock.ariaAtomic = "false"; | ||
clockWithDisplayContents.ariaAtomic = "false"; | ||
await waitFor(() => !axClock.isAtomicLiveRegion && !axClockWithDisplayContents.isAtomicLiveRegion); | ||
verifyIsAtomic(); | ||
|
||
testOutput += "Setting aria-relevant to removals.\n\n"; | ||
clock.ariaRelevant = "removals"; | ||
clockWithDisplayContents.ariaRelevant = "removals"; | ||
await waitFor(() => axClock.liveRegionRelevant.includes("removals") && axClockWithDisplayContents.liveRegionRelevant.includes("removals")); | ||
verifyLiveRegionRelevant(); | ||
|
||
testOutput += "Setting aria-live to assertive.\n\n"; | ||
clock.ariaLive = "assertive"; | ||
clockWithDisplayContents.ariaLive = "assertive"; | ||
await waitFor(() => axClock.liveRegionStatus.includes("assertive") && axClockWithDisplayContents.liveRegionStatus.includes("assertive")); | ||
verifyLiveRegionStatus(); | ||
|
||
debug(testOutput); | ||
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
Oops, something went wrong.