Title: [295727] trunk
Revision
295727
Author
andresg...@apple.com
Date
2022-06-22 05:41:33 -0700 (Wed, 22 Jun 2022)

Log Message

AX ITM: Update the target node of a ChildrenChanged notification in addition of updating its children.
https://bugs.webkit.org/show_bug.cgi?id=241834

Reviewed by Chris Fleizach.

Fixes several tests in isolated tree mode, including:
    accessibility/mac/figure-element.html [ Failure ]
    accessibility/mac/progress-with-label-element.html [ Failure ]
    accessibility/mac/label-element-changing-children-string-value.html [ Timeout ]
    accessibility/mac/label-element-changing-textcontent-string-value.html [ Timeout ]
    accessibility/visible-elements.html [ Timeout ]

In updateChildren, replaced AXIsolatedTree::updateRelatedProperties with updateNodeAndDependetnProperties to replace the whole object instead of individual properties. This will update several properties that depend on the children of any given object such as those properties that compute textUnderElement. The added cost should be marginal given that updating the children is a lot more costly.

* LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt:
* LayoutTests/accessibility/mac/label-element-changing-children-string-value.html:
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::updateNodeAndDependentProperties):
(WebCore::AXIsolatedTree::updateChildren):
(WebCore::AXIsolatedTree::updateTableProperties): Deleted.
(WebCore::AXIsolatedTree::updateTreeItemProperties): Deleted.
(WebCore::AXIsolatedTree::updateRelatedProperties): Deleted.
* Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h:

Canonical link: https://commits.webkit.org/251732@main

Modified Paths

Diff

Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt (295726 => 295727)


--- trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt	2022-06-22 12:20:21 UTC (rev 295726)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt	2022-06-22 12:41:33 UTC (rev 295727)
@@ -4,7 +4,7 @@
 
 
 PASS label.role is 'AXRole: AXStaticText'
-PASS initialStringValue is 'AXValue: first choice'
+PASS label.stringValue is 'AXValue: first choice'
 PASS label.stringValue === 'AXValue: first foo choice'
 PASS successfullyParsed is true
 

Modified: trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html (295726 => 295727)


--- trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html	2022-06-22 12:20:21 UTC (rev 295726)
+++ trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html	2022-06-22 12:41:33 UTC (rev 295727)
@@ -15,12 +15,13 @@
 <script>
     description("This tests that if a label element's children change, the string value updates");
 
-    var label, initialStringValue;
     if (window.accessibilityController) {
         window.jsTestIsAsync = true;
 
-        label = accessibilityController.accessibleElementById("label");
-        initialStringValue = label.stringValue;
+        var label = accessibilityController.accessibleElementById("label");
+        shouldBe("label.role", "'AXRole: AXStaticText'");
+        shouldBe("label.stringValue", "'AXValue: first choice'");
+
         let first = document.getElementById("first")
         let span = document.createElement("span");
         let textNode = document.createTextNode("foo");
@@ -27,9 +28,6 @@
         span.appendChild(textNode);
         first.appendChild(textNode);
 
-        shouldBe("label.role", "'AXRole: AXStaticText'");
-        shouldBe("initialStringValue", "'AXValue: first choice'");
-
         setTimeout(async function() {
             await expectAsyncExpression("label.stringValue", "'AXValue: first foo choice'");
             finishJSTest();
@@ -38,6 +36,3 @@
 </script>
 </body>
 </html>
-
-
-

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (295726 => 295727)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp	2022-06-22 12:20:21 UTC (rev 295726)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp	2022-06-22 12:41:33 UTC (rev 295727)
@@ -448,57 +448,12 @@
     m_pendingPropertyChanges.append({ axObject.objectID(), propertyMap });
 }
 
-void AXIsolatedTree::updateTableProperties(AXCoreObject& axObject)
+void AXIsolatedTree::updateNodeAndDependentProperties(AXCoreObject& axObject)
 {
     ASSERT(isMainThread());
-    ASSERT(axObject.isTable());
 
-    AXPropertyMap propertyMap {
-        { AXPropertyName::IsTable, true },
-        { AXPropertyName::IsExposable, axObject.isExposable() },
-        { AXPropertyName::IsDataTable, axObject.isDataTable() },
-        { AXPropertyName::TableLevel, axObject.tableLevel() },
-        { AXPropertyName::SupportsSelectedRows, axObject.supportsSelectedRows() },
-        { AXPropertyName::Columns, axIDs(axObject.columns()) },
-        { AXPropertyName::Rows, axIDs(axObject.rows()) },
-        { AXPropertyName::ColumnCount, axObject.columnCount() },
-        { AXPropertyName::RowCount, axObject.rowCount() },
-        { AXPropertyName::Cells, axIDs(axObject.cells()) },
-        { AXPropertyName::ColumnHeaders, axIDs(axObject.columnHeaders()) },
-        { AXPropertyName::RowHeaders, axIDs(axObject.rowHeaders()) },
-        { AXPropertyName::VisibleRows, axIDs(axObject.visibleRows()) },
-        { AXPropertyName::HeaderContainer, axObject.headerContainer() ? axObject.headerContainer()->objectID() : AXID() },
-        { AXPropertyName::AXColumnCount, axObject.axColumnCount() },
-        { AXPropertyName::AXRowCount, axObject.axRowCount() },
-    };
+    updateNode(axObject);
 
-    Locker locker { m_changeLogLock };
-    m_pendingPropertyChanges.append({ axObject.objectID(), propertyMap });
-}
-
-void AXIsolatedTree::updateTreeItemProperties(AXCoreObject& axObject)
-{
-    ASSERT(isMainThread());
-    ASSERT(axObject.isTreeItem());
-
-    AXPropertyMap propertyMap {
-        { AXPropertyName::ARIATreeItemContent, axIDs(axObject.ariaTreeItemContent()) },
-        { AXPropertyName::DisclosedRows, axIDs(axObject.disclosedRows()) },
-    };
-
-    Locker locker { m_changeLogLock };
-    m_pendingPropertyChanges.append({ axObject.objectID(), propertyMap });
-}
-
-void AXIsolatedTree::updateRelatedProperties(AXCoreObject& axObject)
-{
-    ASSERT(isMainThread());
-
-    if (axObject.isTable())
-        updateTableProperties(axObject);
-    else if (axObject.isTreeItem())
-        updateTreeItemProperties(axObject);
-
     if (auto* treeAncestor = Accessibility::findAncestor(axObject, true, [] (const auto& object) { return object.isTree(); }))
         updateNodeProperty(*treeAncestor, AXPropertyName::ARIATreeRows);
 }
@@ -575,8 +530,8 @@
     }
     queueRemovalsAndUnresolvedChanges(oldChildrenIDs);
 
-    // Also queue updates for properties that derive from children().
-    updateRelatedProperties(*axAncestor);
+    // Also queue updates to the target node itself and any properties that depend on children().
+    updateNodeAndDependentProperties(*axAncestor);
 }
 
 RefPtr<AXIsolatedObject> AXIsolatedTree::focusedNode()

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h (295726 => 295727)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h	2022-06-22 12:20:21 UTC (rev 295726)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h	2022-06-22 12:41:33 UTC (rev 295727)
@@ -348,9 +348,7 @@
     void updateNode(AXCoreObject&);
     void updateChildren(AXCoreObject&);
     void updateNodeProperty(AXCoreObject&, AXPropertyName);
-    void updateRelatedProperties(AXCoreObject&);
-    void updateTableProperties(AXCoreObject&);
-    void updateTreeItemProperties(AXCoreObject&);
+    void updateNodeAndDependentProperties(AXCoreObject&);
 
     double loadingProgress() { return m_loadingProgress; }
     void updateLoadingProgress(double);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to