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 | 10 |
10 namespace blink { | 11 namespace blink { |
11 | 12 |
12 // A group of columns, that are laid out in the inline progression direction, al
l with the same | 13 // A group of columns, that are laid out in the inline progression direction, al
l with the same |
13 // column height. | 14 // column height. |
14 // | 15 // |
15 // When a multicol container is inside another fragmentation context, and said m
ulticol container | 16 // When a multicol container is inside another fragmentation context, and said m
ulticol container |
16 // lives in multiple outer fragmentainers (pages / columns), we need to put thes
e inner columns into | 17 // lives in multiple outer fragmentainers (pages / columns), we need to put thes
e inner columns into |
17 // separate groups, with one group per outer fragmentainer. Such a group of colu
mns is what | 18 // separate groups, with one group per outer fragmentainer. Such a group of colu
mns is what |
18 // comprises a "row of column boxes" in spec lingo. | 19 // comprises a "row of column boxes" in spec lingo. |
19 // | 20 // |
20 // Column balancing, when enabled, takes place within a column fragmentainer gro
up. | 21 // Column balancing, when enabled, takes place within a column fragmentainer gro
up. |
21 // | 22 // |
22 // Each fragmentainer group may have its own actual column count (if there are u
nused columns | 23 // Each fragmentainer group may have its own actual column count (if there are u
nused columns |
23 // because of forced breaks, for example). If there are multiple fragmentainer g
roups, the actual | 24 // because of forced breaks, for example). If there are multiple fragmentainer g
roups, the actual |
24 // column count must not exceed the used column count (the one calculated based
on column-count and | 25 // column count must not exceed the used column count (the one calculated based
on column-count and |
25 // column-width from CSS), or they'd overflow the outer fragmentainer in the inl
ine direction. If we | 26 // column-width from CSS), or they'd overflow the outer fragmentainer in the inl
ine direction. If we |
26 // need more columns than what a group has room for, we'll create another group
and put them there | 27 // 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). | 28 // (and make them appear in the next outer fragmentainer). |
28 class MultiColumnFragmentainerGroup { | 29 class MultiColumnFragmentainerGroup { |
| 30 ALLOW_ONLY_INLINE_ALLOCATION(); |
29 public: | 31 public: |
30 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); | 32 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); |
31 | 33 |
32 bool isLastGroup() const; | 34 bool isLastGroup() const; |
33 | 35 |
34 // Position within the LayoutMultiColumnSet. | 36 // Position within the LayoutMultiColumnSet. |
35 LayoutUnit logicalTop() const { return m_logicalTop; } | 37 LayoutUnit logicalTop() const { return m_logicalTop; } |
36 void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; } | 38 void setLogicalTop(LayoutUnit logicalTop) { m_logicalTop = logicalTop; } |
37 | 39 |
38 LayoutUnit logicalHeight() const { return m_columnHeight; } | 40 LayoutUnit logicalHeight() const { return m_columnHeight; } |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. | 151 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. |
150 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r
un assumed so far. | 152 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r
un assumed so far. |
151 }; | 153 }; |
152 Vector<ContentRun, 1> m_contentRuns; | 154 Vector<ContentRun, 1> m_contentRuns; |
153 }; | 155 }; |
154 | 156 |
155 // List of all fragmentainer groups within a column set. There will always be at
least one | 157 // List of all fragmentainer groups within a column set. There will always be at
least one |
156 // group. Deleting the one group is not allowed (or possible). There will be mor
e than one group if | 158 // group. Deleting the one group is not allowed (or possible). There will be mor
e than one group if |
157 // the owning column set lives in multiple outer fragmentainers (e.g. multicol i
nside paged media). | 159 // the owning column set lives in multiple outer fragmentainers (e.g. multicol i
nside paged media). |
158 class CORE_EXPORT MultiColumnFragmentainerGroupList { | 160 class CORE_EXPORT MultiColumnFragmentainerGroupList { |
| 161 DISALLOW_ALLOCATION(); |
159 public: | 162 public: |
160 MultiColumnFragmentainerGroupList(LayoutMultiColumnSet&); | 163 MultiColumnFragmentainerGroupList(LayoutMultiColumnSet&); |
161 ~MultiColumnFragmentainerGroupList(); | 164 ~MultiColumnFragmentainerGroupList(); |
162 | 165 |
163 // Add an additional fragmentainer group to the end of the list, and return
it. | 166 // Add an additional fragmentainer group to the end of the list, and return
it. |
164 MultiColumnFragmentainerGroup& addExtraGroup(); | 167 MultiColumnFragmentainerGroup& addExtraGroup(); |
165 | 168 |
166 // Remove all fragmentainer groups but the first one. | 169 // Remove all fragmentainer groups but the first one. |
167 void deleteExtraGroups(); | 170 void deleteExtraGroups(); |
168 | 171 |
(...skipping 19 matching lines...) Expand all Loading... |
188 | 191 |
189 private: | 192 private: |
190 LayoutMultiColumnSet& m_columnSet; | 193 LayoutMultiColumnSet& m_columnSet; |
191 | 194 |
192 Vector<MultiColumnFragmentainerGroup, 1> m_groups; | 195 Vector<MultiColumnFragmentainerGroup, 1> m_groups; |
193 }; | 196 }; |
194 | 197 |
195 } // namespace blink | 198 } // namespace blink |
196 | 199 |
197 #endif // MultiColumnFragmentainerGroup_h | 200 #endif // MultiColumnFragmentainerGroup_h |
OLD | NEW |