| 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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // the next layout pass, since each pass will rebuild this. | 110 // the next layout pass, since each pass will rebuild this. |
| 111 m_contentRuns.clear(); | 111 m_contentRuns.clear(); |
| 112 | 112 |
| 113 if (m_columnHeight == oldColumnHeight) | 113 if (m_columnHeight == oldColumnHeight) |
| 114 return false; // No change. We're done. | 114 return false; // No change. We're done. |
| 115 | 115 |
| 116 m_minSpaceShortage = LayoutUnit::max(); | 116 m_minSpaceShortage = LayoutUnit::max(); |
| 117 return true; // Need another pass. | 117 return true; // Need another pass. |
| 118 } | 118 } |
| 119 | 119 |
| 120 void MultiColumnFragmentainerGroup::expandToEncompassFlowThreadOverflow() | |
| 121 { | |
| 122 ASSERT(isLastGroup()); | |
| 123 // Get the offset within the flow thread in its block progression direction.
Then get the | |
| 124 // flow thread's remaining logical height including its overflow and expand
our rect | |
| 125 // to encompass that remaining height and overflow. The idea is that we will
generate | |
| 126 // additional columns and pages to hold that overflow, since people do write
bad | |
| 127 // content like <body style="height:0px"> in multi-column layouts. | |
| 128 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); | |
| 129 LayoutRect layoutRect = flowThread->layoutOverflowRect(); | |
| 130 m_logicalBottomInFlowThread = flowThread->isHorizontalWritingMode() ? layout
Rect.maxY() : layoutRect.maxX(); | |
| 131 } | |
| 132 | |
| 133 LayoutSize MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset(LayoutUn
it offsetInFlowThread) const | 120 LayoutSize MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset(LayoutUn
it offsetInFlowThread) const |
| 134 { | 121 { |
| 135 LayoutFlowThread* flowThread = m_columnSet.flowThread(); | 122 LayoutFlowThread* flowThread = m_columnSet.flowThread(); |
| 136 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread); | 123 unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread); |
| 137 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); | 124 LayoutRect portionRect(flowThreadPortionRectAt(columnIndex)); |
| 138 flowThread->flipForWritingMode(portionRect); | 125 flowThread->flipForWritingMode(portionRect); |
| 139 LayoutRect columnRect(columnRectAt(columnIndex)); | 126 LayoutRect columnRect(columnRectAt(columnIndex)); |
| 140 m_columnSet.flipForWritingMode(columnRect); | 127 m_columnSet.flipForWritingMode(columnRect); |
| 141 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect.
location(); | 128 LayoutSize translationRelativeToGroup = columnRect.location() - portionRect.
location(); |
| 142 return translationRelativeToGroup + offsetFromColumnSet() + m_columnSet.topL
eftLocationOffset() - flowThread->topLeftLocationOffset(); | 129 return translationRelativeToGroup + offsetFromColumnSet() + m_columnSet.topL
eftLocationOffset() - flowThread->topLeftLocationOffset(); |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 append(MultiColumnFragmentainerGroup(m_columnSet)); | 544 append(MultiColumnFragmentainerGroup(m_columnSet)); |
| 558 return last(); | 545 return last(); |
| 559 } | 546 } |
| 560 | 547 |
| 561 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 548 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
| 562 { | 549 { |
| 563 shrink(1); | 550 shrink(1); |
| 564 } | 551 } |
| 565 | 552 |
| 566 } // namespace blink | 553 } // namespace blink |
| OLD | NEW |