Changeset 240450 in webkit


Ignore:
Timestamp:
Jan 24, 2019 2:58:09 PM (5 years ago)
Author:
Alan Bujtas
Message:

DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
https://bugs.webkit.org/show_bug.cgi?id=193741
<rdar://problem/47135030>

Reviewed by Antti Koivisto and Simon Fraser.

Source/WebCore:

fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when

  1. the received data is not "contentful" yet
  2. and we are expecting some more (loading is not complete yet)
  3. but no layout is initiated anymore

nothing triggers the milestone firing.

This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.

  • page/FrameView.cpp:

(WebCore::FrameView::FrameView):
(WebCore::FrameView::loadProgressingStatusChanged):

Tools:

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:

(TestWebKitAPI::TEST):

Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r240446 r240450  
     12019-01-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
     4        https://bugs.webkit.org/show_bug.cgi?id=193741
     5        <rdar://problem/47135030>
     6
     7        Reviewed by Antti Koivisto and Simon Fraser.
     8
     9        fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when
     10            1. the received data is not "contentful" yet
     11            2. and we are expecting some more (loading is not complete yet)
     12            3. but no layout is initiated anymore
     13        nothing triggers the milestone firing.
     14
     15        This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did.
     16
     17        * page/FrameView.cpp:
     18        (WebCore::FrameView::FrameView):
     19        (WebCore::FrameView::loadProgressingStatusChanged):
     20
    1212019-01-24  Brent Fulgham  <bfulgham@apple.com>
    222
  • trunk/Source/WebCore/page/FrameView.cpp

    r240237 r240450  
    28522852void FrameView::loadProgressingStatusChanged()
    28532853{
     2854    auto hasPendingVisuallyNonEmptyCallback = m_firstVisuallyNonEmptyLayoutCallbackPending && !m_isVisuallyNonEmpty;
     2855    if (hasPendingVisuallyNonEmptyCallback && frame().loader().isComplete())
     2856        fireLayoutRelatedMilestonesIfNeeded();
    28542857    updateLayerFlushThrottling();
    28552858    adjustTiledBackingCoverage();
     
    51675170    }
    51685171
    5169     if (milestonesAchieved && frame().isMainFrame())
     5172    if (milestonesAchieved && frame().isMainFrame()) {
     5173        if (milestonesAchieved.contains(DidFirstVisuallyNonEmptyLayout))
     5174            RELEASE_LOG_IF_ALLOWED("fireLayoutRelatedMilestonesIfNeeded() - firing first visually non-empty layout milestone on the main frame");
    51705175        frame().loader().didReachLayoutMilestone(milestonesAchieved);
     5176    }
    51715177}
    51725178
  • trunk/Tools/ChangeLog

    r240446 r240450  
     12019-01-24  Zalan Bujtas  <zalan@apple.com>
     2
     3        DidFirstVisuallyNonEmptyLayout milestone should always fire at some point.
     4        https://bugs.webkit.org/show_bug.cgi?id=193741
     5        <rdar://problem/47135030>
     6
     7        Reviewed by Antti Koivisto and Simon Fraser.
     8
     9        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     10        * TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
     11        (TestWebKitAPI::TEST):
     12
    1132019-01-24  Brent Fulgham  <bfulgham@apple.com>
    214
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r240437 r240450  
    5252                1171B24F219F49CD00CB897D /* FirstMeaningfulPaintMilestone_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */; };
    5353                11B7FD28219F47110069B27F /* FirstMeaningfulPaintMilestone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */; };
     54                11C2598D21FA6324004C9E23 /* async-script-load.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 11C2598C21FA618D004C9E23 /* async-script-load.html */; };
    5455                143DDE9820C9018B007F76FA /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 574F55D0204D471C002948C6 /* Security.framework */; };
    5556                1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
     
    10041005                                5C9E59431D3EB5AC00E3C62E /* ApplicationCache.db-wal in Copy Resources */,
    10051006                                F6B7BE9717469B96008A3445 /* associate-form-controls.html in Copy Resources */,
     1007                                11C2598D21FA6324004C9E23 /* async-script-load.html in Copy Resources */,
    10061008                                F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */,
    10071009                                B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */,
     
    13281330                11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone_Bundle.cpp; sourceTree = "<group>"; };
    13291331                11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone.cpp; sourceTree = "<group>"; };
     1332                11C2598C21FA618D004C9E23 /* async-script-load.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "async-script-load.html"; sourceTree = "<group>"; };
    13301333                14464012167A8305000BD218 /* LayoutUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnit.cpp; sourceTree = "<group>"; };
    13311334                14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SaturatedArithmeticOperations.cpp; sourceTree = "<group>"; };
     
    32733276                                93D3D19B17B1A7B000C7C415 /* all-content-in-one-iframe.html */,
    32743277                                F6B7BE9617469B7E008A3445 /* associate-form-controls.html */,
     3278                                11C2598C21FA618D004C9E23 /* async-script-load.html */,
    32753279                                C9C9A91A21DED24D00FDE96E /* audio-with-play-button.html */,
    32763280                                76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
  • trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp

    r239631 r240450  
    118118}
    119119
     120TEST(WebKit, FirstVisuallyNonEmptyMilestoneWithLoadComplete)
     121{
     122    WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
     123    PlatformWebView webView(context.get());
     124
     125    WKPageNavigationClientV3 loaderClient;
     126    memset(&loaderClient, 0, sizeof(loaderClient));
     127
     128    loaderClient.base.version = 3;
     129    loaderClient.base.clientInfo = &webView;
     130    loaderClient.renderingProgressDidChange = renderingProgressDidChange;
     131
     132    WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
     133    didFirstVisuallyNonEmptyLayout = false;
     134
     135    WKPageListenForLayoutMilestones(webView.page(), WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout);
     136    WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("async-script-load", "html")).get());
     137
     138    Util::run(&didFirstVisuallyNonEmptyLayout);
     139    EXPECT_TRUE(didFirstVisuallyNonEmptyLayout);
     140}
     141
    120142} // namespace TestWebKitAPI
    121143
Note: See TracChangeset for help on using the changeset viewer.