Changeset 295727 in webkit


Ignore:
Timestamp:
Jun 22, 2022 5:41:33 AM (2 years ago)
Author:
Andres Gonzalez
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

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value-expected.txt

    r286794 r295727  
    55
    66PASS label.role is 'AXRole: AXStaticText'
    7 PASS initialStringValue is 'AXValue: first choice'
     7PASS label.stringValue is 'AXValue: first choice'
    88PASS label.stringValue === 'AXValue: first foo choice'
    99PASS successfullyParsed is true
  • trunk/LayoutTests/accessibility/mac/label-element-changing-children-string-value.html

    r286794 r295727  
    1616    description("This tests that if a label element's children change, the string value updates");
    1717
    18     var label, initialStringValue;
    1918    if (window.accessibilityController) {
    2019        window.jsTestIsAsync = true;
    2120
    22         label = accessibilityController.accessibleElementById("label");
    23         initialStringValue = label.stringValue;
     21        var label = accessibilityController.accessibleElementById("label");
     22        shouldBe("label.role", "'AXRole: AXStaticText'");
     23        shouldBe("label.stringValue", "'AXValue: first choice'");
     24
    2425        let first = document.getElementById("first")
    2526        let span = document.createElement("span");
     
    2728        span.appendChild(textNode);
    2829        first.appendChild(textNode);
    29 
    30         shouldBe("label.role", "'AXRole: AXStaticText'");
    31         shouldBe("initialStringValue", "'AXValue: first choice'");
    3230
    3331        setTimeout(async function() {
     
    3937</body>
    4038</html>
    41 
    42 
    43 
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp

    r295721 r295727  
    449449}
    450450
    451 void AXIsolatedTree::updateTableProperties(AXCoreObject& axObject)
    452 {
    453     ASSERT(isMainThread());
    454     ASSERT(axObject.isTable());
    455 
    456     AXPropertyMap propertyMap {
    457         { AXPropertyName::IsTable, true },
    458         { AXPropertyName::IsExposable, axObject.isExposable() },
    459         { AXPropertyName::IsDataTable, axObject.isDataTable() },
    460         { AXPropertyName::TableLevel, axObject.tableLevel() },
    461         { AXPropertyName::SupportsSelectedRows, axObject.supportsSelectedRows() },
    462         { AXPropertyName::Columns, axIDs(axObject.columns()) },
    463         { AXPropertyName::Rows, axIDs(axObject.rows()) },
    464         { AXPropertyName::ColumnCount, axObject.columnCount() },
    465         { AXPropertyName::RowCount, axObject.rowCount() },
    466         { AXPropertyName::Cells, axIDs(axObject.cells()) },
    467         { AXPropertyName::ColumnHeaders, axIDs(axObject.columnHeaders()) },
    468         { AXPropertyName::RowHeaders, axIDs(axObject.rowHeaders()) },
    469         { AXPropertyName::VisibleRows, axIDs(axObject.visibleRows()) },
    470         { AXPropertyName::HeaderContainer, axObject.headerContainer() ? axObject.headerContainer()->objectID() : AXID() },
    471         { AXPropertyName::AXColumnCount, axObject.axColumnCount() },
    472         { AXPropertyName::AXRowCount, axObject.axRowCount() },
    473     };
    474 
    475     Locker locker { m_changeLogLock };
    476     m_pendingPropertyChanges.append({ axObject.objectID(), propertyMap });
    477 }
    478 
    479 void AXIsolatedTree::updateTreeItemProperties(AXCoreObject& axObject)
    480 {
    481     ASSERT(isMainThread());
    482     ASSERT(axObject.isTreeItem());
    483 
    484     AXPropertyMap propertyMap {
    485         { AXPropertyName::ARIATreeItemContent, axIDs(axObject.ariaTreeItemContent()) },
    486         { AXPropertyName::DisclosedRows, axIDs(axObject.disclosedRows()) },
    487     };
    488 
    489     Locker locker { m_changeLogLock };
    490     m_pendingPropertyChanges.append({ axObject.objectID(), propertyMap });
    491 }
    492 
    493 void AXIsolatedTree::updateRelatedProperties(AXCoreObject& axObject)
    494 {
    495     ASSERT(isMainThread());
    496 
    497     if (axObject.isTable())
    498         updateTableProperties(axObject);
    499     else if (axObject.isTreeItem())
    500         updateTreeItemProperties(axObject);
     451void AXIsolatedTree::updateNodeAndDependentProperties(AXCoreObject& axObject)
     452{
     453    ASSERT(isMainThread());
     454
     455    updateNode(axObject);
    501456
    502457    if (auto* treeAncestor = Accessibility::findAncestor(axObject, true, [] (const auto& object) { return object.isTree(); }))
     
    576531    queueRemovalsAndUnresolvedChanges(oldChildrenIDs);
    577532
    578     // Also queue updates for properties that derive from children().
    579     updateRelatedProperties(*axAncestor);
     533    // Also queue updates to the target node itself and any properties that depend on children().
     534    updateNodeAndDependentProperties(*axAncestor);
    580535}
    581536
  • trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.h

    r295721 r295727  
    349349    void updateChildren(AXCoreObject&);
    350350    void updateNodeProperty(AXCoreObject&, AXPropertyName);
    351     void updateRelatedProperties(AXCoreObject&);
    352     void updateTableProperties(AXCoreObject&);
    353     void updateTreeItemProperties(AXCoreObject&);
     351    void updateNodeAndDependentProperties(AXCoreObject&);
    354352
    355353    double loadingProgress() { return m_loadingProgress; }
Note: See TracChangeset for help on using the changeset viewer.