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