OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2011 Adobe Systems Incorporated. All rights reserved. | 2 * Copyright (C) 2011 Adobe Systems Incorporated. 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 * | 7 * |
8 * 1. Redistributions of source code must retain the above | 8 * 1. Redistributions of source code must retain the above |
9 * copyright notice, this list of conditions and the following | 9 * copyright notice, this list of conditions and the following |
10 * disclaimer. | 10 * disclaimer. |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
83 if (m_regionsHaveUniformLogicalHeight && previousRegionLogic alHeight != regionLogicalHeight) | 83 if (m_regionsHaveUniformLogicalHeight && previousRegionLogic alHeight != regionLogicalHeight) |
84 m_regionsHaveUniformLogicalHeight = false; | 84 m_regionsHaveUniformLogicalHeight = false; |
85 } | 85 } |
86 | 86 |
87 previousRegionLogicalHeight = regionLogicalHeight; | 87 previousRegionLogicalHeight = regionLogicalHeight; |
88 } | 88 } |
89 } | 89 } |
90 } | 90 } |
91 | 91 |
92 updateLogicalWidth(); // Called to get the maximum logical width for the col umnSet. | 92 updateLogicalWidth(); // Called to get the maximum logical width for the col umnSet. |
93 updateRegionsFlowThreadPortionRect(); | 93 generateColumnSetIntervalTree(); |
94 } | 94 } |
95 | 95 |
96 void RenderFlowThread::mapRectToPaintInvalidationBacking(const LayoutLayerModelO bject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationStat e* paintInvalidationState) const | 96 void RenderFlowThread::mapRectToPaintInvalidationBacking(const LayoutLayerModelO bject* paintInvalidationContainer, LayoutRect& rect, const PaintInvalidationStat e* paintInvalidationState) const |
97 { | 97 { |
98 ASSERT(paintInvalidationContainer != this); // A flow thread should never be an invalidation container. | 98 ASSERT(paintInvalidationContainer != this); // A flow thread should never be an invalidation container. |
99 rect = fragmentsBoundingBox(rect); | 99 rect = fragmentsBoundingBox(rect); |
100 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine r, rect, paintInvalidationState); | 100 RenderBlockFlow::mapRectToPaintInvalidationBacking(paintInvalidationContaine r, rect, paintInvalidationState); |
101 } | 101 } |
102 | 102 |
103 void RenderFlowThread::layout() | 103 void RenderFlowThread::layout() |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 return m_multiColumnSetList.first(); | 159 return m_multiColumnSetList.first(); |
160 } | 160 } |
161 | 161 |
162 RenderRegion* RenderFlowThread::lastRegion() const | 162 RenderRegion* RenderFlowThread::lastRegion() const |
163 { | 163 { |
164 if (!hasValidRegionInfo()) | 164 if (!hasValidRegionInfo()) |
165 return 0; | 165 return 0; |
166 return m_multiColumnSetList.last(); | 166 return m_multiColumnSetList.last(); |
167 } | 167 } |
168 | 168 |
169 void RenderFlowThread::updateRegionsFlowThreadPortionRect() | 169 void RenderFlowThread::generateColumnSetIntervalTree() |
170 { | 170 { |
171 LayoutUnit logicalHeight = 0; | |
172 // FIXME: Optimize not to clear the interval all the time. This implies manu ally managing the tree nodes lifecycle. | 171 // FIXME: Optimize not to clear the interval all the time. This implies manu ally managing the tree nodes lifecycle. |
173 m_multiColumnSetIntervalTree.clear(); | 172 m_multiColumnSetIntervalTree.clear(); |
174 m_multiColumnSetIntervalTree.initIfNeeded(); | 173 m_multiColumnSetIntervalTree.initIfNeeded(); |
175 for (RenderMultiColumnSetList::iterator iter = m_multiColumnSetList.begin(); iter != m_multiColumnSetList.end(); ++iter) { | 174 for (auto columnSet : m_multiColumnSetList) |
Julien - ping for review
2015/02/11 07:25:29
I assume this doesn't do a deep copy behind the sc
mstensho (USE GERRIT)
2015/02/11 09:49:55
Correct. No copying.
| |
176 RenderMultiColumnSet* columnSet = *iter; | 175 m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInter val(columnSet->logicalTopInFlowThread(), columnSet->logicalBottomInFlowThread(), columnSet)); |
177 | |
178 LayoutUnit columnSetLogicalWidth = columnSet->pageLogicalWidth(); | |
179 LayoutUnit columnSetLogicalHeight = std::min<LayoutUnit>(RenderFlowThrea d::maxLogicalHeight() - logicalHeight, columnSet->logicalHeightInFlowThread()); | |
180 | |
181 LayoutRect columnSetRect(style()->direction() == LTR ? LayoutUnit() : lo gicalWidth() - columnSetLogicalWidth, logicalHeight, columnSetLogicalWidth, colu mnSetLogicalHeight); | |
182 | |
183 columnSet->setFlowThreadPortionRect(isHorizontalWritingMode() ? columnSe tRect : columnSetRect.transposedRect()); | |
184 | |
185 m_multiColumnSetIntervalTree.add(MultiColumnSetIntervalTree::createInter val(logicalHeight, logicalHeight + columnSetLogicalHeight, columnSet)); | |
186 | |
187 logicalHeight += columnSetLogicalHeight; | |
188 } | |
189 } | 176 } |
190 | 177 |
191 void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, con st LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) | 178 void RenderFlowThread::collectLayerFragments(LayerFragments& layerFragments, con st LayoutRect& layerBoundingBox, const LayoutRect& dirtyRect) |
192 { | 179 { |
193 ASSERT(!m_regionsInvalidated); | 180 ASSERT(!m_regionsInvalidated); |
194 | 181 |
195 for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be gin(); iter != m_multiColumnSetList.end(); ++iter) { | 182 for (RenderMultiColumnSetList::const_iterator iter = m_multiColumnSetList.be gin(); iter != m_multiColumnSetList.end(); ++iter) { |
196 RenderMultiColumnSet* columnSet = *iter; | 183 RenderMultiColumnSet* columnSet = *iter; |
197 columnSet->collectLayerFragments(layerFragments, layerBoundingBox, dirty Rect); | 184 columnSet->collectLayerFragments(layerFragments, layerBoundingBox, dirty Rect); |
198 } | 185 } |
(...skipping 22 matching lines...) Expand all Loading... | |
221 | 208 |
222 void RenderFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval) | 209 void RenderFlowThread::MultiColumnSetSearchAdapter::collectIfNeeded(const MultiC olumnSetInterval& interval) |
223 { | 210 { |
224 if (m_result) | 211 if (m_result) |
225 return; | 212 return; |
226 if (interval.low() <= m_offset && interval.high() > m_offset) | 213 if (interval.low() <= m_offset && interval.high() > m_offset) |
227 m_result = interval.data(); | 214 m_result = interval.data(); |
228 } | 215 } |
229 | 216 |
230 } // namespace blink | 217 } // namespace blink |
OLD | NEW |