Unpainted area while scrolling in Reader is white
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jun 2018 23:06:09 +0000 (23:06 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Jun 2018 23:06:09 +0000 (23:06 +0000)
commite4b78350e98205a99669bcddfe9fad142fdaf8ab
treed4b7dd4bd8c8b0684e534c9ac6de839389615b3e
parentfaf5c3b48a98660434307c807e3a7a4ad4455284
Unpainted area while scrolling in Reader is white
https://bugs.webkit.org/show_bug.cgi?id=186541
<rdar://problem/40471363>

Reviewed by Timothy Hatcher.

Source/WebCore:

New test: tiled-drawing/simple-document-with-dynamic-background-color.html

For platforms that do not use the overhang layer, we depend on
RenderView's background color to fill unpainted space.

RenderView's background color is only updated inside updateRootLayerConfiguration,
and it is possible with a simple enough page to change the document's
background color without running that code.

* page/FrameView.cpp:
(WebCore::FrameView::setTransparent):
(WebCore::FrameView::setBaseBackgroundColor):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

(WebCore::FrameView::calculateExtendedBackgroundMode const):
Update a comment, since the function it mentioned is no longer.

(WebCore::FrameView::updateTilesForExtendedBackgroundMode):
Remove this code that clears the root extended background color
if using tiles to extend in both directions. Two reasons:
1) it seems harmless to also have a root extended background color
2) this just gets clobbered by the call in RenderView::paintBoxDecorations

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
Add a bit that will do a updateConfiguration() on the root layer if no
other work needs to be done, so that we can update the root layer's
transparency or background color without doing a full layer rebuild.

(WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

(WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
Change rootBackgroundTransparencyChanged to also cover color changes.
Fold setRootExtendedBackgroundColor in here, and make use of
setRootLayerConfigurationNeedsUpdate() instead of doing a full rebuild.
Previously, we would bail if the transparency state hadn't changed;
now, we'll also update the root layer's background color and the
exposed-to-WebKit extended background color if they change too.

(WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Deleted.
(WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): Deleted.

* rendering/RenderLayerCompositor.h:
Add setRootLayerConfigurationNeedsUpdate, remove setRootExtendedBackgroundColor,
and add both a bit indicating that the root layer configuration needs updating
and the cached view background color to make the early return in
rootBackgroundColorOrTransparencyChanged possible.

* rendering/RenderView.cpp:
(WebCore::RenderView::paintBoxDecorations):
Make use of the newly added rootBackgroundColorOrTransparencyChanged.

LayoutTests:

* tiled-drawing/background-transparency-toggle-expected.txt:
This is a progression; the extended background color now matches the color
of the page at this point (#CCCCCC is the specified body background, black
with 0.2 alpha, blended with the root's white background).

* tiled-drawing/simple-document-with-dynamic-background-color-expected.txt: Added.
* tiled-drawing/simple-document-with-dynamic-background-color.html: Added.
Added a test that ensures that dynamically changing the background color
actually applies to the RenderView background. Previously, the second layer
tree dump would have a black background where it should be red.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/tiled-drawing/background-transparency-toggle-expected.txt
LayoutTests/tiled-drawing/simple-document-with-dynamic-background-color-expected.txt [new file with mode: 0644]
LayoutTests/tiled-drawing/simple-document-with-dynamic-background-color.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderView.cpp