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 #ifndef MultiColumnFragmentainerGroup_h | 5 #ifndef MultiColumnFragmentainerGroup_h |
6 #define MultiColumnFragmentainerGroup_h | 6 #define MultiColumnFragmentainerGroup_h |
7 | 7 |
8 #include "core/layout/LayoutMultiColumnFlowThread.h" | 8 #include "core/layout/LayoutMultiColumnFlowThread.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 LayoutUnit logicalTopInFlowThread() const { return m_logicalTopInFlowThread; } | 56 LayoutUnit logicalTopInFlowThread() const { return m_logicalTopInFlowThread; } |
57 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { | 57 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { |
58 m_logicalTopInFlowThread = logicalTopInFlowThread; | 58 m_logicalTopInFlowThread = logicalTopInFlowThread; |
59 } | 59 } |
60 | 60 |
61 // The bottom of our flow thread portion | 61 // The bottom of our flow thread portion |
62 LayoutUnit logicalBottomInFlowThread() const { | 62 LayoutUnit logicalBottomInFlowThread() const { |
63 return m_logicalBottomInFlowThread; | 63 return m_logicalBottomInFlowThread; |
64 } | 64 } |
65 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { | 65 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { |
66 ASSERT(logicalBottomInFlowThread >= m_logicalTopInFlowThread); | |
67 m_logicalBottomInFlowThread = logicalBottomInFlowThread; | 66 m_logicalBottomInFlowThread = logicalBottomInFlowThread; |
68 } | 67 } |
69 | 68 |
70 // The height of our flow thread portion | 69 // The height of the flow thread portion for the entire fragmentainer group. |
71 LayoutUnit logicalHeightInFlowThread() const { | 70 LayoutUnit logicalHeightInFlowThread() const { |
72 return m_logicalBottomInFlowThread - m_logicalTopInFlowThread; | 71 // Due to negative margins, logical bottom may actually end up above logical |
| 72 // top, but we never want to return negative logical heights. |
| 73 return (m_logicalBottomInFlowThread - m_logicalTopInFlowThread) |
| 74 .clampNegativeToZero(); |
73 } | 75 } |
| 76 // The height of the flow thread portion for the specified fragmentainer. |
| 77 // The last fragmentainer may not be using all available space. |
| 78 LayoutUnit logicalHeightInFlowThreadAt(unsigned columnIndex) const; |
74 | 79 |
75 void resetColumnHeight(); | 80 void resetColumnHeight(); |
76 bool recalculateColumnHeight(LayoutMultiColumnSet&); | 81 bool recalculateColumnHeight(LayoutMultiColumnSet&); |
77 | 82 |
78 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, | 83 LayoutSize flowThreadTranslationAtOffset(LayoutUnit, |
79 LayoutBox::PageBoundaryRule, | 84 LayoutBox::PageBoundaryRule, |
80 CoordinateSpaceConversion) const; | 85 CoordinateSpaceConversion) const; |
81 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; | 86 LayoutUnit columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const; |
82 | 87 |
83 // If SnapToColumnPolicy is SnapToColumn, visualPointToFlowThreadPoint() won't | 88 // If SnapToColumnPolicy is SnapToColumn, visualPointToFlowThreadPoint() won't |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 | 204 |
200 private: | 205 private: |
201 LayoutMultiColumnSet& m_columnSet; | 206 LayoutMultiColumnSet& m_columnSet; |
202 | 207 |
203 Vector<MultiColumnFragmentainerGroup, 1> m_groups; | 208 Vector<MultiColumnFragmentainerGroup, 1> m_groups; |
204 }; | 209 }; |
205 | 210 |
206 } // namespace blink | 211 } // namespace blink |
207 | 212 |
208 #endif // MultiColumnFragmentainerGroup_h | 213 #endif // MultiColumnFragmentainerGroup_h |
OLD | NEW |