[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

simon.fraser at apple.com simon.fraser at apple.com
Wed Dec 22 18:41:54 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 987eca9cca40f9e9c2c03ffbf87f5233b924e01a
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 15 23:49:45 2010 +0000

    2010-12-15  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Chris Marrin.
    
            Reflection does not render properly when -webkit-transform is toggled, untoggled, and retoggled
            https://bugs.webkit.org/show_bug.cgi?id=50967
    
            If a reflection on a compositied, transformed element is toggled on, off and on,
            then we pick up a cached layer clone that has the wrong transform set on it.
    
            The fix is to reset those properties on the layer clones that get changed
            when the GraphicsLayer gains a structural layer (for reflection flattening).
    
            Test: compositing/reflections/remove-add-reflection.html
    
            * platform/graphics/ca/GraphicsLayerCA.cpp:
            (WebCore::GraphicsLayerCA::ensureStructuralLayer):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74155 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 12ead47..df6efee 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-12-15  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Reflection does not render properly when -webkit-transform is toggled, untoggled, and retoggled
+        https://bugs.webkit.org/show_bug.cgi?id=50967
+
+        Testcase for toggled reflection on transformed element.
+        
+        * compositing/reflections/remove-add-reflection-expected.checksum: Added.
+        * compositing/reflections/remove-add-reflection-expected.png: Added.
+        * compositing/reflections/remove-add-reflection-expected.txt: Added.
+        * compositing/reflections/remove-add-reflection.html: Added.
+
 2010-12-15  Helder Correia  <helder at sencha.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/LayoutTests/compositing/reflections/remove-add-reflection-expected.checksum b/LayoutTests/compositing/reflections/remove-add-reflection-expected.checksum
new file mode 100644
index 0000000..f6dd1b7
--- /dev/null
+++ b/LayoutTests/compositing/reflections/remove-add-reflection-expected.checksum
@@ -0,0 +1 @@
+663fe15263d41fa06381564407a29ba3
\ No newline at end of file
diff --git a/LayoutTests/compositing/reflections/remove-add-reflection-expected.png b/LayoutTests/compositing/reflections/remove-add-reflection-expected.png
new file mode 100644
index 0000000..da6f8f2
Binary files /dev/null and b/LayoutTests/compositing/reflections/remove-add-reflection-expected.png differ
diff --git a/LayoutTests/compositing/reflections/remove-add-reflection-expected.txt b/LayoutTests/compositing/reflections/remove-add-reflection-expected.txt
new file mode 100644
index 0000000..2211cce
--- /dev/null
+++ b/LayoutTests/compositing/reflections/remove-add-reflection-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (0,0) size 800x600
+layer at (50,150) size 100x100
+  RenderBlock (positioned) {DIV} at (50,150) size 100x100 [bgcolor=#FF0000]
+layer at (0,0) size 100x100
+  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/LayoutTests/compositing/reflections/remove-add-reflection.html b/LayoutTests/compositing/reflections/remove-add-reflection.html
new file mode 100644
index 0000000..25edea9
--- /dev/null
+++ b/LayoutTests/compositing/reflections/remove-add-reflection.html
@@ -0,0 +1,58 @@
+<html>
+  <head>
+    <style>
+      body {
+        margin: 0;
+      }
+
+      #indicator {
+        position: absolute;
+        width: 100px;
+        height: 100px;
+        left: 50px;
+        top: 150px;
+        background-color: red;
+      }
+      #box {
+        width: 100px;
+        height: 100px;
+        background-color: green;
+        -webkit-transform: translate3d(50px, 50px, 0);
+        -webkit-box-reflect: below;
+      }
+    </style>
+    <script type="text/javascript">
+      if (window.layoutTestController)
+        layoutTestController.waitUntilDone();
+
+      var reflectionOn = true;
+      function toggleReflection()
+      {
+        reflectionOn = !reflectionOn;
+        var box = document.getElementById('box');
+        box.style.webkitBoxReflect = reflectionOn? 'below' : 'none';
+      }
+      
+      function doTest()
+      {
+        window.setTimeout(function() {
+          toggleReflection(); // remove
+          
+          window.setTimeout(function() {
+            toggleReflection(); // add
+          
+            if (window.layoutTestController)
+              layoutTestController.notifyDone();
+          }, 0);
+        }, 50);
+      }
+      
+      window.addEventListener('load', doTest, false);
+    </script>
+  </head>
+  <body>
+    <!-- You should see a single green rectangle and no red below. -->
+    <div id="indicator"></div>
+    <div id="box"></div>
+  </body>
+</html>
\ No newline at end of file
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index d84d7f3..faf19a3 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-12-15  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Chris Marrin.
+
+        Reflection does not render properly when -webkit-transform is toggled, untoggled, and retoggled
+        https://bugs.webkit.org/show_bug.cgi?id=50967
+        
+        If a reflection on a compositied, transformed element is toggled on, off and on,
+        then we pick up a cached layer clone that has the wrong transform set on it.
+        
+        The fix is to reset those properties on the layer clones that get changed
+        when the GraphicsLayer gains a structural layer (for reflection flattening).
+
+        Test: compositing/reflections/remove-add-reflection.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+
 2010-12-15  Helder Correia  <helder at sencha.com>
 
         Reviewed by Ariya Hidayat.
diff --git a/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp b/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
index 9868def..8bde9fd 100644
--- a/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
+++ b/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
@@ -1149,10 +1149,21 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
     
     // Set properties of m_layer to their default values, since these are expressed on on the structural layer.
     FloatPoint point(m_size.width() / 2.0f, m_size.height() / 2.0f);
+    FloatPoint3D anchorPoint(0.5f, 0.5f, 0);
     m_layer->setPosition(point);
-    m_layer->setAnchorPoint(FloatPoint3D(0.5f, 0.5f, 0));
+    m_layer->setAnchorPoint(anchorPoint);
     m_layer->setTransform(TransformationMatrix());
     m_layer->setOpacity(1);
+    if (m_layerClones) {
+        LayerMap::const_iterator end = m_layerClones->end();
+        for (LayerMap::const_iterator it = m_layerClones->begin(); it != end; ++it) {
+            PlatformCALayer* currLayer = it->second.get();
+            currLayer->setPosition(point);
+            currLayer->setAnchorPoint(anchorPoint);
+            currLayer->setTransform(TransformationMatrix());
+            currLayer->setOpacity(1);
+        }
+    }
 
     // Move this layer to be a child of the transform layer.
     m_layer->superlayer()->replaceSublayer(m_layer.get(), m_structuralLayer.get());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list