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

Side by Side Diff: Source/core/layout/MultiColumnFragmentainerGroup.cpp

Issue 1017263004: [New Multicolumn] Give up on stretching columns if they have already reached max height. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « LayoutTests/fast/multicol/unbreakable-content-taller-than-height-crash-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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 6
7 #include "core/layout/MultiColumnFragmentainerGroup.h" 7 #include "core/layout/MultiColumnFragmentainerGroup.h"
8 8
9 #include "core/layout/LayoutMultiColumnSet.h" 9 #include "core/layout/LayoutMultiColumnSet.h"
10 10
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 // With the current column height, the content fits without creating ove rflowing columns. We're done. 413 // With the current column height, the content fits without creating ove rflowing columns. We're done.
414 return m_columnHeight; 414 return m_columnHeight;
415 } 415 }
416 416
417 if (m_contentRuns.size() >= m_columnSet.usedColumnCount()) { 417 if (m_contentRuns.size() >= m_columnSet.usedColumnCount()) {
418 // Too many forced breaks to allow any implicit breaks. Initial balancin g should already 418 // Too many forced breaks to allow any implicit breaks. Initial balancin g should already
419 // have set a good height. There's nothing more we should do. 419 // have set a good height. There's nothing more we should do.
420 return m_columnHeight; 420 return m_columnHeight;
421 } 421 }
422 422
423 if (m_columnHeight >= m_maxColumnHeight) {
424 // We cannot stretch any further. We'll just have to live with the overf lowing columns. This
425 // typically happens if the max column height is less than the height of the tallest piece
426 // of unbreakable content (e.g. lines).
427 return m_columnHeight;
428 }
429
423 // If the initial guessed column height wasn't enough, stretch it now. Stret ch by the lowest 430 // If the initial guessed column height wasn't enough, stretch it now. Stret ch by the lowest
424 // amount of space shortage found during layout. 431 // amount of space shortage found during layout.
425 432
426 ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height! 433 ASSERT(m_minSpaceShortage > 0); // We should never _shrink_ the height!
427 ASSERT(m_minSpaceShortage != LayoutFlowThread::maxLogicalHeight()); // If th is happens, we probably have a bug. 434 ASSERT(m_minSpaceShortage != LayoutFlowThread::maxLogicalHeight()); // If th is happens, we probably have a bug.
428 if (m_minSpaceShortage == LayoutFlowThread::maxLogicalHeight()) 435 if (m_minSpaceShortage == LayoutFlowThread::maxLogicalHeight())
429 return m_columnHeight; // So bail out rather than looping infinitely. 436 return m_columnHeight; // So bail out rather than looping infinitely.
430 437
431 return m_columnHeight + m_minSpaceShortage; 438 return m_columnHeight + m_minSpaceShortage;
432 } 439 }
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 append(MultiColumnFragmentainerGroup(m_columnSet)); 553 append(MultiColumnFragmentainerGroup(m_columnSet));
547 return last(); 554 return last();
548 } 555 }
549 556
550 void MultiColumnFragmentainerGroupList::deleteExtraGroups() 557 void MultiColumnFragmentainerGroupList::deleteExtraGroups()
551 { 558 {
552 shrink(1); 559 shrink(1);
553 } 560 }
554 561
555 } // namespace blink 562 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/multicol/unbreakable-content-taller-than-height-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698