Changeset 244107 in webkit
- Timestamp:
- Apr 10, 2019, 1:01:01 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/platform/gtk/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AXObjectCache.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AXObjectCache.h (modified) (3 diffs)
-
Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp (modified) (3 diffs)
-
Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm (modified) (1 diff)
-
Source/WebCore/accessibility/mac/AXObjectCacheMac.mm (modified) (1 diff)
-
Source/WebCore/accessibility/win/AXObjectCacheWin.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/wpe/AXObjectCacheWPE.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r244105 r244107 1 2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [ATK] Defer the emision of AtkObject::children-changed signal after layout is done 4 https://bugs.webkit.org/show_bug.cgi?id=187948 5 6 Reviewed by Michael Catanzaro. 7 8 Remove expectations of accessibility/children-changed-sends-notification.html that passes now. 9 10 * platform/gtk/TestExpectations: 11 1 12 2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 13 -
trunk/LayoutTests/platform/gtk/TestExpectations
r244105 r244107 3213 3213 3214 3214 webkit.org/b/161583 accessibility/auto-fill-types.html [ Failure ] 3215 webkit.org/b/161584 accessibility/children-changed-sends-notification.html [ Failure Crash ]3216 3215 3217 3216 webkit.org/b/161587 css3/font-feature-settings-rendering.html [ ImageOnlyFailure ] -
trunk/Source/WebCore/ChangeLog
r244105 r244107 1 2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [ATK] Defer the emision of AtkObject::children-changed signal after layout is done 4 https://bugs.webkit.org/show_bug.cgi?id=187948 5 6 Reviewed by Michael Catanzaro. 7 8 The signal AtkObject::children-changed is emitted from AXObjectCache::attachWrapper() and 9 AXObjectCache::detachWrapper(). Both can be called in the middle of a layout, so we need to defer the emission 10 of the signal after the layout is done, to avoid other atk entry points from being called at that point, since 11 most of them update the backing store at the beginning. 12 13 Fixes: accessibility/children-changed-sends-notification.html 14 15 * accessibility/AXObjectCache.cpp: 16 (WebCore::AXObjectCache::performDeferredCacheUpdate): Call platformPerformDeferredCacheUpdate(). 17 * accessibility/AXObjectCache.h: 18 * accessibility/atk/AXObjectCacheAtk.cpp: 19 (WebCore::wrapperParent): Helper to get the AtkObject parent of a given WebKitAccessible. 20 (WebCore::AXObjectCache::detachWrapper): Add wrapper to m_deferredDetachedWrapperList. 21 (WebCore::AXObjectCache::attachWrapper): Add object to m_deferredAttachedWrapperObjectList. 22 (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): Emit AtkObject::children-changed::add for objects 23 in m_deferredAttachedWrapperObjectList and AtkObject::children-changed::remove for wrappers in m_deferredDetachedWrapperList. 24 * accessibility/ios/AXObjectCacheIOS.mm: 25 (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): 26 * accessibility/mac/AXObjectCacheMac.mm: 27 (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): 28 * accessibility/win/AXObjectCacheWin.cpp: 29 (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): 30 * accessibility/wpe/AXObjectCacheWPE.cpp: 31 (WebCore::AXObjectCache::platformPerformDeferredCacheUpdate): 32 1 33 2019-04-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 34 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r243163 r244107 2920 2920 handleFocusedUIElementChanged(deferredFocusedChangeContext.first, deferredFocusedChangeContext.second); 2921 2921 m_deferredFocusedNodeChange.clear(); 2922 2923 platformPerformDeferredCacheUpdate(); 2922 2924 } 2923 2925 -
trunk/Source/WebCore/accessibility/AXObjectCache.h
r241321 r244107 40 40 #include <wtf/ListHashSet.h> 41 41 #include <wtf/RefPtr.h> 42 43 #if PLATFORM(GTK) 44 #include <wtf/glib/GRefPtr.h> 45 #endif 42 46 43 47 namespace WebCore { … … 356 360 void platformHandleFocusedUIElementChanged(Node* oldFocusedNode, Node* newFocusedNode); 357 361 362 void platformPerformDeferredCacheUpdate(); 363 358 364 #if PLATFORM(COCOA) 359 365 void postTextStateChangePlatformNotification(AccessibilityObject*, const AXTextStateChangeIntent&, const VisibleSelection&); … … 477 483 bool m_isSynchronizingSelection { false }; 478 484 bool m_performingDeferredCacheUpdate { false }; 485 486 #if PLATFORM(GTK) 487 ListHashSet<RefPtr<AccessibilityObject>> m_deferredAttachedWrapperObjectList; 488 ListHashSet<GRefPtr<AccessibilityObjectWrapper>> m_deferredDetachedWrapperList; 489 #endif 479 490 }; 480 491 -
trunk/Source/WebCore/accessibility/atk/AXObjectCacheAtk.cpp
r243970 r244107 37 37 namespace WebCore { 38 38 39 static AtkObject* wrapperParent(WebKitAccessible* wrapper) 40 { 41 // Look for the right object to emit the signal from, but using the implementation 42 // of atk_object_get_parent from AtkObject class (which uses a cached pointer if set) 43 // since the accessibility hierarchy in WebCore will no longer be navigable. 44 gpointer webkitAccessibleClass = g_type_class_peek_parent(WEBKIT_ACCESSIBLE_GET_CLASS(wrapper)); 45 gpointer atkObjectClass = g_type_class_peek_parent(webkitAccessibleClass); 46 AtkObject* atkParent = ATK_OBJECT_CLASS(atkObjectClass)->get_parent(ATK_OBJECT(wrapper)); 47 // We don't want to emit any signal from an object outside WebKit's world. 48 return WEBKIT_IS_ACCESSIBLE(atkParent) ? atkParent : nullptr; 49 } 50 39 51 void AXObjectCache::detachWrapper(AccessibilityObject* obj, AccessibilityDetachmentType detachmentType) 40 52 { … … 44 56 // If an object is being detached NOT because of the AXObjectCache being destroyed, 45 57 // then it's being removed from the accessibility tree and we should emit a signal. 46 if (detachmentType != AccessibilityDetachmentType::CacheDestroyed) { 47 if (obj->document()) { 48 // Look for the right object to emit the signal from, but using the implementation 49 // of atk_object_get_parent from AtkObject class (which uses a cached pointer if set) 50 // since the accessibility hierarchy in WebCore will no longer be navigable. 51 gpointer webkitAccessibleClass = g_type_class_peek_parent(WEBKIT_ACCESSIBLE_GET_CLASS(wrapper)); 52 gpointer atkObjectClass = g_type_class_peek_parent(webkitAccessibleClass); 53 AtkObject* atkParent = ATK_OBJECT_CLASS(atkObjectClass)->get_parent(ATK_OBJECT(wrapper)); 54 55 // We don't want to emit any signal from an object outside WebKit's world. 56 if (WEBKIT_IS_ACCESSIBLE(atkParent)) { 57 // The accessibility hierarchy is already invalid, so the parent-children relationships 58 // in the AccessibilityObject tree are not there anymore, so we can't know the offset. 59 g_signal_emit_by_name(atkParent, "children-changed::remove", -1, wrapper); 60 } 61 } 62 } 58 if (detachmentType != AccessibilityDetachmentType::CacheDestroyed && obj->document() && wrapperParent(wrapper)) 59 m_deferredDetachedWrapperList.add(wrapper); 63 60 64 61 webkitAccessibleDetach(WEBKIT_ACCESSIBLE(wrapper)); … … 88 85 return; 89 86 90 // Don't emit the signal for objects whose parents won't be exposed directly. 91 AccessibilityObject* coreParent = obj->parentObjectUnignored(); 92 if (!coreParent || coreParent->accessibilityIsIgnoredByDefault()) 93 return; 94 95 // Look for the right object to emit the signal from. 96 auto* atkParent = coreParent->wrapper(); 97 if (!atkParent) 98 return; 99 100 size_t index = coreParent->children(false).find(obj); 101 g_signal_emit_by_name(atkParent, "children-changed::add", index != notFound ? index : -1, wrapper.get()); 87 m_deferredAttachedWrapperObjectList.add(obj); 88 } 89 90 void AXObjectCache::platformPerformDeferredCacheUpdate() 91 { 92 for (auto& coreObject : m_deferredAttachedWrapperObjectList) { 93 auto* wrapper = coreObject->wrapper(); 94 if (!wrapper) 95 continue; 96 97 // Don't emit the signal for objects whose parents won't be exposed directly. 98 auto* coreParent = coreObject->parentObjectUnignored(); 99 if (!coreParent || coreParent->accessibilityIsIgnoredByDefault()) 100 continue; 101 102 // Look for the right object to emit the signal from. 103 auto* atkParent = coreParent->wrapper(); 104 if (!atkParent) 105 continue; 106 107 size_t index = coreParent->children(false).find(coreObject); 108 g_signal_emit_by_name(atkParent, "children-changed::add", index != notFound ? index : -1, wrapper); 109 } 110 m_deferredAttachedWrapperObjectList.clear(); 111 112 for (auto& wrapper : m_deferredDetachedWrapperList) { 113 if (auto* atkParent = wrapperParent(wrapper.get())) { 114 // The accessibility hierarchy is already invalid, so the parent-children relationships 115 // in the AccessibilityObject tree are not there anymore, so we can't know the offset. 116 g_signal_emit_by_name(atkParent, "children-changed::remove", -1, wrapper.get()); 117 } 118 } 119 m_deferredDetachedWrapperList.clear(); 102 120 } 103 121 -
trunk/Source/WebCore/accessibility/ios/AXObjectCacheIOS.mm
r237266 r244107 136 136 { 137 137 } 138 138 139 void AXObjectCache::platformPerformDeferredCacheUpdate() 140 { 141 } 142 139 143 } 140 144 -
trunk/Source/WebCore/accessibility/mac/AXObjectCacheMac.mm
r242714 r244107 548 548 } 549 549 550 void AXObjectCache::platformPerformDeferredCacheUpdate() 551 { 552 } 553 550 554 } 551 555 -
trunk/Source/WebCore/accessibility/win/AXObjectCacheWin.cpp
r239551 r244107 184 184 } 185 185 186 void AXObjectCache::platformPerformDeferredCacheUpdate() 187 { 188 } 189 186 190 } // namespace WebCore -
trunk/Source/WebCore/accessibility/wpe/AXObjectCacheWPE.cpp
r237168 r244107 61 61 } 62 62 63 void AXObjectCache::platformPerformDeferredCacheUpdate() 64 { 65 notImplemented(); 66 } 67 63 68 } // namespace WebCore 64 69
Note:
See TracChangeset
for help on using the changeset viewer.