| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 void populate(); | 130 void populate(); |
| 131 | 131 |
| 132 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific | 132 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific |
| 133 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular | 133 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular |
| 134 // block. | 134 // block. |
| 135 void evacuateAndDestroy(); | 135 void evacuateAndDestroy(); |
| 136 | 136 |
| 137 unsigned columnCount() const { return m_columnCount; } | 137 unsigned columnCount() const { return m_columnCount; } |
| 138 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } | 138 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } |
| 139 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } | 139 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } |
| 140 virtual bool heightIsAuto() const { return !columnHeightAvailable() || multi
ColumnBlockFlow()->style()->columnFill() == ColumnFillBalance; } | |
| 141 bool progressionIsInline() const { return m_progressionIsInline; } | 140 bool progressionIsInline() const { return m_progressionIsInline; } |
| 142 | 141 |
| 143 virtual LayoutSize columnOffset(const LayoutPoint&) const override final; | 142 virtual LayoutSize columnOffset(const LayoutPoint&) const override final; |
| 144 | 143 |
| 145 // Do we need to set a new width and lay out? | 144 // Do we need to set a new width and lay out? |
| 146 virtual bool needsNewWidth() const; | 145 virtual bool needsNewWidth() const; |
| 147 | 146 |
| 147 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const overr
ide final; |
| 148 |
| 148 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); | 149 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); |
| 149 | 150 |
| 150 bool recalculateColumnHeights(); | 151 bool recalculateColumnHeights(); |
| 151 | 152 |
| 152 protected: | 153 protected: |
| 153 RenderMultiColumnFlowThread(); | 154 RenderMultiColumnFlowThread(); |
| 154 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } | 155 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
| 155 | 156 |
| 156 virtual void layout() override; | 157 virtual void layout() override; |
| 157 | 158 |
| 158 private: | 159 private: |
| 159 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 160 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
| 160 void createAndInsertMultiColumnSet(); | 161 void createAndInsertMultiColumnSet(); |
| 161 void createAndInsertSpannerPlaceholder(RenderBox* spanner); | 162 void createAndInsertSpannerPlaceholder(RenderBox* spanner); |
| 162 virtual bool descendantIsValidColumnSpanner(RenderObject* descendant) const; | 163 virtual bool descendantIsValidColumnSpanner(RenderObject* descendant) const; |
| 163 | 164 |
| 164 virtual const char* renderName() const override; | 165 virtual const char* renderName() const override; |
| 165 virtual void addRegionToThread(RenderMultiColumnSet*) override; | 166 virtual void addRegionToThread(RenderMultiColumnSet*) override; |
| 166 virtual void willBeRemovedFromTree() override; | 167 virtual void willBeRemovedFromTree() override; |
| 168 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow
Thread) override; |
| 167 virtual void flowThreadDescendantWasInserted(RenderObject*) override; | 169 virtual void flowThreadDescendantWasInserted(RenderObject*) override; |
| 168 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) override; | 170 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) override; |
| 169 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 171 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
| 170 virtual void updateLogicalWidth() override; | 172 virtual void updateLogicalWidth() override; |
| 171 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; | 173 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; |
| 172 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; | 174 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; |
| 173 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const overr
ide; | |
| 174 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; | 175 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; |
| 175 virtual bool isPageLogicalHeightKnown() const override; | 176 virtual bool isPageLogicalHeightKnown() const override; |
| 176 | 177 |
| 178 // The last set we worked on. It's not to be used as the "current set". The
concept of a |
| 179 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong |
| 180 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. |
| 181 RenderMultiColumnSet* m_lastSetWorkedOn; |
| 182 |
| 177 unsigned m_columnCount; // The used value of column-count | 183 unsigned m_columnCount; // The used value of column-count |
| 178 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 184 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
| 179 bool m_inBalancingPass; // Set when relayouting for column balancing. | 185 bool m_inBalancingPass; // Set when relayouting for column balancing. |
| 180 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 186 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
| 181 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. | 187 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
| 182 bool m_isBeingEvacuated; | 188 bool m_isBeingEvacuated; |
| 183 }; | 189 }; |
| 184 | 190 |
| 185 } // namespace blink | 191 } // namespace blink |
| 186 | 192 |
| 187 #endif // RenderMultiColumnFlowThread_h | 193 #endif // RenderMultiColumnFlowThread_h |
| OLD | NEW |