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/ColumnBalancer.h" | 9 #include "core/layout/ColumnBalancer.h" |
10 #include "core/layout/LayoutMultiColumnSet.h" | 10 #include "core/layout/LayoutMultiColumnSet.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 } | 48 } |
49 | 49 |
50 void MultiColumnFragmentainerGroup::resetColumnHeight() | 50 void MultiColumnFragmentainerGroup::resetColumnHeight() |
51 { | 51 { |
52 // Nuke previously stored minimum column height. Contents may have changed f
or all we know. | 52 // Nuke previously stored minimum column height. Contents may have changed f
or all we know. |
53 m_minimumColumnHeight = 0; | 53 m_minimumColumnHeight = 0; |
54 | 54 |
55 m_maxColumnHeight = calculateMaxColumnHeight(); | 55 m_maxColumnHeight = calculateMaxColumnHeight(); |
56 | 56 |
57 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); | 57 LayoutMultiColumnFlowThread* flowThread = m_columnSet.multiColumnFlowThread(
); |
58 LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosingFlow
Thread(); | 58 if (heightIsAuto()) { |
59 if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown())
{ | 59 LayoutMultiColumnFlowThread* enclosingFlowThread = flowThread->enclosing
FlowThread(); |
60 // TODO(mstensho): Do this better. If height is auto here, we shouldn't
set a | 60 if (enclosingFlowThread && enclosingFlowThread->isPageLogicalHeightKnown
()) { |
61 // height, or forced breaks and pagination struts might mess up column b
alancing. | 61 // Even if height is auto, we set an initial height, in order to tel
l how much content |
62 LayoutUnit columnHeight = heightIsAuto() ? m_maxColumnHeight : heightAdj
ustedForRowOffset(flowThread->columnHeightAvailable()); | 62 // this MultiColumnFragmentainerGroup can hold, and when we need to
append a new one. |
63 setAndConstrainColumnHeight(columnHeight); | 63 m_columnHeight = m_maxColumnHeight; |
64 } else if (heightIsAuto()) { | 64 } else { |
65 m_columnHeight = LayoutUnit(); | 65 m_columnHeight = LayoutUnit(); |
| 66 } |
66 } else { | 67 } else { |
67 setAndConstrainColumnHeight(heightAdjustedForRowOffset(flowThread->colum
nHeightAvailable())); | 68 setAndConstrainColumnHeight(heightAdjustedForRowOffset(flowThread->colum
nHeightAvailable())); |
68 } | 69 } |
69 } | 70 } |
70 | 71 |
71 bool MultiColumnFragmentainerGroup::recalculateColumnHeight(BalancedColumnHeight
Calculation calculationMode) | 72 bool MultiColumnFragmentainerGroup::recalculateColumnHeight(BalancedColumnHeight
Calculation calculationMode) |
72 { | 73 { |
73 LayoutUnit oldColumnHeight = m_columnHeight; | 74 LayoutUnit oldColumnHeight = m_columnHeight; |
74 | 75 |
75 m_maxColumnHeight = calculateMaxColumnHeight(); | 76 m_maxColumnHeight = calculateMaxColumnHeight(); |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 append(MultiColumnFragmentainerGroup(m_columnSet)); | 557 append(MultiColumnFragmentainerGroup(m_columnSet)); |
557 return last(); | 558 return last(); |
558 } | 559 } |
559 | 560 |
560 void MultiColumnFragmentainerGroupList::deleteExtraGroups() | 561 void MultiColumnFragmentainerGroupList::deleteExtraGroups() |
561 { | 562 { |
562 shrink(1); | 563 shrink(1); |
563 } | 564 } |
564 | 565 |
565 } // namespace blink | 566 } // namespace blink |
OLD | NEW |