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 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 // 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 |
14 // column height. | 14 // column height. |
15 // | 15 // |
16 // 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 |
17 // 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 |
18 // 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 |
19 // comprises a "row of column boxes" in spec lingo. | 19 // comprises a "row of column boxes" in spec lingo. |
20 // | 20 // |
21 // 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. |
22 // | 22 // |
23 // 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 |
24 // 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 |
25 // 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 |
26 // 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 |
27 // 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 |
28 // (and make them appear in the next outer fragmentainer). | 28 // (and make them appear in the next outer fragmentainer). |
29 class MultiColumnFragmentainerGroup { | 29 class MultiColumnFragmentainerGroup { |
30 ALLOW_ONLY_INLINE_ALLOCATION(); | 30 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
31 public: | 31 public: |
32 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); | 32 MultiColumnFragmentainerGroup(LayoutMultiColumnSet&); |
33 | 33 |
34 const LayoutMultiColumnSet& columnSet() const { return m_columnSet; } | 34 const LayoutMultiColumnSet& columnSet() const { return m_columnSet; } |
35 | 35 |
36 bool isFirstGroup() const; | 36 bool isFirstGroup() const; |
37 bool isLastGroup() const; | 37 bool isLastGroup() const; |
38 | 38 |
39 // Position within the LayoutMultiColumnSet. | 39 // Position within the LayoutMultiColumnSet. |
40 LayoutUnit logicalTop() const { return m_logicalTop; } | 40 LayoutUnit logicalTop() const { return m_logicalTop; } |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 115 |
116 // The following variables are used when balancing the column set. | 116 // The following variables are used when balancing the column set. |
117 LayoutUnit m_maxColumnHeight; // Maximum column height allowed. | 117 LayoutUnit m_maxColumnHeight; // Maximum column height allowed. |
118 LayoutUnit m_minimumColumnHeight; | 118 LayoutUnit m_minimumColumnHeight; |
119 }; | 119 }; |
120 | 120 |
121 // List of all fragmentainer groups within a column set. There will always be at
least one | 121 // List of all fragmentainer groups within a column set. There will always be at
least one |
122 // group. Deleting the one group is not allowed (or possible). There will be mor
e than one group if | 122 // group. Deleting the one group is not allowed (or possible). There will be mor
e than one group if |
123 // the owning column set lives in multiple outer fragmentainers (e.g. multicol i
nside paged media). | 123 // the owning column set lives in multiple outer fragmentainers (e.g. multicol i
nside paged media). |
124 class CORE_EXPORT MultiColumnFragmentainerGroupList { | 124 class CORE_EXPORT MultiColumnFragmentainerGroupList { |
125 DISALLOW_ALLOCATION(); | 125 DISALLOW_NEW(); |
126 public: | 126 public: |
127 MultiColumnFragmentainerGroupList(LayoutMultiColumnSet&); | 127 MultiColumnFragmentainerGroupList(LayoutMultiColumnSet&); |
128 ~MultiColumnFragmentainerGroupList(); | 128 ~MultiColumnFragmentainerGroupList(); |
129 | 129 |
130 // Add an additional fragmentainer group to the end of the list, and return
it. | 130 // Add an additional fragmentainer group to the end of the list, and return
it. |
131 MultiColumnFragmentainerGroup& addExtraGroup(); | 131 MultiColumnFragmentainerGroup& addExtraGroup(); |
132 | 132 |
133 // Remove all fragmentainer groups but the first one. | 133 // Remove all fragmentainer groups but the first one. |
134 void deleteExtraGroups(); | 134 void deleteExtraGroups(); |
135 | 135 |
(...skipping 19 matching lines...) Expand all Loading... |
155 | 155 |
156 private: | 156 private: |
157 LayoutMultiColumnSet& m_columnSet; | 157 LayoutMultiColumnSet& m_columnSet; |
158 | 158 |
159 Vector<MultiColumnFragmentainerGroup, 1> m_groups; | 159 Vector<MultiColumnFragmentainerGroup, 1> m_groups; |
160 }; | 160 }; |
161 | 161 |
162 } // namespace blink | 162 } // namespace blink |
163 | 163 |
164 #endif // MultiColumnFragmentainerGroup_h | 164 #endif // MultiColumnFragmentainerGroup_h |
OLD | NEW |