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