Title: [105879] trunk
Revision
105879
Author
[email protected]
Date
2012-01-25 07:50:53 -0800 (Wed, 25 Jan 2012)

Log Message

Clipping of render layer boundaries does not take page scale into account
https://bugs.webkit.org/show_bug.cgi?id=76850

Source/WebCore:

Patch by Sami Kyostila <[email protected]> on 2012-01-25
Reviewed by Simon Fraser.

When inserting render layers into the compositor's overlap map, the
layer boundaries are clipped against any potential parent clip rects.
The clip rects are given in CSS coordinates, while the render layer
boundaries are in scaled CSS coordinates, so the result is incorrect.
This patch scales the clip rects before calculating the intersection.

Test: compositing/overflow/overflow-scaled-descendant-overlapping.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::addToOverlapMap):

LayoutTests:

Added new test to make sure render layers inside clipped containers
are correctly tested for overlap with other layers.

Patch by Sami Kyostila <[email protected]> on 2012-01-25
Reviewed by Simon Fraser.

* compositing/overflow/overflow-scaled-descendant-overlapping.html: Added.
* platform/chromium-linux/compositing/overflow/overflow-scaled-descendant-overlapping-expected.png: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (105878 => 105879)


--- trunk/LayoutTests/ChangeLog	2012-01-25 15:31:39 UTC (rev 105878)
+++ trunk/LayoutTests/ChangeLog	2012-01-25 15:50:53 UTC (rev 105879)
@@ -1,3 +1,16 @@
+2012-01-25  Sami Kyostila  <[email protected]>
+
+        Clipping of render layer boundaries does not take page scale into account
+        https://bugs.webkit.org/show_bug.cgi?id=76850
+
+        Added new test to make sure render layers inside clipped containers
+        are correctly tested for overlap with other layers.
+
+        Reviewed by Simon Fraser.
+
+        * compositing/overflow/overflow-scaled-descendant-overlapping.html: Added.
+        * platform/chromium-linux/compositing/overflow/overflow-scaled-descendant-overlapping-expected.png: Added.
+
 2012-01-25  Stephen Chenney  <[email protected]>
 
         Linecaps wrong for zero length lines

Added: trunk/LayoutTests/compositing/overflow/overflow-scaled-descendant-overlapping.html (0 => 105879)


--- trunk/LayoutTests/compositing/overflow/overflow-scaled-descendant-overlapping.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/overflow/overflow-scaled-descendant-overlapping.html	2012-01-25 15:50:53 UTC (rev 105879)
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<html>
+    <!-- This checks the overlap test between render layers inside clipped
+    containers and other render layers when page scaling is used. See
+    https://bugs.webkit.org/show_bug.cgi?id=76850 -->
+    <script>
+        window._onload_ = function() {
+            if (window.layoutTestController)
+                layoutTestController.dumpAsText(true);
+            if (window.internals)
+                window.internals.setPageScaleFactor(document, 0.5, 0, 0);
+        }
+    </script>
+
+    <style type="text/css">
+        .box {
+            width: 100px;
+            height: 100px;
+        }
+
+        .positioned {
+            position: absolute;
+            left: 400px;
+        }
+
+        .transformed {
+            -webkit-transform: translateZ(0);
+        }
+
+        .clip {
+            overflow: hidden;
+        }
+
+        .test {
+            z-index: 1;
+            background-color: green;
+        }
+
+        .indicator {
+            background-color: red;
+        }
+    </style>
+
+    <div class="positioned test box"></div>
+
+    <div class="positioned clip box">
+        <div class="transformed indicator box"></div>
+    </div>
+</html>

Added: trunk/LayoutTests/platform/chromium-linux/compositing/overflow/overflow-scaled-descendant-overlapping-expected.png (0 => 105879)


--- trunk/LayoutTests/platform/chromium-linux/compositing/overflow/overflow-scaled-descendant-overlapping-expected.png	                        (rev 0)
+++ trunk/LayoutTests/platform/chromium-linux/compositing/overflow/overflow-scaled-descendant-overlapping-expected.png	2012-01-25 15:50:53 UTC (rev 105879)
@@ -0,0 +1,6 @@
+\x89PNG
+
+
+IHDR X')tEXtchecksum8c3a04b2bbc73057c6c9c7c48c1a34cb@\xD6\xC1?
+\xC1IDATx\x9C\xED\xDA\xC1	\xC3@A\x9Dp\xDEƑ\xAFг\xF1\xC1Q\xC1<\x9Be\xD7\xCC\t\xEE\xDDN#\xB0b \xF6\xD9=\x803\xAD\xDF\xDA=\xE1\xC5|}\xF0.X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X1\x81X\xB153\xBB7\xC5 &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b &\xB0b \xF6\x9A\xCE
+\xAB\xD2\xDF\xF6\xFDIEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (105878 => 105879)


--- trunk/Source/WebCore/ChangeLog	2012-01-25 15:31:39 UTC (rev 105878)
+++ trunk/Source/WebCore/ChangeLog	2012-01-25 15:50:53 UTC (rev 105879)
@@ -1,3 +1,21 @@
+2012-01-25  Sami Kyostila  <[email protected]>
+
+        Clipping of render layer boundaries does not take page scale into account
+        https://bugs.webkit.org/show_bug.cgi?id=76850
+
+        Reviewed by Simon Fraser.
+
+        When inserting render layers into the compositor's overlap map, the
+        layer boundaries are clipped against any potential parent clip rects.
+        The clip rects are given in CSS coordinates, while the render layer
+        boundaries are in scaled CSS coordinates, so the result is incorrect.
+        This patch scales the clip rects before calculating the intersection.
+
+        Test: compositing/overflow/overflow-scaled-descendant-overlapping.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::addToOverlapMap):
+
 2012-01-25  Stephen Chenney  <[email protected]>
 
         Linecaps wrong for zero length lines

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (105878 => 105879)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-25 15:31:39 UTC (rev 105878)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2012-01-25 15:50:53 UTC (rev 105879)
@@ -595,6 +595,7 @@
     }
 
     LayoutRect clipRect = layer->backgroundClipRect(rootRenderLayer(), 0, true).rect(); // FIXME: Incorrect for CSS regions.
+    clipRect.scale(pageScaleFactor());
     clipRect.intersect(layerBounds);
     overlapMap.add(layer, clipRect);
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to