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

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

Issue 1495033002: Clear intruding floats when moving child to inline parent. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@558405-5
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/LayoutBoxModelObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
index 34c0b0792f4ba35358b9df99ac1b8106c46df1f8..74d53b3160cc4b290e148a77b828241d52056b2b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBoxModelObject.cpp
@@ -1010,6 +1010,13 @@ void LayoutBoxModelObject::moveChildTo(LayoutBoxModelObject* toBoxModelObject, L
ASSERT(this == child->parent());
ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent());
+
+ // If a child is moving from a block-flow to an inline-flow parent then any floats currently intruding into
mstensho (USE GERRIT) 2015/12/07 14:07:35 I think we need an example here. When can things l
+ // the child can no longer do so. Remove them from their float-lists immediately as markAllDescendantsWithFloatsForLayout
+ // won't attempt to remove floats from parents that have inline-flow if we try later.
mstensho (USE GERRIT) 2015/12/07 14:07:35 Yeah... regarding that... Why don't we just attemp
rhogan 2015/12/07 17:29:52 Performance. I removed it once but then added it b
mstensho (USE GERRIT) 2015/12/07 21:14:44 Why did that cause a performance regression? I don
rhogan 2015/12/08 18:15:44 I let markAllDescendantsWithFloatForLayout() desce
+ if (child->isLayoutBlockFlow() && toBoxModelObject->childrenInline() && !child->childrenInline())
mstensho (USE GERRIT) 2015/12/07 21:14:44 I think something is missing here. The condition
rhogan 2015/12/08 18:15:44 Yes, that's true - it couldn't have any intruding
+ toLayoutBlockFlow(child)->removeFloatingObjectsFromDescendants();
+
if (fullRemoveInsert && (toBoxModelObject->isLayoutBlock() || toBoxModelObject->isLayoutInline())) {
// Takes care of adding the new child correctly if toBlock and fromBlock
// have different kind of children (block vs inline).

Powered by Google App Engine
This is Rietveld 408576698