[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.15.1-1414-gc69ee75

simon.fraser at apple.com simon.fraser at apple.com
Thu Oct 29 20:47:08 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 02459ab2840fc56349f12bfee6c9727ad4f165e2
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 18 17:17:43 2009 +0000

    2009-10-18  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Compositing layers not correctly updated after partial layout
            https://bugs.webkit.org/show_bug.cgi?id=30425
    
            When a partial layout happened, for example as the result of a postion-change-only
            layout, then some compositing layer positions were not correctly updated. To fix
            this, updateLayerPositions() now carries along a flag that is set at the rootmost
            layer being updated, and used to determine when we hit the first compositing layer
            in this update. RenderLayerBacking::updateAfterLayout() makes use of this information
            to do a full geometry update on that layer, which is thus the rootmost compositing
            layer that is being updated.
    
            Test: compositing/geometry/partial-layout-update.html
    
            * page/FrameView.cpp:
            (WebCore::FrameView::layout):
            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::updateLayerPositions):
            (WebCore::RenderLayer::scrollToOffset):
            * rendering/RenderLayer.h:
            (WebCore::RenderLayer::):
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::updateAfterLayout):
            * rendering/RenderLayerBacking.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 4e8b445..6c80e05 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-10-18  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Compositing layers not correctly updated after partial layout
+        https://bugs.webkit.org/show_bug.cgi?id=30425
+        
+        Testcase that hits the "position change only" layout path, thus doing a subtree layout,
+        to ensure that compositing layers are correctly positioned.
+
+        * compositing/geometry/partial-layout-update.html: Added.
+        * platform/mac/compositing/geometry/partial-layout-update-expected.checksum: Added.
+        * platform/mac/compositing/geometry/partial-layout-update-expected.png: Added.
+        * platform/mac/compositing/geometry/partial-layout-update-expected.txt: Added.
+
 2009-10-18  Eric Carlson  <eric.carlson at apple.com>
 
         Skip media/video-empty-source.html until <rdar://problem/6563117> has been fixed.
diff --git a/LayoutTests/compositing/geometry/partial-layout-update.html b/LayoutTests/compositing/geometry/partial-layout-update.html
new file mode 100644
index 0000000..c7df881
--- /dev/null
+++ b/LayoutTests/compositing/geometry/partial-layout-update.html
@@ -0,0 +1,71 @@
+<!DOCTYPE>
+<html>
+<head>
+  <title>Partial layout compositing update</title>
+
+  <style type="text/css" media="screen">
+  .container {
+    position: relative;
+    width: 400px;
+    height: 200px;
+    border: 1px solid black;
+    overflow: hidden;
+  }
+
+  .panel {
+    position: absolute;
+    top: 0px;
+    left: 200px;
+    width: 200px;
+    height: 200px;
+    z-index: 3;
+    background-color: #bbb;
+    -webkit-transition: left 0.1s linear;
+  }
+
+  .box {
+    width: 100px;
+    height: 100px;
+  }
+
+  .panel .content {
+    background-color: green;
+    -webkit-transform: translateZ(0);
+  }
+  
+  .indicator {
+    position: absolute;
+    top: 0;
+    left: 0;
+    background-color: red;
+  }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+
+    function startProgram()
+    {
+      var panel = document.getElementById("panel");
+      panel.addEventListener('webkitTransitionEnd', function() {
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, false);
+      panel.style.left = "0";
+    }
+
+    window.addEventListener('load', startProgram, false)
+    </script>
+</head>
+<body>
+
+  <p>The green box should always obscure the red box below.</p>
+  <div class="container">
+    <div id="panel" class="panel">
+      <div class="indicator box"></div>
+      <div class="content box"></div>
+    </div>
+  </div>
+
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.checksum b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.checksum
new file mode 100644
index 0000000..e379381
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.checksum
@@ -0,0 +1 @@
+58a8f3da08c7bbb4917463ad3412e35a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.png b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.png
new file mode 100644
index 0000000..ba6d69b
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.txt b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.txt
new file mode 100644
index 0000000..33ece6e
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/geometry/partial-layout-update-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 361x18
+          text run at (0,0) width 361: "The green box should always obscure the red box below."
+layer at (8,42) size 402x202 clip at (9,43) size 400x200
+  RenderBlock (relative positioned) {DIV} at (0,34) size 402x202 [border: (1px solid #000000)]
+layer at (9,43) size 200x200
+  RenderBlock (positioned) zI: 3 {DIV} at (1,1) size 200x200 [bgcolor=#BBBBBB]
+layer at (9,43) size 100x100
+  RenderBlock (positioned) {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+layer at (9,43) size 100x100
+  RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ed3ec36..7ff89d7 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,31 @@
+2009-10-18  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Compositing layers not correctly updated after partial layout
+        https://bugs.webkit.org/show_bug.cgi?id=30425
+        
+        When a partial layout happened, for example as the result of a postion-change-only
+        layout, then some compositing layer positions were not correctly updated. To fix
+        this, updateLayerPositions() now carries along a flag that is set at the rootmost
+        layer being updated, and used to determine when we hit the first compositing layer
+        in this update. RenderLayerBacking::updateAfterLayout() makes use of this information
+        to do a full geometry update on that layer, which is thus the rootmost compositing
+        layer that is being updated.
+
+        Test: compositing/geometry/partial-layout-update.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateLayerPositions):
+        (WebCore::RenderLayer::scrollToOffset):
+        * rendering/RenderLayer.h:
+        (WebCore::RenderLayer::):
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateAfterLayout):
+        * rendering/RenderLayerBacking.h:
+
 2009-09-13  Kevin Watters  <kevinwatters at gmail.com>
 
         Reviewed by Kevin Ollivier.
diff --git a/WebCore/page/FrameView.cpp b/WebCore/page/FrameView.cpp
index 1993513..bc4e4f2 100644
--- a/WebCore/page/FrameView.cpp
+++ b/WebCore/page/FrameView.cpp
@@ -652,6 +652,7 @@ void FrameView::layout(bool allowSubtree)
     beginDeferredRepaints();
     layer->updateLayerPositions((m_doFullRepaint ? RenderLayer::DoFullRepaint : 0)
                                 | RenderLayer::CheckForRepaint
+                                | RenderLayer::IsCompositingUpdateRoot
                                 | RenderLayer::UpdateCompositingLayers);
     endDeferredRepaints();
 
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 9356c70..fea61c9 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -311,12 +311,19 @@ void RenderLayer::updateLayerPositions(UpdateLayerPositionsFlags flags)
     if (m_reflection)
         m_reflection->layout();
 
+#if USE(ACCELERATED_COMPOSITING)
+    // Clear the IsCompositingUpdateRoot flag once we've found the first compositing layer in this update.
+    bool isUpdateRoot = (flags & IsCompositingUpdateRoot);
+    if (isComposited())
+        flags &= ~IsCompositingUpdateRoot;
+#endif
+
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling())
         child->updateLayerPositions(flags);
 
 #if USE(ACCELERATED_COMPOSITING)
     if ((flags & UpdateCompositingLayers) && isComposited())
-        backing()->updateAfterLayout(RenderLayerBacking::CompositingChildren);
+        backing()->updateAfterLayout(RenderLayerBacking::CompositingChildren, isUpdateRoot);
 #endif
         
     // With all our children positioned, now update our marquee if we need to.
@@ -1139,8 +1146,10 @@ void RenderLayer::scrollToOffset(int x, int y, bool updateScrollbars, bool repai
 
 #if USE(ACCELERATED_COMPOSITING)
     if (compositor()->inCompositingMode()) {
-        if (RenderLayer* compositingAncestor = ancestorCompositingLayer())
-            compositingAncestor->backing()->updateAfterLayout(RenderLayerBacking::AllDescendants);
+        if (RenderLayer* compositingAncestor = ancestorCompositingLayer()) {
+            bool isUpdateRoot = true;
+            compositingAncestor->backing()->updateAfterLayout(RenderLayerBacking::AllDescendants, isUpdateRoot);
+        }
     }
 #endif
     
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index e6a15c5..a274638 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -298,10 +298,11 @@ public:
     enum UpdateLayerPositionsFlag {
         DoFullRepaint = 1,
         CheckForRepaint = 1 << 1,
-        UpdateCompositingLayers = 1 << 2,
+        IsCompositingUpdateRoot = 1 << 2,
+        UpdateCompositingLayers = 1 << 3,
     };
     typedef unsigned UpdateLayerPositionsFlags;
-    void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | UpdateCompositingLayers);
+    void updateLayerPositions(UpdateLayerPositionsFlags = DoFullRepaint | IsCompositingUpdateRoot | UpdateCompositingLayers);
 
     void updateTransform();
 
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 50e4756..4c82843 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -148,7 +148,7 @@ void RenderLayerBacking::updateCompositedBounds()
     setCompositedBounds(layerBounds);
 }
 
-void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth)
+void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth, bool isUpdateRoot)
 {
     RenderLayerCompositor* layerCompositor = compositor();
     if (!layerCompositor->compositingLayersNeedRebuild()) {
@@ -162,7 +162,7 @@ void RenderLayerBacking::updateAfterLayout(UpdateDepth updateDepth)
         updateCompositedBounds();
         layerCompositor->updateCompositingDescendantGeometry(m_owningLayer, m_owningLayer, updateDepth);
         
-        if (!m_owningLayer->parent()) {
+        if (isUpdateRoot) {
             updateGraphicsLayerGeometry();
             layerCompositor->updateRootLayerPosition();
         }
diff --git a/WebCore/rendering/RenderLayerBacking.h b/WebCore/rendering/RenderLayerBacking.h
index e12aa58..8f95a94 100644
--- a/WebCore/rendering/RenderLayerBacking.h
+++ b/WebCore/rendering/RenderLayerBacking.h
@@ -54,7 +54,7 @@ public:
     RenderLayer* owningLayer() const { return m_owningLayer; }
 
     enum UpdateDepth { CompositingChildren, AllDescendants };
-    void updateAfterLayout(UpdateDepth);
+    void updateAfterLayout(UpdateDepth, bool isUpdateRoot);
     
     // Returns true if layer configuration changed.
     bool updateGraphicsLayerConfiguration();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list