| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
| 3 * | 3 * |
| 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
| 5 * | 5 * |
| 6 * Other contributors: | 6 * Other contributors: |
| 7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
| 8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
| 9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
| 10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 while (curr && !curr->hasLayer()) { | 340 while (curr && !curr->hasLayer()) { |
| 341 if (curr->isBox()) { | 341 if (curr->isBox()) { |
| 342 // Rows and cells share the same coordinate space (that of the s
ection). | 342 // Rows and cells share the same coordinate space (that of the s
ection). |
| 343 // Omit them when computing our xpos/ypos. | 343 // Omit them when computing our xpos/ypos. |
| 344 localPoint += toRenderBox(curr)->locationOffset(); | 344 localPoint += toRenderBox(curr)->locationOffset(); |
| 345 } | 345 } |
| 346 curr = curr->parent(); | 346 curr = curr->parent(); |
| 347 } | 347 } |
| 348 } | 348 } |
| 349 | 349 |
| 350 // Subtract our parent's scroll offset. | |
| 351 if (renderer()->isOutOfFlowPositioned() && enclosingPositionedAncestor()) { | |
| 352 RenderLayer* positionedParent = enclosingPositionedAncestor(); | |
| 353 | |
| 354 if (positionedParent->renderer()->isRelPositioned() && positionedParent-
>renderer()->isRenderInline()) { | |
| 355 LayoutSize offset = toRenderInline(positionedParent->renderer())->of
fsetForInFlowPositionedInline(*toRenderBox(renderer())); | |
| 356 localPoint += offset; | |
| 357 } | |
| 358 } | |
| 359 | |
| 360 localPoint.move(offsetForInFlowPosition()); | |
| 361 | |
| 362 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the renderers. | 350 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the renderers. |
| 363 localPoint -= inlineBoundingBoxOffset; | 351 localPoint -= inlineBoundingBoxOffset; |
| 364 | 352 |
| 365 return localPoint; | 353 return localPoint; |
| 366 } | 354 } |
| 367 | 355 |
| 368 const LayoutSize RenderLayer::offsetForInFlowPosition() const | |
| 369 { | |
| 370 return renderer()->isRelPositioned() ? toRenderBoxModelObject(renderer())->o
ffsetForInFlowPosition() : LayoutSize(); | |
| 371 } | |
| 372 | |
| 373 TransformationMatrix RenderLayer::perspectiveTransform() const | 356 TransformationMatrix RenderLayer::perspectiveTransform() const |
| 374 { | 357 { |
| 375 if (!renderer()->hasTransform()) | 358 if (!renderer()->hasTransform()) |
| 376 return TransformationMatrix(); | 359 return TransformationMatrix(); |
| 377 | 360 |
| 378 RenderStyle* style = renderer()->style(); | 361 RenderStyle* style = renderer()->style(); |
| 379 if (!style->hasPerspective()) | 362 if (!style->hasPerspective()) |
| 380 return TransformationMatrix(); | 363 return TransformationMatrix(); |
| 381 | 364 |
| 382 // Maybe fetch the perspective from the backing? | 365 // Maybe fetch the perspective from the backing? |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1068 } | 1051 } |
| 1069 } | 1052 } |
| 1070 | 1053 |
| 1071 void showLayerTree(const blink::RenderObject* renderer) | 1054 void showLayerTree(const blink::RenderObject* renderer) |
| 1072 { | 1055 { |
| 1073 if (!renderer) | 1056 if (!renderer) |
| 1074 return; | 1057 return; |
| 1075 showLayerTree(renderer->enclosingLayer()); | 1058 showLayerTree(renderer->enclosingLayer()); |
| 1076 } | 1059 } |
| 1077 #endif | 1060 #endif |
| OLD | NEW |