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 3023993789bdeda86e8e50571691a2fda2d9f2e5..45607bdde8b166eb4b9092b18e8d059939e91489 100644 |
--- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
+++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp |
@@ -325,6 +325,15 @@ void MinimumSpaceShortageFinder::examineLine(const RootInlineBox& line) |
ASSERT(isFirstAfterBreak(lineTopInFlowThread) || !line.paginationStrut() || !isLogicalTopWithinBounds(lineTopInFlowThread - line.paginationStrut())); |
if (isFirstAfterBreak(lineTopInFlowThread)) |
recordSpaceShortage(lineHeight - line.paginationStrut()); |
+ |
+ // Even if the line box itself fits fine inside a column, some content may overflow the line |
+ // box bottom (due to restrictive line-height, for instance). We should check if some portion |
+ // of said overflow ends up in the next column. That counts as space shortage. |
+ LayoutUnit lineBottomWithOverflow = lineTopInFlowThread + line.lineBottom() - lineTop; |
+ if (group().columnLogicalTopForOffset(lineTopInFlowThread) != group().columnLogicalTopForOffset(lineBottomWithOverflow)) { |
+ LayoutUnit shortage = lineBottomWithOverflow - group().columnLogicalTopForOffset(lineBottomWithOverflow); |
+ recordSpaceShortage(shortage); |
+ } |
} |
} // namespace blink |