haikuwebkit/LayoutTests/accessibility/mac/checked-status-tree-items.html

49 lines
1.6 KiB
HTML
Raw Permalink Normal View History

AX: VoiceOver does not announce the aria-checked state for ARIA treeitem https://bugs.webkit.org/show_bug.cgi?id=218316 <rdar://problem/70787809> Reviewed by Zalan Bujtas. Source/WebCore: Tree items need to be able to support their aria-checked status according to WAI-ARIA. In addition, when the value changes they need to be able to post an appropriate notification. While working on this, I realized that if an attribute changes, the notification is not fired until the next layout change which is problematic. Those need to fire immediately. Test: accessibility/mac/checked-status-tree-items.html accessibility/ios-simulator/checked-status-tree-items.html * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::deferAttributeChangeIfNeeded): * accessibility/AccessibilityNodeObject.cpp: (WebCore::AccessibilityNodeObject::isChecked const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::supportsCheckedState const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityObjectInterface.h: * accessibility/AccessibilityTreeItem.cpp: (WebCore::AccessibilityTreeItem::supportsCheckedState const): * accessibility/AccessibilityTreeItem.h: * accessibility/ios/AXObjectCacheIOS.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityTraits]): (-[WebAccessibilityObjectWrapper accessibilityValue]): * accessibility/isolatedtree/AXIsolatedObject.cpp: (WebCore::AXIsolatedObject::initializeAttributeData): * accessibility/isolatedtree/AXIsolatedObject.h: * accessibility/isolatedtree/AXIsolatedTree.h: * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (AXAttributedStringAppendText): (-[WebAccessibilityObjectWrapper ALLOW_DEPRECATED_IMPLEMENTATIONS_END]): (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): LayoutTests: * accessibility/ios-simulator/checked-status-tree-items-expected.txt: Added. * accessibility/ios-simulator/checked-status-tree-items.html: Added. * accessibility/mac/checked-status-tree-items-expected.txt: Added. * accessibility/mac/checked-status-tree-items.html: Added. Canonical link: https://commits.webkit.org/232027@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@270333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2020-12-02 00:55:04 +00:00
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="tree" role="tree">
<div id="treeitem_notchecked" role="treeitem">item</div>
<div id="treeitem" role="treeitem" aria-checked="true">item</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
var webArea;
var treeItem;
function notificationCallback(notification, userInfo) {
if (notification == "AXValueChanged") {
debug("final tree item value: " + treeItem.intValue);
treeItem.removeNotificationListener();
finishJSTest();
}
}
description("This tests that aria-checked is supported on tree items and changes generate notifications.");
if (window.accessibilityController) {
jsTestIsAsync = true;
webArea = accessibilityController.rootElement.childAtIndex(0);
treeItem = accessibilityController.accessibleElementById("treeitem");
var addedNotification = treeItem.addNotificationListener(notificationCallback);
shouldBe("addedNotification", "true");
var treeItemNotChecked = accessibilityController.accessibleElementById("treeitem_notchecked");
debug("tree item not checked: value attribute supported: " + treeItemNotChecked.isAttributeSupported('AXValue'));
debug("value attribute supported: " + treeItem.isAttributeSupported('AXValue'));
debug("initial tree item value: " + treeItem.intValue);
document.getElementById("treeitem").ariaChecked = "false";
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>