Index: third_party/WebKit/Source/core/layout/LayoutBox.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
index 92342e025981d09bbb700ce959d588a3b27c7fc8..c683aabf8caa3e0bcd247ee7dff783b73ed303be 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp |
@@ -4373,12 +4373,11 @@ static void markBoxForRelayoutAfterSplit(LayoutBox* box) |
LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChild) |
{ |
- bool didSplitParentAnonymousBoxes = false; |
+ LayoutBox* boxAtTopOfNewBranch = nullptr; |
while (beforeChild->parent() != this) { |
LayoutBox* boxToSplit = toLayoutBox(beforeChild->parent()); |
if (boxToSplit->slowFirstChild() != beforeChild && boxToSplit->isAnonymous()) { |
- didSplitParentAnonymousBoxes = true; |
// We have to split the parent box into two boxes and move children |
// from |beforeChild| to end into the new post box. |
@@ -4394,6 +4393,7 @@ LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil |
markBoxForRelayoutAfterSplit(boxToSplit); |
markBoxForRelayoutAfterSplit(postBox); |
+ boxAtTopOfNewBranch = postBox; |
beforeChild = postBox; |
} else { |
@@ -4401,7 +4401,12 @@ LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil |
} |
} |
- if (didSplitParentAnonymousBoxes) |
+ // Splitting the box means the left side of the container chain will lose any percent height descendants |
+ // below |boxAtTopOfNewBranch| on the right hand side. |
+ if (boxAtTopOfNewBranch && LayoutBlock::hasPercentHeightContainerMap()) |
+ LayoutBlock::clearPercentHeightDescendantsFrom(boxAtTopOfNewBranch); |
+ |
+ if (boxAtTopOfNewBranch) |
mstensho (USE GERRIT)
2016/01/25 19:37:07
We could if for |boxAtTopOfNewBranch| only once.
|
markBoxForRelayoutAfterSplit(this); |
ASSERT(beforeChild->parent() == this); |