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

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 65fcc59a155771b05adca84f275a5b7209287676..7d31cb0ae42161fbf46a576ae446e5aa02282171 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -4374,12 +4374,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.
@@ -4395,6 +4394,7 @@ LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil
markBoxForRelayoutAfterSplit(boxToSplit);
markBoxForRelayoutAfterSplit(postBox);
+ boxAtTopOfNewBranch = postBox;
beforeChild = postBox;
} else {
@@ -4402,8 +4402,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) {
+ boxAtTopOfNewBranch->clearPercentHeightDescendants();
markBoxForRelayoutAfterSplit(this);
+ }
ASSERT(beforeChild->parent() == this);
return beforeChild;
« 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