Changeset 166740 in webkit
- Timestamp:
- Apr 3, 2014 1:56:33 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166739 r166740 1 2014-04-03 Andreas Kling <akling@apple.com> 2 3 Stop throwing away the Document's StyleResolver on a timer. 4 <https://webkit.org/b/131168> 5 <rdar://problem/15227045> 6 7 This was causing some unfortunate pauses when returning to idle pages 8 after a long-ish time. There's already a mechanism in place that will 9 throw these away if the system comes under memory pressure. 10 11 Reviewed by Sam Weinig. 12 13 * css/StyleResolver.cpp: 14 (WebCore::StyleResolver::styleForElement): 15 (WebCore::StyleResolver::styleForKeyframe): 16 (WebCore::StyleResolver::pseudoStyleForElement): 17 (WebCore::StyleResolver::styleForPage): 18 * dom/Document.cpp: 19 (WebCore::Document::Document): 20 (WebCore::Document::didAccessStyleResolver): Deleted. 21 (WebCore::Document::styleResolverThrowawayTimerFired): Deleted. 22 * dom/Document.h: 23 1 24 2014-04-02 Simon Fraser <simon.fraser@apple.com> 2 25 -
trunk/Source/WebCore/css/StyleResolver.cpp
r166712 r166740 809 809 state.clear(); // Clear out for the next resolve. 810 810 811 document().didAccessStyleResolver();812 813 811 // Now return the style. 814 812 return state.takeStyle(); … … 868 866 } 869 867 870 document().didAccessStyleResolver();871 872 868 return state.takeStyle(); 873 869 } … … 983 979 loadPendingResources(); 984 980 985 document().didAccessStyleResolver();986 987 981 // Now return the style. 988 982 return state.takeStyle(); … … 1024 1018 // Start loading resources referenced by this style. 1025 1019 loadPendingResources(); 1026 1027 document().didAccessStyleResolver();1028 1020 1029 1021 // Now return the style. -
trunk/Source/WebCore/dom/Document.cpp
r166680 r166740 380 380 uint64_t Document::s_globalTreeVersion = 0; 381 381 382 static const double timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds = 30;383 384 382 #if ENABLE(IOS_TEXT_AUTOSIZING) 385 383 void TextAutoSizingTraits::constructDeletedValue(TextAutoSizingKey& slot) … … 409 407 #endif 410 408 , m_referencingNodeCount(0) 411 , m_styleResolverThrowawayTimer(this, &Document::styleResolverThrowawayTimerFired, timeBeforeThrowingAwayStyleResolverAfterLastUseInSeconds)412 409 , m_didCalculateStyleResolver(false) 413 410 , m_hasNodesWithPlaceholderStyle(false) … … 4486 4483 } 4487 4484 4488 void Document::didAccessStyleResolver()4489 {4490 m_styleResolverThrowawayTimer.restart();4491 }4492 4493 void Document::styleResolverThrowawayTimerFired(DeferrableOneShotTimer<Document>&)4494 {4495 ASSERT(!m_inStyleRecalc);4496 clearStyleResolver();4497 }4498 4499 4485 #if ENABLE(TELEPHONE_NUMBER_DETECTION) 4500 4486 // FIXME: Find a better place for this functionality. -
trunk/Source/WebCore/dom/Document.h
r166668 r166740 561 561 void scheduleOptimizedStyleSheetUpdate(); 562 562 563 void didAccessStyleResolver();564 565 563 void evaluateMediaQueryList(); 566 564 … … 1356 1354 void didAssociateFormControlsTimerFired(Timer<Document>&); 1357 1355 1358 void styleResolverThrowawayTimerFired(DeferrableOneShotTimer<Document>&);1359 1360 1356 unsigned m_referencingNodeCount; 1361 1362 DeferrableOneShotTimer<Document> m_styleResolverThrowawayTimer;1363 1357 1364 1358 std::unique_ptr<StyleResolver> m_styleResolver;
Note: See TracChangeset
for help on using the changeset viewer.