OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
176 | 176 |
177 LayoutMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const final; | 177 LayoutMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const final; |
178 | 178 |
179 void layoutColumns(SubtreeLayoutScope&); | 179 void layoutColumns(SubtreeLayoutScope&); |
180 | 180 |
181 // Skip past a column spanner during flow thread layout. Spanners are not la
id out inside the | 181 // Skip past a column spanner during flow thread layout. Spanners are not la
id out inside the |
182 // flow thread, since the flow thread is not in a spanner's containing block
chain (since the | 182 // flow thread, since the flow thread is not in a spanner's containing block
chain (since the |
183 // containing block is the multicol container). | 183 // containing block is the multicol container). |
184 void skipColumnSpanner(LayoutBox*, LayoutUnit logicalTopInFlowThread); | 184 void skipColumnSpanner(LayoutBox*, LayoutUnit logicalTopInFlowThread); |
185 | 185 |
186 bool recalculateColumnHeights(); | 186 // Returns true if at least one column got a new height after flow thread la
yout (during column |
| 187 // set layout), in which case we need another layout pass. Column heights ma
y change after flow |
| 188 // thread layout because of balancing. We may have to do multiple layout pas
ses, depending on |
| 189 // how the contents is fitted to the changed column heights. In most cases,
laying out again |
| 190 // twice or even just once will suffice. Sometimes we need more passes than
that, though, but |
| 191 // the number of retries should not exceed the number of columns, unless we
have a bug. |
| 192 bool columnHeightsChanged() const { return m_columnHeightsChanged; } |
| 193 void setColumnHeightsChanged() { m_columnHeightsChanged = true; } |
187 | 194 |
188 void columnRuleStyleDidChange(); | 195 void columnRuleStyleDidChange(); |
189 | 196 |
190 // Remove the spanner placeholder and return true if the specified object is
no longer a valid spanner. | 197 // Remove the spanner placeholder and return true if the specified object is
no longer a valid spanner. |
191 bool removeSpannerPlaceholderIfNoLongerValid(LayoutBox* spannerObjectInFlowT
hread); | 198 bool removeSpannerPlaceholderIfNoLongerValid(LayoutBox* spannerObjectInFlowT
hread); |
192 | 199 |
193 LayoutMultiColumnFlowThread* enclosingFlowThread() const; | 200 LayoutMultiColumnFlowThread* enclosingFlowThread() const; |
194 FragmentationContext* enclosingFragmentationContext() const; | 201 FragmentationContext* enclosingFragmentationContext() const; |
195 LayoutUnit blockOffsetInEnclosingFragmentationContext() const { ASSERT(enclo
singFragmentationContext()); return m_blockOffsetInEnclosingFragmentationContext
; } | 202 LayoutUnit blockOffsetInEnclosingFragmentationContext() const { ASSERT(enclo
singFragmentationContext()); return m_blockOffsetInEnclosingFragmentationContext
; } |
196 | 203 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. | 243 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. |
237 LayoutMultiColumnSet* m_lastSetWorkedOn; | 244 LayoutMultiColumnSet* m_lastSetWorkedOn; |
238 | 245 |
239 unsigned m_columnCount; // The used value of column-count | 246 unsigned m_columnCount; // The used value of column-count |
240 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 247 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
241 | 248 |
242 // Cached block offset from this flow thread to the enclosing fragmentation
context, if any. In | 249 // Cached block offset from this flow thread to the enclosing fragmentation
context, if any. In |
243 // the coordinate space of the enclosing fragmentation context. | 250 // the coordinate space of the enclosing fragmentation context. |
244 LayoutUnit m_blockOffsetInEnclosingFragmentationContext; | 251 LayoutUnit m_blockOffsetInEnclosingFragmentationContext; |
245 | 252 |
246 bool m_inBalancingPass; // Set when relayouting for column balancing. | 253 bool m_columnHeightsChanged; // Set when column heights are out of sync with
actual layout. |
247 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | |
248 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. | 254 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
249 bool m_isBeingEvacuated; | 255 bool m_isBeingEvacuated; |
250 }; | 256 }; |
251 | 257 |
252 // Cannot use DEFINE_LAYOUT_OBJECT_TYPE_CASTS here, because isMultiColumnFlowThr
ead() is defined in | 258 // Cannot use DEFINE_LAYOUT_OBJECT_TYPE_CASTS here, because isMultiColumnFlowThr
ead() is defined in |
253 // LayoutFlowThread, not in LayoutObject. | 259 // LayoutFlowThread, not in LayoutObject. |
254 DEFINE_TYPE_CASTS(LayoutMultiColumnFlowThread, LayoutFlowThread, object, object-
>isLayoutMultiColumnFlowThread(), object.isLayoutMultiColumnFlowThread()); | 260 DEFINE_TYPE_CASTS(LayoutMultiColumnFlowThread, LayoutFlowThread, object, object-
>isLayoutMultiColumnFlowThread(), object.isLayoutMultiColumnFlowThread()); |
255 | 261 |
256 } // namespace blink | 262 } // namespace blink |
257 | 263 |
258 #endif // LayoutMultiColumnFlowThread_h | 264 #endif // LayoutMultiColumnFlowThread_h |
OLD | NEW |