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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 virtual const char* name() const override { return "LayoutMultiColumnFlowThr
ead"; } | 181 virtual const char* name() const override { return "LayoutMultiColumnFlowThr
ead"; } |
182 | 182 |
183 protected: | 183 protected: |
184 LayoutMultiColumnFlowThread(); | 184 LayoutMultiColumnFlowThread(); |
185 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } | 185 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
186 | 186 |
187 virtual void layout() override; | 187 virtual void layout() override; |
188 | 188 |
189 private: | 189 private: |
190 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 190 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
191 void createAndInsertMultiColumnSet(LayoutBox* insertBefore = 0); | 191 void createAndInsertMultiColumnSet(LayoutBox* insertBefore = nullptr); |
192 void createAndInsertSpannerPlaceholder(LayoutBox* spanner, LayoutBox* insert
Before = 0); | 192 void createAndInsertSpannerPlaceholder(LayoutBox* spanner, LayoutBox* insert
Before = nullptr); |
193 virtual bool descendantIsValidColumnSpanner(LayoutObject* descendant) const; | 193 virtual bool descendantIsValidColumnSpanner(LayoutObject* descendant) const; |
194 | 194 |
195 virtual void addColumnSetToThread(LayoutMultiColumnSet*) override; | 195 virtual void addColumnSetToThread(LayoutMultiColumnSet*) override; |
196 virtual void willBeRemovedFromTree() override; | 196 virtual void willBeRemovedFromTree() override; |
197 virtual LayoutUnit skipColumnSpanner(LayoutBox*, LayoutUnit logicalTopInFlow
Thread) override; | 197 virtual LayoutUnit skipColumnSpanner(LayoutBox*, LayoutUnit logicalTopInFlow
Thread) override; |
198 virtual void flowThreadDescendantWasInserted(LayoutObject*) override; | 198 virtual void flowThreadDescendantWasInserted(LayoutObject*) override; |
199 virtual void flowThreadDescendantWillBeRemoved(LayoutObject*) override; | 199 virtual void flowThreadDescendantWillBeRemoved(LayoutObject*) override; |
200 virtual void flowThreadDescendantStyleWillChange(LayoutObject*, StyleDiffere
nce, const ComputedStyle& newStyle) override; | 200 virtual void flowThreadDescendantStyleWillChange(LayoutObject*, StyleDiffere
nce, const ComputedStyle& newStyle) override; |
201 virtual void flowThreadDescendantStyleDidChange(LayoutObject*, StyleDifferen
ce, const ComputedStyle& oldStyle) override; | 201 virtual void flowThreadDescendantStyleDidChange(LayoutObject*, StyleDifferen
ce, const ComputedStyle& oldStyle) override; |
202 virtual void computePreferredLogicalWidths() override; | 202 virtual void computePreferredLogicalWidths() override; |
203 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 203 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
204 virtual void updateLogicalWidth() override; | 204 virtual void updateLogicalWidth() override; |
205 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; | 205 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; |
206 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; | 206 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; |
207 virtual bool addForcedColumnBreak(LayoutUnit, LayoutObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; | 207 virtual bool addForcedColumnBreak(LayoutUnit, LayoutObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = nullptr) override; |
208 virtual bool isPageLogicalHeightKnown() const override; | 208 virtual bool isPageLogicalHeightKnown() const override; |
209 | 209 |
210 // The last set we worked on. It's not to be used as the "current set". The
concept of a | 210 // The last set we worked on. It's not to be used as the "current set". The
concept of a |
211 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong | 211 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong |
212 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. | 212 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. |
213 LayoutMultiColumnSet* m_lastSetWorkedOn; | 213 LayoutMultiColumnSet* m_lastSetWorkedOn; |
214 | 214 |
215 unsigned m_columnCount; // The used value of column-count | 215 unsigned m_columnCount; // The used value of column-count |
216 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 216 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
217 bool m_inBalancingPass; // Set when relayouting for column balancing. | 217 bool m_inBalancingPass; // Set when relayouting for column balancing. |
218 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 218 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
219 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. | 219 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
220 bool m_isBeingEvacuated; | 220 bool m_isBeingEvacuated; |
221 }; | 221 }; |
222 | 222 |
223 } // namespace blink | 223 } // namespace blink |
224 | 224 |
225 #endif // LayoutMultiColumnFlowThread_h | 225 #endif // LayoutMultiColumnFlowThread_h |
OLD | NEW |