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

Unified Diff: Source/core/rendering/RenderMultiColumnFlowThread.cpp

Issue 263203003: [New Multicolumn] Guard against zero or negative space shortage. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove failing test. Need to fix an additional issue first. Test will be attached to the CL fixing … Created 6 years, 7 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/widows2-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderMultiColumnFlowThread.cpp
diff --git a/Source/core/rendering/RenderMultiColumnFlowThread.cpp b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
index c71439b5ed9062f126dd016aa24b993a06989db8..487dc477fae4780aa4e5a356e9ea1205e6dda420 100644
--- a/Source/core/rendering/RenderMultiColumnFlowThread.cpp
+++ b/Source/core/rendering/RenderMultiColumnFlowThread.cpp
@@ -278,6 +278,13 @@ void RenderMultiColumnFlowThread::layout()
void RenderMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage)
{
+ // Only positive values are interesting (and allowed) here. Zero space shortage may be reported
+ // when we're at the top of a column and the element has zero height. Ignore this, and also
+ // ignore any negative values, which may occur when we set an early break in order to honor
+ // widows in the next column.
+ if (spaceShortage <= 0)
+ return;
+
if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlockOffset(offset)))
multicolSet->recordSpaceShortage(spaceShortage);
}
« no previous file with comments | « LayoutTests/fast/multicol/widows2-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698