Bug 191078

Summary: [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired.
Product: WebKit Reporter: zalan <zalan>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, commit-queue, ews-watchlist, koivisto, rniwa, ryanhaddad, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Archive of layout-test-results from ews107 for mac-sierra-wk2
none
Patch
none
Archive of layout-test-results from ews104 for mac-sierra-wk2
none
Patch
none
Patch
none
Archive of layout-test-results from ews103 for mac-sierra
none
Patch
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
Patch none

zalan
Reported 2018-10-30 13:13:35 PDT
as opposed to waiting for 500ms with the initial paint.
Attachments
Patch (22.83 KB, patch)
2018-10-30 13:22 PDT, zalan
no flags
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.34 MB, application/zip)
2018-10-30 14:26 PDT, EWS Watchlist
no flags
Patch (25.38 KB, patch)
2018-11-01 11:36 PDT, zalan
no flags
Archive of layout-test-results from ews104 for mac-sierra-wk2 (3.22 MB, application/zip)
2018-11-01 12:58 PDT, EWS Watchlist
no flags
Patch (25.27 KB, patch)
2018-11-06 12:59 PST, zalan
no flags
Patch (24.06 KB, patch)
2018-11-09 13:36 PST, zalan
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.50 MB, application/zip)
2018-11-09 14:29 PST, EWS Watchlist
no flags
Patch (24.18 KB, patch)
2018-11-09 15:33 PST, zalan
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (3.11 MB, application/zip)
2018-11-09 19:41 PST, EWS Watchlist
no flags
Patch (24.07 KB, patch)
2018-11-09 21:59 PST, zalan
no flags
zalan
Comment 1 2018-10-30 13:14:26 PDT
waiting 500ms that is.
zalan
Comment 2 2018-10-30 13:22:59 PDT
EWS Watchlist
Comment 3 2018-10-30 13:26:32 PDT
Attachment 353403 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] ERROR: Source/WebCore/page/FrameView.cpp:96: Alphabetical sorting problem. [build/include_order] [4] Total errors found: 2 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 4 2018-10-30 14:26:50 PDT
Comment on attachment 353403 [details] Patch Attachment 353403 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9783488 New failing tests: tiled-drawing/simple-document-with-margin-tiles.html compositing/tiling/non-visible-window-tile-coverage.html
EWS Watchlist
Comment 5 2018-10-30 14:26:52 PDT
Created attachment 353408 [details] Archive of layout-test-results from ews107 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews107 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Simon Fraser (smfr)
Comment 6 2018-10-31 13:44:07 PDT
Comment on attachment 353403 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353403&action=review > Source/WebCore/ChangeLog:12 > + 1. Improve visuallyNoneEmpty milestone confidence > + 2. Issue initial paint soon after the milestone fires > + 3. Suspend optional style recalcs and layouts while painting is being throttled. Will you break this into 3 patches? > Source/WebCore/dom/Document.cpp:1810 > + const Seconds styleRecalcDelay = 50_ms; Would be nice to see all the throttling-related code in one place some day. > Source/WebCore/page/FrameView.cpp:4415 > + auto hasPendingScriptExecution = frame().document()->scriptRunner() && frame().document()->scriptRunner()->hasPendingScripts(); > + if (auto* documentLoader = frame().loader().documentLoader()) { > + auto& resourceLoader = documentLoader->cachedResourceLoader(); > + if (!resourceLoader.requestCount()) > + return hasPendingScriptExecution; > + > + auto& resources = resourceLoader.allCachedResources(); > + for (auto& resource : resources) { > + if (resource.value->isLoaded()) > + continue; > + if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type::Script || resource.value->type() == CachedResource::Type::FontResource) > + return false; > + } > + } Maybe pull this into a separate function. > Source/WebCore/page/FrameView.h:396 > + void incrementVisuallyNonEmptyCharacterCount(const String); const String& > Source/WebCore/page/FrameView.h:947 > + auto whitespaceCheck = [](UChar character) { > + return character == ' ' || character == '\t' || character == '\n'; > + }; Can you not share some existing code for this? What about &nbsp; ? > Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:117 > + void initialDeferredPaint(); Hard to figure out what this means. Does it mean do the paint, or something else?
Radar WebKit Bug Importer
Comment 7 2018-11-01 11:31:18 PDT
zalan
Comment 8 2018-11-01 11:36:59 PDT
EWS Watchlist
Comment 9 2018-11-01 11:39:34 PDT
Attachment 353624 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
zalan
Comment 10 2018-11-01 11:40:07 PDT
(In reply to Simon Fraser (smfr) from comment #6) > Comment on attachment 353403 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=353403&action=review > > > Source/WebCore/ChangeLog:12 > > + 1. Improve visuallyNoneEmpty milestone confidence > > + 2. Issue initial paint soon after the milestone fires > > + 3. Suspend optional style recalcs and layouts while painting is being throttled. > > Will you break this into 3 patches? Normally I would, but since the additional paint is certainly a perf regression, I'd rather have it together with the potential progression of suspending optional style recalcs/layouts. > > > Source/WebCore/dom/Document.cpp:1810 > > + const Seconds styleRecalcDelay = 50_ms; > > Would be nice to see all the throttling-related code in one place some day. > > > Source/WebCore/page/FrameView.cpp:4415 > > + auto hasPendingScriptExecution = frame().document()->scriptRunner() && frame().document()->scriptRunner()->hasPendingScripts(); > > + if (auto* documentLoader = frame().loader().documentLoader()) { > > + auto& resourceLoader = documentLoader->cachedResourceLoader(); > > + if (!resourceLoader.requestCount()) > > + return hasPendingScriptExecution; > > + > > + auto& resources = resourceLoader.allCachedResources(); > > + for (auto& resource : resources) { > > + if (resource.value->isLoaded()) > > + continue; > > + if (resource.value->type() == CachedResource::Type::CSSStyleSheet || resource.value->type() == CachedResource::Type::Script || resource.value->type() == CachedResource::Type::FontResource) > > + return false; > > + } > > + } > > Maybe pull this into a separate function. Done. > > > Source/WebCore/page/FrameView.h:396 > > + void incrementVisuallyNonEmptyCharacterCount(const String); > > const String& :( > > > Source/WebCore/page/FrameView.h:947 > > + auto whitespaceCheck = [](UChar character) { > > + return character == ' ' || character == '\t' || character == '\n'; > > + }; > > Can you not share some existing code for this? What about &nbsp; ? I actually did find something similar in parsing code. > > > Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:117 > > + void initialDeferredPaint(); > > Hard to figure out what this means. Does it mean do the paint, or something > else? Good point. Renamed.
Antti Koivisto
Comment 11 2018-11-01 12:14:41 PDT
Comment on attachment 353624 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=353624&action=review r=me. Interesting to see how the perf bots like this. > Source/WebCore/dom/Document.cpp:1810 > + const auto styleRecalcDelay = 50_ms; I suppose there is some deep science here? > Source/WebCore/dom/Document.cpp:1811 > + m_styleRecalcTimer.startOneShot(throttleStyleRecalc ? styleRecalcDelay : 0_s); Maybe this change could be done separately? > Source/WebCore/rendering/RenderText.cpp:203 > + // FIXME: Find out how to increment the visually non empty character count when the font becomes available. Maybe this stuff needs to move to RenderText::styleDidChange
zalan
Comment 12 2018-11-01 12:48:34 PDT
(In reply to Antti Koivisto from comment #11) > Comment on attachment 353624 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=353624&action=review > > r=me. Interesting to see how the perf bots like this. > > > Source/WebCore/dom/Document.cpp:1810 > > + const auto styleRecalcDelay = 50_ms; > > I suppose there is some deep science here? 49ms seemed too short, while 51ms felt way too long. > > > Source/WebCore/dom/Document.cpp:1811 > > + m_styleRecalcTimer.startOneShot(throttleStyleRecalc ? styleRecalcDelay : 0_s); > > Maybe this change could be done separately? perf bots would see this patch as a net regression without that change. > > > Source/WebCore/rendering/RenderText.cpp:203 > > + // FIXME: Find out how to increment the visually non empty character count when the font becomes available. > > Maybe this stuff needs to move to RenderText::styleDidChange I was thinking about that too. Will probably do it in a a followup patch.
EWS Watchlist
Comment 13 2018-11-01 12:58:40 PDT
Comment on attachment 353624 [details] Patch Attachment 353624 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/9817559 New failing tests: tiled-drawing/simple-document-with-margin-tiles.html compositing/tiling/non-visible-window-tile-coverage.html
EWS Watchlist
Comment 14 2018-11-01 12:58:41 PDT
Created attachment 353636 [details] Archive of layout-test-results from ews104 for mac-sierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-sierra-wk2 Platform: Mac OS X 10.12.6
Simon Fraser (smfr)
Comment 15 2018-11-01 13:01:27 PDT
Also, what's the story on macOS? Do we do similar throttling?
zalan
Comment 16 2018-11-01 13:58:24 PDT
(In reply to Simon Fraser (smfr) from comment #15) > Also, what's the story on macOS? Do we do similar throttling? Geoff and I talked about it and agreed that it would be part of a followup patch.
zalan
Comment 17 2018-11-04 08:38:43 PST
Ryan Haddad
Comment 18 2018-11-05 09:30:44 PST
(In reply to Build Bot from comment #13) > Comment on attachment 353624 [details] > Patch > > Attachment 353624 [details] did not pass mac-wk2-ews (mac-wk2): > Output: https://webkit-queues.webkit.org/results/9817559 > > New failing tests: > tiled-drawing/simple-document-with-margin-tiles.html > compositing/tiling/non-visible-window-tile-coverage.html These tests are failing on the bots after <https://trac.webkit.org/changeset/237785>: https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/r237785%20(12559)/results.html
zalan
Comment 19 2018-11-05 09:34:29 PST
(In reply to Ryan Haddad from comment #18) > (In reply to Build Bot from comment #13) > > Comment on attachment 353624 [details] > > Patch > > > > Attachment 353624 [details] did not pass mac-wk2-ews (mac-wk2): > > Output: https://webkit-queues.webkit.org/results/9817559 > > > > New failing tests: > > tiled-drawing/simple-document-with-margin-tiles.html > > compositing/tiling/non-visible-window-tile-coverage.html > > These tests are failing on the bots after > <https://trac.webkit.org/changeset/237785>: > https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/ > r237785%20(12559)/results.html It looks to me a (In reply to Ryan Haddad from comment #18) > (In reply to Build Bot from comment #13) > > Comment on attachment 353624 [details] > > Patch > > > > Attachment 353624 [details] did not pass mac-wk2-ews (mac-wk2): > > Output: https://webkit-queues.webkit.org/results/9817559 > > > > New failing tests: > > tiled-drawing/simple-document-with-margin-tiles.html > > compositing/tiling/non-visible-window-tile-coverage.html > > These tests are failing on the bots after > <https://trac.webkit.org/changeset/237785>: > https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/ > r237785%20(12559)/results.html I assume those tests need rebaselining but not 100% sure what values represent in this context. Let me check with Tim/Simon first.
Ryan Haddad
Comment 20 2018-11-05 09:36:22 PST
Other issues after this change: These two API tests are timing out on macOS bots TestWebKitAPI.WebKit.LayoutMilestonesWithAllContentInFrame TestWebKitAPI.WebKit.FirstVisuallyNonEmptyLayoutAfterPageCacheRestore https://build.webkit.org/builders/Apple%20Sierra%20Release%20WK2%20%28Tests%29/builds/12559 Layout tests are exiting early and 5 API tests are failing the following assertion on iOS Simulator Debug bots: ASSERTION FAILED: !m_layerFlushTimer.isActive() /Volumes/Data/slave/ios-simulator-12-debug/build/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm(290) : virtual void WebKit::RemoteLayerTreeDrawingArea::scheduleInitialDeferredPaint() https://build.webkit.org/builders/Apple%20iOS%2012%20Simulator%20Debug%20WK2%20(Tests)/builds/637
Ryan Haddad
Comment 21 2018-11-05 10:07:13 PST
Reverted r237785 for reason: Introduced layout test and API test failures on macOS and iOS. Committed r237813: <https://trac.webkit.org/changeset/237813>
Simon Fraser (smfr)
Comment 22 2018-11-05 11:31:28 PST
(In reply to zalan from comment #19) > (In reply to Ryan Haddad from comment #18) > > > > These tests are failing on the bots after > > <https://trac.webkit.org/changeset/237785>: > > https://build.webkit.org/results/Apple%20Sierra%20Release%20WK2%20(Tests)/ > > r237785%20(12559)/results.html > I assume those tests need rebaselining but not 100% sure what values > represent in this context. Let me check with Tim/Simon first. Those seem like real regressions.
zalan
Comment 23 2018-11-05 21:30:30 PST
(In reply to Ryan Haddad from comment #21) > Reverted r237785 for reason: > > Introduced layout test and API test failures on macOS and iOS. > > Committed r237813: <https://trac.webkit.org/changeset/237813> Both the API and the iOS failures are addressed now and I can't repro the mac-wk2 only failures locally. :(
zalan
Comment 24 2018-11-06 12:59:11 PST
EWS Watchlist
Comment 25 2018-11-06 13:01:13 PST
Attachment 353992 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
zalan
Comment 26 2018-11-09 13:36:34 PST
EWS Watchlist
Comment 27 2018-11-09 13:37:46 PST
Attachment 354380 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 28 2018-11-09 14:29:35 PST
Comment on attachment 354380 [details] Patch Attachment 354380 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/9928487 New failing tests: http/wpt/css/css-animations/start-animation-001.html
EWS Watchlist
Comment 29 2018-11-09 14:29:36 PST
Created attachment 354386 [details] Archive of layout-test-results from ews103 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews103 Port: mac-sierra Platform: Mac OS X 10.12.6
zalan
Comment 30 2018-11-09 15:33:42 PST
EWS Watchlist
Comment 31 2018-11-09 15:37:36 PST
Attachment 354394 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
EWS Watchlist
Comment 32 2018-11-09 19:41:52 PST
Comment on attachment 354394 [details] Patch Attachment 354394 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/9932804 New failing tests: accessibility/ios-simulator/form-control-validation-message.html
EWS Watchlist
Comment 33 2018-11-09 19:41:54 PST
Created attachment 354430 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.6
zalan
Comment 34 2018-11-09 21:59:59 PST
EWS Watchlist
Comment 35 2018-11-09 22:02:58 PST
Attachment 354441 [details] did not pass style-queue: ERROR: Source/WebCore/page/ChromeClient.h:336: Inline functions should not be in classes annotated with WEBCORE_EXPORT. Remove the macro from the class and apply it to each appropriate method, or move the inline function definition out-of-line. [build/webcore_export] [4] Total errors found: 1 in 17 files If any of these errors are false positives, please file a bug against check-webkit-style.
WebKit Commit Bot
Comment 36 2018-11-09 22:39:27 PST
Comment on attachment 354441 [details] Patch Clearing flags on attachment: 354441 Committed r238064: <https://trac.webkit.org/changeset/238064>
WebKit Commit Bot
Comment 37 2018-11-09 22:39:29 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.