⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243453 in webkit


Ignore:
Timestamp:
Mar 25, 2019, 1:46:53 PM (7 years ago)
Author:
Keith Rollin
Message:

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):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r243449 r243453  
     12019-03-25  Keith Rollin  <krollin@apple.com>
     2
     3        Add WebKit logging for first paint and other interesting layout milestones
     4        https://bugs.webkit.org/show_bug.cgi?id=196159
     5        <rdar://problem/49128952>
     6
     7        Reviewed by Simon Fraser.
     8
     9        Add some logging to indicate what layout milestones have been reached.
     10        This should help us determine if there's a client, rendering, layout,
     11        or some other issue when page content does not appear in the client
     12        window.
     13
     14        The logging is being added to
     15        WebFrameLoaderClient::dispatchDidReachLayoutMilestone. This seems like
     16        a nice central place to capture layout milestones. However, it will
     17        only log notifications that are being sent to clients. It does not
     18        indicate all milestones that have occurred. That is, it does not
     19        report milestones that are filtered out due to client disinterest.
     20        There doesn't seem to be a good central place to capture all
     21        milestones, regardless of client interest.
     22
     23        * Platform/Logging.h:
     24        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
     25        (WebKit::WebFrameLoaderClient::dispatchDidReachLayoutMilestone):
     26
    1272019-03-25  Patrick Griffis  <pgriffis@igalia.com>
    228
  • trunk/Source/WebKit/Platform/Logging.h

    r243328 r243453  
    5656    M(KeyHandling) \
    5757    M(Layers) \
     58    M(Layout) \
    5859    M(Loading) \
    5960    M(LocalStorageDatabaseTracker) \
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

    r242920 r243453  
    647647
    648648    if (milestones & DidFirstLayout) {
     649        RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidFirstLayoutForFrame, page = %p", this, webPage);
     650
    649651        // FIXME: We should consider removing the old didFirstLayout API since this is doing double duty with the
    650652        // new didLayout API.
     
    655657        // FIXME: Do this on DidFirstVisuallyNonEmptyLayout when Mac Safari is able to handle it (<rdar://problem/17580021>)
    656658        if (m_frame->isMainFrame() && !m_didCompletePageTransition && !webPage->corePage()->settings().suppressesIncrementalRendering()) {
     659            RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = %p", this, webPage);
    657660            webPage->didCompletePageTransition();
    658661            m_didCompletePageTransition = true;
     
    666669    }
    667670
     671#if !RELEASE_LOG_DISABLED
     672    StringBuilder builder;
     673    auto addIfSet = [&milestones, &builder] (WebCore::LayoutMilestone milestone, const String& toAdd) {
     674        if (milestones.contains(milestone)) {
     675            if (!builder.isEmpty())
     676                builder.append(", ");
     677            builder.append(toAdd);
     678        }
     679    };
     680
     681    addIfSet(DidFirstLayout, "DidFirstLayout"_s);
     682    addIfSet(DidFirstVisuallyNonEmptyLayout, "DidFirstVisuallyNonEmptyLayout"_s);
     683    addIfSet(DidHitRelevantRepaintedObjectsAreaThreshold, "DidHitRelevantRepaintedObjectsAreaThreshold"_s);
     684    addIfSet(DidFirstFlushForHeaderLayer, "DidFirstFlushForHeaderLayer"_s);
     685    addIfSet(DidFirstLayoutAfterSuppressedIncrementalRendering, "DidFirstLayoutAfterSuppressedIncrementalRendering"_s);
     686    addIfSet(DidFirstPaintAfterSuppressedIncrementalRendering, "DidFirstPaintAfterSuppressedIncrementalRendering"_s);
     687    addIfSet(ReachedSessionRestorationRenderTreeSizeThreshold, "ReachedSessionRestorationRenderTreeSizeThreshold"_s);
     688    addIfSet(DidRenderSignificantAmountOfText, "DidRenderSignificantAmountOfText"_s);
     689    addIfSet(DidFirstMeaningfulPaint, "DidFirstMeaningfulPaint"_s);
     690
     691    RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidReachLayoutMilestone, page = %p, milestones = %{public}s", this, webPage, builder.toString().utf8().data());
     692#endif
     693
    668694    // Send this after DidFirstLayout-specific calls since some clients expect to get those messages first.
    669695    webPage->dispatchDidReachLayoutMilestone(milestones);
     
    671697    if (milestones & DidFirstVisuallyNonEmptyLayout) {
    672698        if (m_frame->isMainFrame() && !m_didCompletePageTransition && !webPage->corePage()->settings().suppressesIncrementalRendering()) {
     699            RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching didCompletePageTransition, page = %p", this, webPage);
    673700            webPage->didCompletePageTransition();
    674701            m_didCompletePageTransition = true;
     
    677704        // FIXME: We should consider removing the old didFirstVisuallyNonEmptyLayoutForFrame API since this is doing
    678705        // double duty with the new didLayout API.
     706        RELEASE_LOG(Layout, "%p - WebFrameLoaderClient::dispatchDidReachLayoutMilestone: dispatching DidFirstVisuallyNonEmptyLayoutForFrame, page = %p", this, webPage);
    679707        webPage->injectedBundleLoaderClient().didFirstVisuallyNonEmptyLayoutForFrame(*webPage, *m_frame, userData);
    680708        webPage->send(Messages::WebPageProxy::DidFirstVisuallyNonEmptyLayoutForFrame(m_frame->frameID(), UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));
Note: See TracChangeset for help on using the changeset viewer.