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

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

Issue 1393533002: Clear floats that are nested in previous siblings and don't overhang. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 5 years, 2 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
Index: third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index 3f9c12f381a38e37c3da6530c8d553774887fc86..0e1a6b06a6ea29b89ef1827cdc57527b7da61b3f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -429,6 +429,8 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
// TODO(robhogan): We should exclude blocks that create formatting contexts, not just out of flow or floating blocks.
if (child->isLayoutBlockFlow() && !child->isFloatingOrOutOfFlowPositioned()) {
LayoutBlockFlow* block = toLayoutBlockFlow(child);
+ if (!block->containsFloats())
+ continue;
lowestBlock = block;
if (oldHeight <= newHeight || block->lowestFloatLogicalBottom() + block->logicalTop() <= newHeight)
break;
@@ -436,6 +438,8 @@ inline bool LayoutBlockFlow::layoutBlockFlow(bool relayoutChildren, LayoutUnit &
addedOverhangingFloats = true;
}
}
+ // If we have no overhanging floats we still pass a record of the lowest non-overhanging float up the tree so we can enclose it if
+ // we are a formatting context and allow siblings to avoid it if they have negative margin and find themselves in its vicinity.
if (!addedOverhangingFloats)
addLowestFloatFromChildren(lowestBlock);
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/block/margin-collapse/clear-nested-float-more-than-one-previous-sibling-away-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698