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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 bool recalculateColumnHeight(bool initial); | 101 bool recalculateColumnHeight(bool initial); |
102 | 102 |
103 // Record space shortage (the amount of space that would have been enough to
prevent some | 103 // Record space shortage (the amount of space that would have been enough to
prevent some |
104 // element from being moved to the next column) at a column break. The small
est amount of space | 104 // element from being moved to the next column) at a column break. The small
est amount of space |
105 // shortage we find is the amount with which we will stretch the column heig
ht, if it turns out | 105 // shortage we find is the amount with which we will stretch the column heig
ht, if it turns out |
106 // after layout that the columns weren't tall enough. | 106 // after layout that the columns weren't tall enough. |
107 void recordSpaceShortage(LayoutUnit spaceShortage); | 107 void recordSpaceShortage(LayoutUnit spaceShortage); |
108 | 108 |
109 virtual void updateLogicalWidth() OVERRIDE; | 109 virtual void updateLogicalWidth() OVERRIDE; |
110 | 110 |
111 void prepareForLayout(); | 111 void prepareForLayout(bool initial); |
112 | 112 |
113 // Expand this set's flow thread portion rectangle to contain all trailing f
low thread | 113 // Expand this set's flow thread portion rectangle to contain all trailing f
low thread |
114 // overflow. Only to be called on the last set. | 114 // overflow. Only to be called on the last set. |
115 void expandToEncompassFlowThreadContentsIfNeeded(); | 115 void expandToEncompassFlowThreadContentsIfNeeded(); |
116 | 116 |
117 private: | 117 private: |
118 RenderMultiColumnSet(RenderFlowThread*); | 118 RenderMultiColumnSet(RenderFlowThread*); |
119 | 119 |
120 virtual void layout() OVERRIDE; | 120 virtual void layout() OVERRIDE; |
121 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 121 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
122 | 122 |
123 virtual void paintObject(PaintInfo&, const LayoutPoint& paintOffset) OVERRID
E; | 123 virtual void paintObject(PaintInfo&, const LayoutPoint& paintOffset) OVERRID
E; |
124 | 124 |
125 virtual LayoutUnit pageLogicalWidth() const OVERRIDE { return m_computedColu
mnWidth; } | 125 virtual LayoutUnit pageLogicalWidth() const OVERRIDE { return m_computedColu
mnWidth; } |
126 virtual LayoutUnit pageLogicalHeight() const OVERRIDE { return m_computedCol
umnHeight; } | 126 virtual LayoutUnit pageLogicalHeight() const OVERRIDE { return m_computedCol
umnHeight; } |
127 | 127 |
128 virtual LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const OVERRIDE
; | 128 virtual LayoutUnit pageLogicalTopForOffset(LayoutUnit offset) const OVERRIDE
; |
129 | 129 |
130 virtual LayoutUnit logicalHeightOfAllFlowThreadContent() const OVERRIDE { re
turn logicalHeightInFlowThread(); } | 130 virtual LayoutUnit logicalHeightOfAllFlowThreadContent() const OVERRIDE { re
turn logicalHeightInFlowThread(); } |
131 | 131 |
132 virtual void repaintFlowThreadContent(const LayoutRect& repaintRect) const O
VERRIDE; | 132 virtual void repaintFlowThreadContent(const LayoutRect& repaintRect) const O
VERRIDE; |
133 | 133 |
134 virtual void collectLayerFragments(LayerFragments&, const LayoutRect& layerB
oundingBox, const LayoutRect& dirtyRect) OVERRIDE; | 134 virtual void collectLayerFragments(LayerFragments&, const LayoutRect& layerB
oundingBox, const LayoutRect& dirtyRect) OVERRIDE; |
135 | 135 |
136 virtual const char* renderName() const OVERRIDE; | 136 virtual const char* renderName() const OVERRIDE; |
137 | 137 |
138 void paintColumnRules(PaintInfo&, const LayoutPoint& paintOffset); | 138 void paintColumnRules(PaintInfo&, const LayoutPoint& paintOffset); |
139 | 139 |
| 140 LayoutUnit calculateMaxColumnHeight() const; |
140 LayoutUnit columnGap() const; | 141 LayoutUnit columnGap() const; |
141 LayoutRect columnRectAt(unsigned index) const; | 142 LayoutRect columnRectAt(unsigned index) const; |
142 unsigned columnCount() const; | 143 unsigned columnCount() const; |
143 | 144 |
144 LayoutRect flowThreadPortionRectAt(unsigned index) const; | 145 LayoutRect flowThreadPortionRectAt(unsigned index) const; |
145 LayoutRect flowThreadPortionOverflowRect(const LayoutRect& flowThreadPortion
, unsigned index, unsigned colCount, LayoutUnit colGap) const; | 146 LayoutRect flowThreadPortionOverflowRect(const LayoutRect& flowThreadPortion
, unsigned index, unsigned colCount, LayoutUnit colGap) const; |
146 | 147 |
147 enum ColumnIndexCalculationMode { | 148 enum ColumnIndexCalculationMode { |
148 ClampToExistingColumns, // Stay within the range of already existing col
umns. | 149 ClampToExistingColumns, // Stay within the range of already existing col
umns. |
149 AssumeNewColumns // Allow column indices outside the range of already ex
isting columns. | 150 AssumeNewColumns // Allow column indices outside the range of already ex
isting columns. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 }; | 200 }; |
200 Vector<ContentRun, 1> m_contentRuns; | 201 Vector<ContentRun, 1> m_contentRuns; |
201 }; | 202 }; |
202 | 203 |
203 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); | 204 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); |
204 | 205 |
205 } // namespace WebCore | 206 } // namespace WebCore |
206 | 207 |
207 #endif // RenderMultiColumnSet_h | 208 #endif // RenderMultiColumnSet_h |
208 | 209 |
OLD | NEW |