Title: [258780] trunk/Source/WebCore
Revision
258780
Author
[email protected]
Date
2020-03-20 12:56:49 -0700 (Fri, 20 Mar 2020)

Log Message

Isolated tree updates must happen after AXObject has finished handling notifications.
https://bugs.webkit.org/show_bug.cgi?id=209354

Reviewed by Chris Fleizach.

Isolated tree updates were happening in AXObjectCache::postNotification,
but that is too early because the AXObject tree is updated during
notificationPostTimerFired. Thus, moved the updates to after all
AXObject tree updates have been done.
In addition, fixed the check for replacement of the IsolatedObject in
AXIsolatedTree::applyPendingChanges, which now happens only if the old
and new objects have the same platform wrapper.

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::notificationPostTimerFired):
(WebCore::AXObjectCache::postNotification):
* accessibility/isolatedtree/AXIsolatedTree.cpp:
(WebCore::AXIsolatedTree::applyPendingChanges):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (258779 => 258780)


--- trunk/Source/WebCore/ChangeLog	2020-03-20 19:35:02 UTC (rev 258779)
+++ trunk/Source/WebCore/ChangeLog	2020-03-20 19:56:49 UTC (rev 258780)
@@ -1,5 +1,26 @@
 2020-03-20  Andres Gonzalez  <[email protected]>
 
+        Isolated tree updates must happen after AXObject has finished handling notifications.
+        https://bugs.webkit.org/show_bug.cgi?id=209354
+
+        Reviewed by Chris Fleizach.
+
+        Isolated tree updates were happening in AXObjectCache::postNotification,
+        but that is too early because the AXObject tree is updated during
+        notificationPostTimerFired. Thus, moved the updates to after all
+        AXObject tree updates have been done.
+        In addition, fixed the check for replacement of the IsolatedObject in
+        AXIsolatedTree::applyPendingChanges, which now happens only if the old
+        and new objects have the same platform wrapper.
+
+        * accessibility/AXObjectCache.cpp:
+        (WebCore::AXObjectCache::notificationPostTimerFired):
+        (WebCore::AXObjectCache::postNotification):
+        * accessibility/isolatedtree/AXIsolatedTree.cpp:
+        (WebCore::AXIsolatedTree::applyPendingChanges):
+
+2020-03-20  Andres Gonzalez  <[email protected]>
+
         Fix for retrieving focus in isolated tree mode.
         https://bugs.webkit.org/show_bug.cgi?id=209336
 

Modified: trunk/Source/WebCore/accessibility/AXObjectCache.cpp (258779 => 258780)


--- trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-03-20 19:35:02 UTC (rev 258779)
+++ trunk/Source/WebCore/accessibility/AXObjectCache.cpp	2020-03-20 19:56:49 UTC (rev 258780)
@@ -1053,10 +1053,14 @@
                 continue;
         }
         
-        postPlatformNotification(obj, notification);
-
         if (notification == AXChildrenChanged && obj->parentObjectIfExists() && obj->lastKnownIsIgnoredValue() != obj->accessibilityIsIgnored())
             childrenChanged(obj->parentObject());
+
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+        updateIsolatedTree(obj, notification);
+#endif
+
+        postPlatformNotification(obj, notification);
     }
 }
 
@@ -1129,16 +1133,17 @@
     if (!object)
         return;
 
-#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
-    updateIsolatedTree(object, notification);
-#endif
-
     if (postType == PostAsynchronously) {
         m_notificationsToPost.append(std::make_pair(object, notification));
         if (!m_notificationPostTimer.isActive())
             m_notificationPostTimer.startOneShot(0_s);
-    } else
+    } else {
+#if ENABLE(ACCESSIBILITY_ISOLATED_TREE)
+        updateIsolatedTree(object, notification);
+#endif
+
         postPlatformNotification(object, notification);
+    }
 }
 
 void AXObjectCache::checkedStateChanged(Node* node)

Modified: trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp (258779 => 258780)


--- trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp	2020-03-20 19:35:02 UTC (rev 258779)
+++ trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp	2020-03-20 19:56:49 UTC (rev 258780)
@@ -221,16 +221,19 @@
     }
 
     for (const auto& item : m_pendingAppends) {
+        ASSERT(item.m_isolatedObject->wrapper() || item.m_wrapper);
         AXID axID = item.m_isolatedObject->objectID();
         if (axID == InvalidAXID)
             continue;
 
-        if (m_readerThreadNodeMap.get(axID) != &item.m_isolatedObject.get()) {
-            // The new IsolatedObject is a replacement for an existing object
-            // as the result of an update. Thus detach the existing one before
-            // adding the new one.
-            if (auto object = nodeForID(axID))
-                object->detach(AccessibilityDetachmentType::ElementDestroyed);
+        if (auto object = m_readerThreadNodeMap.get(axID)) {
+            if (object != &item.m_isolatedObject.get()
+                && (object->wrapper() == item.m_wrapper || object->wrapper() == item.m_isolatedObject->wrapper())) {
+                // The new IsolatedObject is a replacement for an existing object
+                // as the result of an update. Thus detach the existing one before
+                // adding the new one.
+                object->detachWrapper(AccessibilityDetachmentType::ElementDestroyed);
+            }
             m_readerThreadNodeMap.remove(axID);
         }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to