diff options
author | Steve Block <steveblock@google.com> | 2012-04-12 15:42:19 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2012-04-12 18:44:42 +0100 |
commit | 5eb142cf16d1349544dc19cfb780917d36fbf3b6 (patch) | |
tree | 0ec5843b2c29c4437b62db8c6ca80d998a3778fd /Source | |
parent | 18b8d441a9374dd8d867c63f12c330b20ae9b5d0 (diff) | |
download | external_webkit-5eb142cf16d1349544dc19cfb780917d36fbf3b6.zip external_webkit-5eb142cf16d1349544dc19cfb780917d36fbf3b6.tar.gz external_webkit-5eb142cf16d1349544dc19cfb780917d36fbf3b6.tar.bz2 |
Cherry-pick WebKit change r107627 to fix a LayoutTest crash
LayoutTests/fast/multicol/span/split-flow-anonymous-wrapper-crash.html
See http://trac.webkit.org/changeset/107627
Bug: 6328992
Change-Id: Icc964ad0a6eb967f56fc298577a3b4515e81e886
Diffstat (limited to 'Source')
-rw-r--r-- | Source/WebCore/rendering/RenderBlock.cpp | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index d01ced8..a3bd41a 100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -420,14 +420,18 @@ void RenderBlock::addChildToAnonymousColumnBlocks(RenderObject* newChild, Render RenderBlock* RenderBlock::containingColumnsBlock(bool allowAnonymousColumnBlock) { + RenderBlock* firstChildIgnoringAnonymousWrappers = 0; for (RenderObject* curr = this; curr; curr = curr->parent()) { if (!curr->isRenderBlock() || curr->isFloatingOrPositioned() || curr->isTableCell() || curr->isRoot() || curr->isRenderView() || curr->hasOverflowClip() || curr->isInlineBlockOrInlineTable()) return 0; RenderBlock* currBlock = toRenderBlock(curr); + if (!currBlock->createsAnonymousWrapper()) + firstChildIgnoringAnonymousWrappers = currBlock; + if (currBlock->style()->specifiesColumns() && (allowAnonymousColumnBlock || !currBlock->isAnonymousColumnsBlock())) - return currBlock; + return firstChildIgnoringAnonymousWrappers; if (currBlock->isAnonymousColumnSpanBlock()) return 0; @@ -661,22 +665,17 @@ RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild) RenderBlock* columnsBlockAncestor = 0; if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isBeforeOrAfterContent() && !newChild->isFloatingOrPositioned() && !newChild->isInline() && !isAnonymousColumnSpanBlock()) { - if (style()->specifiesColumns()) - columnsBlockAncestor = this; - else if (!isInline() && parent() && parent()->isRenderBlock()) { - columnsBlockAncestor = toRenderBlock(parent())->containingColumnsBlock(false); - - if (columnsBlockAncestor) { - // Make sure that none of the parent ancestors have a continuation. - // If yes, we do not want split the block into continuations. - RenderObject* curr = this; - while (curr && curr != columnsBlockAncestor) { - if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()) { - columnsBlockAncestor = 0; - break; - } - curr = curr->parent(); + columnsBlockAncestor = containingColumnsBlock(false); + if (columnsBlockAncestor) { + // Make sure that none of the parent ancestors have a continuation. + // If yes, we do not want split the block into continuations. + RenderObject* curr = this; + while (curr && curr != columnsBlockAncestor) { + if (curr->isRenderBlock() && toRenderBlock(curr)->continuation()) { + columnsBlockAncestor = 0; + break; } + curr = curr->parent(); } } } |