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

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

Issue 2846923003: Fix regression in page_cycler_v2.tough_layout_cases (Closed)
Patch Set: bug 716385 Created 3 years, 8 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 | « no previous file | 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/LayoutBlockFlow.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index b0e66841315b3cea38a413ce8e4550d05a91175b..d09bfd46d03a16484f774bccc03d8788232e20d6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -691,7 +691,6 @@ void LayoutBlockFlow::MarkDescendantsWithFloatsForLayoutIfNeeded(
// mark it for layout.
LayoutUnit lowest_float =
std::max(previous_float_logical_bottom, LowestFloatLogicalBottom());
- lowest_float = std::max(lowest_float, child.LowestFloatLogicalBottom());
if (lowest_float > new_logical_top)
mark_descendants_with_floats = true;
}
@@ -3717,6 +3716,7 @@ LayoutUnit LayoutBlockFlow::PositionAndLayoutFloat(
}
}
+ LayoutUnit old_logical_top = child.LogicalTop();
if (child.NeedsLayout()) {
if (is_paginated) {
// Before we can lay out the float, we need to estimate a position for
@@ -3766,6 +3766,17 @@ LayoutUnit LayoutBlockFlow::PositionAndLayoutFloat(
MarkChildForPaginationRelayoutIfNeeded(child, layout_scope);
child.LayoutIfNeeded();
+ // If negative margin pushes the child completely out of its old position
+ // mark for layout siblings that may have it in its float lists.
+ if (child.LogicalBottom() <= old_logical_top) {
+ LayoutObject* next = child.NextSibling();
+ if (next && next->IsLayoutBlockFlow()) {
+ LayoutBlockFlow* nextBlock = ToLayoutBlockFlow(next);
+ if (!nextBlock->AvoidsFloats() || nextBlock->ShrinkToAvoidFloats())
+ nextBlock->MarkAllDescendantsWithFloatsForLayout();
+ }
+ }
+
if (is_paginated) {
PaginatedContentWasLaidOut(child.LogicalBottom());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698