Index: third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
index 75fabaddfae7c3372eb547349e52000fce1ab42a..66a070e6b986aa160974c9913820ce73418c874c 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp |
@@ -369,6 +369,16 @@ void LayoutBlock::invalidateDisplayItemClients(const LayoutBoxModelObject& paint |
invalidateDisplayItemClientForStartOfContinuationsIfNeeded(*this); |
} |
+static void addSubsequentFloatingOrOutOfFlowSiblingsToBlock(LayoutBlock* block, LayoutBlock* container) |
+{ |
+ LayoutObject* child = block->nextSibling(); |
+ while (child && child->isFloatingOrOutOfFlowPositioned()) { |
+ LayoutObject* sibling = child->nextSibling(); |
+ container->moveChildTo(block, child, nullptr, false); |
+ child = sibling; |
+ } |
+} |
+ |
void LayoutBlock::addChildIgnoringContinuation(LayoutObject* newChild, LayoutObject* beforeChild) |
{ |
if (beforeChild && beforeChild->parent() != this) { |
@@ -450,12 +460,7 @@ void LayoutBlock::addChildIgnoringContinuation(LayoutObject* newChild, LayoutObj |
child = sibling; |
} |
newBox->addChild(newChild); |
- child = newBox->nextSibling(); |
- while (child && child->isFloatingOrOutOfFlowPositioned()) { |
- LayoutObject* sibling = child->nextSibling(); |
- moveChildTo(newBox, child, nullptr, false); |
- child = sibling; |
- } |
+ addSubsequentFloatingOrOutOfFlowSiblingsToBlock(newBox, this); |
return; |
} |
} |
@@ -730,6 +735,8 @@ void LayoutBlock::removeChild(LayoutObject* oldChild) |
&& (!anonymousBlock->nextSibling() || (anonymousBlock->nextSibling()->style()->styleType() != NOPSEUDO && anonymousBlock->nextSibling()->isFloating() && !anonymousBlock->nextSibling()->nextSibling()))) { |
collapseAnonymousBlockChild(this, anonymousBlock); |
} |
+ if (prev && prev->isAnonymousBlock()) |
mstensho (USE GERRIT)
2015/10/30 08:15:14
Don't we also need something similar for |next|?
rhogan
2015/10/30 19:28:16
I would expect https://codereview.chromium.org/142
mstensho (USE GERRIT)
2015/11/02 12:31:57
Actually, the test in this CL also passes with onl
rhogan
2015/11/02 19:38:05
Oops, fixed the test - it was missing a <div> befo
|
+ addSubsequentFloatingOrOutOfFlowSiblingsToBlock(toLayoutBlock(prev), this); |
} |
if (!firstChild()) { |