[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:36:51 UTC 2009


The following commit has been merged in the webkit-1.1 branch:
commit 195d0d6710a493bc05aeaefe16867c6fc641cbe5
Author: simon.fraser at apple.com <simon.fraser at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Sep 30 17:21:48 2009 +0000

    2009-09-29  Simon Fraser  <simon.fraser at apple.com>
    
            Reviewed by Dan Bernstein.
    
            ASSERTION FAILED: !repaintContainer || repaintContainer == this
            https://bugs.webkit.org/show_bug.cgi?id=29755
    
            Generalize the fix for this bug to account for cases where there may be multiple
            containing blocks between the repaint container, and the container of the element
            being repainted.
    
            Test: compositing/repaint/opacity-between-absolute2.html
    
            * rendering/RenderBox.cpp:
            (WebCore::RenderBox::mapLocalToContainer):
            Call offsetFromAncestorContainer() to get the correct offset.
    
            (WebCore::RenderBox::computeRectForRepaint): Ditto
            * rendering/RenderInline.cpp:
            (WebCore::RenderInline::computeRectForRepaint): Ditto.
    
            * rendering/RenderObject.h:
            * rendering/RenderObject.cpp:
            (WebCore::RenderObject::offsetFromAncestorContainer):
            New method that computes an offset from some object in the ancestor container() chain.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48932 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 13edf46..e806ed0 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2009-09-29  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        ASSERTION FAILED: !repaintContainer || repaintContainer == this
+        https://bugs.webkit.org/show_bug.cgi?id=29755
+        
+        Testcase with multiple containers between the absolutely positioned div and its positioned
+        ancestor.
+
+        * compositing/repaint/opacity-between-absolute2.html: Added.
+        * platform/mac/compositing/repaint/opacity-between-absolute2-expected.checksum: Added.
+        * platform/mac/compositing/repaint/opacity-between-absolute2-expected.png: Added.
+        * platform/mac/compositing/repaint/opacity-between-absolute2-expected.txt: Added.
+
 2009-09-30  Renata Hodovan  <hodovan.renata at stud.u-szeged.hu>
 
         Reviewed by Simon Hausmann.
diff --git a/LayoutTests/compositing/repaint/opacity-between-absolute2.html b/LayoutTests/compositing/repaint/opacity-between-absolute2.html
new file mode 100644
index 0000000..faefe93
--- /dev/null
+++ b/LayoutTests/compositing/repaint/opacity-between-absolute2.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+   "http://www.w3.org/TR/html4/loose.dtd">
+
+<html lang="en">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+  <title>Opacity between absolutes</title>
+  <style type="text/css" media="screen">
+    .container {
+      position: relative;
+      height: 200px;
+      width: 200px;
+      border: 1px solid black;
+      -webkit-transform: translateZ(0);
+    }
+
+    .fader {
+      height: 50px;
+      width: 50px;
+      margin: 20px;
+      border: 1px solid black;
+      -webkit-transition: opacity 100s;
+    }
+    
+    .container:hover .fader {
+      opacity: 0.5;
+    }
+
+    .inner {
+      position: absolute;
+      left: 100px;
+      top: 100px;
+      height: 80px;
+      width: 80px;
+      background-color: gray;
+    }
+    
+    .inner:hover {
+      background-color: orange !important;
+    }
+  </style>
+  <script type="text/javascript" charset="utf-8">
+    if (window.layoutTestController)
+      layoutTestController.waitUntilDone();
+
+    function runTest()
+    {
+      // Kick off an opacity fade to make .fader into a compositing layer
+      var container = document.querySelectorAll('.fader')[1];
+      container.style.opacity = 0.99;
+      window.setTimeout(function() {
+        // Now test redraw on .inner
+        var inner = document.querySelectorAll('.inner')[0];
+        inner.style.backgroundColor = 'green';
+        if (window.layoutTestController)
+          layoutTestController.notifyDone();
+      }, 0);
+    }
+
+    window.addEventListener('load', runTest, false)
+  </script>
+</head>
+<body>
+<p>This test should not assert, and you should see a fully green square.</p>
+<div class="container">
+  <div class="fader">
+    <div class="fader">
+      <div class="inner">
+      </div>
+    </div>
+  </div>
+</div>
+
+</body>
+</html>
diff --git a/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.checksum b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.checksum
new file mode 100644
index 0000000..20300a3
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.checksum
@@ -0,0 +1 @@
+0f88c69b4a690d65de89c780c09c0d0a
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.png b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.png
new file mode 100644
index 0000000..4901f7e
Binary files /dev/null and b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.png differ
diff --git a/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.txt b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.txt
new file mode 100644
index 0000000..cc91986
--- /dev/null
+++ b/LayoutTests/platform/mac/compositing/repaint/opacity-between-absolute2-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x260
+  RenderBlock {HTML} at (0,0) size 800x260
+    RenderBody {BODY} at (8,16) size 784x236
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 423x18
+          text run at (0,0) width 423: "This test should not assert, and you should see a fully green square."
+layer at (8,50) size 202x202
+  RenderBlock (relative positioned) {DIV} at (0,34) size 202x202 [border: (1px solid #000000)]
+    RenderBlock {DIV} at (21,21) size 52x52 [border: (1px solid #000000)]
+layer at (50,92) size 52x52
+  RenderBlock {DIV} at (21,21) size 52x52 [border: (1px solid #000000)]
+layer at (109,151) size 80x80
+  RenderBlock (positioned) {DIV} at (101,101) size 80x80 [bgcolor=#008000]
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 11017b5..aa028b9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,29 @@
+2009-09-29  Simon Fraser  <simon.fraser at apple.com>
+
+        Reviewed by Dan Bernstein.
+
+        ASSERTION FAILED: !repaintContainer || repaintContainer == this
+        https://bugs.webkit.org/show_bug.cgi?id=29755
+        
+        Generalize the fix for this bug to account for cases where there may be multiple
+        containing blocks between the repaint container, and the container of the element
+        being repainted.
+
+        Test: compositing/repaint/opacity-between-absolute2.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::mapLocalToContainer):
+        Call offsetFromAncestorContainer() to get the correct offset.
+        
+        (WebCore::RenderBox::computeRectForRepaint): Ditto
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::computeRectForRepaint): Ditto.
+        
+        * rendering/RenderObject.h:
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::offsetFromAncestorContainer):
+        New method that computes an offset from some object in the ancestor container() chain.
+
 2009-09-30  Andras Becsi  <becsi.andras at stud.u-szeged.hu>
 
         Reviewed by Simon Hausmann.
diff --git a/WebCore/rendering/RenderBox.cpp b/WebCore/rendering/RenderBox.cpp
index c8d3037..4e045af 100644
--- a/WebCore/rendering/RenderBox.cpp
+++ b/WebCore/rendering/RenderBox.cpp
@@ -961,10 +961,10 @@ void RenderBox::mapLocalToContainer(RenderBoxModelObject* repaintContainer, bool
         transformState.move(containerOffset.width(), containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
 
     if (containerSkipped) {
-        // There can't be a transfrom between repaintContainer and o, because transforms create containers, so it should be safe
+        // There can't be a transform between repaintContainer and o, because transforms create containers, so it should be safe
         // to just subtract the delta between the repaintContainer and o.
-        IntSize repaintContainerOffset = repaintContainer->offsetFromContainer(o);
-        transformState.move(-repaintContainerOffset.width(), -repaintContainerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
+        IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
+        transformState.move(-containerOffset.width(), -containerOffset.height(), preserve3D ? TransformState::AccumulateTransform : TransformState::FlattenTransform);
         return;
     }
     
@@ -1201,7 +1201,7 @@ void RenderBox::computeRectForRepaint(RenderBoxModelObject* repaintContainer, In
 
     if (containerSkipped) {
         // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
-        IntSize containerOffset = repaintContainer->offsetFromContainer(o);
+        IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
         rect.move(-containerOffset);
         return;
     }
diff --git a/WebCore/rendering/RenderInline.cpp b/WebCore/rendering/RenderInline.cpp
index a5e973e..05d29d0 100644
--- a/WebCore/rendering/RenderInline.cpp
+++ b/WebCore/rendering/RenderInline.cpp
@@ -697,7 +697,7 @@ void RenderInline::computeRectForRepaint(RenderBoxModelObject* repaintContainer,
 
     if (containerSkipped) {
         // If the repaintContainer is below o, then we need to map the rect into repaintContainer's coordinates.
-        IntSize containerOffset = repaintContainer->offsetFromContainer(o);
+        IntSize containerOffset = repaintContainer->offsetFromAncestorContainer(o);
         rect.move(-containerOffset);
         return;
     }
diff --git a/WebCore/rendering/RenderObject.cpp b/WebCore/rendering/RenderObject.cpp
index b7f59e1..fe0f197 100644
--- a/WebCore/rendering/RenderObject.cpp
+++ b/WebCore/rendering/RenderObject.cpp
@@ -1755,6 +1755,23 @@ IntSize RenderObject::offsetFromContainer(RenderObject* o) const
     return offset;
 }
 
+IntSize RenderObject::offsetFromAncestorContainer(RenderObject* container) const
+{
+    IntSize offset;
+    const RenderObject* currContainer = this;
+    do {
+        RenderObject* nextContainer = currContainer->container();
+        ASSERT(nextContainer);  // This means we reached the top without finding container.
+        if (!nextContainer)
+            break;
+        ASSERT(!currContainer->hasTransform());
+        offset += currContainer->offsetFromContainer(nextContainer);
+        currContainer = nextContainer;
+    } while (currContainer != container);
+
+    return offset;
+}
+
 IntRect RenderObject::localCaretRect(InlineBox*, int, int* extraWidthToEndOfLine)
 {
     if (extraWidthToEndOfLine)
diff --git a/WebCore/rendering/RenderObject.h b/WebCore/rendering/RenderObject.h
index 367eaa6..e358c98 100644
--- a/WebCore/rendering/RenderObject.h
+++ b/WebCore/rendering/RenderObject.h
@@ -541,6 +541,8 @@ public:
 
     // Return the offset from the container() renderer (excluding transforms)
     virtual IntSize offsetFromContainer(RenderObject*) const;
+    // Return the offset from an object up the container() chain. Asserts that none of the intermediate objects have transforms.
+    IntSize offsetFromAncestorContainer(RenderObject*) const;
     
     virtual void absoluteRects(Vector<IntRect>&, int, int) { }
     // FIXME: useTransforms should go away eventually

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list