- Revision
- 184932
- Author
- [email protected]
- Date
- 2015-05-27 17:39:35 -0700 (Wed, 27 May 2015)
Log Message
REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
https://bugs.webkit.org/show_bug.cgi?id=145420
Reviewed by Dean Jackson.
Source/WebCore:
After r183820, the media controls no longer had a wrapper that created CSS stacking context.
The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
a stacking context ancestor and make it composited. After this change, it would walk up
to a layer outside of the media element (e.g. the document element's layer), and make
that composited. This triggered bugs with root background painting.
Prevent mix-blend-mode affecting content outside the media elements by having the media element's
layer act as a stacking context.
Test: media/controls-layers.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
* rendering/RenderLayer.h:
LayoutTests:
Test that dumps compositing layers in a document with media controls.
* media/controls-layers.html: Added.
* platform/mac/media/controls-layers-expected.txt: Added.
* platform/mac-mavericks/media/controls-layers-expected.txt: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (184931 => 184932)
--- trunk/LayoutTests/ChangeLog 2015-05-28 00:34:39 UTC (rev 184931)
+++ trunk/LayoutTests/ChangeLog 2015-05-28 00:39:35 UTC (rev 184932)
@@ -1,3 +1,16 @@
+2015-05-27 Simon Fraser <[email protected]>
+
+ REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
+ https://bugs.webkit.org/show_bug.cgi?id=145420
+
+ Reviewed by Dean Jackson.
+
+ Test that dumps compositing layers in a document with media controls.
+
+ * media/controls-layers.html: Added.
+ * platform/mac/media/controls-layers-expected.txt: Added.
+ * platform/mac-mavericks/media/controls-layers-expected.txt: Added.
+
2015-05-27 Alexey Proskuryakov <[email protected]>
Update Mac WebKit1 TestExpectations for platform/mac/fast/ruby/ruby-expansion-cjk-2.html
Added: trunk/LayoutTests/media/controls-layers.html (0 => 184932)
--- trunk/LayoutTests/media/controls-layers.html (rev 0)
+++ trunk/LayoutTests/media/controls-layers.html 2015-05-28 00:39:35 UTC (rev 184932)
@@ -0,0 +1,47 @@
+<html>
+<head>
+ <script src=""
+ <style>
+ body {
+ position: absolute;
+ background-image: linear-gradient(white, silver);
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ function doTest()
+ {
+ setSrcByTagName("audio", findMediaFile("audio", "content/test"));
+ setSrcByTagName("video", findMediaFile("video", "content/test"));
+
+ if (window.testRunner) {
+ testRunner.waitUntilDone();
+ setTimeout(function() {
+ document.body.appendChild(document.createTextNode('FAIL'));
+ if (window.testRunner)
+ testRunner.notifyDone();
+ } , 8000);
+ }
+
+ var count = document.getElementsByTagName('audio').length + document.getElementsByTagName('video').length;
+ document.addEventListener("canplaythrough", function () {
+ if (!--count) {
+ if (window.testRunner) {
+ document.getElementById('layers').textContent = window.internals.layerTreeAsText(document);
+ testRunner.notifyDone();
+ }
+ }
+ }, true);
+ }
+
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+<video controls></video>
+<audio controls></audio>
+<pre id="layers"></pre>
+</body>
+</html>
Added: trunk/LayoutTests/platform/mac/media/controls-layers-expected.txt (0 => 184932)
--- trunk/LayoutTests/platform/mac/media/controls-layers-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac/media/controls-layers-expected.txt 2015-05-28 00:39:35 UTC (rev 184932)
@@ -0,0 +1,179 @@
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (children 22
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 320.00 240.00)
+ )
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 320.00 240.00)
+ )
+ (GraphicsLayer
+ (position 8.00 203.00)
+ (bounds 320.00 45.00)
+ )
+ (GraphicsLayer
+ (position 8.00 203.00)
+ (bounds 320.00 45.00)
+ (children 2
+ (GraphicsLayer
+ (bounds 320.00 45.00)
+ )
+ (GraphicsLayer
+ (bounds 320.00 45.00)
+ (blendMode lighten)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 16.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 12.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 44.00 227.00)
+ (anchor 0.50 0.56)
+ (bounds 16.00 16.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 68.00 227.00)
+ (bounds 201.00 17.00)
+ )
+ (GraphicsLayer
+ (position 76.00 228.00)
+ (bounds 32.00 14.00)
+ (opacity 0.45)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 118.00 227.00)
+ (bounds 96.00 17.00)
+ )
+ (GraphicsLayer
+ (position 118.00 227.00)
+ (bounds 96.00 17.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 224.00 228.00)
+ (bounds 37.00 14.00)
+ (opacity 0.45)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 277.00 223.00)
+ (bounds 14.00 25.00)
+ )
+ (GraphicsLayer
+ (position 252.00 243.00)
+ (opacity 0.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 63.00 0.00)
+ (children 1
+ (GraphicsLayer
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 277.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 307.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 332.00 203.00)
+ (bounds 200.00 45.00)
+ (children 2
+ (GraphicsLayer
+ (bounds 200.00 45.00)
+ )
+ (GraphicsLayer
+ (bounds 200.00 45.00)
+ (blendMode lighten)
+ (contentsOpaque 1)
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 340.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 12.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 368.00 227.00)
+ (anchor 0.50 0.56)
+ (bounds 16.00 16.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 392.00 235.00)
+ (bounds 0.00 1.00)
+ )
+ (GraphicsLayer
+ (position 510.00 223.00)
+ (bounds 14.00 25.00)
+ )
+ (GraphicsLayer
+ (position 485.00 243.00)
+ (opacity 0.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 63.00 0.00)
+ (children 1
+ (GraphicsLayer
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 510.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/platform/mac-mavericks/media/controls-layers-expected.txt (0 => 184932)
--- trunk/LayoutTests/platform/mac-mavericks/media/controls-layers-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/mac-mavericks/media/controls-layers-expected.txt 2015-05-28 00:39:35 UTC (rev 184932)
@@ -0,0 +1,124 @@
+
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 600.00)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 600.00)
+ (drawsContent 1)
+ (children 4
+ (GraphicsLayer
+ (position 8.00 8.00)
+ (bounds 320.00 240.00)
+ (children 14
+ (GraphicsLayer
+ (bounds 320.00 240.00)
+ )
+ (GraphicsLayer
+ (position 0.00 195.00)
+ (bounds 320.00 45.00)
+ )
+ (GraphicsLayer
+ (position 0.00 195.00)
+ (bounds 320.00 45.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 8.00 220.00)
+ (anchor 0.50 0.53)
+ (bounds 12.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 36.00 219.00)
+ (anchor 0.50 0.56)
+ (bounds 16.00 16.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 60.00 219.00)
+ (bounds 201.00 17.00)
+ )
+ (GraphicsLayer
+ (position 68.00 220.00)
+ (bounds 32.00 14.00)
+ (opacity 0.45)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 110.00 219.00)
+ (bounds 96.00 17.00)
+ )
+ (GraphicsLayer
+ (position 110.00 219.00)
+ (bounds 96.00 17.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 216.00 220.00)
+ (bounds 37.00 14.00)
+ (opacity 0.45)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 269.00 215.00)
+ (bounds 14.00 25.00)
+ )
+ (GraphicsLayer
+ (position 244.00 235.00)
+ (opacity 0.00)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 269.00 220.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 299.00 220.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ )
+ )
+ (GraphicsLayer
+ (position 340.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 12.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 368.00 227.00)
+ (anchor 0.50 0.56)
+ (bounds 16.00 16.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ (GraphicsLayer
+ (position 510.00 228.00)
+ (anchor 0.50 0.53)
+ (bounds 14.00 15.00)
+ (blendMode plus-lighter)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Modified: trunk/Source/WebCore/ChangeLog (184931 => 184932)
--- trunk/Source/WebCore/ChangeLog 2015-05-28 00:34:39 UTC (rev 184931)
+++ trunk/Source/WebCore/ChangeLog 2015-05-28 00:39:35 UTC (rev 184932)
@@ -1,3 +1,25 @@
+2015-05-27 Simon Fraser <[email protected]>
+
+ REGRESSION (r183820): webkit.org/blog/ background painting issue on reload, when the page contains videos
+ https://bugs.webkit.org/show_bug.cgi?id=145420
+
+ Reviewed by Dean Jackson.
+
+ After r183820, the media controls no longer had a wrapper that created CSS stacking context.
+ The media controls on Mac use mix-blend-mode, which causes the compositing code to look for
+ a stacking context ancestor and make it composited. After this change, it would walk up
+ to a layer outside of the media element (e.g. the document element's layer), and make
+ that composited. This triggered bugs with root background painting.
+
+ Prevent mix-blend-mode affecting content outside the media elements by having the media element's
+ layer act as a stacking context.
+
+ Test: media/controls-layers.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::RenderLayer):
+ * rendering/RenderLayer.h:
+
2015-05-27 Andreas Kling <[email protected]>
[WK2] Local storage areas should get torn down when they have no remaining references.
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (184931 => 184932)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2015-05-28 00:34:39 UTC (rev 184931)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2015-05-28 00:39:35 UTC (rev 184932)
@@ -261,7 +261,9 @@
}
RenderLayer::RenderLayer(RenderLayerModelObject& rendererLayerModelObject)
- : m_inResizeMode(false)
+ : m_isRootLayer(rendererLayerModelObject.isRenderView())
+ , m_forcedStackingContext(rendererLayerModelObject.isMedia())
+ , m_inResizeMode(false)
, m_scrollDimensionsDirty(true)
, m_normalFlowListDirty(true)
, m_hasSelfPaintingLayerDescendant(false)
@@ -270,7 +272,6 @@
, m_hasOutOfFlowPositionedDescendantDirty(true)
, m_needsCompositedScrolling(false)
, m_descendantsAreContiguousInStackingOrder(false)
- , m_isRootLayer(rendererLayerModelObject.isRenderView())
, m_usedTransparency(false)
, m_paintingInsideReflection(false)
, m_inOverflowRelayout(false)
Modified: trunk/Source/WebCore/rendering/RenderLayer.h (184931 => 184932)
--- trunk/Source/WebCore/rendering/RenderLayer.h 2015-05-28 00:34:39 UTC (rev 184931)
+++ trunk/Source/WebCore/rendering/RenderLayer.h 2015-05-28 00:39:35 UTC (rev 184932)
@@ -702,7 +702,7 @@
// Non-auto z-index always implies stacking context here, because StyleResolver::adjustRenderStyle already adjusts z-index
// based on positioning and other criteria.
- bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRootLayer(); }
+ bool isStackingContext(const RenderStyle* style) const { return !style->hasAutoZIndex() || isRootLayer() || m_forcedStackingContext; }
bool isDirtyStackingContainer() const { return m_zOrderListsDirty && isStackingContainer(); }
@@ -991,6 +991,9 @@
private:
// The bitfields are up here so they will fall into the padding from ScrollableArea on 64-bit.
+ const bool m_isRootLayer : 1;
+ const bool m_forcedStackingContext : 1;
+
// Keeps track of whether the layer is currently resizing, so events can cause resizing to start and stop.
bool m_inResizeMode : 1;
@@ -1019,8 +1022,6 @@
// able to safely become a stacking context.
bool m_descendantsAreContiguousInStackingOrder : 1;
- const bool m_isRootLayer : 1;
-
bool m_usedTransparency : 1; // Tracks whether we need to close a transparent layer, i.e., whether
// we ended up painting this layer or any descendants (and therefore need to
// blend).