Changeset 207234 in webkit
- Timestamp:
- Oct 12, 2016 12:35:55 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r207232 r207234 1 2016-10-12 Andreas Kling <akling@apple.com> 2 3 Make Document::existingAXObjectCache() fast with accessibility disabled. 4 <https://webkit.org/b/163347> 5 6 Reviewed by Antti Koivisto. 7 8 Instruments says we were spending 2.3% of Dromaeo/dom-modify.html in this function, 9 traversing ancestors. Track whether we've ever had a cache, and use that knowledge 10 to return early if possible. 11 12 * dom/Document.cpp: 13 (WebCore::Document::existingAXObjectCache): 14 (WebCore::Document::axObjectCache): 15 1 16 2016-10-12 Jeremy Huddleston Sequoia <jeremyhu@apple.com> 2 17 -
trunk/Source/WebCore/dom/Document.cpp
r207155 r207234 2428 2428 } 2429 2429 2430 static bool hasEverCreatedAnAXObjectCache = false; 2431 2430 2432 AXObjectCache* Document::existingAXObjectCache() const 2431 2433 { 2434 if (!hasEverCreatedAnAXObjectCache) 2435 return nullptr; 2436 2432 2437 Document& topDocument = this->topDocument(); 2433 2438 if (!topDocument.hasLivingRenderTree()) … … 2452 2457 2453 2458 ASSERT(&topDocument == this || !m_axObjectCache); 2454 if (!topDocument.m_axObjectCache) 2459 if (!topDocument.m_axObjectCache) { 2455 2460 topDocument.m_axObjectCache = std::make_unique<AXObjectCache>(topDocument); 2461 hasEverCreatedAnAXObjectCache = true; 2462 } 2456 2463 return topDocument.m_axObjectCache.get(); 2457 2464 }
Note: See TracChangeset
for help on using the changeset viewer.