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

mitz at apple.com mitz at apple.com
Wed Apr 7 23:48:47 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 53dcbed6fa771ceae7ce8c5be7965d0ee00526ce
Author: mitz at apple.com <mitz at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Nov 19 06:17:07 2009 +0000

    WebCore: Fixed <rdar://problem/7398987> Assertion failure in
    RenderLayer::updateClipRects when a plug-in’s enclosing layer is
    enclosed by a transformed layer
    
    Reviewed by Simon Fraser.
    
    Tests: fast/layers/clip-rects-transformed-2.html
           fast/layers/clip-rects-transformed.html
    
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::clippingRoot): Added. Finds the nearest ancestor
    that is either transformed or composited. During painting and hit
    testing, when a transformed or composited layer is hit, it becomes the
    new root layer, which ultimately gets passed to calculateRects().
    (WebCore::RenderLayer::childrenClipRect): Pass the clipping root as the
    root layer to calculateRects(), and return the bounding box of the
    transformed rectangle.
    (WebCore::RenderLayer::selfClipRect): Ditto.
    * rendering/RenderLayer.h:
    
    LayoutTests: Test for <rdar://problem/7398987> Assertion failure in
    RenderLayer::updateClipRects when a plug-in’s enclosing layer is
    enclosed by a transformed layer
    
    Reviewed by Simon Fraser.
    
    * fast/layers/clip-rects-transformed-2-expected.txt: Added.
    * fast/layers/clip-rects-transformed-2.html: Added.
    * fast/layers/clip-rects-transformed-expected.txt: Added.
    * fast/layers/clip-rects-transformed.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51175 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a35d775..f2c66e2 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
+2009-11-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Test for <rdar://problem/7398987> Assertion failure in
+        RenderLayer::updateClipRects when a plug-in’s enclosing layer is
+        enclosed by a transformed layer
+
+        * fast/layers/clip-rects-transformed-2-expected.txt: Added.
+        * fast/layers/clip-rects-transformed-2.html: Added.
+        * fast/layers/clip-rects-transformed-expected.txt: Added.
+        * fast/layers/clip-rects-transformed.html: Added.
+
 2009-11-18  Michelangelo De Simone  <micdesim at gmail.com>
 
         Reviewed by Darin Adler.
diff --git a/LayoutTests/fast/layers/clip-rects-transformed-2-expected.txt b/LayoutTests/fast/layers/clip-rects-transformed-2-expected.txt
new file mode 100644
index 0000000..5a8a13d
--- /dev/null
+++ b/LayoutTests/fast/layers/clip-rects-transformed-2-expected.txt
@@ -0,0 +1,5 @@
+Test 2/2 for rdar://problem/7398987 Assertion failure in RenderLayer::updateClipRects when a plug-in’s enclosing layer is enclosed by a transformed layer.
+
+This test should not cause an assertion faliure.
+
+
diff --git a/LayoutTests/fast/layers/clip-rects-transformed-2.html b/LayoutTests/fast/layers/clip-rects-transformed-2.html
new file mode 100644
index 0000000..35dd055
--- /dev/null
+++ b/LayoutTests/fast/layers/clip-rects-transformed-2.html
@@ -0,0 +1,18 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<p>
+    Test 2/2 for <i><a href="rdar://problem/7398987">rdar://problem/7398987</a>
+    Assertion failure in RenderLayer::updateClipRects when a plug-in&rsquo;s
+    enclosing layer is enclosed by a transformed layer</i>.
+</p>
+<p>
+    This test should not cause an assertion faliure.
+</p>
+<div style="-webkit-transform: translateZ(0); position: absolute;"></div>
+<div style="opacity: 0.9">
+    <div style="position: absolute;">
+        <embed type="application/x-webkit-test-netscape">
+    </div>
+</div>
diff --git a/LayoutTests/fast/layers/clip-rects-transformed-expected.txt b/LayoutTests/fast/layers/clip-rects-transformed-expected.txt
new file mode 100644
index 0000000..c6d634b
--- /dev/null
+++ b/LayoutTests/fast/layers/clip-rects-transformed-expected.txt
@@ -0,0 +1,5 @@
+Test 1/2 for rdar://problem/7398987 Assertion failure in RenderLayer::updateClipRects when a plug-in’s enclosing layer is enclosed by a transformed layer.
+
+This test should not cause an assertion faliure.
+
+
diff --git a/LayoutTests/fast/layers/clip-rects-transformed.html b/LayoutTests/fast/layers/clip-rects-transformed.html
new file mode 100644
index 0000000..71edfa5
--- /dev/null
+++ b/LayoutTests/fast/layers/clip-rects-transformed.html
@@ -0,0 +1,17 @@
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
+<p>
+    Test 1/2 for <i><a href="rdar://problem/7398987">rdar://problem/7398987</a>
+    Assertion failure in RenderLayer::updateClipRects when a plug-in&rsquo;s
+    enclosing layer is enclosed by a transformed layer</i>.
+</p>
+<p>
+    This test should not cause an assertion faliure.
+</p>
+<div style="-webkit-transform: translateX(100px);">
+    <div style="position: absolute; overflow: hidden;">
+        <embed type="application/x-webkit-test-netscape">
+    </div>
+</div>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 3ff7145..a10673f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,25 @@
+2009-11-18  Dan Bernstein  <mitz at apple.com>
+
+        Reviewed by Simon Fraser.
+
+        Fixed <rdar://problem/7398987> Assertion failure in
+        RenderLayer::updateClipRects when a plug-in’s enclosing layer is
+        enclosed by a transformed layer
+
+        Tests: fast/layers/clip-rects-transformed-2.html
+               fast/layers/clip-rects-transformed.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::clippingRoot): Added. Finds the nearest ancestor
+        that is either transformed or composited. During painting and hit
+        testing, when a transformed or composited layer is hit, it becomes the
+        new root layer, which ultimately gets passed to calculateRects().
+        (WebCore::RenderLayer::childrenClipRect): Pass the clipping root as the
+        root layer to calculateRects(), and return the bounding box of the
+        transformed rectangle.
+        (WebCore::RenderLayer::selfClipRect): Ditto.
+        * rendering/RenderLayer.h:
+
 2009-11-18  Laszlo Gombos  <laszlo.1.gombos at nokia.com>
 
         Reviewed by Kenneth Rohde Christiansen.
diff --git a/WebCore/rendering/RenderLayer.cpp b/WebCore/rendering/RenderLayer.cpp
index 3932cb6..ea3c891 100644
--- a/WebCore/rendering/RenderLayer.cpp
+++ b/WebCore/rendering/RenderLayer.cpp
@@ -681,6 +681,27 @@ RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const
 }
 #endif
 
+RenderLayer* RenderLayer::clippingRoot() const
+{
+    const RenderLayer* current = this;
+    while (current) {
+        if (current->renderer()->isRenderView())
+            return const_cast<RenderLayer*>(current);
+
+        current = compositingContainer(current);
+        ASSERT(current);
+        if (current->transform()
+#if USE(ACCELERATED_COMPOSITING)
+            || current->isComposited()
+#endif
+        )
+            return const_cast<RenderLayer*>(current);
+    }
+
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
 IntPoint RenderLayer::absoluteToContents(const IntPoint& absolutePoint) const
 {
     // We don't use convertToLayerCoords because it doesn't know about transforms
@@ -2801,17 +2822,19 @@ void RenderLayer::calculateRects(const RenderLayer* rootLayer, const IntRect& pa
 IntRect RenderLayer::childrenClipRect() const
 {
     RenderLayer* rootLayer = renderer()->view()->layer();
+    RenderLayer* clippingRootLayer = clippingRoot();
     IntRect layerBounds, backgroundRect, foregroundRect, outlineRect;
-    calculateRects(rootLayer, rootLayer->boundingBox(rootLayer), layerBounds, backgroundRect, foregroundRect, outlineRect);
-    return foregroundRect;
+    calculateRects(clippingRootLayer, rootLayer->boundingBox(rootLayer), layerBounds, backgroundRect, foregroundRect, outlineRect);
+    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(foregroundRect)).enclosingBoundingBox();
 }
 
 IntRect RenderLayer::selfClipRect() const
 {
     RenderLayer* rootLayer = renderer()->view()->layer();
+    RenderLayer* clippingRootLayer = clippingRoot();
     IntRect layerBounds, backgroundRect, foregroundRect, outlineRect;
-    calculateRects(rootLayer, rootLayer->boundingBox(rootLayer), layerBounds, backgroundRect, foregroundRect, outlineRect);
-    return backgroundRect;
+    calculateRects(clippingRootLayer, rootLayer->boundingBox(rootLayer), layerBounds, backgroundRect, foregroundRect, outlineRect);
+    return clippingRootLayer->renderer()->localToAbsoluteQuad(FloatQuad(backgroundRect)).enclosingBoundingBox();
 }
 
 bool RenderLayer::intersectsDamageRect(const IntRect& layerBounds, const IntRect& damageRect, const RenderLayer* rootLayer) const
diff --git a/WebCore/rendering/RenderLayer.h b/WebCore/rendering/RenderLayer.h
index 9b7d5bc..2c7579c 100644
--- a/WebCore/rendering/RenderLayer.h
+++ b/WebCore/rendering/RenderLayer.h
@@ -336,6 +336,9 @@ public:
     // the <html> layer and the root layer).
     RenderLayer* enclosingPositionedAncestor() const;
 
+    // The layer relative to which clipping rects for this layer are computed.
+    RenderLayer* clippingRoot() const;
+
 #if USE(ACCELERATED_COMPOSITING)
     // Enclosing compositing layer; if includeSelf is true, may return this.
     RenderLayer* enclosingCompositingLayer(bool includeSelf = true) const;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list