2010-07-08 Simon Fraser <simon.fraser@apple.com>
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jul 2010 05:33:01 +0000 (05:33 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Jul 2010 05:33:01 +0000 (05:33 +0000)
        Reviewed by Darin Adler.

        compositing/iframes/iframe-resize.html displays incorrectly after the resize
        https://bugs.webkit.org/show_bug.cgi?id=41794

        The clip and scroll layers of a composited iframe's RenderLayerCompositor are updated from
        from updateGraphicsLayerGeometry(), but this is too early to get the correct layoutWidth and
        layoutHeight from the FrameView which happen later in layout. So when a widget size changes,
        call updateAfterWidgetResize() directly on the RenderLayerBacking (if any).

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateAfterWidgetResize): New method that updates the clip
        and scroll layers of the iframe's content RenderLayerCompositor.
        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Call updateAfterWidgetResize()
        * rendering/RenderLayerBacking.h: Add updateAfterWidgetResize().
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::setWidgetGeometry): Call updateAfterWidgetResize().

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

LayoutTests/ChangeLog
LayoutTests/compositing/iframes/iframe-resize-expected.txt
LayoutTests/compositing/iframes/iframe-resize.html
LayoutTests/compositing/iframes/overlapped-iframe.html
LayoutTests/platform/mac/Skipped
WebCore/ChangeLog
WebCore/rendering/RenderLayerBacking.cpp
WebCore/rendering/RenderLayerBacking.h
WebCore/rendering/RenderWidget.cpp

index 6a8904c..b70dd09 100644 (file)
@@ -1,5 +1,20 @@
 2010-07-08  Simon Fraser  <simon.fraser@apple.com>
 
+        Reviewed by Darin Adler.
+
+        compositing/iframes/iframe-resize.html displays incorrectly after the resize
+        https://bugs.webkit.org/show_bug.cgi?id=41794
+        
+        Re-enable iframe-resize.html and overlapped-iframe.html tests, add an offsetWidth call to
+        force layout, and update the results.
+
+        * compositing/iframes/iframe-resize-expected.txt:
+        * compositing/iframes/iframe-resize.html:
+        * compositing/iframes/overlapped-iframe.html: Fix this test now that it's not skipped.
+        * platform/mac/Skipped:
+
+2010-07-08  Simon Fraser  <simon.fraser@apple.com>
+
         Reviewed by Dan Bernstein.
 
         Calling layoutTestController.layerTreeAsText() should update layout
index 0c0ac16..ce625da 100644 (file)
@@ -27,7 +27,7 @@
         (GraphicsLayer
           (position 8.00 8.00)
           (anchor 0.50 0.50)
-          (bounds 370.00 220.00)
+          (bounds 470.00 190.00)
           (opacity 1.00)
           (usingTiledLayer 0)
           (preserves3D 0)
@@ -40,7 +40,7 @@
             (GraphicsLayer
               (position 35.00 35.00)
               (anchor 0.50 0.50)
-              (bounds 285.00 150.00)
+              (bounds 385.00 120.00)
               (opacity 1.00)
               (usingTiledLayer 0)
               (preserves3D 0)
@@ -66,7 +66,7 @@
                     (GraphicsLayer
                       (position 0.00 0.00)
                       (anchor 0.50 0.50)
-                      (bounds 285.00 230.00)
+                      (bounds 385.00 230.00)
                       (opacity 1.00)
                       (usingTiledLayer 0)
                       (preserves3D 0)
@@ -79,7 +79,7 @@
                         (GraphicsLayer
                           (position 0.00 0.00)
                           (anchor 0.50 0.50)
-                          (bounds 285.00 230.00)
+                          (bounds 385.00 230.00)
                           (opacity 1.00)
                           (usingTiledLayer 0)
                           (preserves3D 0)
index 77afaec..9239435 100644 (file)
@@ -39,6 +39,7 @@
         window.setTimeout(function() {
             document.getElementById('parent-iframe').className = 'bigger';
             if (window.layoutTestController) {
+                document.body.offsetWidth;  // force layout, because layerTreeAsText() doesn't.
                 document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
                 layoutTestController.notifyDone();
             }
index 64eff8d..d598689 100644 (file)
 
     function doTest()
     {
-        if (window.layoutTestController) {
-            document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
-            layoutTestController.notifyDone();
-        }
+        window.setTimeout(function() {
+          if (window.layoutTestController) {
+              document.getElementById('layers').innerHTML = layoutTestController.layerTreeAsText();
+              layoutTestController.notifyDone();
+          }
+        }, 0);
     }
 
     window.addEventListener('load', doTest, false);
index 4bd9c2d..da8489f 100644 (file)
@@ -41,10 +41,6 @@ printing/compositing-layer-printing.html
 # Skip because fix for https://bugs.webkit.org/show_bug.cgi?id=26770 was reverted
 compositing/animation/animated-composited-inside-hidden.html
 
-# Tests are flakey: https://bugs.webkit.org/show_bug.cgi?id=38888
-compositing/iframes/iframe-resize.html
-compositing/iframes/overlapped-iframe.html
-
 # https://bugs.webkit.org/show_bug.cgi?id=20342 REGRESSION: fast/dom/cssTarget-crash.html fails
 fast/dom/cssTarget-crash.html
 
index 1f5fa09..5182b43 100644 (file)
@@ -1,5 +1,25 @@
 2010-07-08  Simon Fraser  <simon.fraser@apple.com>
 
+        Reviewed by Darin Adler.
+
+        compositing/iframes/iframe-resize.html displays incorrectly after the resize
+        https://bugs.webkit.org/show_bug.cgi?id=41794
+        
+        The clip and scroll layers of a composited iframe's RenderLayerCompositor are updated from
+        from updateGraphicsLayerGeometry(), but this is too early to get the correct layoutWidth and
+        layoutHeight from the FrameView which happen later in layout. So when a widget size changes,
+        call updateAfterWidgetResize() directly on the RenderLayerBacking (if any).
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateAfterWidgetResize): New method that updates the clip
+        and scroll layers of the iframe's content RenderLayerCompositor.
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Call updateAfterWidgetResize()
+        * rendering/RenderLayerBacking.h: Add updateAfterWidgetResize().
+        * rendering/RenderWidget.cpp:
+        (WebCore::RenderWidget::setWidgetGeometry): Call updateAfterWidgetResize().
+
+2010-07-08  Simon Fraser  <simon.fraser@apple.com>
+
         Reviewed by Dan Bernstein.
 
         Calling layoutTestController.layerTreeAsText() should update layout
index 924fdef..ae01799 100644 (file)
@@ -156,6 +156,14 @@ void RenderLayerBacking::updateCompositedBounds()
     setCompositedBounds(layerBounds);
 }
 
+void RenderLayerBacking::updateAfterWidgetResize()
+{
+    if (renderer()->isRenderIFrame()) {
+        if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer())))
+            innerCompositor->updateContentLayerOffset(contentsBox().location());
+    }
+}
+
 void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth, bool isUpdateRoot)
 {
     RenderLayerCompositor* layerCompositor = compositor();
@@ -390,12 +398,7 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
 
     m_graphicsLayer->setContentsRect(contentsBox());
     updateDrawsContent();
-
-    // If this is an iframe parent, update the iframe content's box
-    if (renderer()->isRenderIFrame()) {
-        if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::iframeContentsCompositor(toRenderIFrame(renderer())))
-            innerCompositor->updateContentLayerOffset(contentsBox().location());
-    }
+    updateAfterWidgetResize();
 }
 
 void RenderLayerBacking::updateInternalHierarchy()
index faa553c..16c39da 100644 (file)
@@ -110,6 +110,8 @@ public:
     IntRect compositedBounds() const;
     void setCompositedBounds(const IntRect&);
     void updateCompositedBounds();
+    
+    void updateAfterWidgetResize();
 
     FloatPoint graphicsLayerToContentsCoordinates(const GraphicsLayer*, const FloatPoint&);
     FloatPoint contentsToGraphicsLayerCoordinates(const GraphicsLayer*, const FloatPoint&);
index aa3b772..6fb2749 100644 (file)
 #include "RenderView.h"
 #include "RenderWidgetProtector.h"
 
+#if USE(ACCELERATED_COMPOSITING)
+#include "RenderLayerBacking.h"
+#endif
+
 using namespace std;
 
 namespace WebCore {
@@ -171,6 +175,12 @@ bool RenderWidget::setWidgetGeometry(const IntRect& frame)
     RenderWidgetProtector protector(this);
     RefPtr<Node> protectedNode(node());
     m_widget->setFrameRect(frame);
+    
+#if USE(ACCELERATED_COMPOSITING)
+    if (hasLayer() && layer()->isComposited())
+        layer()->backing()->updateAfterWidgetResize();
+#endif
+    
     return boundsChanged;
 }