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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // For each layout iteration done for column balancing, the flow thread will nee
d a deep layout if | 83 // For each layout iteration done for column balancing, the flow thread will nee
d a deep layout if |
84 // column heights changed in the previous pass, since column height changes may
affect break points | 84 // column heights changed in the previous pass, since column height changes may
affect break points |
85 // and pagination struts anywhere in the tree, and currently no way exists to do
this in a more | 85 // and pagination struts anywhere in the tree, and currently no way exists to do
this in a more |
86 // optimized manner. | 86 // optimized manner. |
87 class RenderMultiColumnFlowThread : public RenderFlowThread { | 87 class RenderMultiColumnFlowThread : public RenderFlowThread { |
88 public: | 88 public: |
89 virtual ~RenderMultiColumnFlowThread(); | 89 virtual ~RenderMultiColumnFlowThread(); |
90 | 90 |
91 static RenderMultiColumnFlowThread* createAnonymous(Document&, RenderStyle*
parentStyle); | 91 static RenderMultiColumnFlowThread* createAnonymous(Document&, RenderStyle*
parentStyle); |
92 | 92 |
93 virtual bool isRenderMultiColumnFlowThread() const OVERRIDE FINAL { return t
rue; } | 93 virtual bool isRenderMultiColumnFlowThread() const override final { return t
rue; } |
94 | 94 |
95 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par
ent()); } | 95 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par
ent()); } |
96 | 96 |
97 RenderMultiColumnSet* firstMultiColumnSet() const; | 97 RenderMultiColumnSet* firstMultiColumnSet() const; |
98 RenderMultiColumnSet* lastMultiColumnSet() const; | 98 RenderMultiColumnSet* lastMultiColumnSet() const; |
99 | 99 |
100 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
OVERRIDE; | 100 virtual void addChild(RenderObject* newChild, RenderObject* beforeChild = 0)
override; |
101 | 101 |
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 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 virtual bool heightIsAuto() const { return !columnHeightAvailable() || multi
ColumnBlockFlow()->style()->columnFill() == ColumnFillBalance; } | 114 virtual bool heightIsAuto() const { return !columnHeightAvailable() || multi
ColumnBlockFlow()->style()->columnFill() == ColumnFillBalance; } |
115 bool progressionIsInline() const { return m_progressionIsInline; } | 115 bool progressionIsInline() const { return m_progressionIsInline; } |
116 | 116 |
117 virtual LayoutSize columnOffset(const LayoutPoint&) const OVERRIDE FINAL; | 117 virtual LayoutSize columnOffset(const LayoutPoint&) const override final; |
118 | 118 |
119 // Do we need to set a new width and lay out? | 119 // Do we need to set a new width and lay out? |
120 virtual bool needsNewWidth() const; | 120 virtual bool needsNewWidth() const; |
121 | 121 |
122 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); | 122 void layoutColumns(bool relayoutChildren, SubtreeLayoutScope&); |
123 | 123 |
124 bool recalculateColumnHeights(); | 124 bool recalculateColumnHeights(); |
125 | 125 |
126 protected: | 126 protected: |
127 RenderMultiColumnFlowThread(); | 127 RenderMultiColumnFlowThread(); |
128 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } | 128 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
129 | 129 |
130 virtual void layout() OVERRIDE; | 130 virtual void layout() override; |
131 | 131 |
132 private: | 132 private: |
133 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 133 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
134 | 134 |
135 virtual const char* renderName() const OVERRIDE; | 135 virtual const char* renderName() const override; |
136 virtual void addRegionToThread(RenderMultiColumnSet*) OVERRIDE; | 136 virtual void addRegionToThread(RenderMultiColumnSet*) override; |
137 virtual void willBeRemovedFromTree() OVERRIDE; | 137 virtual void willBeRemovedFromTree() override; |
138 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 138 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
139 virtual void updateLogicalWidth() OVERRIDE; | 139 virtual void updateLogicalWidth() override; |
140 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) OVERR
IDE; | 140 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; |
141 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) OVERRIDE; | 141 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; |
142 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const OVERR
IDE; | 142 virtual RenderMultiColumnSet* columnSetAtBlockOffset(LayoutUnit) const overr
ide; |
143 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; |
144 virtual bool isPageLogicalHeightKnown() const OVERRIDE; | 144 virtual bool isPageLogicalHeightKnown() const override; |
145 | 145 |
146 unsigned m_columnCount; // The used value of column-count | 146 unsigned m_columnCount; // The used value of column-count |
147 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. |
148 bool m_inBalancingPass; // Set when relayouting for column balancing. | 148 bool m_inBalancingPass; // Set when relayouting for column balancing. |
149 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. | 150 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
151 }; | 151 }; |
152 | 152 |
153 } // namespace blink | 153 } // namespace blink |
154 | 154 |
155 #endif // RenderMultiColumnFlowThread_h | 155 #endif // RenderMultiColumnFlowThread_h |
156 | 156 |
OLD | NEW |