Title: [100831] trunk
Revision
100831
Author
[email protected]
Date
2011-11-18 17:17:12 -0800 (Fri, 18 Nov 2011)

Log Message

Reflection on composited element doesn't update if the element changes to show no content
https://bugs.webkit.org/show_bug.cgi?id=72774

Source/WebCore:

Reviewed by Chris Marrin.

When a style change results in a reflected element losing its backing store,
we need to clear the backing stores on the layer clones as well.

Test: compositing/reflections/become-simple-composited-reflection.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateLayerDrawsContent):

LayoutTests:

Reviewed by Chris Marrin.

Test that removes the background-color of a reflected, composited element.

* compositing/reflections/become-simple-composited-reflection-expected.png: Added.
* compositing/reflections/become-simple-composited-reflection-expected.txt: Added.
* compositing/reflections/become-simple-composited-reflection.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (100830 => 100831)


--- trunk/LayoutTests/ChangeLog	2011-11-19 01:12:06 UTC (rev 100830)
+++ trunk/LayoutTests/ChangeLog	2011-11-19 01:17:12 UTC (rev 100831)
@@ -1,3 +1,16 @@
+2011-11-18  Simon Fraser  <[email protected]>
+
+        Reflection on composited element doesn't update if the element changes to show no content
+        https://bugs.webkit.org/show_bug.cgi?id=72774
+
+        Reviewed by Chris Marrin.
+        
+        Test that removes the background-color of a reflected, composited element.
+
+        * compositing/reflections/become-simple-composited-reflection-expected.png: Added.
+        * compositing/reflections/become-simple-composited-reflection-expected.txt: Added.
+        * compositing/reflections/become-simple-composited-reflection.html: Added.
+
 2011-11-18  Daniel Cheng  <[email protected]>
 
         [chromium] Use correct backing store for ChromiumDataObject in pasteboard writes.

Added: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.txt (0 => 100831)


--- trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.txt	2011-11-19 01:17:12 UTC (rev 100831)
@@ -0,0 +1 @@
+
Property changes on: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection-expected.txt
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection.html (0 => 100831)


--- trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection.html	2011-11-19 01:17:12 UTC (rev 100831)
@@ -0,0 +1,52 @@
+<!DOCTYPE>
+
+<html>
+<head>
+  <style>
+    body {
+      margin: 0;
+    }
+
+    .box {
+      height: 200px;
+      width: 200px;
+      background-color: red;
+      -webkit-transform: translateZ(1px);
+    }
+    
+    .indicator {
+      position: absolute;
+      top: 200px;
+      background-color: green;
+    }
+
+    .reflected {
+      -webkit-box-reflect: below 0;
+    }
+  </style>
+  <script>
+    
+    if (window.layoutTestController) {
+      layoutTestController.dumpAsText(true);
+      layoutTestController.waitUntilDone();
+    }
+    
+    function doTest()
+    {
+      window.setTimeout(function() {
+        document.getElementById('test').style.backgroundColor = 'transparent';
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, 0);
+    }
+    window.addEventListener('load', doTest, false);
+  </script>
+</head>
+<body>
+
+  <div class="indicator box"></div>
+  <!-- You should see no red box below -->
+  <div id="test" class="reflected box"></div>
+
+</body>
+</html>
Property changes on: trunk/LayoutTests/compositing/reflections/become-simple-composited-reflection.html
___________________________________________________________________

Added: svn:mime-type

Added: svn:keywords

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (100830 => 100831)


--- trunk/Source/WebCore/ChangeLog	2011-11-19 01:12:06 UTC (rev 100830)
+++ trunk/Source/WebCore/ChangeLog	2011-11-19 01:17:12 UTC (rev 100831)
@@ -1,3 +1,18 @@
+2011-11-18  Simon Fraser  <[email protected]>
+
+        Reflection on composited element doesn't update if the element changes to show no content
+        https://bugs.webkit.org/show_bug.cgi?id=72774
+
+        Reviewed by Chris Marrin.
+        
+        When a style change results in a reflected element losing its backing store,
+        we need to clear the backing stores on the layer clones as well.
+
+        Test: compositing/reflections/become-simple-composited-reflection.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::updateLayerDrawsContent):
+
 2011-11-18  Daniel Cheng  <[email protected]>
 
         [chromium] Use correct backing store for ChromiumDataObject in pasteboard writes.

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (100830 => 100831)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-11-19 01:12:06 UTC (rev 100830)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2011-11-19 01:17:12 UTC (rev 100831)
@@ -1338,9 +1338,14 @@
 
     if (m_drawsContent)
         m_layer->setNeedsDisplay();
-    else
+    else {
         m_layer->setContents(0);
-
+        if (m_layerClones) {
+            LayerMap::const_iterator end = m_layerClones->end();
+            for (LayerMap::const_iterator it = m_layerClones->begin(); it != end; ++it)
+                it->second->setContents(0);
+        }
+    }
     updateDebugIndicators();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to