Title: [94315] trunk
Revision
94315
Author
[email protected]
Date
2011-09-01 10:58:41 -0700 (Thu, 01 Sep 2011)

Log Message

[chromium] Fix scissor rects on clipped nested iframes
https://bugs.webkit.org/show_bug.cgi?id=67221

Reviewed by James Robinson.

Source/WebCore:

Layers that mask to bounds (like iframes) weren't being properly
clipped if their parent scissor rect was empty. This case happens
when a parent iframe is clipped. Fixed by propagating the empty
scissor rect to child layers rather than ignoring it.

Test: compositing/iframes/nested-composited-iframe.html

* platform/graphics/chromium/LayerRendererChromium.cpp:

LayoutTests:

* compositing/iframes/nested-composited-iframe-expected.png: Added.
* compositing/iframes/nested-composited-iframe-expected.txt: Added.
* compositing/iframes/nested-composited-iframe.html: Added.
* compositing/iframes/resources/composited-red.html: Added.
* compositing/iframes/resources/has-composited-iframe-child.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (94314 => 94315)


--- trunk/LayoutTests/ChangeLog	2011-09-01 17:57:09 UTC (rev 94314)
+++ trunk/LayoutTests/ChangeLog	2011-09-01 17:58:41 UTC (rev 94315)
@@ -1,3 +1,16 @@
+2011-08-30  Adrienne Walker  <[email protected]>
+
+        [chromium] Fix scissor rects on clipped nested iframes
+        https://bugs.webkit.org/show_bug.cgi?id=67221
+
+        Reviewed by James Robinson.
+
+        * compositing/iframes/nested-composited-iframe-expected.png: Added.
+        * compositing/iframes/nested-composited-iframe-expected.txt: Added.
+        * compositing/iframes/nested-composited-iframe.html: Added.
+        * compositing/iframes/resources/composited-red.html: Added.
+        * compositing/iframes/resources/has-composited-iframe-child.html: Added.
+
 2011-09-01  Alexander Pavlov  <[email protected]>
 
         [Chromium] Unreviewed, rebaseline tests after r94299.

Added: trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.txt (0 => 94315)


--- trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.txt	2011-09-01 17:58:41 UTC (rev 94315)
@@ -0,0 +1 @@
+
Property changes on: trunk/LayoutTests/compositing/iframes/nested-composited-iframe-expected.txt
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/iframes/nested-composited-iframe.html (0 => 94315)


--- trunk/LayoutTests/compositing/iframes/nested-composited-iframe.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/nested-composited-iframe.html	2011-09-01 17:58:41 UTC (rev 94315)
@@ -0,0 +1,30 @@
+<html>
+  <head>
+    <style>
+      body {
+        overflow: hidden;
+        background-color: green;
+      }
+      iframe {
+        position: absolute;
+        width: 400px;
+        height: 400px;
+        left: 0px;
+        top: 200px;
+        border: 0px;
+      }
+    </style>
+    <script>
+      function runTest() {
+        var iframe = document.getElementsByTagName("iframe")[0];
+        iframe.contentWindow.scrollTo(0, 250);
+      }
+      if (window.layoutTestController)
+        layoutTestController.dumpAsText(true);
+      window.addEventListener("load", runTest, false);
+    </script>
+  </head>
+  <body>
+    <iframe src=""
+  </body>
+</html>
Property changes on: trunk/LayoutTests/compositing/iframes/nested-composited-iframe.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/iframes/resources/composited-red.html (0 => 94315)


--- trunk/LayoutTests/compositing/iframes/resources/composited-red.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/resources/composited-red.html	2011-09-01 17:58:41 UTC (rev 94315)
@@ -0,0 +1,16 @@
+<html>
+  <head>
+    <style>
+      body {
+        overflow: auto;
+        background-color: red;
+      }
+      #trigger {
+        -webkit-transform: translateZ(0);
+      }
+    </style>
+  </head>
+  <body>
+    <div id="trigger"></div>
+  </body>
+</html>
Property changes on: trunk/LayoutTests/compositing/iframes/resources/composited-red.html
___________________________________________________________________

Added: svn:eol-style

Added: trunk/LayoutTests/compositing/iframes/resources/has-composited-iframe-child.html (0 => 94315)


--- trunk/LayoutTests/compositing/iframes/resources/has-composited-iframe-child.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/iframes/resources/has-composited-iframe-child.html	2011-09-01 17:58:41 UTC (rev 94315)
@@ -0,0 +1,21 @@
+<html>
+  <head>
+    <style>
+      body {
+        overflow: hidden;
+        height: 1000px;
+      }
+      iframe {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        border: 0px;
+      }
+    </style>
+  </head>
+  <body>
+    <iframe src=""
+  </body>
+</html>
Property changes on: trunk/LayoutTests/compositing/iframes/resources/has-composited-iframe-child.html
___________________________________________________________________

Added: svn:eol-style

Modified: trunk/Source/WebCore/ChangeLog (94314 => 94315)


--- trunk/Source/WebCore/ChangeLog	2011-09-01 17:57:09 UTC (rev 94314)
+++ trunk/Source/WebCore/ChangeLog	2011-09-01 17:58:41 UTC (rev 94315)
@@ -1,3 +1,19 @@
+2011-08-30  Adrienne Walker  <[email protected]>
+
+        [chromium] Fix scissor rects on clipped nested iframes
+        https://bugs.webkit.org/show_bug.cgi?id=67221
+
+        Reviewed by James Robinson.
+
+        Layers that mask to bounds (like iframes) weren't being properly
+        clipped if their parent scissor rect was empty. This case happens
+        when a parent iframe is clipped. Fixed by propagating the empty
+        scissor rect to child layers rather than ignoring it.
+
+        Test: compositing/iframes/nested-composited-iframe.html
+
+        * platform/graphics/chromium/LayerRendererChromium.cpp:
+
 2011-08-31  Yury Semikhatsky  <[email protected]>
 
         Web Inspector: close dedicated worker inspectors when page inspector is closing

Modified: trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp (94314 => 94315)


--- trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-09-01 17:57:09 UTC (rev 94314)
+++ trunk/Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp	2011-09-01 17:58:41 UTC (rev 94315)
@@ -258,8 +258,7 @@
 
         if (layer->masksToBounds()) {
             IntRect scissor = transformedLayerRect;
-            if (!layer->scissorRect().isEmpty())
-                scissor.intersect(layer->scissorRect());
+            scissor.intersect(layer->scissorRect());
             layer->setScissorRect(scissor);
             layer->setUsesLayerScissor(true);
         }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to