Title: [170306] trunk
- Revision
- 170306
- Author
- [email protected]
- Date
- 2014-06-23 12:00:32 -0700 (Mon, 23 Jun 2014)
Log Message
Adding a mask on a simple color compositing layer removes the content
https://bugs.webkit.org/show_bug.cgi?id=134127
Reviewed by Dean Jackson.
Source/WebCore:
In r169053 I moved some updateDrawsContent() into updateAfterDescendents(),
but this isn't called when a composited layer gains or loses a mask (which
doesn't cause a layout). This caused us to fail to allocate backing store
when gaining a mask, resulting in missing content.
Fix by calling updateAfterDescendents() from RenderLayer::styleChange()
when the layer config isn't changing.
Also remove a condition in isSimpleContainerCompositingLayer() that caused us
to fall off the simple layer path for masked layers, since this works just
fine.
Test: compositing/masks/solid-color-masked.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
LayoutTests:
* compositing/masks/mask-layer-size-expected.txt:
* compositing/masks/solid-color-masked-expected.html: Added.
* compositing/masks/solid-color-masked.html: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (170305 => 170306)
--- trunk/LayoutTests/ChangeLog 2014-06-23 19:00:30 UTC (rev 170305)
+++ trunk/LayoutTests/ChangeLog 2014-06-23 19:00:32 UTC (rev 170306)
@@ -1,3 +1,14 @@
+2014-06-23 Simon Fraser <[email protected]>
+
+ Adding a mask on a simple color compositing layer removes the content
+ https://bugs.webkit.org/show_bug.cgi?id=134127
+
+ Reviewed by Dean Jackson.
+
+ * compositing/masks/mask-layer-size-expected.txt:
+ * compositing/masks/solid-color-masked-expected.html: Added.
+ * compositing/masks/solid-color-masked.html: Added.
+
2014-06-23 David Hyatt <[email protected]>
[New Multicolumn] Writing mode changes on the <html> and RenderView need to
Modified: trunk/LayoutTests/compositing/masks/mask-layer-size-expected.txt (170305 => 170306)
--- trunk/LayoutTests/compositing/masks/mask-layer-size-expected.txt 2014-06-23 19:00:30 UTC (rev 170305)
+++ trunk/LayoutTests/compositing/masks/mask-layer-size-expected.txt 2014-06-23 19:00:32 UTC (rev 170306)
@@ -10,7 +10,6 @@
(position 10.00 10.00)
(bounds 400.00 200.00)
(contentsOpaque 1)
- (drawsContent 1)
)
)
)
Added: trunk/LayoutTests/compositing/masks/solid-color-masked-expected.html (0 => 170306)
--- trunk/LayoutTests/compositing/masks/solid-color-masked-expected.html (rev 0)
+++ trunk/LayoutTests/compositing/masks/solid-color-masked-expected.html 2014-06-23 19:00:32 UTC (rev 170306)
@@ -0,0 +1,25 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+
+ .masked {
+ -webkit-mask-image: linear-gradient(black, transparent);
+ }
+ </style>
+</head>
+<body>
+<div id="box" class="masked composited box">
+</div>
+</body>
+</html>
Added: trunk/LayoutTests/compositing/masks/solid-color-masked.html (0 => 170306)
--- trunk/LayoutTests/compositing/masks/solid-color-masked.html (rev 0)
+++ trunk/LayoutTests/compositing/masks/solid-color-masked.html 2014-06-23 19:00:32 UTC (rev 170306)
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <style>
+ .box {
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+ }
+
+ .composited {
+ -webkit-transform: translateZ(0);
+ }
+
+ .masked {
+ -webkit-mask-image: linear-gradient(black, transparent);
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.waitUntilDone();
+ function doTest()
+ {
+ window.setTimeout(function() {
+ document.getElementById('box').classList.add('masked');
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }, 0);
+ }
+ window.addEventListener('load', doTest, false);
+ </script>
+</head>
+<body>
+<div id="box" class="composited box">
+</div>
+</body>
+</html>
Modified: trunk/Source/WebCore/ChangeLog (170305 => 170306)
--- trunk/Source/WebCore/ChangeLog 2014-06-23 19:00:30 UTC (rev 170305)
+++ trunk/Source/WebCore/ChangeLog 2014-06-23 19:00:32 UTC (rev 170306)
@@ -1,3 +1,29 @@
+2014-06-23 Simon Fraser <[email protected]>
+
+ Adding a mask on a simple color compositing layer removes the content
+ https://bugs.webkit.org/show_bug.cgi?id=134127
+
+ Reviewed by Dean Jackson.
+
+ In r169053 I moved some updateDrawsContent() into updateAfterDescendents(),
+ but this isn't called when a composited layer gains or loses a mask (which
+ doesn't cause a layout). This caused us to fail to allocate backing store
+ when gaining a mask, resulting in missing content.
+
+ Fix by calling updateAfterDescendents() from RenderLayer::styleChange()
+ when the layer config isn't changing.
+
+ Also remove a condition in isSimpleContainerCompositingLayer() that caused us
+ to fall off the simple layer path for masked layers, since this works just
+ fine.
+
+ Test: compositing/masks/solid-color-masked.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::calculateClipRects):
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
+
2014-06-23 David Hyatt <[email protected]>
[New Multicolumn] Writing mode changes on the <html> and RenderView need to
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (170305 => 170306)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-06-23 19:00:30 UTC (rev 170305)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2014-06-23 19:00:32 UTC (rev 170306)
@@ -6395,8 +6395,11 @@
|| needsCompositingLayersRebuiltForClip(oldStyle, &newStyle)
|| needsCompositingLayersRebuiltForOverflow(oldStyle, &newStyle))
compositor().setCompositingLayersNeedRebuild();
- else if (isComposited())
+ else if (isComposited()) {
+ // FIXME: updating geometry here is potentially harmful, because layout is not up-to-date.
backing()->updateGeometry();
+ backing()->updateAfterDescendents();
+ }
if (oldStyle) {
// Compositing layers keep track of whether they are clipped by any of the ancestors.
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (170305 => 170306)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-06-23 19:00:30 UTC (rev 170305)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2014-06-23 19:00:32 UTC (rev 170306)
@@ -1703,9 +1703,6 @@
// This is a useful optimization, because it allows us to avoid allocating backing store.
bool RenderLayerBacking::isSimpleContainerCompositingLayer() const
{
- if (renderer().hasMask()) // masks require special treatment
- return false;
-
if (renderer().isReplaced() && (!isCompositedPlugin(&renderer()) || isRestartedPlugin(&renderer())))
return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes