| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 // Return the last column set or spanner placeholder. | 133 // Return the last column set or spanner placeholder. |
| 134 RenderBox* lastMultiColumnBox() const | 134 RenderBox* lastMultiColumnBox() const |
| 135 { | 135 { |
| 136 RenderBox* lastSiblingBox = multiColumnBlockFlow()->lastChildBox(); | 136 RenderBox* lastSiblingBox = multiColumnBlockFlow()->lastChildBox(); |
| 137 // The flow thread is the first child of the multicol container. If the
flow thread is also | 137 // The flow thread is the first child of the multicol container. If the
flow thread is also |
| 138 // the last child, it means that there are no siblings; i.e. we have no
column boxes. | 138 // the last child, it means that there are no siblings; i.e. we have no
column boxes. |
| 139 return lastSiblingBox != this ? lastSiblingBox : 0; | 139 return lastSiblingBox != this ? lastSiblingBox : 0; |
| 140 } | 140 } |
| 141 | 141 |
| 142 // Find the first set inside which the specified renderer would be rendered. | 142 // Find the first set inside which the specified renderer would be rendered. |
| 143 RenderMultiColumnSet* findSetRendering(RenderObject*) const; | 143 RenderMultiColumnSet* findSetRendering(LayoutObject*) const; |
| 144 | 144 |
| 145 // Return the spanner placeholder that belongs to the spanner in the contain
ing block chain, if | 145 // Return the spanner placeholder that belongs to the spanner in the contain
ing block chain, if |
| 146 // any. This includes the renderer for the element that actually establishes
the spanner too. | 146 // any. This includes the renderer for the element that actually establishes
the spanner too. |
| 147 RenderMultiColumnSpannerPlaceholder* containingColumnSpannerPlaceholder(cons
t RenderObject* descendant) const; | 147 RenderMultiColumnSpannerPlaceholder* containingColumnSpannerPlaceholder(cons
t LayoutObject* descendant) const; |
| 148 | 148 |
| 149 // Populate the flow thread with what's currently its siblings. Called when
a regular block | 149 // Populate the flow thread with what's currently its siblings. Called when
a regular block |
| 150 // becomes a multicol container. | 150 // becomes a multicol container. |
| 151 void populate(); | 151 void populate(); |
| 152 | 152 |
| 153 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific | 153 // Empty the flow thread by moving everything to the parent. Remove all mult
icol specific |
| 154 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular | 154 // renderers. Then destroy the flow thread. Called when a multicol container
becomes a regular |
| 155 // block. | 155 // block. |
| 156 void evacuateAndDestroy(); | 156 void evacuateAndDestroy(); |
| 157 | 157 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 176 protected: | 176 protected: |
| 177 RenderMultiColumnFlowThread(); | 177 RenderMultiColumnFlowThread(); |
| 178 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } | 178 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
| 179 | 179 |
| 180 virtual void layout() override; | 180 virtual void layout() override; |
| 181 | 181 |
| 182 private: | 182 private: |
| 183 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 183 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
| 184 void createAndInsertMultiColumnSet(RenderBox* insertBefore = 0); | 184 void createAndInsertMultiColumnSet(RenderBox* insertBefore = 0); |
| 185 void createAndInsertSpannerPlaceholder(RenderBox* spanner, RenderBox* insert
Before = 0); | 185 void createAndInsertSpannerPlaceholder(RenderBox* spanner, RenderBox* insert
Before = 0); |
| 186 virtual bool descendantIsValidColumnSpanner(RenderObject* descendant) const; | 186 virtual bool descendantIsValidColumnSpanner(LayoutObject* descendant) const; |
| 187 | 187 |
| 188 virtual const char* renderName() const override; | 188 virtual const char* renderName() const override; |
| 189 virtual void addRegionToThread(RenderMultiColumnSet*) override; | 189 virtual void addRegionToThread(RenderMultiColumnSet*) override; |
| 190 virtual void willBeRemovedFromTree() override; | 190 virtual void willBeRemovedFromTree() override; |
| 191 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow
Thread) override; | 191 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow
Thread) override; |
| 192 virtual void flowThreadDescendantWasInserted(RenderObject*) override; | 192 virtual void flowThreadDescendantWasInserted(LayoutObject*) override; |
| 193 virtual void flowThreadDescendantWillBeRemoved(RenderObject*) override; | 193 virtual void flowThreadDescendantWillBeRemoved(LayoutObject*) override; |
| 194 virtual void computePreferredLogicalWidths() override; | 194 virtual void computePreferredLogicalWidths() override; |
| 195 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 195 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
| 196 virtual void updateLogicalWidth() override; | 196 virtual void updateLogicalWidth() override; |
| 197 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; | 197 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; |
| 198 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; | 198 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; |
| 199 virtual bool addForcedRegionBreak(LayoutUnit, RenderObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; | 199 virtual bool addForcedRegionBreak(LayoutUnit, LayoutObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; |
| 200 virtual bool isPageLogicalHeightKnown() const override; | 200 virtual bool isPageLogicalHeightKnown() const override; |
| 201 | 201 |
| 202 // The last set we worked on. It's not to be used as the "current set". The
concept of a | 202 // The last set we worked on. It's not to be used as the "current set". The
concept of a |
| 203 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong | 203 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong |
| 204 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. | 204 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. |
| 205 RenderMultiColumnSet* m_lastSetWorkedOn; | 205 RenderMultiColumnSet* m_lastSetWorkedOn; |
| 206 | 206 |
| 207 unsigned m_columnCount; // The used value of column-count | 207 unsigned m_columnCount; // The used value of column-count |
| 208 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 208 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
| 209 bool m_inBalancingPass; // Set when relayouting for column balancing. | 209 bool m_inBalancingPass; // Set when relayouting for column balancing. |
| 210 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 210 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
| 211 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. | 211 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
| 212 bool m_isBeingEvacuated; | 212 bool m_isBeingEvacuated; |
| 213 }; | 213 }; |
| 214 | 214 |
| 215 } // namespace blink | 215 } // namespace blink |
| 216 | 216 |
| 217 #endif // RenderMultiColumnFlowThread_h | 217 #endif // RenderMultiColumnFlowThread_h |
| OLD | NEW |