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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/multicol/widows2-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 271
272 void RenderMultiColumnFlowThread::layout() 272 void RenderMultiColumnFlowThread::layout()
273 { 273 {
274 RenderFlowThread::layout(); 274 RenderFlowThread::layout();
275 if (RenderMultiColumnSet* lastSet = lastMultiColumnSet()) 275 if (RenderMultiColumnSet* lastSet = lastMultiColumnSet())
276 lastSet->expandToEncompassFlowThreadContentsIfNeeded(); 276 lastSet->expandToEncompassFlowThreadContentsIfNeeded();
277 } 277 }
278 278
279 void RenderMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa ceShortage) 279 void RenderMultiColumnFlowThread::setPageBreak(LayoutUnit offset, LayoutUnit spa ceShortage)
280 { 280 {
281 // Only positive values are interesting (and allowed) here. Zero space short age may be reported
282 // when we're at the top of a column and the element has zero height. Ignore this, and also
283 // ignore any negative values, which may occur when we set an early break in order to honor
284 // widows in the next column.
285 if (spaceShortage <= 0)
286 return;
287
281 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset))) 288 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset)))
282 multicolSet->recordSpaceShortage(spaceShortage); 289 multicolSet->recordSpaceShortage(spaceShortage);
283 } 290 }
284 291
285 void RenderMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay outUnit minHeight) 292 void RenderMultiColumnFlowThread::updateMinimumPageHeight(LayoutUnit offset, Lay outUnit minHeight)
286 { 293 {
287 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset))) 294 if (RenderMultiColumnSet* multicolSet = toRenderMultiColumnSet(regionAtBlock Offset(offset)))
288 multicolSet->updateMinimumColumnHeight(minHeight); 295 multicolSet->updateMinimumColumnHeight(minHeight);
289 } 296 }
290 297
(...skipping 15 matching lines...) Expand all
306 } 313 }
307 314
308 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const 315 bool RenderMultiColumnFlowThread::isPageLogicalHeightKnown() const
309 { 316 {
310 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet()) 317 if (RenderMultiColumnSet* columnSet = lastMultiColumnSet())
311 return columnSet->computedColumnHeight(); 318 return columnSet->computedColumnHeight();
312 return false; 319 return false;
313 } 320 }
314 321
315 } 322 }
OLDNEW
« 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