<rdar://problem/8895977> REGRESSION: multicol crashes with positioned elements
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 21:32:42 +0000 (21:32 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 28 Mar 2011 21:32:42 +0000 (21:32 +0000)
https://bugs.webkit.org/show_bug.cgi?id=48983

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/multicol/paginated-layer-crash.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::paintPaginatedChildLayer): Bring the logic for finding pagintating layers
into sync with updatePagination() after r68069.
(WebCore::RenderLayer::hitTestPaginatedChildLayer): Ditto.

LayoutTests:

* fast/multicol/paginated-layer-crash-expected.txt: Added.
* fast/multicol/paginated-layer-crash.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/multicol/paginated-layer-crash-expected.txt [new file with mode: 0644]
LayoutTests/fast/multicol/paginated-layer-crash.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp

index 3e3d3d22829f755d8944285d647ce93fca090772..1a198f68a711212afd10b4f933cebd6492cafadd 100644 (file)
@@ -1,3 +1,13 @@
+2011-03-28  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/8895977> REGRESSION: multicol crashes with positioned elements
+        https://bugs.webkit.org/show_bug.cgi?id=48983
+
+        * fast/multicol/paginated-layer-crash-expected.txt: Added.
+        * fast/multicol/paginated-layer-crash.html: Added.
+
 2011-03-28  Vincent Scheib  <scheib@chromium.org>
 
         Chromium rebaseline for r82123.
diff --git a/LayoutTests/fast/multicol/paginated-layer-crash-expected.txt b/LayoutTests/fast/multicol/paginated-layer-crash-expected.txt
new file mode 100644 (file)
index 0000000..b8a95e0
--- /dev/null
@@ -0,0 +1,5 @@
+Test for https://bugs.webkit.org/show_bug.cgi?id=48983 REGRESSION: multicol crashes with positioned elements.
+
+This test should not cause a crash.
+
+
diff --git a/LayoutTests/fast/multicol/paginated-layer-crash.html b/LayoutTests/fast/multicol/paginated-layer-crash.html
new file mode 100644 (file)
index 0000000..4a6c6da
--- /dev/null
@@ -0,0 +1,31 @@
+<style>
+    .section {
+        position: absolute;
+        -webkit-column-count: 2;
+    }
+
+    .graph {
+        overflow: hidden;
+    }
+
+    .img {
+        position: relative;
+        width: 180px;
+    }
+</style>
+<p>
+    Test for <i><a href="https://bugs.webkit.org/show_bug.cgi?id=48983">https://bugs.webkit.org/show_bug.cgi?id=48983</a>
+    REGRESSION: multicol crashes with positioned elements</i>.
+</p>
+<p>
+    This test should not cause a crash.
+</p>
+<div class="section">
+    <div class="graph">
+        <div class="img"></div>
+    </div>
+</div>
+<script>
+    if (window.layoutTestController)
+        layoutTestController.dumpAsText();
+</script>
index e2ba947560dc2c28fb607516c5e07cdd7f20326a..6a7e2424d0d1518312a12e879820cdcf750a4890 100644 (file)
@@ -1,3 +1,17 @@
+2011-03-28  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        <rdar://problem/8895977> REGRESSION: multicol crashes with positioned elements
+        https://bugs.webkit.org/show_bug.cgi?id=48983
+
+        Test: fast/multicol/paginated-layer-crash.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::paintPaginatedChildLayer): Bring the logic for finding pagintating layers
+        into sync with updatePagination() after r68069.
+        (WebCore::RenderLayer::hitTestPaginatedChildLayer): Ditto.
+
 2011-03-28  Maciej Stachowiak  <mjs@apple.com>
 
         Reviewed by Darin Adler' .
index 9e60ce340d108fac728500169b40d519dd9f3d54..0af4e46c5272dc1612b3382670f402b0e136aa8b 100644 (file)
@@ -2626,9 +2626,9 @@ void RenderLayer::paintPaginatedChildLayer(RenderLayer* childLayer, RenderLayer*
     Vector<RenderLayer*> columnLayers;
     RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext();
     for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) {
-        if (curr->renderer()->hasColumns())
+        if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox()))
             columnLayers.append(curr);
-        if (curr == ancestorLayer || (curr->parent() && curr->parent()->renderer()->isPositioned()))
+        if (curr == ancestorLayer)
             break;
     }
 
@@ -3101,9 +3101,9 @@ RenderLayer* RenderLayer::hitTestPaginatedChildLayer(RenderLayer* childLayer, Re
     Vector<RenderLayer*> columnLayers;
     RenderLayer* ancestorLayer = isNormalFlowOnly() ? parent() : stackingContext();
     for (RenderLayer* curr = childLayer->parent(); curr; curr = curr->parent()) {
-        if (curr->renderer()->hasColumns())
+        if (curr->renderer()->hasColumns() && checkContainingBlockChainForPagination(childLayer->renderer(), curr->renderBox()))
             columnLayers.append(curr);
-        if (curr == ancestorLayer || (curr->parent() && curr->parent()->renderer()->isPositioned()))
+        if (curr == ancestorLayer)
             break;
     }