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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 void populate(); | 104 void populate(); |
105 | 105 |
106 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific | 106 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific |
107 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular | 107 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular |
108 // block. | 108 // block. |
109 void evacuateAndDestroy(); | 109 void evacuateAndDestroy(); |
110 | 110 |
111 unsigned columnCount() const { return m_columnCount; } | 111 unsigned columnCount() const { return m_columnCount; } |
112 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } | 112 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } |
113 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } | 113 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } |
114 bool requiresBalancing() const { return !columnHeightAvailable() || multiCol
umnBlockFlow()->style()->columnFill() == ColumnFillBalance; } | 114 virtual bool heightIsAuto() const { return !columnHeightAvailable() || multi
ColumnBlockFlow()->style()->columnFill() == ColumnFillBalance; } |
| 115 bool progressionIsInline() const { return m_progressionIsInline; } |
115 | 116 |
116 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE FINAL; | 117 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE FINAL; |
117 | 118 |
118 // Do we need to set a new width and lay out? | 119 // Do we need to set a new width and lay out? |
119 bool needsNewWidth() const; | 120 virtual bool needsNewWidth() const; |
120 | 121 |
121 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); | 122 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); |
122 | 123 |
123 bool recalculateColumnHeights(); | 124 bool recalculateColumnHeights(); |
124 | 125 |
| 126 protected: |
| 127 RenderMultiColumnFlowThread(); |
| 128 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
| 129 |
| 130 virtual void layout() OVERRIDE; |
| 131 |
125 private: | 132 private: |
126 RenderMultiColumnFlowThread(); | |
127 | |
128 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 133 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
129 | 134 |
130 virtual const char* renderName() const OVERRIDE; | 135 virtual const char* renderName() const OVERRIDE; |
131 virtual void addRegionToThread(RenderRegion*) OVERRIDE; | 136 virtual void addRegionToThread(RenderRegion*) OVERRIDE; |
132 virtual void willBeRemovedFromTree() OVERRIDE; | 137 virtual void willBeRemovedFromTree() OVERRIDE; |
133 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 138 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
134 virtual void updateLogicalWidth() OVERRIDE FINAL; | 139 virtual void updateLogicalWidth() OVERRIDE FINAL; |
135 virtual void layout() OVERRIDE FINAL; | |
136 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; | 140 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; |
137 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; | 141 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; |
138 virtual RenderRegion* regionAtBlockOffset(LayoutUnit) const OVERRIDE; | 142 virtual RenderRegion* regionAtBlockOffset(LayoutUnit) const OVERRIDE; |
139 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; | 143 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; |
140 virtual bool isPageLogicalHeightKnown() const OVERRIDE; | 144 virtual bool isPageLogicalHeightKnown() const OVERRIDE; |
141 | 145 |
142 unsigned m_columnCount; // The used value of column-count | 146 unsigned m_columnCount; // The used value of column-count |
143 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 147 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
144 bool m_inBalancingPass; // Set when relayouting for column balancing. | 148 bool m_inBalancingPass; // Set when relayouting for column balancing. |
145 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 149 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
| 150 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
146 }; | 151 }; |
147 | 152 |
148 } // namespace WebCore | 153 } // namespace WebCore |
149 | 154 |
150 #endif // RenderMultiColumnFlowThread_h | 155 #endif // RenderMultiColumnFlowThread_h |
151 | 156 |
OLD | NEW |