- Revision
- 240450
- Author
- [email protected]
- Date
- 2019-01-24 14:58:09 -0800 (Thu, 24 Jan 2019)
Log 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):
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (240449 => 240450)
--- trunk/Source/WebCore/ChangeLog 2019-01-24 22:37:01 UTC (rev 240449)
+++ trunk/Source/WebCore/ChangeLog 2019-01-24 22:58:09 UTC (rev 240450)
@@ -1,3 +1,23 @@
+2019-01-24 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ 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):
+
2019-01-24 Brent Fulgham <[email protected]>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
Modified: trunk/Source/WebCore/page/FrameView.cpp (240449 => 240450)
--- trunk/Source/WebCore/page/FrameView.cpp 2019-01-24 22:37:01 UTC (rev 240449)
+++ trunk/Source/WebCore/page/FrameView.cpp 2019-01-24 22:58:09 UTC (rev 240450)
@@ -2851,6 +2851,9 @@
void FrameView::loadProgressingStatusChanged()
{
+ auto hasPendingVisuallyNonEmptyCallback = m_firstVisuallyNonEmptyLayoutCallbackPending && !m_isVisuallyNonEmpty;
+ if (hasPendingVisuallyNonEmptyCallback && frame().loader().isComplete())
+ fireLayoutRelatedMilestonesIfNeeded();
updateLayerFlushThrottling();
adjustTiledBackingCoverage();
}
@@ -5166,8 +5169,11 @@
milestonesAchieved.add(DidRenderSignificantAmountOfText);
}
- if (milestonesAchieved && frame().isMainFrame())
+ if (milestonesAchieved && frame().isMainFrame()) {
+ if (milestonesAchieved.contains(DidFirstVisuallyNonEmptyLayout))
+ RELEASE_LOG_IF_ALLOWED("fireLayoutRelatedMilestonesIfNeeded() - firing first visually non-empty layout milestone on the main frame");
frame().loader().didReachLayoutMilestone(milestonesAchieved);
+ }
}
void FrameView::firePaintRelatedMilestonesIfNeeded()
Modified: trunk/Tools/ChangeLog (240449 => 240450)
--- trunk/Tools/ChangeLog 2019-01-24 22:37:01 UTC (rev 240449)
+++ trunk/Tools/ChangeLog 2019-01-24 22:58:09 UTC (rev 240450)
@@ -1,3 +1,15 @@
+2019-01-24 Zalan Bujtas <[email protected]>
+
+ 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.
+
+ * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
+ * TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
+ (TestWebKitAPI::TEST):
+
2019-01-24 Brent Fulgham <[email protected]>
Activate the WebResourceLoadStatisticsStore in the NetworkProcess and deactivate it in the UIProcess.
Modified: trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj (240449 => 240450)
--- trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2019-01-24 22:37:01 UTC (rev 240449)
+++ trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj 2019-01-24 22:58:09 UTC (rev 240450)
@@ -51,6 +51,7 @@
115EB3431EE0BA03003C2C0A /* ViewportSizeForViewportUnits.mm in Sources */ = {isa = PBXBuildFile; fileRef = 115EB3421EE0B720003C2C0A /* ViewportSizeForViewportUnits.mm */; };
1171B24F219F49CD00CB897D /* FirstMeaningfulPaintMilestone_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */; };
11B7FD28219F47110069B27F /* FirstMeaningfulPaintMilestone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */; };
+ 11C2598D21FA6324004C9E23 /* async-script-load.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 11C2598C21FA618D004C9E23 /* async-script-load.html */; };
143DDE9820C9018B007F76FA /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 574F55D0204D471C002948C6 /* Security.framework */; };
1A02C870125D4CFD00E3F4BD /* find.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 1A02C84B125D4A5E00E3F4BD /* find.html */; };
1A3524AE1D63A4FB0031729B /* Scope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A3524AC1D63A4FB0031729B /* Scope.cpp */; };
@@ -1003,6 +1004,7 @@
5C9E59421D3EB5AC00E3C62E /* ApplicationCache.db-shm in Copy Resources */,
5C9E59431D3EB5AC00E3C62E /* ApplicationCache.db-wal in Copy Resources */,
F6B7BE9717469B96008A3445 /* associate-form-controls.html in Copy Resources */,
+ 11C2598D21FA6324004C9E23 /* async-script-load.html in Copy Resources */,
F4856CA31E649EA8009D7EE7 /* attachment-element.html in Copy Resources */,
B55F11B71517D03300915916 /* attributedStringCustomFont.html in Copy Resources */,
7C9ED98B17A19F4B00E4DC33 /* attributedStringStrikethrough.html in Copy Resources */,
@@ -1327,6 +1329,7 @@
115EB3421EE0B720003C2C0A /* ViewportSizeForViewportUnits.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewportSizeForViewportUnits.mm; sourceTree = "<group>"; };
11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone_Bundle.cpp; sourceTree = "<group>"; };
11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone.cpp; sourceTree = "<group>"; };
+ 11C2598C21FA618D004C9E23 /* async-script-load.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "async-script-load.html"; sourceTree = "<group>"; };
14464012167A8305000BD218 /* LayoutUnit.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayoutUnit.cpp; sourceTree = "<group>"; };
14F3B11215E45EAB00210069 /* SaturatedArithmeticOperations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SaturatedArithmeticOperations.cpp; sourceTree = "<group>"; };
1A02C84B125D4A5E00E3F4BD /* find.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = find.html; sourceTree = "<group>"; };
@@ -3272,6 +3275,7 @@
1C2B81851C89252300A5529F /* Ahem.ttf */,
93D3D19B17B1A7B000C7C415 /* all-content-in-one-iframe.html */,
F6B7BE9617469B7E008A3445 /* associate-form-controls.html */,
+ 11C2598C21FA618D004C9E23 /* async-script-load.html */,
C9C9A91A21DED24D00FDE96E /* audio-with-play-button.html */,
76E182DE15475A8300F1FADD /* auto-submitting-form.html */,
C9C60E631E53A9BA006DA181 /* autoplay-check-frame.html */,
Modified: trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp (240449 => 240450)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp 2019-01-24 22:37:01 UTC (rev 240449)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp 2019-01-24 22:58:09 UTC (rev 240450)
@@ -117,6 +117,28 @@
didNavigate = false;
}
+TEST(WebKit, FirstVisuallyNonEmptyMilestoneWithLoadComplete)
+{
+ WKRetainPtr<WKContextRef> context(AdoptWK, WKContextCreateWithConfiguration(nullptr));
+ PlatformWebView webView(context.get());
+
+ WKPageNavigationClientV3 loaderClient;
+ memset(&loaderClient, 0, sizeof(loaderClient));
+
+ loaderClient.base.version = 3;
+ loaderClient.base.clientInfo = &webView;
+ loaderClient.renderingProgressDidChange = renderingProgressDidChange;
+
+ WKPageSetPageNavigationClient(webView.page(), &loaderClient.base);
+ didFirstVisuallyNonEmptyLayout = false;
+
+ WKPageListenForLayoutMilestones(webView.page(), WKPageRenderingProgressEventFirstVisuallyNonEmptyLayout);
+ WKPageLoadURL(webView.page(), adoptWK(Util::createURLForResource("async-script-load", "html")).get());
+
+ Util::run(&didFirstVisuallyNonEmptyLayout);
+ EXPECT_TRUE(didFirstVisuallyNonEmptyLayout);
+}
+
} // namespace TestWebKitAPI
#endif
Added: trunk/Tools/TestWebKitAPI/Tests/WebKit/async-script-load.html (0 => 240450)
--- trunk/Tools/TestWebKitAPI/Tests/WebKit/async-script-load.html (rev 0)
+++ trunk/Tools/TestWebKitAPI/Tests/WebKit/async-script-load.html 2019-01-24 22:58:09 UTC (rev 240450)
@@ -0,0 +1,16 @@
+<head>
+<style>
+@font-face {
+ font-family: 'FontAwesome';
+ src: url("font1.woff2") format("woff2");
+ font-weight: normal;
+ font-style: normal
+}
+
+.foobar {
+ font: normal normal normal 14px / 1 FontAwesome;
+}
+</style>
+</head>
+<body>foobar<script>document.body.offsetHeight</script>
+<script async="true" src=""
\ No newline at end of file