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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // Populate the flow thread with what's currently its siblings. Called when
a regular block | 102 // Populate the flow thread with what's currently its siblings. Called when
a regular block |
103 // becomes a multicol container. | 103 // becomes a multicol container. |
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 columnWidth() const { return m_columnWidth; } | |
113 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } | 112 LayoutUnit columnHeightAvailable() const { return m_columnHeightAvailable; } |
114 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } | 113 void setColumnHeightAvailable(LayoutUnit available) { m_columnHeightAvailabl
e = available; } |
115 bool requiresBalancing() const { return !columnHeightAvailable() || multiCol
umnBlockFlow()->style()->columnFill() == ColumnFillBalance; } | 114 bool requiresBalancing() const { return !columnHeightAvailable() || multiCol
umnBlockFlow()->style()->columnFill() == ColumnFillBalance; } |
116 | 115 |
117 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE FINAL; | 116 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE FINAL; |
118 | 117 |
| 118 // Do we need to set a new width and lay out? |
| 119 bool needsNewWidth() const; |
| 120 |
119 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); | 121 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); |
120 bool computeColumnCountAndWidth(); | 122 |
121 bool recalculateColumnHeights(); | 123 bool recalculateColumnHeights(); |
122 | 124 |
123 private: | 125 private: |
124 RenderMultiColumnFlowThread(); | 126 RenderMultiColumnFlowThread(); |
125 | 127 |
| 128 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
| 129 |
126 virtual const char* renderName() const OVERRIDE; | 130 virtual const char* renderName() const OVERRIDE; |
127 virtual void addRegionToThread(RenderRegion*) OVERRIDE; | 131 virtual void addRegionToThread(RenderRegion*) OVERRIDE; |
128 virtual void willBeRemovedFromTree() OVERRIDE; | 132 virtual void willBeRemovedFromTree() OVERRIDE; |
129 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 133 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
130 virtual void updateLogicalWidth() OVERRIDE FINAL; | 134 virtual void updateLogicalWidth() OVERRIDE FINAL; |
131 virtual void layout() OVERRIDE FINAL; | 135 virtual void layout() OVERRIDE FINAL; |
132 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; | 136 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; |
133 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; | 137 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; |
134 virtual RenderRegion* regionAtBlockOffset(LayoutUnit) const OVERRIDE; | 138 virtual RenderRegion* regionAtBlockOffset(LayoutUnit) const OVERRIDE; |
135 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; | 139 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) OVERRIDE; |
136 virtual bool isPageLogicalHeightKnown() const OVERRIDE; | 140 virtual bool isPageLogicalHeightKnown() const OVERRIDE; |
137 | 141 |
138 unsigned m_columnCount; // The used value of column-count | 142 unsigned m_columnCount; // The used value of column-count |
139 LayoutUnit m_columnWidth; // The used value of column-width | |
140 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 143 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
141 bool m_inBalancingPass; // Set when relayouting for column balancing. | 144 bool m_inBalancingPass; // Set when relayouting for column balancing. |
142 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 145 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
143 }; | 146 }; |
144 | 147 |
145 } // namespace WebCore | 148 } // namespace WebCore |
146 | 149 |
147 #endif // RenderMultiColumnFlowThread_h | 150 #endif // RenderMultiColumnFlowThread_h |
148 | 151 |
OLD | NEW |