Title: [242102] trunk/Source/WebCore
- Revision
- 242102
- Author
- [email protected]
- Date
- 2019-02-26 13:01:28 -0800 (Tue, 26 Feb 2019)
Log Message
[ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
https://bugs.webkit.org/show_bug.cgi?id=195062
<rdar://problem/48409258>
Reviewed by Tim Horton.
Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
* dom/Document.cpp:
(WebCore::Document::scheduleStyleRecalc):
* page/DOMTimer.cpp:
(WebCore::DOMTimer::install):
* page/ios/ContentChangeObserver.h:
* page/ios/ContentChangeObserver.mm:
(WebCore::ContentChangeObserver::didInstallDOMTimer):
(WebCore::ContentChangeObserver::didScheduleStyleRecalc):
(WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (242101 => 242102)
--- trunk/Source/WebCore/ChangeLog 2019-02-26 20:54:12 UTC (rev 242101)
+++ trunk/Source/WebCore/ChangeLog 2019-02-26 21:01:28 UTC (rev 242102)
@@ -1,3 +1,23 @@
+2019-02-26 Zalan Bujtas <[email protected]>
+
+ [ContentChangeObserver] Move style recalc schedule observation logic to ContentChangeObserver
+ https://bugs.webkit.org/show_bug.cgi?id=195062
+ <rdar://problem/48409258>
+
+ Reviewed by Tim Horton.
+
+ Also rename registerDOMTimerForContentObservationIfNeeded to be consistent with the did* naming style.
+
+ * dom/Document.cpp:
+ (WebCore::Document::scheduleStyleRecalc):
+ * page/DOMTimer.cpp:
+ (WebCore::DOMTimer::install):
+ * page/ios/ContentChangeObserver.h:
+ * page/ios/ContentChangeObserver.mm:
+ (WebCore::ContentChangeObserver::didInstallDOMTimer):
+ (WebCore::ContentChangeObserver::didScheduleStyleRecalc):
+ (WebCore::ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded): Deleted.
+
2019-02-26 Chris Dumez <[email protected]>
[iOS] Regression(PSON) Scroll position is no longer restored when navigating back to reddit.com
Modified: trunk/Source/WebCore/dom/Document.cpp (242101 => 242102)
--- trunk/Source/WebCore/dom/Document.cpp 2019-02-26 20:54:12 UTC (rev 242101)
+++ trunk/Source/WebCore/dom/Document.cpp 2019-02-26 21:01:28 UTC (rev 242102)
@@ -1809,17 +1809,6 @@
return;
ASSERT(childNeedsStyleRecalc() || m_needsFullStyleRebuild);
-
-#if PLATFORM(IOS_FAMILY)
- if (auto* page = this->page()) {
- auto& contentChangeObserver = page->contentChangeObserver();
- if (contentChangeObserver.isObservingStyleRecalcScheduling()) {
- LOG_WITH_STREAM(ContentObservation, stream << "Document(" << this << ")::scheduleStyleRecalc: register this style recalc schedule and observe when it fires.");
- contentChangeObserver.setObservedContentChange(WKContentIndeterminateChange);
- }
- }
-#endif
-
auto shouldThrottleStyleRecalc = [&] {
if (!view() || !view()->isVisuallyNonEmpty())
return false;
@@ -1832,6 +1821,10 @@
return;
m_styleRecalcTimer.startOneShot(0_s);
+#if PLATFORM(IOS_FAMILY)
+ if (auto* page = this->page())
+ page->contentChangeObserver().didScheduleStyleRecalc();
+#endif
InspectorInstrumentation::didScheduleStyleRecalculation(*this);
}
Modified: trunk/Source/WebCore/page/DOMTimer.cpp (242101 => 242102)
--- trunk/Source/WebCore/page/DOMTimer.cpp 2019-02-26 20:54:12 UTC (rev 242101)
+++ trunk/Source/WebCore/page/DOMTimer.cpp 2019-02-26 21:01:28 UTC (rev 242102)
@@ -223,7 +223,7 @@
nestedTimers->add(timer->m_timeoutId, *timer);
#if PLATFORM(IOS_FAMILY)
if (is<Document>(context))
- downcast<Document>(context).page()->contentChangeObserver().registerDOMTimerForContentObservationIfNeeded(*timer, timeout, singleShot);
+ downcast<Document>(context).page()->contentChangeObserver().didInstallDOMTimer(*timer, timeout, singleShot);
#endif
return timer->m_timeoutId;
}
Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.h (242101 => 242102)
--- trunk/Source/WebCore/page/ios/ContentChangeObserver.h 2019-02-26 20:54:12 UTC (rev 242101)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.h 2019-02-26 21:01:28 UTC (rev 242102)
@@ -38,11 +38,12 @@
public:
ContentChangeObserver(Page&);
- void registerDOMTimerForContentObservationIfNeeded(const DOMTimer&, Seconds timeout, bool singleShot);
+ void didInstallDOMTimer(const DOMTimer&, Seconds timeout, bool singleShot);
void removeDOMTimer(const DOMTimer&);
void startObservingDOMTimerExecute(const DOMTimer&);
void stopObservingDOMTimerExecute(const DOMTimer&);
+ void didScheduleStyleRecalc();
void startObservingStyleResolve();
void stopObservingStyleResolve();
@@ -49,12 +50,6 @@
WEBCORE_EXPORT void startObservingContentChanges();
WEBCORE_EXPORT void stopObservingContentChanges();
- bool isObservingStyleRecalcScheduling();
-
- void setShouldObserveNextStyleRecalc(bool);
- bool shouldObserveNextStyleRecalc();
-
- void setObservedContentChange(WKContentChange);
WEBCORE_EXPORT WKContentChange observedContentChange();
WEBCORE_EXPORT unsigned countOfObservedDOMTimers();
@@ -85,8 +80,14 @@
void startObservingStyleRecalcScheduling();
void stopObservingStyleRecalcScheduling();
+ void setShouldObserveNextStyleRecalc(bool);
+ bool shouldObserveNextStyleRecalc();
+
bool isObservingContentChanges();
+ bool isObservingStyleRecalcScheduling();
+ void setObservedContentChange(WKContentChange);
+
Page& m_page;
};
Modified: trunk/Source/WebCore/page/ios/ContentChangeObserver.mm (242101 => 242102)
--- trunk/Source/WebCore/page/ios/ContentChangeObserver.mm 2019-02-26 20:54:12 UTC (rev 242101)
+++ trunk/Source/WebCore/page/ios/ContentChangeObserver.mm 2019-02-26 21:01:28 UTC (rev 242102)
@@ -40,7 +40,7 @@
{
}
-void ContentChangeObserver::registerDOMTimerForContentObservationIfNeeded(const DOMTimer& timer, Seconds timeout, bool singleShot)
+void ContentChangeObserver::didInstallDOMTimer(const DOMTimer& timer, Seconds timeout, bool singleShot)
{
if (!m_page.mainFrame().document())
return;
@@ -52,7 +52,7 @@
return;
setObservedContentChange(WKContentIndeterminateChange);
addObservedDOMTimer(timer);
- LOG_WITH_STREAM(ContentObservation, stream << "registerDOMTimerForContentObservationIfNeeded: registed this timer: (" << &timer << ") and observe when it fires.");
+ LOG_WITH_STREAM(ContentObservation, stream << "didInstallDOMTimer: register this timer: (" << &timer << ") and observe when it fires.");
}
void ContentChangeObserver::startObservingDOMTimerExecute(const DOMTimer& timer)
@@ -86,6 +86,14 @@
}
}
+void ContentChangeObserver::didScheduleStyleRecalc()
+{
+ if (!isObservingStyleRecalcScheduling())
+ return;
+ LOG(ContentObservation, "didScheduleStyleRecalc: register this style recalc schedule and observe when it fires.");
+ setObservedContentChange(WKContentIndeterminateChange);
+}
+
void ContentChangeObserver::startObservingStyleResolve()
{
if (!shouldObserveNextStyleRecalc())
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes