Changeset 242102 in webkit
- Timestamp:
- Feb 26, 2019, 1:01:28 PM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r242099 r242102 1 2019-02-26 Zalan Bujtas <zalan@apple.com> 2 3 [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver 4 https://bugs.webkit.org/show_bug.cgi?id=195062 5 <rdar://problem/48409258> 6 7 Reviewed by Tim Horton. 8 9 Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style. 10 11 * dom/Document.cpp: 12 (WebCore::Document::scheduleStyleRecalc): 13 * page/DOMTimer.cpp: 14 (WebCore::DOMTimer::install): 15 * page/ios/ContentChangeObserver.h: 16 * page/ios/ContentChangeObserver.mm: 17 (WebCore::ContentChangeObserver::didInstallDOMTimer): 18 (WebCore::ContentChangeObserver::didScheduleStyleRecalc): 19 (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted. 20 1 21 2019-02-26 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/dom/Document.cpp
r242093 r242102 1810 1810 1811 1811 ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild); 1812 1813 #if PLATFORM(IOS_FAMILY)1814 if (auto* page = this->page()) {1815 auto& contentChangeObserver = page->contentChangeObserver();1816 if (contentChangeObserver.isObservingStyleRecalcScheduling()) {1817 LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: register this style recalc schedule and observe when it fires.");1818 contentChangeObserver.setObservedContentChange(WKContentIndeterminateChange);1819 }1820 }1821 #endif1822 1823 1812 auto shouldThrottleStyleRecalc = [&] { 1824 1813 if (!view() || !view()->isVisuallyNonEmpty()) … … 1833 1822 1834 1823 m_styleRecalcTimer.startOneShot(0_s); 1824 #if PLATFORM(IOS_FAMILY) 1825 if (auto* page = this->page()) 1826 page->contentChangeObserver().didScheduleStyleRecalc(); 1827 #endif 1835 1828 1836 1829 InspectorInstrumentation::didScheduleStyleRecalculation(*this); -
trunk/Source/WebCore/page/DOMTimer.cpp
r242058 r242102 224 224 #if PLATFORM(IOS_FAMILY) 225 225 if (is<Document>(context)) 226 downcast<Document>(context).page()->contentChangeObserver(). registerDOMTimerForContentObservationIfNeeded(*timer, timeout, singleShot);226 downcast<Document>(context).page()->contentChangeObserver().didInstallDOMTimer(*timer, timeout, singleShot); 227 227 #endif 228 228 return timer->m_timeoutId; -
trunk/Source/WebCore/page/ios/ContentChangeObserver.h
r242094 r242102 39 39 ContentChangeObserver(Page&); 40 40 41 void registerDOMTimerForContentObservationIfNeeded(const DOMTimer&, Seconds timeout, bool singleShot);41 void didInstallDOMTimer(const DOMTimer&, Seconds timeout, bool singleShot); 42 42 void removeDOMTimer(const DOMTimer&); 43 43 void startObservingDOMTimerExecute(const DOMTimer&); 44 44 void stopObservingDOMTimerExecute(const DOMTimer&); 45 45 46 void didScheduleStyleRecalc(); 46 47 void startObservingStyleResolve(); 47 48 void stopObservingStyleResolve(); … … 50 51 WEBCORE_EXPORT void stopObservingContentChanges(); 51 52 52 bool isObservingStyleRecalcScheduling();53 54 void setShouldObserveNextStyleRecalc(bool);55 bool shouldObserveNextStyleRecalc();56 57 void setObservedContentChange(WKContentChange);58 53 WEBCORE_EXPORT WKContentChange observedContentChange(); 59 54 … … 86 81 void stopObservingStyleRecalcScheduling(); 87 82 83 void setShouldObserveNextStyleRecalc(bool); 84 bool shouldObserveNextStyleRecalc(); 85 88 86 bool isObservingContentChanges(); 87 bool isObservingStyleRecalcScheduling(); 88 89 void setObservedContentChange(WKContentChange); 89 90 90 91 Page& m_page; -
trunk/Source/WebCore/page/ios/ContentChangeObserver.mm
r242094 r242102 41 41 } 42 42 43 void ContentChangeObserver:: registerDOMTimerForContentObservationIfNeeded(const DOMTimer& timer, Seconds timeout, bool singleShot)43 void ContentChangeObserver::didInstallDOMTimer(const DOMTimer& timer, Seconds timeout, bool singleShot) 44 44 { 45 45 if (!m_page.mainFrame().document()) … … 53 53 setObservedContentChange(WKContentIndeterminateChange); 54 54 addObservedDOMTimer(timer); 55 LOG_WITH_STREAM(ContentObservation, stream << " registerDOMTimerForContentObservationIfNeeded: registedthis timer: (" << &timer << ") and observe when it fires.");55 LOG_WITH_STREAM(ContentObservation, stream << "didInstallDOMTimer: register this timer: (" << &timer << ") and observe when it fires."); 56 56 } 57 57 … … 85 85 setShouldObserveNextStyleRecalc(true); 86 86 } 87 } 88 89 void ContentChangeObserver::didScheduleStyleRecalc() 90 { 91 if (!isObservingStyleRecalcScheduling()) 92 return; 93 LOG(ContentObservation, "didScheduleStyleRecalc: register this style recalc schedule and observe when it fires."); 94 setObservedContentChange(WKContentIndeterminateChange); 87 95 } 88 96
Note:
See TracChangeset
for help on using the changeset viewer.