Title: [268830] branches/safari-610-branch/Source/WebCore
Revision
268830
Author
[email protected]
Date
2020-10-21 15:15:45 -0700 (Wed, 21 Oct 2020)

Log Message

Cherry-pick r266787. rdar://problem/70541715

    AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
    https://bugs.webkit.org/show_bug.cgi?id=216309
    <rdar://problem/68108824>

    Reviewed by Chris Fleizach.

    MenuList notifications were posted synchronously which triggers a DOM
    layout and style update in the middle of an ongoing DOM mutation update.
    This is unnecessary and, furthermore, causes crashes since the DOM
    layout update cannot be re-entrant. This change makes these
    notifications asynchronous.

    * accessibility/AccessibilityMenuList.cpp:
    (WebCore::AccessibilityMenuList::didUpdateActiveOption):
    * accessibility/AccessibilityMenuListPopup.cpp:
    (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266787 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610-branch/Source/WebCore/ChangeLog (268829 => 268830)


--- branches/safari-610-branch/Source/WebCore/ChangeLog	2020-10-21 22:04:56 UTC (rev 268829)
+++ branches/safari-610-branch/Source/WebCore/ChangeLog	2020-10-21 22:15:45 UTC (rev 268830)
@@ -1,3 +1,46 @@
+2020-10-21  Russell Epstein  <[email protected]>
+
+        Cherry-pick r266787. rdar://problem/70541715
+
+    AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
+    https://bugs.webkit.org/show_bug.cgi?id=216309
+    <rdar://problem/68108824>
+    
+    Reviewed by Chris Fleizach.
+    
+    MenuList notifications were posted synchronously which triggers a DOM
+    layout and style update in the middle of an ongoing DOM mutation update.
+    This is unnecessary and, furthermore, causes crashes since the DOM
+    layout update cannot be re-entrant. This change makes these
+    notifications asynchronous.
+    
+    * accessibility/AccessibilityMenuList.cpp:
+    (WebCore::AccessibilityMenuList::didUpdateActiveOption):
+    * accessibility/AccessibilityMenuListPopup.cpp:
+    (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-09-09  Andres Gonzalez  <[email protected]>
+
+            AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
+            https://bugs.webkit.org/show_bug.cgi?id=216309
+            <rdar://problem/68108824>
+
+            Reviewed by Chris Fleizach.
+
+            MenuList notifications were posted synchronously which triggers a DOM
+            layout and style update in the middle of an ongoing DOM mutation update.
+            This is unnecessary and, furthermore, causes crashes since the DOM
+            layout update cannot be re-entrant. This change makes these
+            notifications asynchronous.
+
+            * accessibility/AccessibilityMenuList.cpp:
+            (WebCore::AccessibilityMenuList::didUpdateActiveOption):
+            * accessibility/AccessibilityMenuListPopup.cpp:
+            (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
+
 2020-10-15  Russell Epstein  <[email protected]>
 
         Apply patch. rdar://problem/70321689

Modified: branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuList.cpp (268829 => 268830)


--- branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2020-10-21 22:04:56 UTC (rev 268829)
+++ branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuList.cpp	2020-10-21 22:15:45 UTC (rev 268830)
@@ -117,7 +117,6 @@
 void AccessibilityMenuList::didUpdateActiveOption(int optionIndex)
 {
     Ref<Document> document(m_renderer->document());
-    AXObjectCache* cache = document->axObjectCache();
 
     const auto& childObjects = children();
     if (!childObjects.isEmpty()) {
@@ -136,7 +135,8 @@
             downcast<AccessibilityMenuListPopup>(*childObjects[0]).didUpdateActiveOption(optionIndex);
     }
 
-    cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostSynchronously);
+    if (auto* cache = document->axObjectCache())
+        cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostAsynchronously);
 }
 
 } // namespace WebCore

Modified: branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp (268829 => 268830)


--- branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2020-10-21 22:04:56 UTC (rev 268829)
+++ branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp	2020-10-21 22:15:45 UTC (rev 268830)
@@ -124,11 +124,12 @@
     ASSERT_ARG(optionIndex, optionIndex >= 0);
     ASSERT_ARG(optionIndex, optionIndex < static_cast<int>(m_children.size()));
 
-    AXObjectCache* cache = axObjectCache();
     RefPtr<AXCoreObject> child = m_children[optionIndex].get();
 
-    cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostSynchronously);
-    cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostSynchronously);
+    if (auto* cache = axObjectCache()) {
+        cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostAsynchronously);
+        cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostAsynchronously);
+    }
 }
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to