Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutBox.cpp

Issue 1551573002: Clear box from percentage descendants when it is split off from the ancestor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/split-table-section-before-anonymous-block-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/split-table-section-before-anonymous-block-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698