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

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

Issue 2690863003: ColumnBalancer: need to examine lines that protrude into the flow thread portion. (Closed)
Patch Set: Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/fast/multicol/span/underflow-after-spanner.html ('k') | 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/ColumnBalancer.cpp
diff --git a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
index a16a4d7ce37e8253f2e49e82f781f981a6d6b34f..1bdf4b05f104b6abe4c1c616eab8116194434b69 100644
--- a/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
+++ b/third_party/WebKit/Source/core/layout/ColumnBalancer.cpp
@@ -41,8 +41,14 @@ void ColumnBalancer::traverseLines(const LayoutBlockFlow& blockFlow) {
line = line->nextRootBox()) {
LayoutUnit lineTopInFlowThread =
m_flowThreadOffset + line->lineTopWithLeading();
- if (lineTopInFlowThread < logicalTopInFlowThread())
- continue;
+ if (lineTopInFlowThread < logicalTopInFlowThread()) {
+ // If the line is fully about the flow thread portion range we're working
+ // with, we can skip it. If its logical top is outside the range, but its
+ // logical bottom protrudes into the range, we need to examine it.
+ LayoutUnit lineBottom = line->lineBottomWithLeading();
+ if (m_flowThreadOffset + lineBottom <= logicalTopInFlowThread())
+ continue;
+ }
if (lineTopInFlowThread >= logicalBottomInFlowThread())
break;
examineLine(*line);
@@ -233,6 +239,8 @@ void InitialColumnHeightFinder::examineLine(const RootInlineBox& line) {
LayoutUnit lineTopInFlowThread = flowThreadOffset() + lineTop;
LayoutUnit minimumLogialHeight =
columnLogicalHeightRequirementForLine(line.block().styleRef(), line);
+ if (lineTopInFlowThread < LayoutUnit())
+ minimumLogialHeight += lineTopInFlowThread;
m_tallestUnbreakableLogicalHeight =
std::max(m_tallestUnbreakableLogicalHeight, minimumLogialHeight);
ASSERT(
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/multicol/span/underflow-after-spanner.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698