Diff
Modified: trunk/LayoutTests/ChangeLog (292762 => 292763)
--- trunk/LayoutTests/ChangeLog 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/LayoutTests/ChangeLog 2022-04-12 06:10:33 UTC (rev 292763)
@@ -1,3 +1,21 @@
+2022-04-11 Tyler Wilcock <[email protected]>
+
+ AX: Update isolated tree in response to AXReadOnlyStatusChanged, AXRequiredStatusChanged, and AXPressedStateChanged notifications
+ https://bugs.webkit.org/show_bug.cgi?id=239047
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/aria-readonly-updates-after-dynamic-change-expected.txt: Added.
+ * accessibility/aria-readonly-updates-after-dynamic-change.html: Added.
+ * accessibility/aria-required-updates-after-dynamic-change-expected.txt: Added.
+ * accessibility/aria-required-updates-after-dynamic-change.html: Added.
+ * accessibility/mac/aria-pressed-button-attributes-expected.txt:
+ * accessibility/mac/aria-pressed-button-attributes.html:
+ Add testcases that dynamically change aria-pressed and expect the
+ right attributes.
+ * platform/ios/TestExpectations: Enable new tests.
+ * platform/win/TestExpectations: Skip new tests.
+
2022-04-11 Patrick Angle <[email protected]>
Web Inspector: preserve DOM.NodeId if a node is removed and re-added
Added: trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change-expected.txt (0 => 292763)
--- trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change-expected.txt 2022-04-12 06:10:33 UTC (rev 292763)
@@ -0,0 +1,12 @@
+This test ensures that objects readonly status is updated after dynamically changing aria-readonly.
+
+PASS: axElement.isAttributeSettable('AXValue') === true
+Updating aria-readonly to true.
+PASS: axElement.isAttributeSettable('AXValue') === false
+Updating aria-readonly to false.
+PASS: axElement.isAttributeSettable('AXValue') === true
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change.html (0 => 292763)
--- trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change.html (rev 0)
+++ trunk/LayoutTests/accessibility/aria-readonly-updates-after-dynamic-change.html 2022-04-12 06:10:33 UTC (rev 292763)
@@ -0,0 +1,38 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<div contenteditable id="contenteditable"></div>
+<script>
+ var testOutput = "This test ensures that objects readonly status is updated after dynamically changing aria-readonly.\n\n";
+
+ var axElement;
+ if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+
+ const domElement = document.getElementById("contenteditable");
+ axElement = accessibilityController.accessibleElementById("contenteditable");
+ testOutput += expect("axElement.isAttributeSettable('AXValue')", "true");
+
+ testOutput += "Updating aria-readonly to true.\n";
+ domElement.ariaReadOnly = "true";
+ setTimeout(async function() {
+ await waitFor(() => { return !axElement.isAttributeSettable('AXValue'); });
+ testOutput += expect("axElement.isAttributeSettable('AXValue')", "false");
+
+ testOutput += "Updating aria-readonly to false.\n";
+ domElement.ariaReadOnly = "false";
+ await waitFor(() => { return axElement.isAttributeSettable('AXValue'); });
+ testOutput += expect("axElement.isAttributeSettable('AXValue')", "true");
+
+ debug(testOutput);
+ finishJSTest();
+ }, 0);
+ }
+</script>
+</body>
+</html>
Added: trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change-expected.txt (0 => 292763)
--- trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change-expected.txt 2022-04-12 06:10:33 UTC (rev 292763)
@@ -0,0 +1,12 @@
+This tests that changing the aria-required attribute is properly reflected in an AX object's required status.
+
+#textbox is required: false
+Setting aria-required to true on #textbox.
+#textbox is required: true
+Setting aria-required to false on #textbox.
+#textbox is required: false
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change.html (0 => 292763)
--- trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change.html (rev 0)
+++ trunk/LayoutTests/accessibility/aria-required-updates-after-dynamic-change.html 2022-04-12 06:10:33 UTC (rev 292763)
@@ -0,0 +1,43 @@
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<div id="textbox" role="textbox" tabindex="0"></div>
+
+<script>
+ var testOutput = "This tests that changing the aria-required attribute is properly reflected in an AX object's required status.\n\n";
+
+ var axElement;
+ function verifyRequiredStatus() {
+ testOutput += `#textbox is required: ${axElement.isRequired}\n`;
+ }
+
+ function setAriaRequired(boolValue) {
+ testOutput += `Setting aria-required to ${boolValue} on #textbox.\n`;
+ document.getElementById("textbox").setAttribute("aria-required", `${boolValue}`);
+ }
+
+ if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+ axElement = accessibilityController.accessibleElementById("textbox");
+ verifyRequiredStatus();
+
+ setAriaRequired(true);
+ setTimeout(async () => {
+ await waitFor(() => { return axElement.isRequired });
+ verifyRequiredStatus();
+
+ setAriaRequired(false);
+ await waitFor(() => { return !axElement.isRequired });
+ verifyRequiredStatus();
+
+ debug(testOutput);
+ finishJSTest();
+ }, 0);
+ }
+</script>
+</body>
+</html>
Modified: trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes-expected.txt (292762 => 292763)
--- trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes-expected.txt 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes-expected.txt 2022-04-12 06:10:33 UTC (rev 292763)
@@ -1,17 +1,41 @@
-Foo
-Bar
-This tests role=button with aria-pressed will create an AXCheckbox:AXToggle on Mac with the right AXValue
+This test ensures a role=button element with aria-pressed has the right attribute values, even after dynamic page changes.
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+#button1: AXRole: AXCheckBox
+#button1: AXSubrole: AXToggle
+#button1: AXValue: 1
+#button1: AXARIAPressedIsPresent: true
+#button2: AXRole: AXCheckBox
+#button2: AXSubrole: AXToggle
+#button2: AXValue: 0
+#button2: AXARIAPressedIsPresent: true
-Button1: AXRole: AXCheckBox
-Button1: AXSubrole: AXToggle
-Button1: AXValue: 1
-Button2: AXRole: AXCheckBox
-Button2: AXSubrole: AXToggle
-Button2: AXValue: 0
+#button-without-initial-press: AXRole: AXButton
+#button-without-initial-press: AXSubrole:
+#button-without-initial-press: AXValue:
+#button-without-initial-press: AXARIAPressedIsPresent: false
+
+Toggling aria-pressed state on both buttons.
+
+#button1: AXRole: AXCheckBox
+#button1: AXSubrole: AXToggle
+#button1: AXValue: 0
+#button1: AXARIAPressedIsPresent: true
+
+#button2: AXRole: AXCheckBox
+#button2: AXSubrole: AXToggle
+#button2: AXValue: 1
+#button2: AXARIAPressedIsPresent: true
+
+#button-without-initial-press: AXRole: AXButton
+#button-without-initial-press: AXSubrole:
+#button-without-initial-press: AXValue:
+#button-without-initial-press: AXARIAPressedIsPresent: true
+
+
PASS successfullyParsed is true
TEST COMPLETE
-
+Foo
+Bar
+Baz
Modified: trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes.html (292762 => 292763)
--- trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes.html 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/LayoutTests/accessibility/mac/aria-pressed-button-attributes.html 2022-04-12 06:10:33 UTC (rev 292763)
@@ -2,36 +2,49 @@
<html>
<head>
<meta charset="utf-8">
-<script src=""
+<script src=""
+<script src=""
</head>
<body id="body">
<div id="button1" role="button" aria-pressed="true">Foo</div>
-
<div id="button2" role="button" aria-pressed="false">Bar</div>
+<div id="button-without-initial-press" role="button">Baz</div>
-<p id="description"></p>
-<div id="console"></div>
-
<script>
+ var testOutput = "This test ensures a role=button element with aria-pressed has the right attribute values, even after dynamic page changes.\n\n";
- description("This tests role=button with aria-pressed will create an AXCheckbox:AXToggle on Mac with the right AXValue");
+ function verify(id) {
+ const element = accessibilityController.accessibleElementById(id);
+ testOutput += `#${id}: ${element.role}\n`;
+ testOutput += `#${id}: ${element.subrole}\n`;
+ testOutput += `#${id}: ${element.stringValue}\n`;
+ testOutput += `#${id}: AXARIAPressedIsPresent: ${element.boolAttributeValue("AXARIAPressedIsPresent")}\n\n`;
+ }
if (window.accessibilityController) {
+ window.jsTestIsAsync = true;
+ verify("button1");
+ verify("button2");
+ verify("button-without-initial-press");
- var button1 = accessibilityController.accessibleElementById("button1");
- debug("Button1: " + button1.role);
- debug("Button1: " + button1.subrole);
- debug("Button1: " + button1.stringValue);
+ testOutput += `Toggling aria-pressed state on both buttons.\n\n`;
+ document.getElementById("button1").ariaPressed = "false";
+ document.getElementById("button2").ariaPressed = "true";
+ document.getElementById("button-without-initial-press").ariaPressed = "true";
+ setTimeout(async () => {
+ await waitFor(() => {
+ return accessibilityController.accessibleElementById("button-without-initial-press").boolAttributeValue("AXARIAPressedIsPresent");
+ });
- var button2 = accessibilityController.accessibleElementById("button2");
- debug("Button2: " + button2.role);
- debug("Button2: " + button2.subrole);
- debug("Button2: " + button2.stringValue);
+ verify("button1");
+ verify("button2");
+ verify("button-without-initial-press");
+
+ debug(testOutput);
+ finishJSTest();
+ }, 0);
}
-
</script>
-
-<script src=""
</body>
</html>
Modified: trunk/LayoutTests/platform/ios/TestExpectations (292762 => 292763)
--- trunk/LayoutTests/platform/ios/TestExpectations 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/LayoutTests/platform/ios/TestExpectations 2022-04-12 06:10:33 UTC (rev 292763)
@@ -2094,6 +2094,8 @@
fast/dom/linkify-phone-numbers.html [ Pass ]
accessibility/aria-hidden-display-contents-element.html [ Pass ]
+accessibility/aria-readonly-updates-after-dynamic-change.html [ Pass ]
+accessibility/aria-required-updates-after-dynamic-change.html [ Pass ]
accessibility/display-contents-element-roles.html [ Pass ]
accessibility/node-only-object-element-rect.html [ Pass ]
accessibility/video-element-url-attribute.html [ Pass ]
Modified: trunk/LayoutTests/platform/win/TestExpectations (292762 => 292763)
--- trunk/LayoutTests/platform/win/TestExpectations 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/LayoutTests/platform/win/TestExpectations 2022-04-12 06:10:33 UTC (rev 292763)
@@ -484,6 +484,11 @@
accessibility/dynamically-changing-iframe-remains-accessible.html [ Skip ]
accessibility/ignore-modals-without-any-content.html [ Skip ]
+# Missing AccessibilityUIElement::isAttributeSettable implementation.
+accessibility/aria-readonly-updates-after-dynamic-change.html [ Skip ]
+# Missing AccessibilityUIElement::isRequired implementation.
+accessibility/aria-required-updates-after-dynamic-change.html [ Skip ]
+
# TODO Conic gradients
http/wpt/css/css-images-4/conic-gradient-parsing.html [ Skip ]
fast/gradients/conic-repeating.html [ Skip ]
Modified: trunk/Source/WebCore/ChangeLog (292762 => 292763)
--- trunk/Source/WebCore/ChangeLog 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Source/WebCore/ChangeLog 2022-04-12 06:10:33 UTC (rev 292763)
@@ -1,3 +1,28 @@
+2022-04-11 Tyler Wilcock <[email protected]>
+
+ AX: Update isolated tree in response to AXReadOnlyStatusChanged, AXRequiredStatusChanged, and AXPressedStateChanged notifications
+ https://bugs.webkit.org/show_bug.cgi?id=239047
+
+ Reviewed by Chris Fleizach.
+
+ When these notifications come in for a live object, we need to update the
+ cached properties of the corresponding isolated object.
+
+ Tests: accessibility/aria-readonly-updates-after-dynamic-change.html,
+ accessibility/aria-required-updates-after-dynamic-change.html,
+ accessibility/mac/aria-pressed-button-attributes.html
+
+ * accessibility/AXObjectCache.cpp:
+ (WebCore::AXObjectCache::updateIsolatedTree):
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (-[WebAccessibilityObjectWrapper accessibilityIsAttributeSettable:]):
+ (-[WebAccessibilityObjectWrapper accessibilityIsRequired]):
+ Added both of these methods so the tests added in this patch can run on iOS.
+ * accessibility/isolatedtree/AXIsolatedTree.cpp:
+ (WebCore::AXIsolatedTree::updateNodeProperty):
+ Handle updates to AXPropertyName::IsRequired, AXPropertyName::CanSetValueAttribute,
+ and AXPropertyName::ReadOnlyValue.
+
2022-04-11 Antti Koivisto <[email protected]>
[CSS Container Queries] Update container shorthand order
Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (292762 => 292763)
--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp 2022-04-12 06:10:33 UTC (rev 292763)
@@ -3413,10 +3413,18 @@
case AXIdAttributeChanged:
tree->updateNodeProperty(*notification.first, AXPropertyName::IdentifierAttribute);
break;
+ case AXReadOnlyStatusChanged:
+ tree->updateNodeProperty(*notification.first, AXPropertyName::CanSetValueAttribute);
+ tree->updateNodeProperty(*notification.first, AXPropertyName::ReadOnlyValue);
+ break;
+ case AXRequiredStatusChanged:
+ tree->updateNodeProperty(*notification.first, AXPropertyName::IsRequired);
+ break;
case AXActiveDescendantChanged:
case AXAriaRoleChanged:
case AXInvalidStatusChanged:
case AXMenuListValueChanged:
+ case AXPressedStateChanged:
case AXSelectedChildrenChanged:
case AXValueChanged: {
bool needsUpdate = appendIfNotContainsMatching(filteredNotifications, notification, [¬ification] (const std::pair<RefPtr<AXCoreObject>, AXNotification>& note) {
Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (292762 => 292763)
--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2022-04-12 06:10:33 UTC (rev 292763)
@@ -564,6 +564,25 @@
return self.axBackingObject->isInCell();
}
+- (BOOL)accessibilityIsAttributeSettable:(NSString *)attributeName
+{
+ if (![self _prepareAccessibilityCall])
+ return NO;
+
+ if ([attributeName isEqualToString:@"AXValue"])
+ return self.axBackingObject->canSetValueAttribute();
+
+ return NO;
+}
+
+- (BOOL)accessibilityIsRequired
+{
+ if (![self _prepareAccessibilityCall])
+ return NO;
+
+ return self.axBackingObject->isRequired();
+}
+
- (NSString *)accessibilityLanguage
{
if (![self _prepareAccessibilityCall])
Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (292762 => 292763)
--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp 2022-04-12 06:10:33 UTC (rev 292763)
@@ -330,6 +330,9 @@
case AXPropertyName::CanSetFocusAttribute:
propertyMap.set(AXPropertyName::CanSetFocusAttribute, axObject.canSetFocusAttribute());
break;
+ case AXPropertyName::CanSetValueAttribute:
+ propertyMap.set(AXPropertyName::CanSetValueAttribute, axObject.canSetValueAttribute());
+ break;
case AXPropertyName::CurrentValue:
propertyMap.set(AXPropertyName::CurrentValue, axObject.currentValue().isolatedCopy());
break;
@@ -350,6 +353,12 @@
case AXPropertyName::IsExpanded:
propertyMap.set(AXPropertyName::IsExpanded, axObject.isExpanded());
break;
+ case AXPropertyName::IsRequired:
+ propertyMap.set(AXPropertyName::IsRequired, axObject.isRequired());
+ break;
+ case AXPropertyName::ReadOnlyValue:
+ propertyMap.set(AXPropertyName::ReadOnlyValue, axObject.readOnlyValue().isolatedCopy());
+ break;
case AXPropertyName::SortDirection:
propertyMap.set(AXPropertyName::SortDirection, static_cast<int>(axObject.sortDirection()));
break;
Modified: trunk/Tools/ChangeLog (292762 => 292763)
--- trunk/Tools/ChangeLog 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Tools/ChangeLog 2022-04-12 06:10:33 UTC (rev 292763)
@@ -1,3 +1,19 @@
+2022-04-11 Tyler Wilcock <[email protected]>
+
+ AX: Update isolated tree in response to AXReadOnlyStatusChanged, AXRequiredStatusChanged, and AXPressedStateChanged notifications
+ https://bugs.webkit.org/show_bug.cgi?id=239047
+
+ Reviewed by Chris Fleizach.
+
+ * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+ (AccessibilityUIElement::isAttributeSettable):
+ (AccessibilityUIElement::isRequired const):
+ Added both of these methods so that the tests added with this patch can run on iOS.
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+ (WTR::AccessibilityUIElement::isAttributeSettable):
+ (WTR::AccessibilityUIElement::isRequired const):
+ Added both of these methods so that the tests added with this patch can run on iOS.
+
2022-04-11 Jonathan Bedard <[email protected]>
[Merge-Queue] Build before landing
Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (292762 => 292763)
--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2022-04-12 06:10:33 UTC (rev 292763)
@@ -92,6 +92,8 @@
- (BOOL)accessibilityIsInDescriptionListDefinition;
- (BOOL)accessibilityIsInDescriptionListTerm;
- (BOOL)_accessibilityIsInTableCell;
+- (BOOL)accessibilityIsAttributeSettable:(NSString *)attributeName;
+- (BOOL)accessibilityIsRequired;
- (NSString *)_accessibilityPhotoDescription;
- (BOOL)accessibilityPerformEscape;
- (NSString *)accessibilityDOMIdentifier;
@@ -747,7 +749,7 @@
bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
- return false;
+ return [m_element accessibilityIsAttributeSettable:[NSString stringWithJSStringRef:attribute]];
}
bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
@@ -866,7 +868,7 @@
bool AccessibilityUIElement::isRequired() const
{
- return false;
+ return [m_element accessibilityIsRequired];
}
bool AccessibilityUIElement::isFocused() const
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (292762 => 292763)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2022-04-12 05:59:08 UTC (rev 292762)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2022-04-12 06:10:33 UTC (rev 292763)
@@ -104,6 +104,8 @@
- (BOOL)accessibilityIsInDescriptionListDefinition;
- (BOOL)accessibilityIsInDescriptionListTerm;
- (BOOL)_accessibilityIsInTableCell;
+- (BOOL)accessibilityIsAttributeSettable:(NSString *)attributeName;
+- (BOOL)accessibilityIsRequired;
- (id)_accessibilityTableAncestor;
- (id)_accessibilityLandmarkAncestor;
- (id)_accessibilityListAncestor;
@@ -486,7 +488,7 @@
bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
{
- return false;
+ return [m_element accessibilityIsAttributeSettable:[NSString stringWithJSStringRef:attribute]];
}
bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
@@ -636,7 +638,7 @@
bool AccessibilityUIElement::isRequired() const
{
- return false;
+ return [m_element accessibilityIsRequired];
}
RefPtr<AccessibilityUIElement> AccessibilityUIElement::focusedElement() const