Changeset 240942 in webkit
- Timestamp:
- Feb 4, 2019 2:19:41 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r240941 r240942 1 2019-02-04 Zalan Bujtas <zalan@apple.com> 2 3 [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account. 4 https://bugs.webkit.org/show_bug.cgi?id=194168 5 6 Reviewed by Simon Fraser. 7 8 First paint should not be blocked by async or deferred scripts. 9 10 * page/FrameView.cpp: 11 (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): 12 1 13 2019-02-04 Simon Fraser <simon.fraser@apple.com> 2 14 -
trunk/Source/WebCore/page/FrameView.cpp
r240940 r240942 4447 4447 return false; 4448 4448 4449 auto finishedParsingMainDocument = frame().loader().stateMachine().committedFirstRealDocumentLoad() && !frame().document()->parsing();4449 auto finishedParsingMainDocument = frame().loader().stateMachine().committedFirstRealDocumentLoad() && (frame().document()->readyState() == Document::Interactive || frame().document()->readyState() == Document::Complete); 4450 4450 // Ensure that we always fire visually non-empty milestone eventually. 4451 4451 if (finishedParsingMainDocument && frame().loader().isComplete()) … … 4478 4478 4479 4479 auto isMoreContentExpected = [&]() { 4480 // Pending css/javascript/font loading/processing means we should wait a little longer. 4481 auto hasPendingScriptExecution = frame().document()->scriptRunner().hasPendingScripts(); 4482 if (hasPendingScriptExecution) 4483 return true; 4484 4480 ASSERT(finishedParsingMainDocument); 4481 // Pending css/font loading means we should wait a little longer. Classic non-async, non-defer scripts are all processed by now. 4485 4482 auto* documentLoader = frame().loader().documentLoader(); 4486 4483 if (!documentLoader) … … 4495 4492 if (resource.value->isLoaded()) 4496 4493 continue; 4497 if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type:: Script || resource.value->type() == CachedResource::Type::FontResource)4494 if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type::FontResource) 4498 4495 return true; 4499 4496 } -
trunk/Tools/ChangeLog
r240936 r240942 1 2019-02-04 Zalan Bujtas <zalan@apple.com> 2 3 [First paint] Adjust "finishedParsingMainDocument" flag by taking deferred and async scripts into account. 4 https://bugs.webkit.org/show_bug.cgi?id=194168 5 6 Reviewed by Simon Fraser. 7 8 Test if the firstVisuallyNoneEmpty milestone fires before the deferred script's post-message. 9 10 * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: 11 * TestWebKitAPI/Tests/WebKit/FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm: Added. 12 (-[FirstPaintMessageHandler userContentController:didReceiveScriptMessage:]): 13 (-[RenderingProgressNavigationDelegate _webView:renderingProgressDidChange:]): 14 (TEST): 15 * TestWebKitAPI/Tests/WebKit/deferred-script-load.html: Added. 16 * TestWebKitAPI/Tests/WebKit/deferred-script.js: Added. 17 1 18 2019-02-04 Dean Johnson <dean_johnson@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
r240667 r240942 51 51 115EB3431EE0BA03003C2C0A /* ViewportSizeForViewportUnits.mm in Sources */ = {isa = PBXBuildFile; fileRef = 115EB3421EE0B720003C2C0A /* ViewportSizeForViewportUnits.mm */; }; 52 52 1171B24F219F49CD00CB897D /* FirstMeaningfulPaintMilestone_Bundle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */; }; 53 118153442208B7AC00B2CCD2 /* deferred-script-load.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 118153432208B7AC00B2CCD2 /* deferred-script-load.html */; }; 54 118153462208B7E500B2CCD2 /* deferred-script.js in Copy Resources */ = {isa = PBXBuildFile; fileRef = 118153452208B7E500B2CCD2 /* deferred-script.js */; }; 55 118153482208BADF00B2CCD2 /* FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm in Sources */ = {isa = PBXBuildFile; fileRef = 118153472208BADF00B2CCD2 /* FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm */; }; 53 56 11B7FD28219F47110069B27F /* FirstMeaningfulPaintMilestone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */; }; 54 57 11C2598D21FA6324004C9E23 /* async-script-load.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 11C2598C21FA618D004C9E23 /* async-script-load.html */; }; … … 1059 1062 F457A9D6202D68AF00F7E9D5 /* DataTransfer.html in Copy Resources */, 1060 1063 F4512E131F60C44600BB369E /* DataTransferItem-getAsEntry.html in Copy Resources */, 1064 118153442208B7AC00B2CCD2 /* deferred-script-load.html in Copy Resources */, 1065 118153462208B7E500B2CCD2 /* deferred-script.js in Copy Resources */, 1061 1066 C07E6CB213FD73930038B22B /* devicePixelRatio.html in Copy Resources */, 1062 1067 0799C34B1EBA3301003B7532 /* disableGetUserMedia.html in Copy Resources */, … … 1330 1335 0FFC45A41B73EBE20085BD62 /* Lock.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Lock.cpp; sourceTree = "<group>"; }; 1331 1336 115EB3421EE0B720003C2C0A /* ViewportSizeForViewportUnits.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewportSizeForViewportUnits.mm; sourceTree = "<group>"; }; 1337 118153432208B7AC00B2CCD2 /* deferred-script-load.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "deferred-script-load.html"; sourceTree = "<group>"; }; 1338 118153452208B7E500B2CCD2 /* deferred-script.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = "deferred-script.js"; sourceTree = "<group>"; }; 1339 118153472208BADF00B2CCD2 /* FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm; sourceTree = "<group>"; }; 1332 1340 11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone_Bundle.cpp; sourceTree = "<group>"; }; 1333 1341 11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FirstMeaningfulPaintMilestone.cpp; sourceTree = "<group>"; }; … … 2514 2522 4612C2B8210A6ABF00B788A6 /* LoadFileThenReload.mm */, 2515 2523 57901FAC1CAF12C200ED64F9 /* LoadInvalidURLRequest.mm */, 2516 5774AA6721FBBF7800AF2A1B /* TestLoadOptimizer.mm */,2517 2524 51E6A8921D2F1BEC00C004B6 /* LocalStorageClear.mm */, 2518 2525 CA38459520AE012E00990D3B /* LocalStorageDatabaseTracker.mm */, … … 2575 2582 1C734B5220788C4800F430EA /* SystemColors.mm */, 2576 2583 2D70059521EDA0C6003463CB /* TabOutOfWebView.mm */, 2584 5774AA6721FBBF7800AF2A1B /* TestLoadOptimizer.mm */, 2577 2585 F4CD74C720FDB49600DE3794 /* TestURLSchemeHandler.h */, 2578 2586 F4CD74C820FDB49600DE3794 /* TestURLSchemeHandler.mm */, … … 3088 3096 11B7FD22219F46DD0069B27F /* FirstMeaningfulPaintMilestone.cpp */, 3089 3097 11B7FD21219F46DD0069B27F /* FirstMeaningfulPaintMilestone_Bundle.cpp */, 3098 118153472208BADF00B2CCD2 /* FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm */, 3090 3099 1ADBEFAD130C689C00D61D19 /* ForceRepaint.cpp */, 3091 3100 376C8C041D6E197C007D2BB9 /* FrameHandle.cpp */, … … 3299 3308 5C9E56861DF9148E00C9EE33 /* contentBlockerCheck.html */, 3300 3309 290F4274172A1FDE00939FF0 /* custom-protocol-sync-xhr.html */, 3310 118153432208B7AC00B2CCD2 /* deferred-script-load.html */, 3311 118153452208B7E500B2CCD2 /* deferred-script.js */, 3301 3312 A14AAB641E78DC3F00C1ADC2 /* encrypted.pdf */, 3302 3313 07492B391DF8ADA400633DE1 /* enumerateMediaDevices.html */, … … 4020 4031 7C83E0401D0A63E300FEBCF3 /* FirstResponderScrollingPosition.mm in Sources */, 4021 4032 C9E6DD351EA97D0800DD78AA /* FirstResponderSuppression.mm in Sources */, 4033 118153482208BADF00B2CCD2 /* FirstVisuallyNonEmptyMilestoneWithDeferredScript.mm in Sources */, 4022 4034 7C83E0BC1D0A650700FEBCF3 /* FixedLayoutSize.mm in Sources */, 4023 4035 7A909A7E1D877480007E10F8 /* FloatPoint.cpp in Sources */, … … 4242 4254 F45E15762112CE6200307E82 /* TestInputDelegate.mm in Sources */, 4243 4255 F45D3891215A7B4B002A2979 /* TestInspectorBar.mm in Sources */, 4256 5774AA6821FBBF7800AF2A1B /* TestLoadOptimizer.mm in Sources */, 4244 4257 2D1C04A71D76298B000A6816 /* TestNavigationDelegate.mm in Sources */, 4245 4258 A14FC5901B8AE36F00D107EB /* TestProtocol.mm in Sources */, … … 4260 4273 7CCE7F2D1A411B1000447C4C /* UserContentTest.mm in Sources */, 4261 4274 7C882E0A1C80C764006BF731 /* UserContentWorld.mm in Sources */, 4262 5774AA6821FBBF7800AF2A1B /* TestLoadOptimizer.mm in Sources */,4263 4275 7CCB99211D3B41F6003922F6 /* UserInitiatedActionInNavigationAction.mm in Sources */, 4264 4276 7CCE7F171A411AE600447C4C /* UserMedia.cpp in Sources */,
Note: See TracChangeset
for help on using the changeset viewer.