Title: [116395] trunk
Revision
116395
Author
[email protected]
Date
2012-05-07 22:45:43 -0700 (Mon, 07 May 2012)

Log Message

Compositing layers with transformed children not large enough to show contents
https://bugs.webkit.org/show_bug.cgi?id=85855

Source/WebCore:

Reviewed by Dan Bernstein.

r114518 added a code path to RenderLayer::calculateLayerBounds() which
does an early return if the layer has clipping. However, this code
path omitted to take local transforms into account.

Fix is to handle transforms as we do in the non-clipped case.

Test: compositing/geometry/bounds-clipped-composited-child.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateLayerBounds):

LayoutTests:

Reviewed by Dan Bernstein.

Test having composited element with clipped, transformed children.

* compositing/geometry/bounds-clipped-composited-child-expected.png: Added.
* compositing/geometry/bounds-clipped-composited-child-expected.txt: Added.
* compositing/geometry/bounds-clipped-composited-child.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (116394 => 116395)


--- trunk/LayoutTests/ChangeLog	2012-05-08 05:14:07 UTC (rev 116394)
+++ trunk/LayoutTests/ChangeLog	2012-05-08 05:45:43 UTC (rev 116395)
@@ -1,3 +1,16 @@
+2012-05-07  Simon Fraser  <[email protected]>
+
+        Compositing layers with transformed children not large enough to show contents
+        https://bugs.webkit.org/show_bug.cgi?id=85855
+
+        Reviewed by Dan Bernstein.
+        
+        Test having composited element with clipped, transformed children.
+
+        * compositing/geometry/bounds-clipped-composited-child-expected.png: Added.
+        * compositing/geometry/bounds-clipped-composited-child-expected.txt: Added.
+        * compositing/geometry/bounds-clipped-composited-child.html: Added.
+
 2012-05-07  Kent Tamura  <[email protected]>
 
         [Chromium] Add expectations for first-line-text-decoration.html.

Added: trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child-expected.txt (0 => 116395)


--- trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child-expected.txt	2012-05-08 05:45:43 UTC (rev 116395)
@@ -0,0 +1,18 @@
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 58.00 8.00)
+          (anchor 0.25 0.50)
+          (bounds 200.00 100.00)
+          (drawsContent 1)
+          (transform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 0.00] [-50.00 0.00 0.00 1.00])
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child.html (0 => 116395)


--- trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/geometry/bounds-clipped-composited-child.html	2012-05-08 05:45:43 UTC (rev 116395)
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+  <style>
+    body {
+      overflow: hidden;
+    }
+    .container {
+      margin-left: 50px;
+      height: 100px;
+      width: 100px;
+      -webkit-transform: translate3d(-50%, 0, 0);
+    }
+    
+    .box {
+      position: absolute;
+      top: 0;
+      height: 100px;
+      width: 100px;
+      overflow: hidden;
+      background-color: green;
+    }
+    
+    #indicator {
+      position: absolute;
+      top: 8px;
+      left: 8px;
+      width: 200px;
+      height: 100px;
+      background-color: red;
+    }
+    
+    #layers {
+      opacity: 0; /* hide from pixel result */
+    }
+  </style>
+  <script>
+    if (window.layoutTestController)
+      layoutTestController.dumpAsText(true);
+
+    function dumpLayers()
+    {
+      if (window.layoutTestController)
+        document.getElementById('layers').innerText = layoutTestController.layerTreeAsText();
+    }
+
+    window.addEventListener('load', dumpLayers, false);
+  </script>
+</head>
+<body>
+  <!-- You should see a green rectangle, and no red. -->
+  <div id="indicator"></div>
+  <div class="container">
+    <div class="box" style="-webkit-transform: translateX(0)"></div>
+    <div class="box" style="-webkit-transform: translateX(100%)"></div>
+  </div>
+<pre id="layers">Layer tree goes here in DRT</pre>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (116394 => 116395)


--- trunk/Source/WebCore/ChangeLog	2012-05-08 05:14:07 UTC (rev 116394)
+++ trunk/Source/WebCore/ChangeLog	2012-05-08 05:45:43 UTC (rev 116395)
@@ -1,3 +1,21 @@
+2012-05-07  Simon Fraser  <[email protected]>
+
+        Compositing layers with transformed children not large enough to show contents
+        https://bugs.webkit.org/show_bug.cgi?id=85855
+
+        Reviewed by Dan Bernstein.
+        
+        r114518 added a code path to RenderLayer::calculateLayerBounds() which
+        does an early return if the layer has clipping. However, this code
+        path omitted to take local transforms into account.
+        
+        Fix is to handle transforms as we do in the non-clipped case.
+
+        Test: compositing/geometry/bounds-clipped-composited-child.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::calculateLayerBounds):
+
 2012-05-07  Scott Graham  <[email protected]>
 
         Fix signed/unsigned mismatch

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (116394 => 116395)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-08 05:14:07 UTC (rev 116394)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2012-05-08 05:45:43 UTC (rev 116395)
@@ -4159,6 +4159,9 @@
     if (flags & UseLocalClipRectIfPossible) {
         LayoutRect localClipRect = layer->localClipRect();
         if (localClipRect != PaintInfo::infiniteRect()) {
+            if ((flags & IncludeSelfTransform) && layer->paintsWithTransform(PaintBehaviorNormal))
+                localClipRect = layer->transform()->mapRect(localClipRect);
+
             LayoutPoint ancestorRelOffset;
             layer->convertToLayerCoords(ancestorLayer, ancestorRelOffset);
             localClipRect.moveBy(ancestorRelOffset);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to