REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2019 19:31:06 +0000 (19:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 1 May 2019 19:31:06 +0000 (19:31 +0000)
commit80b0b369dbf24e10b36e6b8da9e5637bf3f08517
tree32a68ce9b9ff8639b3b83bb226ea4776d98b48b9
parentbe9b0172af813db6dd03773a90103b736f5a4da6
REGRESSION (r244182): RenderingUpdate should not be scheduled for invisible pages
https://bugs.webkit.org/show_bug.cgi?id=197451

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-05-01
Reviewed by Simon Fraser.

Before r244182, some web pages never need to schedule a RenderingUpdate.
Only pages with rAF callbacks, web animations, intersection and resize
observers needed to do so. After r244182, all pages have to schedule a
RenderingUpdate when a page rendering update is required.

When Safari opens, it create a 'blank' web page. The blank page will not
be visible unless the user selects to show the 'Empty page' in the new
tab. Although the blank page is not visible, the loader needs to resolveStyle()
which requires to scheduleLayerFlushNow().

We need to optimize this case: calling scheduleLayerFlushNow() for invisible
pages. We do that by checking if the page is visible before scheduling
the RenderingUpdate.

Also we need to change or get rid of scheduleLayerFlushNow() since its name
has become confusing. It suggests that it is going to schedule flushing
the layer 'now'. But after r244182, it does scheduleRenderingUpdate() first.
And when it fires, scheduleCompositingLayerFlush() will be called.

* page/RenderingUpdateScheduler.cpp:
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlush):
(WebCore::RenderLayerCompositor::didChangeVisibleRect):
(WebCore::RenderLayerCompositor::frameViewDidScroll):
(WebCore::RenderLayerCompositor::attachRootLayer):
(WebCore::RenderLayerCompositor::setLayerFlushThrottlingEnabled):
(WebCore::RenderLayerCompositor::layerFlushTimerFired):
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow): Deleted.
* rendering/RenderLayerCompositor.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244837 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/RenderingUpdateScheduler.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h