Modified: trunk/Source/WebKit/ChangeLog (243452 => 243453)
--- trunk/Source/WebKit/ChangeLog 2019-03-25 20:45:37 UTC (rev 243452)
+++ trunk/Source/WebKit/ChangeLog 2019-03-25 20:46:53 UTC (rev 243453)
@@ -1,3 +1,29 @@
+2019-03-25 Keith Rollin <[email protected]>
+
+ Add WebKit logging for first paint and other interesting layout milestones
+ https://bugs.webkit.org/show_bug.cgi?id=196159
+ <rdar://problem/49128952>
+
+ Reviewed by Simon Fraser.
+
+ Add some logging to indicate what layout milestones have been reached.
+ This should help us determine if there's a client, rendering, layout,
+ or some other issue when page content does not appear in the client
+ window.
+
+ The logging is being added to
+ WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
+ a nice central place to capture layout milestones. However, it will
+ only log notifications that are being sent to clients. It does not
+ indicate all milestones that have occurred. That is, it does not
+ report milestones that are filtered out due to client disinterest.
+ There doesn't seem to be a good central place to capture all
+ milestones, regardless of client interest.
+
+ * Platform/Logging.h:
+ * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+ (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
+
2019-03-25 Patrick Griffis <[email protected]>
[GTK][WPE] Remove network access from web process sandbox
Modified: trunk/Source/WebKit/Platform/Logging.h (243452 => 243453)
--- trunk/Source/WebKit/Platform/Logging.h 2019-03-25 20:45:37 UTC (rev 243452)
+++ trunk/Source/WebKit/Platform/Logging.h 2019-03-25 20:46:53 UTC (rev 243453)
@@ -55,6 +55,7 @@
M(IPC) \
M(KeyHandling) \
M(Layers) \
+ M(Layout) \
M(Loading) \
M(LocalStorageDatabaseTracker) \
M(MouseHandling) \
Modified: trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (243452 => 243453)
--- trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2019-03-25 20:45:37 UTC (rev 243452)
+++ trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp 2019-03-25 20:46:53 UTC (rev 243453)
@@ -646,6 +646,8 @@
RefPtr<API::Object> userData;
if (milestones & DidFirstLayout) {
+ RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidFirstLayoutForFrame, page = %p", this, webPage);
+
// FIXME: We should consider removing the old didFirstLayout API since this is doing double duty with the
// new didLayout API.
webPage->injectedBundleLoaderClient().didFirstLayoutForFrame(*webPage, *m_frame, userData);
@@ -654,6 +656,7 @@
#if PLATFORM(MAC)
// FIXME: Do this on DidFirstVisuallyNonEmptyLayout when Mac Safari is able to handle it (<rdar://problem/17580021>)
if (m_frame->isMainFrame() && !m_didCompletePageTransition && !webPage->corePage()->settings().suppressesIncrementalRendering()) {
+ RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = %p", this, webPage);
webPage->didCompletePageTransition();
m_didCompletePageTransition = true;
}
@@ -665,11 +668,35 @@
#endif
}
+#if !RELEASE_LOG_DISABLED
+ StringBuilder builder;
+ auto addIfSet = [&milestones, &builder] (WebCore::LayoutMilestone milestone, const String& toAdd) {
+ if (milestones.contains(milestone)) {
+ if (!builder.isEmpty())
+ builder.append(", ");
+ builder.append(toAdd);
+ }
+ };
+
+ addIfSet(DidFirstLayout, "DidFirstLayout"_s);
+ addIfSet(DidFirstVisuallyNonEmptyLayout, "DidFirstVisuallyNonEmptyLayout"_s);
+ addIfSet(DidHitRelevantRepaintedObjectsAreaThreshold, "DidHitRelevantRepaintedObjectsAreaThreshold"_s);
+ addIfSet(DidFirstFlushForHeaderLayer, "DidFirstFlushForHeaderLayer"_s);
+ addIfSet(DidFirstLayoutAfterSuppressedIncrementalRendering, "DidFirstLayoutAfterSuppressedIncrementalRendering"_s);
+ addIfSet(DidFirstPaintAfterSuppressedIncrementalRendering, "DidFirstPaintAfterSuppressedIncrementalRendering"_s);
+ addIfSet(ReachedSessionRestorationRenderTreeSizeThreshold, "ReachedSessionRestorationRenderTreeSizeThreshold"_s);
+ addIfSet(DidRenderSignificantAmountOfText, "DidRenderSignificantAmountOfText"_s);
+ addIfSet(DidFirstMeaningfulPaint, "DidFirstMeaningfulPaint"_s);
+
+ RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidReachLayoutMilestone, page = %p, milestones = %{public}s", this, webPage, builder.toString().utf8().data());
+#endif
+
// Send this after DidFirstLayout-specific calls since some clients expect to get those messages first.
webPage->dispatchDidReachLayoutMilestone(milestones);
if (milestones & DidFirstVisuallyNonEmptyLayout) {
if (m_frame->isMainFrame() && !m_didCompletePageTransition && !webPage->corePage()->settings().suppressesIncrementalRendering()) {
+ RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = %p", this, webPage);
webPage->didCompletePageTransition();
m_didCompletePageTransition = true;
}
@@ -676,6 +703,7 @@
// FIXME: We should consider removing the old didFirstVisuallyNonEmptyLayoutForFrame API since this is doing
// double duty with the new didLayout API.
+ RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidFirstVisuallyNonEmptyLayoutForFrame, page = %p", this, webPage);
webPage->injectedBundleLoaderClient().didFirstVisuallyNonEmptyLayoutForFrame(*webPage, *m_frame, userData);
webPage->send(Messages::WebPageProxy::DidFirstVisuallyNonEmptyLayoutForFrame(m_frame->frameID(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
}