Changeset 262073 in webkit
- Timestamp:
- May 22, 2020 2:03:59 PM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r262070 r262073 1 2020-05-22 Andres Gonzalez <andresg_22@apple.com> 2 3 Updates to the isolated tree must happen before posting notifications to clients. 4 https://bugs.webkit.org/show_bug.cgi?id=212266 5 6 Reviewed by Chris Fleizach. 7 8 Multiple tests. 9 10 In AXObjectCache::notificationPostTimerFired we were updating the 11 isolated tree after the notifications were posted to the platform 12 clients. This caused that in some cases when the client requested info 13 as the result of those notifications, the isolated tree was out-of-date. 14 In this patch updateIsolatedTree is called before notifying platform clients. 15 16 * accessibility/AXObjectCache.cpp: 17 (WebCore::AXObjectCache::notificationPostTimerFired): 18 (WebCore::AXObjectCache::postNotification): 19 (WebCore::AXObjectCache::postTextStateChangeNotification): 20 (WebCore::AXObjectCache::updateIsolatedTree): 21 1 22 2020-05-22 Sam Weinig <weinig@apple.com> 2 23 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r261832 r262073 1014 1014 void AXObjectCache::notificationPostTimerFired() 1015 1015 { 1016 AXTRACE("AXObjectCache::notificationPostTimerFired"); 1016 1017 // During LayoutTests, accessibility may be disabled between the time the notifications are queued and the timer fires. 1017 1018 // Thus check here and return if accessibility is disabled. … … 1029 1030 auto notifications = WTFMove(m_notificationsToPost); 1030 1031 1032 // Filter out the notifications that are not going to be posted to platform clients. 1033 Vector<std::pair<RefPtr<AXCoreObject>, AXNotification>> notificationsToPost; 1034 notificationsToPost.reserveCapacity(notifications.size()); 1031 1035 for (const auto& note : notifications) { 1032 A XCoreObject* obj = note.first.get();1033 if (! obj->objectID())1036 ASSERT(note.first); 1037 if (!note.first->objectID() || !note.first->axObjectCache()) 1034 1038 continue; 1035 1039 1036 if (!obj->axObjectCache())1037 continue;1038 1039 1040 #ifndef NDEBUG 1040 1041 // Make sure none of the render views are in the process of being layed out. 1041 1042 // Notifications should only be sent after the renderer has finished 1042 if (is<AccessibilityRenderObject>(* obj)) {1043 if (auto* renderer = downcast<AccessibilityRenderObject>(* obj).renderer())1043 if (is<AccessibilityRenderObject>(*note.first)) { 1044 if (auto* renderer = downcast<AccessibilityRenderObject>(*note.first).renderer()) 1044 1045 ASSERT(!renderer->view().frameView().layoutContext().layoutState()); 1045 1046 } 1046 1047 #endif 1047 1048 1048 AXNotification notification = note.second;1049 1050 1049 // Ensure that this menu really is a menu. We do this check here so that we don't have to create 1051 1050 // the axChildren when the menu is marked as opening. 1052 if (not ification== AXMenuOpened) {1053 obj->updateChildrenIfNecessary();1054 if ( obj->roleValue() != AccessibilityRole::Menu)1051 if (note.second == AXMenuOpened) { 1052 note.first->updateChildrenIfNecessary(); 1053 if (note.first->roleValue() != AccessibilityRole::Menu) 1055 1054 continue; 1056 1055 } 1057 1058 if (notification == AXChildrenChanged && obj->parentObjectIfExists() && obj->lastKnownIsIgnoredValue() != obj->accessibilityIsIgnored()) 1059 childrenChanged(obj->parentObject()); 1060 1061 postPlatformNotification(obj, notification); 1056 1057 if (note.second == AXChildrenChanged && note.first->parentObjectIfExists() 1058 && note.first->lastKnownIsIgnoredValue() != note.first->accessibilityIsIgnored()) 1059 childrenChanged(note.first->parentObject()); 1060 1061 notificationsToPost.append(note); 1062 1062 } 1063 1063 1064 1064 #if ENABLE(ACCESSIBILITY_ISOLATED_TREE) 1065 updateIsolatedTree(notifications );1065 updateIsolatedTree(notificationsToPost); 1066 1066 #endif 1067 1068 for (const auto& note : notificationsToPost) 1069 postPlatformNotification(note.first.get(), note.second); 1067 1070 } 1068 1071 … … 1388 1391 void AXObjectCache::postTextStateChangeNotification(AccessibilityObject* object, const AXTextStateChangeIntent& intent, const VisibleSelection& selection) 1389 1392 { 1393 AXTRACE("AXObjectCache::postTextStateChangeNotification"); 1390 1394 stopCachingComputedObjectAttributes(); 1391 1395 … … 1422 1426 void AXObjectCache::postTextStateChangeNotification(Node* node, AXTextEditType type, const String& text, const VisiblePosition& position) 1423 1427 { 1428 AXTRACE("AXObjectCache::postTextStateChangeNotification"); 1424 1429 if (!node || type == AXTextEditTypeUnknown) 1425 1430 return; … … 3139 3144 AXLOG(*this); 3140 3145 3141 if (!m_pageID )3146 if (!m_pageID || object.objectID() == InvalidAXID) 3142 3147 return; 3143 3148 … … 3149 3154 case AXCheckedStateChanged: 3150 3155 case AXSelectedTextChanged: 3151 case AXValueChanged: { 3152 if (object.objectID() != InvalidAXID) 3153 tree->updateNode(object); 3156 case AXValueChanged: 3157 tree->updateNode(object); 3154 3158 break; 3155 } 3159 case AXChildrenChanged: 3160 tree->updateChildren(object); 3161 break; 3156 3162 default: 3157 3163 break;
Note: See TracChangeset
for help on using the changeset viewer.