| 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 static LayoutMultiColumnFlowThread* createAnonymous(Document&, const LayoutS
tyle& parentStyle); | 121 static LayoutMultiColumnFlowThread* createAnonymous(Document&, const LayoutS
tyle& parentStyle); |
| 122 | 122 |
| 123 virtual bool isLayoutMultiColumnFlowThread() const override final { return t
rue; } | 123 virtual bool isLayoutMultiColumnFlowThread() const override final { return t
rue; } |
| 124 | 124 |
| 125 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par
ent()); } | 125 RenderBlockFlow* multiColumnBlockFlow() const { return toRenderBlockFlow(par
ent()); } |
| 126 | 126 |
| 127 LayoutMultiColumnSet* firstMultiColumnSet() const; | 127 LayoutMultiColumnSet* firstMultiColumnSet() const; |
| 128 LayoutMultiColumnSet* lastMultiColumnSet() const; | 128 LayoutMultiColumnSet* lastMultiColumnSet() const; |
| 129 | 129 |
| 130 // Return the first column set or spanner placeholder. | 130 // Return the first column set or spanner placeholder. |
| 131 RenderBox* firstMultiColumnBox() const | 131 LayoutBox* firstMultiColumnBox() const |
| 132 { | 132 { |
| 133 return nextSiblingBox(); | 133 return nextSiblingBox(); |
| 134 } | 134 } |
| 135 // Return the last column set or spanner placeholder. | 135 // Return the last column set or spanner placeholder. |
| 136 RenderBox* lastMultiColumnBox() const | 136 LayoutBox* lastMultiColumnBox() const |
| 137 { | 137 { |
| 138 RenderBox* lastSiblingBox = multiColumnBlockFlow()->lastChildBox(); | 138 LayoutBox* lastSiblingBox = multiColumnBlockFlow()->lastChildBox(); |
| 139 // The flow thread is the first child of the multicol container. If the
flow thread is also | 139 // The flow thread is the first child of the multicol container. If the
flow thread is also |
| 140 // the last child, it means that there are no siblings; i.e. we have no
column boxes. | 140 // the last child, it means that there are no siblings; i.e. we have no
column boxes. |
| 141 return lastSiblingBox != this ? lastSiblingBox : 0; | 141 return lastSiblingBox != this ? lastSiblingBox : 0; |
| 142 } | 142 } |
| 143 | 143 |
| 144 // Find the first set inside which the specified renderer would be rendered. | 144 // Find the first set inside which the specified renderer would be rendered. |
| 145 LayoutMultiColumnSet* findSetRendering(LayoutObject*) const; | 145 LayoutMultiColumnSet* findSetRendering(LayoutObject*) const; |
| 146 | 146 |
| 147 // Return the spanner placeholder that belongs to the spanner in the contain
ing block chain, if | 147 // Return the spanner placeholder that belongs to the spanner in the contain
ing block chain, if |
| 148 // any. This includes the renderer for the element that actually establishes
the spanner too. | 148 // any. This includes the renderer for the element that actually establishes
the spanner too. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 176 void columnRuleStyleDidChange(); | 176 void columnRuleStyleDidChange(); |
| 177 | 177 |
| 178 protected: | 178 protected: |
| 179 LayoutMultiColumnFlowThread(); | 179 LayoutMultiColumnFlowThread(); |
| 180 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } | 180 void setProgressionIsInline(bool isInline) { m_progressionIsInline = isInlin
e; } |
| 181 | 181 |
| 182 virtual void layout() override; | 182 virtual void layout() override; |
| 183 | 183 |
| 184 private: | 184 private: |
| 185 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; | 185 void calculateColumnCountAndWidth(LayoutUnit& width, unsigned& count) const; |
| 186 void createAndInsertMultiColumnSet(RenderBox* insertBefore = 0); | 186 void createAndInsertMultiColumnSet(LayoutBox* insertBefore = 0); |
| 187 void createAndInsertSpannerPlaceholder(RenderBox* spanner, RenderBox* insert
Before = 0); | 187 void createAndInsertSpannerPlaceholder(LayoutBox* spanner, LayoutBox* insert
Before = 0); |
| 188 virtual bool descendantIsValidColumnSpanner(LayoutObject* descendant) const; | 188 virtual bool descendantIsValidColumnSpanner(LayoutObject* descendant) const; |
| 189 | 189 |
| 190 virtual const char* renderName() const override; | 190 virtual const char* renderName() const override; |
| 191 virtual void addRegionToThread(LayoutMultiColumnSet*) override; | 191 virtual void addRegionToThread(LayoutMultiColumnSet*) override; |
| 192 virtual void willBeRemovedFromTree() override; | 192 virtual void willBeRemovedFromTree() override; |
| 193 virtual LayoutUnit skipColumnSpanner(RenderBox*, LayoutUnit logicalTopInFlow
Thread) override; | 193 virtual LayoutUnit skipColumnSpanner(LayoutBox*, LayoutUnit logicalTopInFlow
Thread) override; |
| 194 virtual void flowThreadDescendantWasInserted(LayoutObject*) override; | 194 virtual void flowThreadDescendantWasInserted(LayoutObject*) override; |
| 195 virtual void flowThreadDescendantWillBeRemoved(LayoutObject*) override; | 195 virtual void flowThreadDescendantWillBeRemoved(LayoutObject*) override; |
| 196 virtual void computePreferredLogicalWidths() override; | 196 virtual void computePreferredLogicalWidths() override; |
| 197 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; | 197 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const override; |
| 198 virtual void updateLogicalWidth() override; | 198 virtual void updateLogicalWidth() override; |
| 199 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; | 199 virtual void setPageBreak(LayoutUnit offset, LayoutUnit spaceShortage) overr
ide; |
| 200 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; | 200 virtual void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight
) override; |
| 201 virtual bool addForcedRegionBreak(LayoutUnit, LayoutObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; | 201 virtual bool addForcedRegionBreak(LayoutUnit, LayoutObject* breakChild, bool
isBefore, LayoutUnit* offsetBreakAdjustment = 0) override; |
| 202 virtual bool isPageLogicalHeightKnown() const override; | 202 virtual bool isPageLogicalHeightKnown() const override; |
| 203 | 203 |
| 204 // The last set we worked on. It's not to be used as the "current set". The
concept of a | 204 // The last set we worked on. It's not to be used as the "current set". The
concept of a |
| 205 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong | 205 // "current set" is difficult, since layout may jump back and forth in the t
ree, due to wrong |
| 206 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. | 206 // top location estimates (due to e.g. margin collapsing), and possibly for
other reasons. |
| 207 LayoutMultiColumnSet* m_lastSetWorkedOn; | 207 LayoutMultiColumnSet* m_lastSetWorkedOn; |
| 208 | 208 |
| 209 unsigned m_columnCount; // The used value of column-count | 209 unsigned m_columnCount; // The used value of column-count |
| 210 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. | 210 LayoutUnit m_columnHeightAvailable; // Total height available to columns, or
0 if auto. |
| 211 bool m_inBalancingPass; // Set when relayouting for column balancing. | 211 bool m_inBalancingPass; // Set when relayouting for column balancing. |
| 212 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. | 212 bool m_needsColumnHeightsRecalculation; // Set when we need to recalculate t
he column set heights after layout. |
| 213 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. | 213 bool m_progressionIsInline; // Always true for regular multicol. False for p
aged-y overflow. |
| 214 bool m_isBeingEvacuated; | 214 bool m_isBeingEvacuated; |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace blink | 217 } // namespace blink |
| 218 | 218 |
| 219 #endif // LayoutMultiColumnFlowThread_h | 219 #endif // LayoutMultiColumnFlowThread_h |
| OLD | NEW |