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

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: Created 5 years 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
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 2348ba690993427266953fde54c7023a018e0497..9ebcb1dc5ebecfdd51c3423e728e9039bafea809 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -4658,9 +4658,16 @@ LayoutObject* LayoutBox::splitAnonymousBoxesAroundChild(LayoutObject* beforeChil
markBoxForRelayoutAfterSplit(boxToSplit);
markBoxForRelayoutAfterSplit(postBox);
+ // Splitting the box means the left side of the container chain will lose any percent height descendants
+ // below |postBox| in the right hand side.
+ if (LayoutBlock::hasPercentHeightContainerMap())
mstensho (USE GERRIT) 2016/01/18 20:06:24 Can this be moved to a separate CL? This change is
mstensho (USE GERRIT) 2016/01/21 19:12:32 Well? :)
+ LayoutBlock::clearPercentHeightDescendantsFrom(postBox);
+
beforeChild = postBox;
} else {
- beforeChild = boxToSplit;
+ // If a lone anonymous block is now unnecessary. Collapse it away and skip to its parent.
mstensho (USE GERRIT) 2016/01/18 20:06:24 "If" without "then". :-P Did you mean to write th
+ if (!boxToSplit->isLayoutBlock() || !toLayoutBlock(boxToSplit)->collapseLoneAnonymousBlock(toLayoutBlock(boxToSplit)))
mstensho (USE GERRIT) 2016/01/18 20:06:24 I hope collapseLoneAnonymousBlock() can be static.
+ beforeChild = boxToSplit;
}
mstensho (USE GERRIT) 2016/01/18 20:06:24 What if collapseLoneAnonymousBlock() did something
}

Powered by Google App Engine
This is Rietveld 408576698