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

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

Issue 1465193002: Record space shortage that prevented an object from fitting in one column. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/ColumnBalancer.cpp
diff --git a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
index 3de1e264d6c82d0d4b2cccf9a02f19e79ed3eb83..55e3dd19d6d489a222fa5270acf6bc084b9ed211 100644
--- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
+++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
@@ -246,11 +246,9 @@ void MinimumSpaceShortageFinder::examineBoxAfterEntering(const LayoutBox& box)
if (isFirstAfterBreak && !box.hasForcedBreakBefore()) {
// This box is first after a soft break.
LayoutUnit strut = box.paginationStrut();
- if (breakability == LayoutBox::ForbidBreaks) {
- // Since we cannot break inside the box, just figure out how much more space we would
- // need to prevent it from being pushed to the next column.
- recordSpaceShortage(box.logicalHeight() - strut);
- } else if (m_pendingStrut == LayoutUnit::min()) {
+ // Figure out how much more space we would need to prevent it from being pushed to the next column.
+ recordSpaceShortage(box.logicalHeight() - strut);
+ if (breakability != LayoutBox::ForbidBreaks && m_pendingStrut == LayoutUnit::min()) {
// We now want to look for the first piece of unbreakable content (e.g. a line or a
// block-displayed image) inside this block. That ought to be a good candidate for
// minimum space shortage; a much better one than reporting space shortage for the

Powered by Google App Engine
This is Rietveld 408576698