Changeset 263571 in webkit
- Timestamp:
- Jun 26, 2020 11:07:35 AM (4 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r263565 r263571 1 2020-06-26 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for crash in accessibility/roles-exposed.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=213648 5 6 Reviewed by Chris Fleizach. 7 8 LayoutTest: accessibility/roles-exposed.html. 9 10 - In layout tests, when AXObjectCache::notificationPostTimerFired is 11 triggered, and we try to update the isolated tree, some of the 12 underlying objects may already be gone. So this change ensure we don't 13 try to update an isolated object that corresponds to an already detached 14 live object. 15 16 * accessibility/AXObjectCache.cpp: 17 (WebCore::AXObjectCache::cacheAndInitializeWrapper): Sanity check. 18 * accessibility/AccessibilityListBox.cpp: 19 (WebCore::AccessibilityListBox::addChildren): m_renderer can be null 20 when trying to update the isolated tree. 21 * accessibility/AccessibilityListBoxOption.cpp: 22 (WebCore::AccessibilityListBoxOption::computeAccessibilityIsIgnored const): 23 Parent object may be gone when trying to update the isolated tree. 24 * accessibility/isolatedtree/AXIsolatedTree.cpp: 25 (WebCore::AXIsolatedTree::updateChildrenIDs): 26 (WebCore::AXIsolatedTree::generateSubtree): 27 (WebCore::AXIsolatedTree::updateChildren): 28 1 29 2020-06-26 Youenn Fablet <youenn@apple.com> 2 30 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r263378 r263571 588 588 ASSERT(newObject); 589 589 AXID axID = getAXID(newObject); 590 ASSERT(axID != InvalidAXID); 591 590 592 WTF::switchOn(domObject, 591 593 [&axID, this] (RenderObject* typedValue) { m_renderObjectMapping.set(typedValue, axID); }, … … 594 596 [] (auto&) { } 595 597 ); 598 596 599 m_objects.set(axID, newObject); 597 600 newObject->init(); -
trunk/Source/WebCore/accessibility/AccessibilityListBox.cpp
r251798 r263571 65 65 void AccessibilityListBox::addChildren() 66 66 { 67 if (!m_renderer) 68 return; 69 67 70 Node* selectNode = m_renderer->node(); 68 71 if (!selectNode) 69 72 return; 70 73 71 74 m_haveChildren = true; 72 75 73 76 for (const auto& listItem : downcast<HTMLSelectElement>(*selectNode).listItems()) { 74 77 // The cast to HTMLElement below is safe because the only other possible listItem type -
trunk/Source/WebCore/accessibility/AccessibilityListBoxOption.cpp
r246490 r263571 118 118 if (accessibilityIsIgnoredByDefault()) 119 119 return true; 120 121 return parentObject()->accessibilityIsIgnored(); 120 121 auto* parent = parentObject(); 122 return parent ? parent->accessibilityIsIgnored() : true; 122 123 } 123 124 -
trunk/Source/WebCore/accessibility/isolatedtree/AXIsolatedTree.cpp
r263378 r263571 167 167 ASSERT(m_changeLogLock.isLocked()); 168 168 169 m_nodeMap.set(axID, childrenIDs); 170 m_pendingChildrenUpdates.append(std::make_pair(axID, WTFMove(childrenIDs))); 169 if (axID != InvalidAXID) { 170 m_nodeMap.set(axID, childrenIDs); 171 m_pendingChildrenUpdates.append(std::make_pair(axID, WTFMove(childrenIDs))); 172 } 171 173 } 172 174 … … 183 185 if (!axParent) 184 186 setRootNode(object.ptr()); 185 else 187 else if (axParent->objectID() != InvalidAXID) // Need to check for the objectID of axParent again because it may have been detached while traversing the tree. 186 188 updateChildrenIDs(axParent->objectID(), axParent->childrenIDs()); 187 189 } … … 279 281 }); 280 282 ASSERT(axAncestor && iterator != m_nodeMap.end()); 281 if (!axAncestor || iterator == m_nodeMap.end())283 if (!axAncestor || axAncestor->objectID() == InvalidAXID || iterator == m_nodeMap.end()) 282 284 return; // nothing to update. 283 285 … … 289 291 auto axChildrenIDs = axAncestor->childrenIDs(); 290 292 291 for (size_t i = 0; i < axChildren IDs.size(); ++i) {293 for (size_t i = 0; i < axChildren.size() && i < axChildrenIDs.size(); ++i) { 292 294 size_t index = removals.find(axChildrenIDs[i]); 293 295 if (index != notFound) 294 296 removals.remove(index); 295 297 else { 298 ASSERT(axChildren[i]->objectID() == axChildrenIDs[i]); 296 299 // This is a new child, add it to the tree. 297 300 AXLOG("Adding a new child for:");
Note: See TracChangeset
for help on using the changeset viewer.