[ATK] Defer the emision of AtkObject::children-changed signal after layout is done
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 08:01:01 +0000 (08:01 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 10 Apr 2019 08:01:01 +0000 (08:01 +0000)
commit97e7af0cd99308ccd245d8b477aa4d2a536b2303
tree5c43c1954cd9bdd849c366c9b4c3a421bfccd55a
parentb54a18dc07bfac294a95e1ae6b4638f86c66c7e6
[ATK] Defer the emision of AtkObject::children-changed signal after layout is done
https://bugs.webkit.org/show_bug.cgi?id=187948

Reviewed by Michael Catanzaro.

Source/WebCore:

The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and
AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission
of the signal after the layout is done, to avoid other atk entry points from being called at that point, since
most of them update the backing store at the beginning.

Fixes: accessibility/children-changed-sends-notification.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate().
* accessibility/AXObjectCache.h:
* accessibility/atk/AXObjectCacheAtk.cpp:
(WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible.
(WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList.
(WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList.
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects
in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList.
* accessibility/ios/AXObjectCacheIOS.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/win/AXObjectCacheWin.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):
* accessibility/wpe/AXObjectCacheWPE.cpp:
(WebCore::AXObjectCache::platformPerformDeferredCacheUpdate):

LayoutTests:

Remove expectations of accessibility/children-changed-sends-notification.html that passes now.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244107 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/platform/gtk/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/accessibility/AXObjectCache.h
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
Source/WebCore/accessibility/wpe/AXObjectCacheWPE.cpp