OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |