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