DescriptionDon't resume commits after every layout.
We were resuming tree commits after any layout on the main frame even if rendering
was not ready and we had pending sheets or imports. This means causing layout
through tasks or API calls (ex. offsetTOp) would start pumping BeginMainFrames
and running the pipeline for no reason.
FOUC is avoided in these cases by the system inside blink that uses placeholder
styles which makes content display: none for updateLayout calls. Still we may
compute the style because of an updateLayoutIgnorePendingStylesheets() call
(ex. offsetTop) and in that case FOUC is avoided because of the painting code
which paints white until sheets have loaded.
This patch removes the call to resumeTreeViewCommits in layoutUpdated, since
we'll already resume when all sheets load or if the body is inserted and there's
no pending sheets. It then adds a new client callback for when the document
finishes parsing so that we resume commits for SVG documents which will never
have a body and may not have any sheets. I can't figure out how to write a test
for this though since layout tests artificially pump frames and paint.
This eager code for resuming commits dates back to:
https://chromium.googlesource.com/chromium/blink/+/c7e01da17b036b054fc0acf2d86483f4cdcf5cc0
BUG=504126
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=200515
Patch Set 1 #Patch Set 2 : Always resume commits after the main document has finished parsing. #
Messages
Total messages: 22 (10 generated)
|