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

Changeset 268830 in webkit


Ignore:
Timestamp:
Oct 21, 2020, 3:15:45 PM (6 years ago)
Author:
Alan Coon
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

Location:
branches/safari-610-branch/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-610-branch/Source/WebCore/ChangeLog

    r268540 r268830  
     12020-10-21  Russell Epstein  <repstein@apple.com>
     2
     3        Cherry-pick r266787. rdar://problem/70541715
     4
     5    AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
     6    https://bugs.webkit.org/show_bug.cgi?id=216309
     7    <rdar://problem/68108824>
     8   
     9    Reviewed by Chris Fleizach.
     10   
     11    MenuList notifications were posted synchronously which triggers a DOM
     12    layout and style update in the middle of an ongoing DOM mutation update.
     13    This is unnecessary and, furthermore, causes crashes since the DOM
     14    layout update cannot be re-entrant. This change makes these
     15    notifications asynchronous.
     16   
     17    * accessibility/AccessibilityMenuList.cpp:
     18    (WebCore::AccessibilityMenuList::didUpdateActiveOption):
     19    * accessibility/AccessibilityMenuListPopup.cpp:
     20    (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
     21   
     22   
     23    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@266787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     24
     25    2020-09-09  Andres Gonzalez  <andresg_22@apple.com>
     26
     27            AccessibilityMenuList and MenuListPopup notifications need to be posted asynchronously.
     28            https://bugs.webkit.org/show_bug.cgi?id=216309
     29            <rdar://problem/68108824>
     30
     31            Reviewed by Chris Fleizach.
     32
     33            MenuList notifications were posted synchronously which triggers a DOM
     34            layout and style update in the middle of an ongoing DOM mutation update.
     35            This is unnecessary and, furthermore, causes crashes since the DOM
     36            layout update cannot be re-entrant. This change makes these
     37            notifications asynchronous.
     38
     39            * accessibility/AccessibilityMenuList.cpp:
     40            (WebCore::AccessibilityMenuList::didUpdateActiveOption):
     41            * accessibility/AccessibilityMenuListPopup.cpp:
     42            (WebCore::AccessibilityMenuListPopup::didUpdateActiveOption):
     43
    1442020-10-15  Russell Epstein  <repstein@apple.com>
    245
  • branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuList.cpp

    r265514 r268830  
    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
  • branches/safari-610-branch/Source/WebCore/accessibility/AccessibilityMenuListPopup.cpp

    r265514 r268830  
    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.