[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

simon.fraser at apple.com simon.fraser at apple.com
Thu Apr 8 01:15:20 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 498c8482f4b3ee86cd9a7a8c3106f3bcf0375a9a
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 19 22:18:22 2010 +0000

    2010-01-19  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            Some composited reflections incorrectly positioned
            https://bugs.webkit.org/show_bug.cgi?id=33856
    
            When setting the position of the replicated layer inside the reflection, we need to take
            into account the bounds of the original layer, and the replica layer to get the
            reflection in the right place.
    
            Tests: compositing/reflections/nested-reflection-transformed2.html
                   compositing/reflections/reflection-positioning2.html
    
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53495 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 47304a8..0ca7696 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,22 @@
+2010-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Some composited reflections incorrectly positioned
+        https://bugs.webkit.org/show_bug.cgi?id=33856
+        
+        New testcases for reflection positioning when adding outline, which affects the compositing
+        layer geometry.
+
+        * compositing/reflections/nested-reflection-transformed2.html: Added.
+        * compositing/reflections/reflection-positioning2.html: Added.
+        * platform/mac/compositing/reflections/nested-reflection-transformed2-expected.checksum: Added.
+        * platform/mac/compositing/reflections/nested-reflection-transformed2-expected.png: Added.
+        * platform/mac/compositing/reflections/nested-reflection-transformed2-expected.txt: Added.
+        * platform/mac/compositing/reflections/reflection-positioning2-expected.checksum: Added.
+        * platform/mac/compositing/reflections/reflection-positioning2-expected.png: Added.
+        * platform/mac/compositing/reflections/reflection-positioning2-expected.txt: Added.
+
 2010-01-19  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/LayoutTests/compositing/reflections/nested-reflection-transformed2.html b/LayoutTests/compositing/reflections/nested-reflection-transformed2.html
new file mode 100644
index 0000000..9768502
--- /dev/null
+++ b/LayoutTests/compositing/reflections/nested-reflection-transformed2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<html>
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <style>
+  .outer {
+    width: 120px;
+    height: 230px;
+    margin: 20px;
+    border: 1px solid black;
+    -webkit-box-reflect: right 10px;
+    outline: 10px solid transparent; /* affects layer sizes */
+  }
+  
+  .inner {
+    margin: 10px;
+    width: 100px;
+    height: 100px;
+    background-color: green;
+    text-align: center;
+    font-size: 50pt;
+    -webkit-box-reflect: below 10px;
+  }
+  
+  .composited {
+    -webkit-transform: translateZ(0);
+  }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    function doTest()
+    {
+      document.getElementById('inner').style.webkitTransform = 'rotate(10deg)';
+    }
+    window.addEventListener('load', doTest, false);
+  </script>
+  </head>
+<body>
+  <p>Test transform change on reflected elements, with compositing layers larger than render layers. Left and right side should be symmetrical.</p>
+  <div class="outer composited">
+    <div id="inner" class="inner composited">
+      1
+    </div>
+  </div>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/compositing/reflections/reflection-positioning2.html b/LayoutTests/compositing/reflections/reflection-positioning2.html
new file mode 100644
index 0000000..cd8e5cd
--- /dev/null
+++ b/LayoutTests/compositing/reflections/reflection-positioning2.html
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+    <style type="text/css" media="screen">
+      
+      div {
+        -webkit-box-sizing: border-box;
+      }
+      .container {
+        position: absolute;
+        left: 50px;
+        top: 50px;
+      }
+      .reflected {
+        position: relative;
+        width: 150px;
+        height: 120px;
+        border: 1px solid black;
+        -webkit-box-reflect: below 6px;
+        outline: 10px solid transparent; /* affects layer sizes */
+      }
+      
+      .box {
+        width: 100px;
+        height: 100px;
+      }
+
+      .inner {
+        position: absolute;
+        top: 10px;
+        left: 10px;
+        background-color: green;
+      }
+
+      .composited {
+        -webkit-transform: translateZ(0);
+      }
+
+      .inner.moved {
+        left: 25px;
+      }
+      
+      #indicator {
+        position: absolute;
+        top: 135px;
+        left: 26px;
+        background-color: red;
+      }
+    </style>
+    <script type="text/javascript" charset="utf-8">
+      function doTest() {
+        document.getElementById('inner').className = 'inner moved box';
+      }
+      window.addEventListener('load', doTest, false);
+    </script>
+  </head>
+  
+  <p>Position of reflected layer should update correctly. You should see no red below.</p>
+  <div class="container">
+    <div id="indicator" class="box"></div>
+    <div class="reflected composited">
+      <div id="inner" class="inner box">
+      </div>
+    </div>
+  </div>
+
+</html>
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.checksum b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.checksum
new file mode 100644
index 0000000..4b3284c
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.checksum
@@ -0,0 +1 @@
+6f46dde59c02093d3cb0d01e23388de8
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.png b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.png
new file mode 100644
index 0000000..01ae3b9
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.txt b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.txt
new file mode 100644
index 0000000..83a8008
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/reflections/nested-reflection-transformed2-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x324
+  RenderBlock {HTML} at (0,0) size 800x324
+    RenderBody {BODY} at (8,16) size 784x288
+      RenderBlock {P} at (0,0) size 784x36
+        RenderText {#text} at (0,0) size 779x36
+          text run at (0,0) width 779: "Test transform change on reflected elements, with compositing layers larger than render layers. Left and right side should be"
+          text run at (0,18) width 80: "symmetrical."
+layer at (28,72) size 122x232
+  RenderBlock {DIV} at (20,56) size 122x232 [border: (1px solid #000000)]
+layer at (39,83) size 100x100
+  RenderBlock {DIV} at (11,11) size 100x100 [bgcolor=#008000]
+    RenderText {#text} at (33,0) size 34x77
+      text run at (33,0) width 34: "1"
diff --git a/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.checksum b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.checksum
new file mode 100644
index 0000000..4b0cb10
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.checksum
@@ -0,0 +1 @@
+0491824f5173eb71d84c06527979131f
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.png b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.png
new file mode 100644
index 0000000..06d45bb
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.txt b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.txt
new file mode 100644
index 0000000..7c08786
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/reflections/reflection-positioning2-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x50
+  RenderBlock {HTML} at (0,0) size 800x50
+    RenderBody {BODY} at (8,16) size 784x18
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 509x18
+          text run at (0,0) width 509: "Position of reflected layer should update correctly. You should see no red below."
+layer at (50,50) size 150x120
+  RenderBlock (positioned) {DIV} at (50,50) size 150x120
+layer at (76,185) size 100x100
+  RenderBlock (positioned) {DIV} at (26,135) size 100x100 [bgcolor=#FF0000]
+layer at (50,50) size 150x120
+  RenderBlock (relative positioned) {DIV} at (0,0) size 150x120 [border: (1px solid #000000)]
+layer at (76,61) size 100x100
+  RenderBlock (positioned) {DIV} at (26,11) size 100x100 [bgcolor=#008000]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 08ce7b6..9ea0752 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,20 @@
+2010-01-19  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        Some composited reflections incorrectly positioned
+        https://bugs.webkit.org/show_bug.cgi?id=33856
+        
+        When setting the position of the replicated layer inside the reflection, we need to take
+        into account the bounds of the original layer, and the replica layer to get the
+        reflection in the right place.
+
+        Tests: compositing/reflections/nested-reflection-transformed2.html
+               compositing/reflections/reflection-positioning2.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::updateGraphicsLayerGeometry):
+
 2010-01-19  Enrica Casucci  <enrica at apple.com>
 
         Reviewed by Simon Fraser.
diff --git a/WebCore/rendering/RenderLayerBacking.cpp b/WebCore/rendering/RenderLayerBacking.cpp
index 21363c3..5435bf1 100644
--- a/WebCore/rendering/RenderLayerBacking.cpp
+++ b/WebCore/rendering/RenderLayerBacking.cpp
@@ -371,8 +371,9 @@ void RenderLayerBacking::updateGraphicsLayerGeometry()
         
         // The reflection layer has the bounds of m_owningLayer->reflectionLayer(),
         // but the reflected layer is the bounds of this layer, so we need to position it appropriately.
-        FloatRect reflectedLayerBounds = compositedBounds();
-        reflectionBacking->graphicsLayer()->setReplicatedLayerPosition(reflectedLayerBounds.location());
+        FloatRect layerBounds = compositedBounds();
+        FloatRect reflectionLayerBounds = reflectionBacking->compositedBounds();
+        reflectionBacking->graphicsLayer()->setReplicatedLayerPosition(FloatPoint() + (layerBounds.location() - reflectionLayerBounds.location()));
     }
 
     m_graphicsLayer->setContentsRect(contentsBox());

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list