diff options
Diffstat (limited to 'Source/WebCore/rendering/RenderBlock.cpp')
-rw-r--r-- | Source/WebCore/rendering/RenderBlock.cpp | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/Source/WebCore/rendering/RenderBlock.cpp b/Source/WebCore/rendering/RenderBlock.cpp index a90bf69..a3bd41a 100644 --- a/Source/WebCore/rendering/RenderBlock.cpp +++ b/Source/WebCore/rendering/RenderBlock.cpp @@ -191,7 +191,7 @@ void RenderBlock::destroy() childBox->remove(); } } - } else if (isInline() && parent()) + } else if (parent()) parent()->dirtyLinesFromChangedChild(this); } @@ -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; @@ -443,6 +447,8 @@ RenderBlock* RenderBlock::clone() const else { cloneBlock = new (renderArena()) RenderBlock(node()); cloneBlock->setStyle(style()); + if (!childrenInline() && cloneBlock->firstChild() && cloneBlock->firstChild()->isInline()) + cloneBlock->makeChildrenNonInline(); } cloneBlock->setChildrenInline(childrenInline()); return cloneBlock; @@ -657,12 +663,21 @@ RenderBlock* RenderBlock::columnsBlockForSpanningElement(RenderObject* newChild) // cross the streams and have to cope with both types of continuations mixed together). // This function currently supports (1) and (2). RenderBlock* columnsBlockAncestor = 0; - if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isFloatingOrPositioned() - && !newChild->isInline() && !isAnonymousColumnSpanBlock()) { - if (style()->specifiesColumns()) - columnsBlockAncestor = this; - else if (parent() && parent()->isRenderBlock()) - columnsBlockAncestor = toRenderBlock(parent())->containingColumnsBlock(false); + if (!newChild->isText() && newChild->style()->columnSpan() && !newChild->isBeforeOrAfterContent() + && !newChild->isFloatingOrPositioned() && !newChild->isInline() && !isAnonymousColumnSpanBlock()) { + 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(); + } + } } return columnsBlockAncestor; } |