- Revision
- 190818
- Author
- simon.fra...@apple.com
- Date
- 2015-10-09 14:07:25 -0700 (Fri, 09 Oct 2015)
Log Message
Garbage pixels on enphaseenergy.com site
https://bugs.webkit.org/show_bug.cgi?id=149915
rdar://problem/22976184
Reviewed by Darin Adler.
Source/WebCore:
When the <html> gets a composited RenderLayer, and we ask whether its background
is opaque, return false, since the document element's background propagates
to the root, and is painted by the RenderView.
Also improve the compositing logging to indicate when fore- and background layers
are present.
Test: compositing/contents-opaque/negative-z-before-html.html
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateGeometry):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::logLayerInfo):
LayoutTests:
New ref test. Also update the expected result for another test that uses negative
z-index children.
* compositing/contents-opaque/body-background-painted-expected.txt:
* compositing/contents-opaque/negative-z-before-html-expected.html: Added.
* compositing/contents-opaque/negative-z-before-html.html: Added.
* platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt:
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (190817 => 190818)
--- trunk/LayoutTests/ChangeLog 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/LayoutTests/ChangeLog 2015-10-09 21:07:25 UTC (rev 190818)
@@ -1,3 +1,19 @@
+2015-10-09 Simon Fraser <simon.fra...@apple.com>
+
+ Garbage pixels on enphaseenergy.com site
+ https://bugs.webkit.org/show_bug.cgi?id=149915
+ rdar://problem/22976184
+
+ Reviewed by Darin Adler.
+
+ New ref test. Also update the expected result for another test that uses negative
+ z-index children.
+
+ * compositing/contents-opaque/body-background-painted-expected.txt:
+ * compositing/contents-opaque/negative-z-before-html-expected.html: Added.
+ * compositing/contents-opaque/negative-z-before-html.html: Added.
+ * platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt:
+
2015-10-09 Antoine Quint <grao...@apple.com>
Dynamic background color changes do not update until a layout is forced
Modified: trunk/LayoutTests/compositing/contents-opaque/body-background-painted-expected.txt (190817 => 190818)
--- trunk/LayoutTests/compositing/contents-opaque/body-background-painted-expected.txt 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/LayoutTests/compositing/contents-opaque/body-background-painted-expected.txt 2015-10-09 21:07:25 UTC (rev 190818)
@@ -8,7 +8,6 @@
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
- (contentsOpaque 1)
(drawsContent 1)
(children 2
(GraphicsLayer
Modified: trunk/LayoutTests/compositing/contents-opaque/body-background-painted.html (190817 => 190818)
--- trunk/LayoutTests/compositing/contents-opaque/body-background-painted.html 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/LayoutTests/compositing/contents-opaque/body-background-painted.html 2015-10-09 21:07:25 UTC (rev 190818)
@@ -28,7 +28,7 @@
</head>
<!-- Composited body over the child div. -->
<!-- Root <html> element has a background-color. -->
- <!-- Background for the body element is painted in this case. ->
+ <!-- Background for the body element is painted in this case. -->
<!-- GraphicsLayer::contentsOpaque for the body layer should be false. -->
<body>
<!-- Box under the body. -->
Added: trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html-expected.html (0 => 190818)
--- trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html-expected.html 2015-10-09 21:07:25 UTC (rev 190818)
@@ -0,0 +1,28 @@
+<html>
+<head>
+ <style>
+ body {
+ margin: 0;
+ }
+
+ .before {
+ background: blue;
+ margin: 10px;
+ width: 200px;
+ height: 200px;
+ position: fixed;
+ }
+
+ html {
+ background-image: linear-gradient(white, white);
+ background-attachment: fixed;
+ background-position: 50% 50%;
+ background-size: 400px 400px;
+ background-color: red;
+ }
+ </style>
+</head>
+<body>
+ <div class="before"></div>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html.html (0 => 190818)
--- trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html.html (rev 0)
+++ trunk/LayoutTests/compositing/contents-opaque/negative-z-before-html.html 2015-10-09 21:07:25 UTC (rev 190818)
@@ -0,0 +1,29 @@
+<html>
+<head>
+ <style>
+ body {
+ margin: 0;
+ }
+
+ html:before {
+ content: '';
+ background: blue;
+ margin: 10px;
+ width: 200px;
+ height: 200px;
+ position: fixed;
+ z-index: -1;
+ }
+
+ html {
+ background-image: linear-gradient(white, white);
+ background-attachment: fixed;
+ background-position: 50% 50%;
+ background-size: 400px 400px;
+ background-color: red;
+ }
+ </style>
+</head>
+<body>
+</body>
+</html>
Modified: trunk/LayoutTests/platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt (190817 => 190818)
--- trunk/LayoutTests/platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/LayoutTests/platform/mac-wk2/compositing/contents-opaque/body-background-painted-expected.txt 2015-10-09 21:07:25 UTC (rev 190818)
@@ -9,7 +9,6 @@
(children 1
(GraphicsLayer
(bounds 800.00 600.00)
- (contentsOpaque 1)
(drawsContent 1)
(children 2
(GraphicsLayer
Modified: trunk/Source/WebCore/ChangeLog (190817 => 190818)
--- trunk/Source/WebCore/ChangeLog 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/Source/WebCore/ChangeLog 2015-10-09 21:07:25 UTC (rev 190818)
@@ -1,3 +1,25 @@
+2015-10-09 Simon Fraser <simon.fra...@apple.com>
+
+ Garbage pixels on enphaseenergy.com site
+ https://bugs.webkit.org/show_bug.cgi?id=149915
+ rdar://problem/22976184
+
+ Reviewed by Darin Adler.
+
+ When the <html> gets a composited RenderLayer, and we ask whether its background
+ is opaque, return false, since the document element's background propagates
+ to the root, and is painted by the RenderView.
+
+ Also improve the compositing logging to indicate when fore- and background layers
+ are present.
+
+ Test: compositing/contents-opaque/negative-z-before-html.html
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::updateGeometry):
+ * rendering/RenderLayerCompositor.cpp:
+ (WebCore::RenderLayerCompositor::logLayerInfo):
+
2015-10-09 Antoine Quint <grao...@apple.com>
Dynamic background color changes do not update until a layout is forced
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (190817 => 190818)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2015-10-09 21:07:25 UTC (rev 190818)
@@ -6127,6 +6127,12 @@
if (paintsWithTransparency(PaintBehaviorNormal))
return false;
+ if (renderer().isRoot()) {
+ // Normally the document element doens't have a layer. If it does have a layer, its background propagates to the RenderView
+ // so this layer doesn't draw it.
+ return false;
+ }
+
// We can't use hasVisibleContent(), because that will be true if our renderer is hidden, but some child
// is visible and that child doesn't cover the entire rect.
if (renderer().style().visibility() != VISIBLE)
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (190817 => 190818)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-10-09 21:00:27 UTC (rev 190817)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2015-10-09 21:07:25 UTC (rev 190818)
@@ -861,12 +861,32 @@
logString.append(logReasonsForCompositing(layer));
logString.appendLiteral(") ");
- if (backing->graphicsLayer()->contentsOpaque() || backing->paintsIntoCompositedAncestor()) {
+ if (backing->graphicsLayer()->contentsOpaque() || backing->paintsIntoCompositedAncestor() || backing->foregroundLayer() || backing->backgroundLayer()) {
logString.append('[');
- if (backing->graphicsLayer()->contentsOpaque())
+ bool prependSpace = false;
+ if (backing->graphicsLayer()->contentsOpaque()) {
logString.appendLiteral("opaque");
- if (backing->paintsIntoCompositedAncestor())
+ prependSpace = true;
+ }
+
+ if (backing->paintsIntoCompositedAncestor()) {
+ if (prependSpace)
+ logString.appendLiteral(", ");
logString.appendLiteral("paints into ancestor");
+ prependSpace = true;
+ }
+
+ if (backing->foregroundLayer() || backing->backgroundLayer()) {
+ if (prependSpace)
+ logString.appendLiteral(", ");
+ if (backing->foregroundLayer() && backing->backgroundLayer())
+ logString.appendLiteral("foreground+background");
+ else if (backing->foregroundLayer())
+ logString.appendLiteral("foreground");
+ else
+ logString.appendLiteral("background");
+ }
+
logString.appendLiteral("] ");
}