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 |
11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
12 * | 12 * |
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY |
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR |
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #include "config.h" | 26 #include "config.h" |
27 #include "core/rendering/RenderGeometryMap.h" | 27 #include "core/rendering/RenderGeometryMap.h" |
28 | 28 |
29 #include "core/frame/LocalFrame.h" | 29 #include "core/frame/LocalFrame.h" |
30 #include "core/rendering/RenderLayer.h" | 30 #include "core/layout/Layer.h" |
31 #include "core/rendering/RenderView.h" | 31 #include "core/rendering/RenderView.h" |
32 #include "platform/geometry/TransformState.h" | 32 #include "platform/geometry/TransformState.h" |
33 #include "wtf/TemporaryChange.h" | 33 #include "wtf/TemporaryChange.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 RenderGeometryMap::RenderGeometryMap(MapCoordinatesFlags flags) | 37 RenderGeometryMap::RenderGeometryMap(MapCoordinatesFlags flags) |
38 : m_insertionPosition(kNotFound) | 38 : m_insertionPosition(kNotFound) |
39 , m_nonUniformStepsCount(0) | 39 , m_nonUniformStepsCount(0) |
40 , m_transformedStepsCount(0) | 40 , m_transformedStepsCount(0) |
41 , m_fixedStepsCount(0) | 41 , m_fixedStepsCount(0) |
42 , m_mapCoordinatesFlags(flags) | 42 , m_mapCoordinatesFlags(flags) |
43 { | 43 { |
44 } | 44 } |
45 | 45 |
46 RenderGeometryMap::~RenderGeometryMap() | 46 RenderGeometryMap::~RenderGeometryMap() |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 void RenderGeometryMap::mapToContainer(TransformState& transformState, const Ren
derLayerModelObject* container) const | 50 void RenderGeometryMap::mapToContainer(TransformState& transformState, const Lay
outLayerModelObject* container) const |
51 { | 51 { |
52 // If the mapping includes something like columns, we have to go via rendere
rs. | 52 // If the mapping includes something like columns, we have to go via rendere
rs. |
53 if (hasNonUniformStep()) { | 53 if (hasNonUniformStep()) { |
54 m_mapping.last().m_renderer->mapLocalToContainer(container, transformSta
te, ApplyContainerFlip | m_mapCoordinatesFlags); | 54 m_mapping.last().m_renderer->mapLocalToContainer(container, transformSta
te, ApplyContainerFlip | m_mapCoordinatesFlags); |
55 transformState.flatten(); | 55 transformState.flatten(); |
56 return; | 56 return; |
57 } | 57 } |
58 | 58 |
59 bool inFixed = false; | 59 bool inFixed = false; |
60 #if ENABLE(ASSERT) | 60 #if ENABLE(ASSERT) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 if (inFixed && !currentStep.m_offsetForFixedPosition.isZero()) { | 97 if (inFixed && !currentStep.m_offsetForFixedPosition.isZero()) { |
98 ASSERT(currentStep.m_renderer->isRenderView()); | 98 ASSERT(currentStep.m_renderer->isRenderView()); |
99 transformState.move(currentStep.m_offsetForFixedPosition); | 99 transformState.move(currentStep.m_offsetForFixedPosition); |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 ASSERT(foundContainer); | 103 ASSERT(foundContainer); |
104 transformState.flatten(); | 104 transformState.flatten(); |
105 } | 105 } |
106 | 106 |
107 FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const RenderLa
yerModelObject* container) const | 107 FloatPoint RenderGeometryMap::mapToContainer(const FloatPoint& p, const LayoutLa
yerModelObject* container) const |
108 { | 108 { |
109 FloatPoint result; | 109 FloatPoint result; |
110 | 110 |
111 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) | 111 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) |
112 result = p + m_accumulatedOffset; | 112 result = p + m_accumulatedOffset; |
113 else { | 113 else { |
114 TransformState transformState(TransformState::ApplyTransformDirection, p
); | 114 TransformState transformState(TransformState::ApplyTransformDirection, p
); |
115 mapToContainer(transformState, container); | 115 mapToContainer(transformState, container); |
116 result = transformState.lastPlanarPoint(); | 116 result = transformState.lastPlanarPoint(); |
117 } | 117 } |
118 | 118 |
119 #if ENABLE(ASSERT) | 119 #if ENABLE(ASSERT) |
120 if (m_mapping.size() > 0) { | 120 if (m_mapping.size() > 0) { |
121 const RenderObject* lastRenderer = m_mapping.last().m_renderer; | 121 const RenderObject* lastRenderer = m_mapping.last().m_renderer; |
122 const RenderLayer* layer = lastRenderer->enclosingLayer(); | 122 const Layer* layer = lastRenderer->enclosingLayer(); |
123 | 123 |
124 // Bounds for invisible layers are intentionally not calculated, and are | 124 // Bounds for invisible layers are intentionally not calculated, and are |
125 // therefore not necessarily expected to be correct here. This is ok, | 125 // therefore not necessarily expected to be correct here. This is ok, |
126 // because they will be recomputed if the layer becomes visible. | 126 // because they will be recomputed if the layer becomes visible. |
127 if (!layer || !layer->subtreeIsInvisible()) { | 127 if (!layer || !layer->subtreeIsInvisible()) { |
128 FloatPoint rendererMappedResult = lastRenderer->localToContainerPoin
t(p, container, m_mapCoordinatesFlags); | 128 FloatPoint rendererMappedResult = lastRenderer->localToContainerPoin
t(p, container, m_mapCoordinatesFlags); |
129 | 129 |
130 ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(resu
lt)); | 130 ASSERT(roundedIntPoint(rendererMappedResult) == roundedIntPoint(resu
lt)); |
131 } | 131 } |
132 } | 132 } |
133 #endif | 133 #endif |
134 | 134 |
135 return result; | 135 return result; |
136 } | 136 } |
137 | 137 |
138 #ifndef NDEBUG | 138 #ifndef NDEBUG |
139 // Handy function to call from gdb while debugging mismatched point/rect errors. | 139 // Handy function to call from gdb while debugging mismatched point/rect errors. |
140 void RenderGeometryMap::dumpSteps() const | 140 void RenderGeometryMap::dumpSteps() const |
141 { | 141 { |
142 fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_
accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); | 142 fprintf(stderr, "RenderGeometryMap::dumpSteps accumulatedOffset=%d,%d\n", m_
accumulatedOffset.width().toInt(), m_accumulatedOffset.height().toInt()); |
143 for (int i = m_mapping.size() - 1; i >= 0; --i) { | 143 for (int i = m_mapping.size() - 1; i >= 0; --i) { |
144 fprintf(stderr, " [%d] %s: offset=%d,%d", i, m_mapping[i].m_renderer->de
bugName().ascii().data(), m_mapping[i].m_offset.width().toInt(), m_mapping[i].m_
offset.height().toInt()); | 144 fprintf(stderr, " [%d] %s: offset=%d,%d", i, m_mapping[i].m_renderer->de
bugName().ascii().data(), m_mapping[i].m_offset.width().toInt(), m_mapping[i].m_
offset.height().toInt()); |
145 if (m_mapping[i].m_hasTransform) | 145 if (m_mapping[i].m_hasTransform) |
146 fprintf(stderr, " hasTransform"); | 146 fprintf(stderr, " hasTransform"); |
147 fprintf(stderr, "\n"); | 147 fprintf(stderr, "\n"); |
148 } | 148 } |
149 } | 149 } |
150 #endif | 150 #endif |
151 | 151 |
152 FloatQuad RenderGeometryMap::mapToContainer(const FloatRect& rect, const RenderL
ayerModelObject* container) const | 152 FloatQuad RenderGeometryMap::mapToContainer(const FloatRect& rect, const LayoutL
ayerModelObject* container) const |
153 { | 153 { |
154 FloatQuad result; | 154 FloatQuad result; |
155 | 155 |
156 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) { | 156 if (!hasFixedPositionStep() && !hasTransformStep() && !hasNonUniformStep() &
& (!container || (m_mapping.size() && container == m_mapping[0].m_renderer))) { |
157 result = rect; | 157 result = rect; |
158 result.move(m_accumulatedOffset); | 158 result.move(m_accumulatedOffset); |
159 } else { | 159 } else { |
160 TransformState transformState(TransformState::ApplyTransformDirection, r
ect.center(), rect); | 160 TransformState transformState(TransformState::ApplyTransformDirection, r
ect.center(), rect); |
161 mapToContainer(transformState, container); | 161 mapToContainer(transformState, container); |
162 result = transformState.lastPlanarQuad(); | 162 result = transformState.lastPlanarQuad(); |
163 } | 163 } |
164 | 164 |
165 #if ENABLE(ASSERT) | 165 #if ENABLE(ASSERT) |
166 if (m_mapping.size() > 0) { | 166 if (m_mapping.size() > 0) { |
167 const RenderObject* lastRenderer = m_mapping.last().m_renderer; | 167 const RenderObject* lastRenderer = m_mapping.last().m_renderer; |
168 const RenderLayer* layer = lastRenderer->enclosingLayer(); | 168 const Layer* layer = lastRenderer->enclosingLayer(); |
169 | 169 |
170 // Bounds for invisible layers are intentionally not calculated, and are | 170 // Bounds for invisible layers are intentionally not calculated, and are |
171 // therefore not necessarily expected to be correct here. This is ok, | 171 // therefore not necessarily expected to be correct here. This is ok, |
172 // because they will be recomputed if the layer becomes visible. | 172 // because they will be recomputed if the layer becomes visible. |
173 if (!layer->subtreeIsInvisible() && lastRenderer->style()->visibility()
== VISIBLE) { | 173 if (!layer->subtreeIsInvisible() && lastRenderer->style()->visibility()
== VISIBLE) { |
174 FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(
rect, container, m_mapCoordinatesFlags).boundingBox(); | 174 FloatRect rendererMappedResult = lastRenderer->localToContainerQuad(
rect, container, m_mapCoordinatesFlags).boundingBox(); |
175 | 175 |
176 // Inspector creates renderers with negative width <https://bugs.web
kit.org/show_bug.cgi?id=87194>. | 176 // Inspector creates renderers with negative width <https://bugs.web
kit.org/show_bug.cgi?id=87194>. |
177 // Taking FloatQuad bounds avoids spurious assertions because of tha
t. | 177 // Taking FloatQuad bounds avoids spurious assertions because of tha
t. |
178 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(re
sult.boundingBox())); | 178 ASSERT(enclosingIntRect(rendererMappedResult) == enclosingIntRect(re
sult.boundingBox())); |
179 } | 179 } |
180 } | 180 } |
181 #endif | 181 #endif |
182 | 182 |
183 return result; | 183 return result; |
184 } | 184 } |
185 | 185 |
186 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con
st RenderLayerModelObject* ancestorRenderer) | 186 void RenderGeometryMap::pushMappingsToAncestor(const RenderObject* renderer, con
st LayoutLayerModelObject* ancestorRenderer) |
187 { | 187 { |
188 // We need to push mappings in reverse order here, so do insertions rather t
han appends. | 188 // We need to push mappings in reverse order here, so do insertions rather t
han appends. |
189 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size()
); | 189 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.size()
); |
190 do { | 190 do { |
191 renderer = renderer->pushMappingToContainer(ancestorRenderer, *this); | 191 renderer = renderer->pushMappingToContainer(ancestorRenderer, *this); |
192 } while (renderer && renderer != ancestorRenderer); | 192 } while (renderer && renderer != ancestorRenderer); |
193 | 193 |
194 ASSERT(m_mapping.isEmpty() || isTopmostRenderView(m_mapping[0].m_renderer)); | 194 ASSERT(m_mapping.isEmpty() || isTopmostRenderView(m_mapping[0].m_renderer)); |
195 } | 195 } |
196 | 196 |
197 static bool canMapBetweenRenderers(const RenderObject* renderer, const RenderObj
ect* ancestor) | 197 static bool canMapBetweenRenderers(const RenderObject* renderer, const RenderObj
ect* ancestor) |
198 { | 198 { |
199 for (const RenderObject* current = renderer; ; current = current->parent())
{ | 199 for (const RenderObject* current = renderer; ; current = current->parent())
{ |
200 const RenderStyle* style = current->style(); | 200 const RenderStyle* style = current->style(); |
201 if (style->position() == FixedPosition || style->isFlippedBlocksWritingM
ode()) | 201 if (style->position() == FixedPosition || style->isFlippedBlocksWritingM
ode()) |
202 return false; | 202 return false; |
203 | 203 |
204 if (current->hasColumns() || current->hasTransformRelatedProperty() || c
urrent->isRenderFlowThread() || current->isSVGRoot()) | 204 if (current->hasColumns() || current->hasTransformRelatedProperty() || c
urrent->isRenderFlowThread() || current->isSVGRoot()) |
205 return false; | 205 return false; |
206 | 206 |
207 if (current == ancestor) | 207 if (current == ancestor) |
208 break; | 208 break; |
209 } | 209 } |
210 | 210 |
211 return true; | 211 return true; |
212 } | 212 } |
213 | 213 |
214 void RenderGeometryMap::pushMappingsToAncestor(const RenderLayer* layer, const R
enderLayer* ancestorLayer) | 214 void RenderGeometryMap::pushMappingsToAncestor(const Layer* layer, const Layer*
ancestorLayer) |
215 { | 215 { |
216 const RenderObject* renderer = layer->renderer(); | 216 const RenderObject* renderer = layer->renderer(); |
217 | 217 |
218 bool crossDocument = ancestorLayer && layer->renderer()->frame() != ancestor
Layer->renderer()->frame(); | 218 bool crossDocument = ancestorLayer && layer->renderer()->frame() != ancestor
Layer->renderer()->frame(); |
219 ASSERT(!crossDocument || m_mapCoordinatesFlags & TraverseDocumentBoundaries)
; | 219 ASSERT(!crossDocument || m_mapCoordinatesFlags & TraverseDocumentBoundaries)
; |
220 | 220 |
221 // We have to visit all the renderers to detect flipped blocks. This might d
efeat the gains | 221 // We have to visit all the renderers to detect flipped blocks. This might d
efeat the gains |
222 // from mapping via layers. | 222 // from mapping via layers. |
223 bool canConvertInLayerTree = (ancestorLayer && !crossDocument) ? canMapBetwe
enRenderers(layer->renderer(), ancestorLayer->renderer()) : false; | 223 bool canConvertInLayerTree = (ancestorLayer && !crossDocument) ? canMapBetwe
enRenderers(layer->renderer(), ancestorLayer->renderer()) : false; |
224 | 224 |
225 // fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p t
o layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, canConvertInLayer
Tree); | 225 // fprintf(stderr, "RenderGeometryMap::pushMappingsToAncestor from layer %p t
o layer %p, canConvertInLayerTree=%d\n", layer, ancestorLayer, canConvertInLayer
Tree); |
226 | 226 |
227 if (canConvertInLayerTree) { | 227 if (canConvertInLayerTree) { |
228 LayoutPoint layerOffset; | 228 LayoutPoint layerOffset; |
229 layer->convertToLayerCoords(ancestorLayer, layerOffset); | 229 layer->convertToLayerCoords(ancestorLayer, layerOffset); |
230 | 230 |
231 // The RenderView must be pushed first. | 231 // The RenderView must be pushed first. |
232 if (!m_mapping.size()) { | 232 if (!m_mapping.size()) { |
233 ASSERT(ancestorLayer->renderer()->isRenderView()); | 233 ASSERT(ancestorLayer->renderer()->isRenderView()); |
234 pushMappingsToAncestor(ancestorLayer->renderer(), 0); | 234 pushMappingsToAncestor(ancestorLayer->renderer(), 0); |
235 } | 235 } |
236 | 236 |
237 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.si
ze()); | 237 TemporaryChange<size_t> positionChange(m_insertionPosition, m_mapping.si
ze()); |
238 bool accumulatingTransform = layer->renderer()->style()->preserves3D() |
| ancestorLayer->renderer()->style()->preserves3D(); | 238 bool accumulatingTransform = layer->renderer()->style()->preserves3D() |
| ancestorLayer->renderer()->style()->preserves3D(); |
239 push(renderer, toLayoutSize(layerOffset), accumulatingTransform, /*isNon
Uniform*/ false, /*isFixedPosition*/ false, /*hasTransform*/ false); | 239 push(renderer, toLayoutSize(layerOffset), accumulatingTransform, /*isNon
Uniform*/ false, /*isFixedPosition*/ false, /*hasTransform*/ false); |
240 return; | 240 return; |
241 } | 241 } |
242 const RenderLayerModelObject* ancestorRenderer = ancestorLayer ? ancestorLay
er->renderer() : 0; | 242 const LayoutLayerModelObject* ancestorRenderer = ancestorLayer ? ancestorLay
er->renderer() : 0; |
243 pushMappingsToAncestor(renderer, ancestorRenderer); | 243 pushMappingsToAncestor(renderer, ancestorRenderer); |
244 } | 244 } |
245 | 245 |
246 void RenderGeometryMap::push(const RenderObject* renderer, const LayoutSize& off
setFromContainer, bool accumulatingTransform, bool isNonUniform, bool isFixedPos
ition, bool hasTransform, LayoutSize offsetForFixedPosition) | 246 void RenderGeometryMap::push(const RenderObject* renderer, const LayoutSize& off
setFromContainer, bool accumulatingTransform, bool isNonUniform, bool isFixedPos
ition, bool hasTransform, LayoutSize offsetForFixedPosition) |
247 { | 247 { |
248 // fprintf(stderr, "RenderGeometryMap::push %p %d,%d isNonUniform=%d\n", rend
erer, offsetFromContainer.width().toInt(), offsetFromContainer.height().toInt(),
isNonUniform); | 248 // fprintf(stderr, "RenderGeometryMap::push %p %d,%d isNonUniform=%d\n", rend
erer, offsetFromContainer.width().toInt(), offsetFromContainer.height().toInt(),
isNonUniform); |
249 | 249 |
250 ASSERT(m_insertionPosition != kNotFound); | 250 ASSERT(m_insertionPosition != kNotFound); |
251 ASSERT(!renderer->isRenderView() || !m_insertionPosition || m_mapCoordinates
Flags & TraverseDocumentBoundaries); | 251 ASSERT(!renderer->isRenderView() || !m_insertionPosition || m_mapCoordinates
Flags & TraverseDocumentBoundaries); |
252 ASSERT(offsetForFixedPosition.isZero() || renderer->isRenderView()); | 252 ASSERT(offsetForFixedPosition.isZero() || renderer->isRenderView()); |
(...skipping 19 matching lines...) Expand all Loading... |
272 step.m_offsetForFixedPosition = offsetForFixedPosition; | 272 step.m_offsetForFixedPosition = offsetForFixedPosition; |
273 | 273 |
274 if (!t.isIntegerTranslation()) | 274 if (!t.isIntegerTranslation()) |
275 step.m_transform = adoptPtr(new TransformationMatrix(t)); | 275 step.m_transform = adoptPtr(new TransformationMatrix(t)); |
276 else | 276 else |
277 step.m_offset = LayoutSize(t.e(), t.f()); | 277 step.m_offset = LayoutSize(t.e(), t.f()); |
278 | 278 |
279 stepInserted(step); | 279 stepInserted(step); |
280 } | 280 } |
281 | 281 |
282 void RenderGeometryMap::popMappingsToAncestor(const RenderLayerModelObject* ance
storRenderer) | 282 void RenderGeometryMap::popMappingsToAncestor(const LayoutLayerModelObject* ance
storRenderer) |
283 { | 283 { |
284 ASSERT(m_mapping.size()); | 284 ASSERT(m_mapping.size()); |
285 | 285 |
286 while (m_mapping.size() && m_mapping.last().m_renderer != ancestorRenderer)
{ | 286 while (m_mapping.size() && m_mapping.last().m_renderer != ancestorRenderer)
{ |
287 stepRemoved(m_mapping.last()); | 287 stepRemoved(m_mapping.last()); |
288 m_mapping.removeLast(); | 288 m_mapping.removeLast(); |
289 } | 289 } |
290 } | 290 } |
291 | 291 |
292 void RenderGeometryMap::popMappingsToAncestor(const RenderLayer* ancestorLayer) | 292 void RenderGeometryMap::popMappingsToAncestor(const Layer* ancestorLayer) |
293 { | 293 { |
294 const RenderLayerModelObject* ancestorRenderer = ancestorLayer ? ancestorLay
er->renderer() : 0; | 294 const LayoutLayerModelObject* ancestorRenderer = ancestorLayer ? ancestorLay
er->renderer() : 0; |
295 popMappingsToAncestor(ancestorRenderer); | 295 popMappingsToAncestor(ancestorRenderer); |
296 } | 296 } |
297 | 297 |
298 void RenderGeometryMap::stepInserted(const RenderGeometryMapStep& step) | 298 void RenderGeometryMap::stepInserted(const RenderGeometryMapStep& step) |
299 { | 299 { |
300 m_accumulatedOffset += step.m_offset; | 300 m_accumulatedOffset += step.m_offset; |
301 | 301 |
302 if (step.m_isNonUniform) | 302 if (step.m_isNonUniform) |
303 ++m_nonUniformStepsCount; | 303 ++m_nonUniformStepsCount; |
304 | 304 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 // If we're not working with multiple RenderViews, then any view is consider
ed | 338 // If we're not working with multiple RenderViews, then any view is consider
ed |
339 // "topmost" (to preserve original behavior). | 339 // "topmost" (to preserve original behavior). |
340 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) | 340 if (!(m_mapCoordinatesFlags & TraverseDocumentBoundaries)) |
341 return true; | 341 return true; |
342 | 342 |
343 return renderer->frame()->isMainFrame(); | 343 return renderer->frame()->isMainFrame(); |
344 } | 344 } |
345 #endif | 345 #endif |
346 | 346 |
347 } // namespace blink | 347 } // namespace blink |
OLD | NEW |