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

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

Issue 1318653004: Never move unbreakable blocks that are at the top of a column / page. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 4 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 | « LayoutTests/fast/multicol/unbreakable-block-too-tall-at-column-start-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/LayoutBlockFlow.cpp
diff --git a/Source/core/layout/LayoutBlockFlow.cpp b/Source/core/layout/LayoutBlockFlow.cpp
index aadf77050085befb9e4b45132a7b5d0a17cb1119..c9aaf9d18baabbfc115ff8696bef66f54b525fc8 100644
--- a/Source/core/layout/LayoutBlockFlow.cpp
+++ b/Source/core/layout/LayoutBlockFlow.cpp
@@ -854,7 +854,9 @@ LayoutUnit LayoutBlockFlow::adjustForUnsplittableChild(LayoutBox& child, LayoutU
if (!pageLogicalHeight)
return logicalOffset;
LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(logicalOffset, AssociateWithLatterPage);
- if (remainingLogicalHeight < childLogicalHeight)
+ // Break if there's not enough space left for us, but only as long as we're not already at the
+ // top of a page. No point in leaving a page completely blank.
+ if (remainingLogicalHeight < childLogicalHeight && remainingLogicalHeight < pageLogicalHeight)
return logicalOffset + remainingLogicalHeight;
return logicalOffset;
}
« no previous file with comments | « LayoutTests/fast/multicol/unbreakable-block-too-tall-at-column-start-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698