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..5e38121ab0a62c05194c4846c950c5706fa1a7fe 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 addSubsequentFloatingSiblingsToBlock(LayoutBlock* block, LayoutBlock* container) |
mstensho (USE GERRIT)
2015/10/29 20:00:26
FloatingOrOutOfFlowSiblings
|
+{ |
+ 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) { |
@@ -435,6 +445,7 @@ void LayoutBlock::addChildIgnoringContinuation(LayoutObject* newChild, LayoutObj |
if (afterChild && afterChild->isAnonymousBlock()) { |
afterChild->addChild(newChild); |
+ addSubsequentFloatingSiblingsToBlock(toLayoutBlock(afterChild), this); |
mstensho (USE GERRIT)
2015/10/29 20:00:26
Why would there be subsequent floats or out-of-flo
|
return; |
} |
@@ -450,12 +461,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; |
- } |
+ addSubsequentFloatingSiblingsToBlock(newBox, this); |
return; |
} |
} |