2011-05-27 James Robinson <jamesr@chromium.org>
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 20:29:12 +0000 (20:29 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 20:29:12 +0000 (20:29 +0000)
        Reviewed by Simon Fraser.

        GraphicsLayers for overflow controls on iframe without clipping layer left out of layer tree
        https://bugs.webkit.org/show_bug.cgi?id=61590

        * compositing/iframes/resizer-expected.txt: Added.
        * compositing/iframes/resizer.html: Added.
2011-05-27  James Robinson  <jamesr@chromium.org>

        Reviewed by Simon Fraser.

        GraphicsLayers for overflow controls on iframe without clipping layer left out of layer tree
        https://bugs.webkit.org/show_bug.cgi?id=61590

        Adds overflow control layers to the compositor tree for layers without clipping layers regardless of whether the
        backing is parented.  This ensures that the scroll corner layer for an iframe without a clipping layer ends up
        in the final layer tree.  We don't currently render resizers for iframes, but we will soon and this keeps the
        graphics layer tree consistent.

        Test: compositing/iframes/resizer.html

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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@87547 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/compositing/iframes/resizer.html [new file with mode: 0644]
LayoutTests/platform/chromium-gpu/compositing/iframes/resizer-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index c0f0d0b..3d754bf 100644 (file)
@@ -1,3 +1,13 @@
+2011-05-27  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        GraphicsLayers for overflow controls on iframe without clipping layer left out of layer tree
+        https://bugs.webkit.org/show_bug.cgi?id=61590
+
+        * compositing/iframes/resizer-expected.txt: Added.
+        * compositing/iframes/resizer.html: Added.
+
 2011-05-27  Nikolas Zimmermann  <nzimmermann@rim.com>
 
         Not reviewed.
diff --git a/LayoutTests/compositing/iframes/resizer.html b/LayoutTests/compositing/iframes/resizer.html
new file mode 100644 (file)
index 0000000..3f41186
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+.container {
+     -webkit-transform: translateZ(0);
+     resize: both;
+}
+</style>
+<script>
+function test() {
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
+    }
+}
+</script>
+<!-- There should be a layer for the iframe's scroll corner alongside the iframe's content's layer tree -->
+<body onload="test()">
+<iframe class="container" src="resources/composited-subframe.html"></iframe>
+<pre id="layers">Layer tree appears here in DRT.</pre>
diff --git a/LayoutTests/platform/chromium-gpu/compositing/iframes/resizer-expected.txt b/LayoutTests/platform/chromium-gpu/compositing/iframes/resizer-expected.txt
new file mode 100644 (file)
index 0000000..b839bb9
--- /dev/null
@@ -0,0 +1,56 @@
+
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (children 2
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (children 2
+                (GraphicsLayer
+                  (bounds 285.00 150.00)
+                  (children 1
+                    (GraphicsLayer
+                      (children 1
+                        (GraphicsLayer
+                          (bounds 285.00 230.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 285.00 230.00)
+                              (drawsContent 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (position 18.00 10.00)
+                                  (bounds 210.00 210.00)
+                                  (drawsContent 1)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+                (GraphicsLayer
+                  (position 285.00 0.00)
+                  (bounds 15.00 150.00)
+                  (drawsContent 1)
+                )
+              )
+            )
+            (GraphicsLayer
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt b/LayoutTests/platform/mac/compositing/iframes/resizer-expected.txt
new file mode 100644 (file)
index 0000000..3b65f87
--- /dev/null
@@ -0,0 +1,49 @@
+
+(GraphicsLayer
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 304.00 154.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (children 1
+                (GraphicsLayer
+                  (bounds 285.00 150.00)
+                  (children 1
+                    (GraphicsLayer
+                      (children 1
+                        (GraphicsLayer
+                          (bounds 285.00 230.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 285.00 230.00)
+                              (drawsContent 1)
+                              (children 1
+                                (GraphicsLayer
+                                  (position 18.00 10.00)
+                                  (bounds 210.00 210.00)
+                                  (drawsContent 1)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
index f226728..ce5f0af 100644 (file)
@@ -1,3 +1,20 @@
+2011-05-27  James Robinson  <jamesr@chromium.org>
+
+        Reviewed by Simon Fraser.
+
+        GraphicsLayers for overflow controls on iframe without clipping layer left out of layer tree
+        https://bugs.webkit.org/show_bug.cgi?id=61590
+
+        Adds overflow control layers to the compositor tree for layers without clipping layers regardless of whether the
+        backing is parented.  This ensures that the scroll corner layer for an iframe without a clipping layer ends up
+        in the final layer tree.  We don't currently render resizers for iframes, but we will soon and this keeps the
+        graphics layer tree consistent.
+
+        Test: compositing/iframes/resizer.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree):
+
 2011-05-27  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index ac8b1fe..2260d5b 100644 (file)
@@ -858,28 +858,28 @@ void RenderLayerCompositor::rebuildCompositingLayerTree(RenderLayer* layer, cons
         if (layer->renderer()->isRenderPart())
             parented = parentFrameContentLayers(toRenderPart(layer->renderer()));
 
+        if (!parented)
+            layerBacking->parentForSublayers()->setChildren(layerChildren);
+
         // If the layer has a clipping layer the overflow controls layers will be siblings of the clipping layer.
         // Otherwise, the overflow control layers are normal children.
         if (!layerBacking->hasClippingLayer()) {
             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForHorizontalScrollbar()) {
                 overflowControlLayer->removeFromParent();
-                layerChildren.append(overflowControlLayer);
+                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
             }
 
             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForVerticalScrollbar()) {
                 overflowControlLayer->removeFromParent();
-                layerChildren.append(overflowControlLayer);
+                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
             }
 
             if (GraphicsLayer* overflowControlLayer = layerBacking->layerForScrollCorner()) {
                 overflowControlLayer->removeFromParent();
-                layerChildren.append(overflowControlLayer);
+                layerBacking->parentForSublayers()->addChild(overflowControlLayer);
             }
         }
 
-        if (!parented)
-            layerBacking->parentForSublayers()->setChildren(layerChildren);
-
 #if ENABLE(FULLSCREEN_API)
         // For the sake of clients of the full screen renderer, don't reparent
         // the full screen layer out from under them if they're in the middle of