⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 266787 in webkit


Ignore:
Timestamp:
Sep 9, 2020, 10:42:00 AM (6 years ago)
Author:
Andres Gonzalez
Message:

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):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r266783 r266787  
     12020-09-09  Andres Gonzalez  <andresg_22@apple.com>
     2
     3        AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
     4        https://bugs.webkit.org/show_bug.cgi?id=216309
     5        <rdar://problem/68108824>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        MenuList notifications were posted synchronously which triggers a DOM
     10        layout and style update in the middle of an ongoing DOM mutation update.
     11        This is unnecessary and, furthermore, causes crashes since the DOM
     12        layout update cannot be re-entrant. This change makes these
     13        notifications asynchronous.
     14
     15        * accessibility/AccessibilityMenuList.cpp:
     16        (WebCore::AccessibilityMenuList::didUpdateActiveOption):
     17        * accessibility/AccessibilityMenuListPopup.cpp:
     18        (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
     19
    1202020-09-09  Zalan Bujtas  <zalan@apple.com>
    221
  • trunk/Source/WebCore/accessibility/AccessibilityMenuList.cpp

    r265514 r266787  
    118118{
    119119    Ref<Document> document(m_renderer->document());
    120     AXObjectCache* cache = document->axObjectCache();
    121120
    122121    const auto& childObjects = children();
     
    137136    }
    138137
    139     cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostSynchronously);
     138    if (auto* cache = document->axObjectCache())
     139        cache->postNotification(this, document.ptr(), AXObjectCache::AXMenuListValueChanged, TargetElement, PostAsynchronously);
    140140}
    141141
  • trunk/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp

    r265514 r266787  
    125125    ASSERT_ARG(optionIndex, optionIndex < static_cast<int>(m_children.size()));
    126126
    127     AXObjectCache* cache = axObjectCache();
    128127    RefPtr<AXCoreObject> child = m_children[optionIndex].get();
    129128
    130     cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostSynchronously);
    131     cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostSynchronously);
     129    if (auto* cache = axObjectCache()) {
     130        cache->postNotification(child.get(), document(), AXObjectCache::AXFocusedUIElementChanged, TargetElement, PostAsynchronously);
     131        cache->postNotification(child.get(), document(), AXObjectCache::AXMenuListItemSelected, TargetElement, PostAsynchronously);
     132    }
    132133}
    133134
Note: See TracChangeset for help on using the changeset viewer.