Title: [285092] trunk/Source/WebCore
Revision
285092
Author
[email protected]
Date
2021-10-31 06:41:34 -0700 (Sun, 31 Oct 2021)

Log Message

Move handling of ChildrenChanged notifications out of the AccessibilityObjects into AXObjectCache.
https://bugs.webkit.org/show_bug.cgi?id=232503
<rdar://problem/84820154>

Reviewed by Chris Fleizach.

ChildrenChanged notifications were handled in
AXObjectCache::performDeferredCacheUpdate by calling into an AX object
method. While in principle this may seem as a good design, it obscures
significantly what exactly happens in response to a notification. This
is aggravated by the fact that the object's handlers may call back into
the AXObjectCache to post or further defer notifications to platform
clients.
This patch atempts to straightline this flow by handling the
ChildrenChanged notifications in AXObjectCache.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::textChanged):
(WebCore::AXObjectCache::handleChildrenChanged):
The name indicates that this is the actual handler for the notification
as opposed as the other childrenChanged(...) methods that just queue
the notifications for a later time.

(WebCore::AXObjectCache::childrenChanged):
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::handleAriaRoleChanged):
(WebCore::AXObjectCache::recomputeIsIgnored):
(WebCore::AXObjectCache::performDeferredCacheUpdate):
* accessibility/AXObjectCache.h:
* accessibility/AccessibilityMenuList.cpp:
(WebCore::AccessibilityMenuList::childrenChanged):
Deleted, now handled in AXObjectCache::handleChildrenChanged.
* accessibility/AccessibilityMenuList.h:
* accessibility/AccessibilityMenuListPopup.cpp:
(WebCore::AccessibilityMenuListPopup::handleChildrenChanged):
(WebCore::AccessibilityMenuListPopup::childrenChanged):
Renamed handleChildrenChanged. It is the only AXObject subclass that
still has this method to update its children. It does not post or
schedule any platform client notification.

* accessibility/AccessibilityMenuListPopup.h:
* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::updateAccessibilityRole):
(WebCore::AccessibilityNodeObject::childrenChanged): Deleted.
* accessibility/AccessibilityNodeObject.h:
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::hasIgnoredValueChanged):
(WebCore::AccessibilityObject::notifyIfIgnoredValueChanged):
Renamed hasIgnoredValueChanged since the actual notifications are posted
in AXObjectCache.

* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::updateAccessibilityRole):
* accessibility/AccessibilityObjectInterface.h:
Several methods can now be removed from the AXCoreObject interface since
they are internal to the AXObject class hierarchy.

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::addChildren):
* accessibility/isolatedtree/AXIsolatedObject.cpp:
Now able to delete several unnecessary methods from the isolated objects.
(WebCore::AXIsolatedObject::childrenChanged): Deleted.
(WebCore::AXIsolatedObject::updateAccessibilityRole): Deleted.
(WebCore::AXIsolatedObject::lastKnownIsIgnoredValue): Deleted.
(WebCore::AXIsolatedObject::setLastKnownIsIgnoredValue): Deleted.
(WebCore::AXIsolatedObject::notifyIfIgnoredValueChanged): Deleted.
* accessibility/isolatedtree/AXIsolatedObject.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285091 => 285092)


--- trunk/Source/WebCore/ChangeLog	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/ChangeLog	2021-10-31 13:41:34 UTC (rev 285092)
@@ -1,3 +1,73 @@
+2021-10-31  Andres Gonzalez  <[email protected]>
+
+        Move handling of ChildrenChanged notifications out of the AccessibilityObjects into AXObjectCache.
+        https://bugs.webkit.org/show_bug.cgi?id=232503
+        <rdar://problem/84820154>
+
+        Reviewed by Chris Fleizach.
+
+        ChildrenChanged notifications were handled in
+        AXObjectCache::performDeferredCacheUpdate by calling into an AX object
+        method. While in principle this may seem as a good design, it obscures
+        significantly what exactly happens in response to a notification. This
+        is aggravated by the fact that the object's handlers may call back into
+        the AXObjectCache to post or further defer notifications to platform
+        clients.
+        This patch atempts to straightline this flow by handling the
+        ChildrenChanged notifications in AXObjectCache.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::textChanged):
+        (WebCore::AXObjectCache::handleChildrenChanged):
+        The name indicates that this is the actual handler for the notification
+        as opposed as the other childrenChanged(...) methods that just queue
+        the notifications for a later time.
+
+        (WebCore::AXObjectCache::childrenChanged):
+        (WebCore::AXObjectCache::notificationPostTimerFired):
+        (WebCore::AXObjectCache::handleAriaRoleChanged):
+        (WebCore::AXObjectCache::recomputeIsIgnored):
+        (WebCore::AXObjectCache::performDeferredCacheUpdate):
+        * accessibility/AXObjectCache.h:
+        * accessibility/AccessibilityMenuList.cpp:
+        (WebCore::AccessibilityMenuList::childrenChanged):
+        Deleted, now handled in AXObjectCache::handleChildrenChanged.
+        * accessibility/AccessibilityMenuList.h:
+        * accessibility/AccessibilityMenuListPopup.cpp:
+        (WebCore::AccessibilityMenuListPopup::handleChildrenChanged):
+        (WebCore::AccessibilityMenuListPopup::childrenChanged):
+        Renamed handleChildrenChanged. It is the only AXObject subclass that
+        still has this method to update its children. It does not post or
+        schedule any platform client notification.
+
+        * accessibility/AccessibilityMenuListPopup.h:
+        * accessibility/AccessibilityNodeObject.cpp:
+        (WebCore::AccessibilityNodeObject::updateAccessibilityRole):
+        (WebCore::AccessibilityNodeObject::childrenChanged): Deleted.
+        * accessibility/AccessibilityNodeObject.h:
+        * accessibility/AccessibilityObject.cpp:
+        (WebCore::AccessibilityObject::hasIgnoredValueChanged):
+        (WebCore::AccessibilityObject::notifyIfIgnoredValueChanged):
+        Renamed hasIgnoredValueChanged since the actual notifications are posted
+        in AXObjectCache.
+
+        * accessibility/AccessibilityObject.h:
+        (WebCore::AccessibilityObject::updateAccessibilityRole):
+        * accessibility/AccessibilityObjectInterface.h:
+        Several methods can now be removed from the AXCoreObject interface since
+        they are internal to the AXObject class hierarchy.
+
+        * accessibility/AccessibilityTable.cpp:
+        (WebCore::AccessibilityTable::addChildren):
+        * accessibility/isolatedtree/AXIsolatedObject.cpp:
+        Now able to delete several unnecessary methods from the isolated objects.
+        (WebCore::AXIsolatedObject::childrenChanged): Deleted.
+        (WebCore::AXIsolatedObject::updateAccessibilityRole): Deleted.
+        (WebCore::AXIsolatedObject::lastKnownIsIgnoredValue): Deleted.
+        (WebCore::AXIsolatedObject::setLastKnownIsIgnoredValue): Deleted.
+        (WebCore::AXIsolatedObject::notifyIfIgnoredValueChanged): Deleted.
+        * accessibility/isolatedtree/AXIsolatedObject.h:
+
 2021-10-31  Cameron McCormack  <[email protected]>
 
         Change some bitwise OR operators to logical OR

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -988,8 +988,8 @@
 
     postNotification(object, object->document(), AXTextChanged);
 
-    if (object->parentObjectIfExists())
-        object->notifyIfIgnoredValueChanged();
+    if (object->parentObjectIfExists() && object->hasIgnoredValueChanged())
+        childrenChanged(object->parentObject());
 }
 
 void AXObjectCache::updateCacheAfterNodeIsAttached(Node* node)
@@ -999,6 +999,53 @@
     get(node);
 }
 
+void AXObjectCache::handleChildrenChanged(AccessibilityObject& object)
+{
+    // Handle MenuLists and MenuListPopups as special cases.
+    if (is<AccessibilityMenuList>(object)) {
+        auto& children = object.children(false);
+        if (children.isEmpty())
+            return;
+
+        ASSERT(children.size() == 1 && is<AccessibilityObject>(*children[0]));
+        handleChildrenChanged(downcast<AccessibilityObject>(*children[0]));
+    } else if (is<AccessibilityMenuListPopup>(object)) {
+        downcast<AccessibilityMenuListPopup>(object).handleChildrenChanged();
+        return;
+    }
+
+    // This method is meant as a quick way of marking a portion of the accessibility tree dirty.
+    if (!object.node() && !object.renderer())
+        return;
+
+    postNotification(&object, object.document(), AXChildrenChanged);
+
+    // Should make the subtree dirty so that everything below will be updated correctly.
+    object.setNeedsToUpdateSubtree();
+
+    // Go up the existing ancestors chain and fire the appropriate notifications.
+    bool shouldUpdateParent = true;
+    for (auto* parent = &object; parent; parent = parent->parentObjectIfExists()) {
+        if (shouldUpdateParent)
+            parent->setNeedsToUpdateChildren();
+
+        // If this object supports ARIA live regions, then notify AT of changes.
+        // This notification need to be sent even when the screen reader has not accessed this live region since the last update.
+        // Sometimes this function can be called many times within a short period of time, leading to posting too many AXLiveRegionChanged notifications.
+        // To fix this, we use a timer to make sure we only post one notification for the children changes within a pre-defined time interval.
+        if (parent->supportsLiveRegion())
+            postLiveRegionChangeNotification(parent);
+
+        // If this object is an ARIA text control, notify that its value changed.
+        if (parent->isNonNativeTextControl()) {
+            postNotification(parent, parent->document(), AXValueChanged);
+
+            // Do not let any ancestor of an editable object update its children.
+            shouldUpdateParent = false;
+        }
+    }
+}
+
 void AXObjectCache::handleMenuOpened(Node* node)
 {
     if (!node || !node->renderer() || !nodeHasRole(node, "menu"))
@@ -1029,7 +1076,8 @@
     if (newChild)
         m_deferredChildrenChangedNodeList.add(newChild);
 
-    childrenChanged(get(node));
+    if (auto* object = get(node))
+        m_deferredChildrenChangedList.add(object);
 }
 
 void AXObjectCache::childrenChanged(RenderObject* renderer, RenderObject* newChild)
@@ -1040,15 +1088,14 @@
     if (newChild && newChild->node())
         m_deferredChildrenChangedNodeList.add(newChild->node());
 
-    childrenChanged(get(renderer));
+    if (auto* object = get(renderer))
+        m_deferredChildrenChangedList.add(object);
 }
 
-void AXObjectCache::childrenChanged(AXCoreObject* obj)
+void AXObjectCache::childrenChanged(AccessibilityObject* object)
 {
-    if (!obj)
-        return;
-
-    m_deferredChildrenChangedList.add(obj);
+    if (object)
+        m_deferredChildrenChangedList.add(object);
 }
 
 void AXObjectCache::notificationPostTimerFired()
@@ -1095,13 +1142,15 @@
         }
 
         if (note.second == AXChildrenChanged && note.first->parentObjectIfExists()
-            && note.first->lastKnownIsIgnoredValue() != note.first->accessibilityIsIgnored())
-            childrenChanged(note.first->parentObject());
+            && downcast<AccessibilityObject>(*note.first).lastKnownIsIgnoredValue() != note.first->accessibilityIsIgnored())
+            childrenChanged(downcast<AccessibilityObject>(note.first->parentObject()));
 
         notificationsToPost.append(note);
     }
 
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+    // FIXME: this updateIsolatedTree here may be premature in some cases.
+    // E.g., if the childrenChanged above is hit, we should updateIsolatedTree after performDeferredCacheUpdate.
     updateIsolatedTree(notificationsToPost);
 #endif
 
@@ -1718,14 +1767,15 @@
     stopCachingComputedObjectAttributes();
 
     // Don't make an AX object unless it's needed
-    if (auto* obj = get(node)) {
-        obj->updateAccessibilityRole();
+    if (auto* object = get(node)) {
+        object->updateAccessibilityRole();
 
+        if (object->hasIgnoredValueChanged())
+            childrenChanged(object->parentObject());
+
 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-        updateIsolatedTree(obj, AXObjectCache::AXAriaRoleChanged);
+        updateIsolatedTree(object, AXObjectCache::AXAriaRoleChanged);
 #endif
-
-        obj->notifyIfIgnoredValueChanged();
     }
 }
 
@@ -1864,14 +1914,18 @@
 
 void AXObjectCache::recomputeIsIgnored(RenderObject* renderer)
 {
-    if (AccessibilityObject* obj = get(renderer))
-        obj->notifyIfIgnoredValueChanged();
+    if (auto* object = get(renderer)) {
+        if (object->hasIgnoredValueChanged())
+            childrenChanged(object->parentObject());
+    }
 }
 
 void AXObjectCache::recomputeIsIgnored(Node* node)
 {
-    if (AccessibilityObject* obj = get(node))
-        obj->notifyIfIgnoredValueChanged();
+    if (auto* object = get(node)) {
+        if (object->hasIgnoredValueChanged())
+            childrenChanged(object->parentObject());
+    }
 }
 
 void AXObjectCache::startCachingComputedObjectAttributesUntilTreeMutates()
@@ -3166,10 +3220,12 @@
     // If there's a pending layout, let the layout trigger the AX update.
     if (!document().view() || document().view()->needsLayout())
         return;
-    
+
     performDeferredCacheUpdate();
+    // FIXME: need to update the isolated tree after the above cache update.
+    // This is most likely the cause of problems with the isolated tree updates..
 }
-    
+
 void AXObjectCache::performDeferredCacheUpdate()
 {
     AXTRACE("AXObjectCache::performDeferredCacheUpdate");
@@ -3185,7 +3241,7 @@
     m_deferredChildrenChangedNodeList.clear();
 
     for (auto& child : m_deferredChildrenChangedList)
-        child->childrenChanged();
+        handleChildrenChanged(*child);
     m_deferredChildrenChangedList.clear();
 
     for (auto* node : m_deferredTextChangedList)

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AXObjectCache.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -184,7 +184,7 @@
 public:
     void childrenChanged(Node*, Node* newChild = nullptr);
     void childrenChanged(RenderObject*, RenderObject* newChild = nullptr);
-    void childrenChanged(AXCoreObject*);
+    void childrenChanged(AccessibilityObject*);
     void checkedStateChanged(Node*);
     // Called when a node has just been attached, so we can make sure we have the right subclass of AccessibilityObject.
     void updateCacheAfterNodeIsAttached(Node*);
@@ -461,6 +461,7 @@
     bool enqueuePasswordValueChangeNotification(AccessibilityObject*);
     void passwordNotificationPostTimerFired();
 
+    void handleChildrenChanged(AccessibilityObject&);
     void handleMenuOpened(Node*);
     void handleLiveRegionCreated(Node*);
     void handleMenuItemSelected(Node*);
@@ -519,7 +520,7 @@
     WeakHashSet<Element> m_deferredRecomputeIsIgnoredList;
     ListHashSet<Node*> m_deferredTextChangedList;
     WeakHashSet<Element> m_deferredSelectedChildredChangedList;
-    ListHashSet<RefPtr<AXCoreObject>> m_deferredChildrenChangedList;
+    ListHashSet<RefPtr<AccessibilityObject>> m_deferredChildrenChangedList;
     ListHashSet<Node*> m_deferredChildrenChangedNodeList;
     WeakHashSet<Element> m_deferredModalChangedList;
     WeakHashSet<Element> m_deferredMenuListChange;

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -86,15 +86,6 @@
     list->addChildren();
 }
 
-void AccessibilityMenuList::childrenChanged()
-{
-    if (m_children.isEmpty())
-        return;
-
-    ASSERT(m_children.size() == 1);
-    m_children[0]->childrenChanged();
-}
-
 bool AccessibilityMenuList::isCollapsed() const
 {
 #if !PLATFORM(IOS_FAMILY)

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuList.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuList.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuList.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -48,7 +48,6 @@
     bool canSetFocusAttribute() const override;
 
     void addChildren() override;
-    void childrenChanged() override;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -104,7 +104,7 @@
     }
 }
 
-void AccessibilityMenuListPopup::childrenChanged()
+void AccessibilityMenuListPopup::handleChildrenChanged()
 {
     AXObjectCache* cache = axObjectCache();
     for (size_t i = m_children.size(); i > 0 ; --i) {
@@ -114,7 +114,7 @@
             cache->remove(child->objectID());
         }
     }
-    
+
     m_children.clear();
     m_childrenInitialized = false;
     addChildren();

Modified: trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -34,6 +34,7 @@
 class HTMLElement;
 
 class AccessibilityMenuListPopup final : public AccessibilityMockObject {
+    friend class AXObjectCache;
 public:
     static Ref<AccessibilityMenuListPopup> create() { return adoptRef(*new AccessibilityMenuListPopup); }
 
@@ -53,7 +54,7 @@
     bool isVisible() const override;
     bool press() override;
     void addChildren() override;
-    void childrenChanged() override;
+    void handleChildrenChanged();
     bool computeAccessibilityIsIgnored() const override;
 
     AccessibilityMenuListOption* menuListOptionAccessibilityObject(HTMLElement*) const;

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -116,61 +116,11 @@
     m_node = nullptr;
 }
 
-void AccessibilityNodeObject::childrenChanged()
-{
-    // This method is meant as a quick way of marking a portion of the accessibility tree dirty.
-    if (!node() && !renderer())
-        return;
-
-    AXObjectCache* cache = axObjectCache();
-    if (!cache)
-        return;
-    cache->postNotification(this, document(), AXObjectCache::AXChildrenChanged);
-    
-    // Should make the sub tree dirty so that everything below will be updated correctly.
-    this->setNeedsToUpdateSubtree();
-    bool shouldStopUpdatingParent = false;
-
-    // Go up the accessibility parent chain, but only if the element already exists. This method is
-    // called during render layouts, minimal work should be done. 
-    // If AX elements are created now, they could interrogate the render tree while it's in a funky state.
-    // At the same time, process ARIA live region changes.
-    for (AccessibilityObject* parent = this; parent; parent = parent->parentObjectIfExists()) {
-        if (!shouldStopUpdatingParent)
-            parent->setNeedsToUpdateChildren();
-        
-
-        // These notifications always need to be sent because screenreaders are reliant on them to perform. 
-        // In other words, they need to be sent even when the screen reader has not accessed this live region since the last update.
-
-        // If this element supports ARIA live regions, then notify the AT of changes.
-        // Sometimes this function can be called many times within a short period of time, leading to posting too many AXLiveRegionChanged
-        // notifications. To fix this, we used a timer to make sure we only post one notification for the children changes within a pre-defined
-        // time interval.
-        if (parent->supportsLiveRegion())
-            cache->postLiveRegionChangeNotification(parent);
-        
-        // If this element is an ARIA text control, notify the AT of changes.
-        if (parent->isNonNativeTextControl()) {
-            cache->postNotification(parent, parent->document(), AXObjectCache::AXValueChanged);
-            
-            // Do not let the parent that's above the editable ancestor update its children
-            // since we already notify the AT of changes.
-            shouldStopUpdatingParent = true;
-        }
-    }
-}
-
 void AccessibilityNodeObject::updateAccessibilityRole()
 {
-    bool ignoredStatus = accessibilityIsIgnored();
     m_role = determineAccessibilityRole();
-    
-    // The AX hierarchy only needs to be updated if the ignored status of an element has changed.
-    if (ignoredStatus != accessibilityIsIgnored())
-        childrenChanged();
 }
-    
+
 AccessibilityObject* AccessibilityNodeObject::firstChild() const
 {
     if (!node())

Modified: trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityNodeObject.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -131,7 +131,6 @@
     AccessibilityObject* parentObject() const override;
     AccessibilityObject* parentObjectIfExists() const override;
 
-    void childrenChanged() override;
     void updateAccessibilityRole() override;
 
     void increment() override;

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -3257,14 +3257,14 @@
     m_lastKnownIsIgnoredValue = isIgnored ? AccessibilityObjectInclusion::IgnoreObject : AccessibilityObjectInclusion::IncludeObject;
 }
 
-void AccessibilityObject::notifyIfIgnoredValueChanged()
+bool AccessibilityObject::hasIgnoredValueChanged()
 {
     bool isIgnored = accessibilityIsIgnored();
     if (lastKnownIsIgnoredValue() != isIgnored) {
-        if (AXObjectCache* cache = axObjectCache())
-            cache->childrenChanged(parentObject());
         setLastKnownIsIgnoredValue(isIgnored);
+        return true;
     }
+    return false;
 }
 
 bool AccessibilityObject::pressedIsPresent() const

Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityObject.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -487,8 +487,7 @@
     void increment() override { }
     void decrement() override { }
 
-    void childrenChanged() override { }
-    void updateAccessibilityRole() override { }
+    virtual void updateAccessibilityRole() { }
     const AccessibilityChildrenVector& children(bool updateChildrenIfNeeded = true) override;
     void addChildren() override { }
     void addChild(AXCoreObject*, DescendIfIgnored = DescendIfIgnored::Yes) override;
@@ -647,12 +646,10 @@
     IntRect scrollVisibleContentRect() const override;
     void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const override;
 
-    bool lastKnownIsIgnoredValue() override;
-    void setLastKnownIsIgnoredValue(bool) override;
+    bool lastKnownIsIgnoredValue();
+    void setLastKnownIsIgnoredValue(bool);
+    bool hasIgnoredValueChanged();
 
-    // Fires a children changed notification on the parent if the isIgnored value changed.
-    void notifyIfIgnoredValueChanged() override;
-
     // All math elements return true for isMathElement().
     bool isMathElement() const override { return false; }
     bool isMathFraction() const override { return false; }

Modified: trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityObjectInterface.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -1234,9 +1234,6 @@
     virtual void increment() = 0;
     virtual void decrement() = 0;
 
-    virtual void childrenChanged() = 0;
-    virtual void updateAccessibilityRole() = 0;
-
     virtual const AccessibilityChildrenVector& children(bool updateChildrenIfNeeded = true) = 0;
 
     enum class DescendIfIgnored : uint8_t {
@@ -1391,12 +1388,6 @@
     virtual IntRect scrollVisibleContentRect() const = 0;
     virtual void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const = 0;
 
-    virtual bool lastKnownIsIgnoredValue() = 0;
-    virtual void setLastKnownIsIgnoredValue(bool) = 0;
-
-    // Fires a children changed notification on the parent if the isIgnored value changed.
-    virtual void notifyIfIgnoredValueChanged() = 0;
-
     // All math elements return true for isMathElement().
     virtual bool isMathElement() const = 0;
     virtual bool isMathFraction() const = 0;

Modified: trunk/Source/WebCore/accessibility/AccessibilityTable.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/AccessibilityTable.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/AccessibilityTable.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -429,7 +429,7 @@
     // see bug: https://bugs.webkit.org/show_bug.cgi?id=147001
     for (const auto& row : m_rows) {
         for (const auto& cell : row->children())
-            cell->updateAccessibilityRole();
+            downcast<AccessibilityObject>(*cell).updateAccessibilityRole();
     }
 }
 

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp (285091 => 285092)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.cpp	2021-10-31 13:41:34 UTC (rev 285092)
@@ -2127,16 +2127,6 @@
     return nullptr;
 }
 
-void AXIsolatedObject::childrenChanged()
-{
-    ASSERT_NOT_REACHED();
-}
-
-void AXIsolatedObject::updateAccessibilityRole()
-{
-    ASSERT_NOT_REACHED();
-}
-
 void AXIsolatedObject::addChildren()
 {
     ASSERT_NOT_REACHED();
@@ -2312,22 +2302,6 @@
     ASSERT_NOT_REACHED();
 }
 
-bool AXIsolatedObject::lastKnownIsIgnoredValue()
-{
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
-void AXIsolatedObject::setLastKnownIsIgnoredValue(bool)
-{
-    ASSERT_NOT_REACHED();
-}
-
-void AXIsolatedObject::notifyIfIgnoredValueChanged()
-{
-    ASSERT_NOT_REACHED();
-}
-
 bool AXIsolatedObject::isMathScriptObject(AccessibilityMathScriptObjectType) const
 {
     ASSERT_NOT_REACHED();

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h (285091 => 285092)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h	2021-10-31 08:49:17 UTC (rev 285091)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedObject.h	2021-10-31 13:41:34 UTC (rev 285092)
@@ -604,8 +604,6 @@
     Document* topDocument() const override;
     ScrollView* scrollView() const override;
     ScrollView* scrollViewAncestor() const override;
-    void childrenChanged() override;
-    void updateAccessibilityRole() override;
     void addChildren() override;
     void addChild(AXCoreObject*, DescendIfIgnored = DescendIfIgnored::Yes) override;
     void insertChild(AXCoreObject*, unsigned, DescendIfIgnored = DescendIfIgnored::Yes) override;
@@ -637,9 +635,6 @@
     IntSize scrollContentsSize() const override;
     IntRect scrollVisibleContentRect() const override;
     void scrollToMakeVisible(const ScrollRectToVisibleOptions&) const override;
-    bool lastKnownIsIgnoredValue() override;
-    void setLastKnownIsIgnoredValue(bool) override;
-    void notifyIfIgnoredValueChanged() override;
     bool isMathScriptObject(AccessibilityMathScriptObjectType) const override;
     bool isMathMultiscriptObject(AccessibilityMathMultiscriptObjectType) const override;
     bool isAXHidden() const override;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to