-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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. Canonical link: https://commits.webkit.org/202091@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@232991 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
75961ba
commit 3af4f32
Showing
9 changed files
with
194 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
LayoutTests/tiled-drawing/simple-document-with-dynamic-background-color-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
(GraphicsLayer | ||
(anchor 0.00 0.00) | ||
(bounds 800.00 600.00) | ||
(children 1 | ||
(GraphicsLayer | ||
(bounds 800.00 600.00) | ||
(contentsOpaque 1) | ||
(backgroundColor #000000) | ||
(tile cache coverage 0, 0 800 x 600) | ||
(tile size 800 x 600) | ||
(top left tile 0, 0 tiles grid 1 x 1) | ||
(in window 1) | ||
) | ||
) | ||
) | ||
|
||
|
||
(GraphicsLayer | ||
(anchor 0.00 0.00) | ||
(bounds 800.00 600.00) | ||
(children 1 | ||
(GraphicsLayer | ||
(bounds 800.00 600.00) | ||
(contentsOpaque 1) | ||
(backgroundColor #FF0000) | ||
(tile cache coverage 0, 0 800 x 600) | ||
(tile size 800 x 600) | ||
(top left tile 0, 0 tiles grid 1 x 1) | ||
(in window 1) | ||
) | ||
) | ||
) | ||
|
35 changes: 35 additions & 0 deletions
35
LayoutTests/tiled-drawing/simple-document-with-dynamic-background-color.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
|
||
<html> | ||
<head> | ||
<script> | ||
if (window.testRunner) { | ||
testRunner.dumpAsText(); | ||
testRunner.waitUntilDone(); | ||
} | ||
|
||
function doTest() | ||
{ | ||
if (!window.internals) | ||
return; | ||
|
||
document.body.style.backgroundColor = "black"; | ||
|
||
// The RenderView's background color should be black. | ||
document.getElementById('layers').innerText = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES) + "\n\n"; | ||
|
||
document.body.style.backgroundColor = "red"; | ||
|
||
// The RenderView's background color should be red. | ||
document.getElementById('layers').innerText += internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_TILE_CACHES); | ||
|
||
testRunner.notifyDone(); | ||
} | ||
window.addEventListener('load', doTest, false); | ||
</script> | ||
</head> | ||
|
||
<body> | ||
<pre id="layers">Layer tree goes here</p> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters