Title: [290965] trunk
Revision
290965
Author
[email protected]
Date
2022-03-07 16:32:44 -0800 (Mon, 07 Mar 2022)

Log Message

Fix for <select> elements in isolated tree mode.
https://bugs.webkit.org/show_bug.cgi?id=237483
rdar://89530022

Reviewed by Chris Fleizach.

Source/WebCore:

Test: accessibility/dropdown-value.html

AXObjectCache was not updating the isolated tree for
AXMenuListValueChanged notifications. Added handleMenuListValueChanged()
for this purpose.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate):
(WebCore::AXObjectCache::handleMenuListValueChanged):
(WebCore::AXObjectCache::updateIsolatedTree):
* accessibility/AXObjectCache.h:

LayoutTests:

* accessibility/dropdown-value-expected.txt: Added.
* accessibility/dropdown-value.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290964 => 290965)


--- trunk/LayoutTests/ChangeLog	2022-03-08 00:00:31 UTC (rev 290964)
+++ trunk/LayoutTests/ChangeLog	2022-03-08 00:32:44 UTC (rev 290965)
@@ -1,3 +1,14 @@
+2022-03-07  Andres Gonzalez  <[email protected]>
+
+        Fix for <select> elements in isolated tree mode.
+        https://bugs.webkit.org/show_bug.cgi?id=237483
+        rdar://89530022
+
+        Reviewed by Chris Fleizach.
+
+        * accessibility/dropdown-value-expected.txt: Added.
+        * accessibility/dropdown-value.html: Added.
+
 2022-03-07  Mark Lam  <[email protected]>
 
         Remove TestExpectations for imported/w3c/web-platform-tests/IndexedDB/key-generators/reading-autoincrement-indexes-cursors.any.worker.html.

Added: trunk/LayoutTests/accessibility/dropdown-value-expected.txt (0 => 290965)


--- trunk/LayoutTests/accessibility/dropdown-value-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/accessibility/dropdown-value-expected.txt	2022-03-08 00:32:44 UTC (rev 290965)
@@ -0,0 +1,7 @@
+select default value: AXValue: dog
+PASS axSelect.stringValue === 'AXValue: cat'
+PASS axSelect.stringValue === 'AXValue: dog'
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/accessibility/dropdown-value.html (0 => 290965)


--- trunk/LayoutTests/accessibility/dropdown-value.html	                        (rev 0)
+++ trunk/LayoutTests/accessibility/dropdown-value.html	2022-03-08 00:32:44 UTC (rev 290965)
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script src=""
+</head>
+<body>
+
+<select id="select">
+    <option>dog</option>
+    <option>cat</option>
+</select>
+
+<script>
+    if (window.accessibilityController) {
+        window.jsTestIsAsync = true;
+
+        var axSelect = accessibilityController.accessibleElementById("select");
+        debug(`select default value: ${axSelect.stringValue}`);
+
+        setTimeout(async () => {
+            document.getElementById("select").selectedIndex = 1;
+            await expectAsyncExpression("axSelect.stringValue", "'AXValue: cat'");
+
+            document.getElementById("select").selectedIndex = 0;
+            await expectAsyncExpression("axSelect.stringValue", "'AXValue: dog'");
+
+            finishJSTest();
+        }, 0);
+    }
+</script>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (290964 => 290965)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-08 00:00:31 UTC (rev 290964)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2022-03-08 00:32:44 UTC (rev 290965)
@@ -133,6 +133,7 @@
 webkit.org/b/223862 accessibility/gtk/text-for-range-table-cells.html [ Failure ]
 webkit.org/b/223862 accessibility/gtk/text-for-range-with-link.html [ Failure ]
 accessibility/model-element-attributes.html [ Skip ]
+accessibility/dropdown-value.html [ Skip ]
 
 # Tests failing with ATSPI implementation.
 webkit.org/b/235941 accessibility/gtk/text-at-offset-embedded-objects.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (290964 => 290965)


--- trunk/Source/WebCore/ChangeLog	2022-03-08 00:00:31 UTC (rev 290964)
+++ trunk/Source/WebCore/ChangeLog	2022-03-08 00:32:44 UTC (rev 290965)
@@ -1,3 +1,23 @@
+2022-03-07  Andres Gonzalez  <[email protected]>
+
+        Fix for <select> elements in isolated tree mode.
+        https://bugs.webkit.org/show_bug.cgi?id=237483
+        rdar://89530022
+
+        Reviewed by Chris Fleizach.
+
+        Test: accessibility/dropdown-value.html
+
+        AXObjectCache was not updating the isolated tree for
+        AXMenuListValueChanged notifications. Added handleMenuListValueChanged()
+        for this purpose.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::performDeferredCacheUpdate):
+        (WebCore::AXObjectCache::handleMenuListValueChanged):
+        (WebCore::AXObjectCache::updateIsolatedTree):
+        * accessibility/AXObjectCache.h:
+
 2022-03-07  Jean-Yves Avenard  <[email protected]>
 
         MediaTime::invalidTime() conversion to CMTime incorrectly creates a valid time.

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (290964 => 290965)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2022-03-08 00:00:31 UTC (rev 290964)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2022-03-08 00:32:44 UTC (rev 290965)
@@ -3329,15 +3329,28 @@
     });
     m_deferredModalChangedList.clear();
 
-    m_deferredMenuListChange.forEach([this] (auto& deferredMenuListChangeElement) {
-        postNotification(&deferredMenuListChangeElement, AXObjectCache::AXMenuListValueChanged);
+    m_deferredMenuListChange.forEach([this] (auto& element) {
+        handleMenuListValueChanged(element);
     });
     m_deferredMenuListChange.clear();
-    
+
     platformPerformDeferredCacheUpdate();
 }
-    
+
+void AXObjectCache::handleMenuListValueChanged(Element& element)
+{
+    RefPtr<AccessibilityObject> object = get(&element);
+    if (!object)
+        return;
+
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    updateIsolatedTree(*object, AXMenuListValueChanged);
+#endif
+
+    postPlatformNotification(object.get(), AXMenuListValueChanged);
+}
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
 // FIXME: should be added to WTF::Vector.
 template<typename T, typename F>
 static bool appendIfNotContainsMatching(Vector<T>& vector, const T& value, F matches)
@@ -3402,6 +3415,7 @@
             break;
         case AXActiveDescendantChanged:
         case AXAriaRoleChanged:
+        case AXMenuListValueChanged:
         case AXSelectedChildrenChanged:
         case AXValueChanged: {
             bool needsUpdate = appendIfNotContainsMatching(filteredNotifications, notification, [&notification] (const std::pair<RefPtr<AXCoreObject>, AXNotification>& note) {

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (290964 => 290965)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2022-03-08 00:00:31 UTC (rev 290964)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2022-03-08 00:32:44 UTC (rev 290965)
@@ -467,6 +467,7 @@
     void handleAriaRoleChanged(Node*);
     void handleAriaExpandedChange(Node*);
     void handleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode);
+    void handleMenuListValueChanged(Element&);
 
     // aria-modal or modal <dialog> related
     bool isModalElement(Element&) const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to