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 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 15 matching lines...) Expand all Loading... |
26 // need more columns than what a group has room for, we'll create another group
and put them there | 26 // need more columns than what a group has room for, we'll create another group
and put them there |
27 // (and make them appear in the next outer fragmentainer). | 27 // (and make them appear in the next outer fragmentainer). |
28 class MultiColumnFragmentainerGroup { | 28 class MultiColumnFragmentainerGroup { |
29 public: | 29 public: |
30 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); | 30 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); |
31 | 31 |
32 bool isLastGroup() const; | 32 bool isLastGroup() const; |
33 | 33 |
34 // Position within the LayoutMultiColumnSet. | 34 // Position within the LayoutMultiColumnSet. |
35 LayoutUnit logicalTop() const { return m_logicalTop; } | 35 LayoutUnit logicalTop() const { return m_logicalTop; } |
| 36 void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; } |
36 | 37 |
37 LayoutUnit logicalHeight() const { return m_columnHeight; } | 38 LayoutUnit logicalHeight() const { return m_columnHeight; } |
38 | 39 |
39 LayoutSize offsetFromColumnSet() const; | 40 LayoutSize offsetFromColumnSet() const; |
40 | 41 |
| 42 // Return the block offset from the enclosing flow thread, if nested. In the
coordinate space |
| 43 // of the enclosing flow thread. |
| 44 LayoutUnit blockOffsetInEnclosingFlowThread() const; |
| 45 |
41 // The top of our flow thread portion | 46 // The top of our flow thread portion |
42 LayoutUnit logicalTopInFlowThread() const { return m_logicalTopInFlowThread;
} | 47 LayoutUnit logicalTopInFlowThread() const { return m_logicalTopInFlowThread;
} |
43 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { m_logica
lTopInFlowThread = logicalTopInFlowThread; } | 48 void setLogicalTopInFlowThread(LayoutUnit logicalTopInFlowThread) { m_logica
lTopInFlowThread = logicalTopInFlowThread; } |
44 | 49 |
45 // The bottom of our flow thread portion | 50 // The bottom of our flow thread portion |
46 LayoutUnit logicalBottomInFlowThread() const { return m_logicalBottomInFlowT
hread; } | 51 LayoutUnit logicalBottomInFlowThread() const { return m_logicalBottomInFlowT
hread; } |
47 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { AS
SERT(logicalBottomInFlowThread >= m_logicalTopInFlowThread); m_logicalBottomInFl
owThread = logicalBottomInFlowThread; } | 52 void setLogicalBottomInFlowThread(LayoutUnit logicalBottomInFlowThread) { AS
SERT(logicalBottomInFlowThread >= m_logicalTopInFlowThread); m_logicalBottomInFl
owThread = logicalBottomInFlowThread; } |
48 | 53 |
49 // The height of our flow thread portion | 54 // The height of our flow thread portion |
50 LayoutUnit logicalHeightInFlowThread() const { return m_logicalBottomInFlowT
hread - m_logicalTopInFlowThread; } | 55 LayoutUnit logicalHeightInFlowThread() const { return m_logicalBottomInFlowT
hread - m_logicalTopInFlowThread; } |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 const MultiColumnFragmentainerGroup& last() const { return m_groups.last();
} | 172 const MultiColumnFragmentainerGroup& last() const { return m_groups.last();
} |
168 | 173 |
169 typedef Vector<MultiColumnFragmentainerGroup, 1>::iterator iterator; | 174 typedef Vector<MultiColumnFragmentainerGroup, 1>::iterator iterator; |
170 typedef Vector<MultiColumnFragmentainerGroup, 1>::const_iterator const_itera
tor; | 175 typedef Vector<MultiColumnFragmentainerGroup, 1>::const_iterator const_itera
tor; |
171 | 176 |
172 iterator begin() { return m_groups.begin(); } | 177 iterator begin() { return m_groups.begin(); } |
173 const_iterator begin() const { return m_groups.begin(); } | 178 const_iterator begin() const { return m_groups.begin(); } |
174 iterator end() { return m_groups.end(); } | 179 iterator end() { return m_groups.end(); } |
175 const_iterator end() const { return m_groups.end(); } | 180 const_iterator end() const { return m_groups.end(); } |
176 | 181 |
| 182 size_t size() const { return m_groups.size(); } |
| 183 MultiColumnFragmentainerGroup& operator[](size_t i) { return m_groups.at(i);
} |
| 184 const MultiColumnFragmentainerGroup& operator[](size_t i) const { return m_g
roups.at(i); } |
| 185 |
177 void append(const MultiColumnFragmentainerGroup& group) { m_groups.append(gr
oup); } | 186 void append(const MultiColumnFragmentainerGroup& group) { m_groups.append(gr
oup); } |
178 | |
179 void shrink(size_t size) { m_groups.shrink(size); } | 187 void shrink(size_t size) { m_groups.shrink(size); } |
180 | 188 |
181 private: | 189 private: |
182 LayoutMultiColumnSet& m_columnSet; | 190 LayoutMultiColumnSet& m_columnSet; |
183 | 191 |
184 Vector<MultiColumnFragmentainerGroup, 1> m_groups; | 192 Vector<MultiColumnFragmentainerGroup, 1> m_groups; |
185 }; | 193 }; |
186 | 194 |
187 } // namespace blink | 195 } // namespace blink |
188 | 196 |
189 #endif // MultiColumnFragmentainerGroup_h | 197 #endif // MultiColumnFragmentainerGroup_h |
OLD | NEW |