| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
| 7 * Copyright (C) 2010 Google Inc. All rights reserved. | 7 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 8 * | 8 * |
| 9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 } | 239 } |
| 240 | 240 |
| 241 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
ayoutPoint& startPoint) const | 241 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
ayoutPoint& startPoint) const |
| 242 { | 242 { |
| 243 // If the element is the HTML body element or doesn't have a parent | 243 // If the element is the HTML body element or doesn't have a parent |
| 244 // return 0 and stop this algorithm. | 244 // return 0 and stop this algorithm. |
| 245 if (isBody() || !parent()) | 245 if (isBody() || !parent()) |
| 246 return LayoutPoint(); | 246 return LayoutPoint(); |
| 247 | 247 |
| 248 LayoutPoint referencePoint = startPoint; | 248 LayoutPoint referencePoint = startPoint; |
| 249 referencePoint.move(parent()->offsetForColumns(referencePoint)); | 249 referencePoint.move(parent()->columnOffset(referencePoint)); |
| 250 | 250 |
| 251 // If the offsetParent of the element is null, or is the HTML body element, | 251 // If the offsetParent of the element is null, or is the HTML body element, |
| 252 // return the distance between the canvas origin and the left border edge | 252 // return the distance between the canvas origin and the left border edge |
| 253 // of the element and stop this algorithm. | 253 // of the element and stop this algorithm. |
| 254 Element* element = offsetParent(); | 254 Element* element = offsetParent(); |
| 255 if (!element) | 255 if (!element) |
| 256 return referencePoint; | 256 return referencePoint; |
| 257 | 257 |
| 258 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject
()) { | 258 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject
()) { |
| 259 if (offsetParent->isBox() && !offsetParent->isBody()) | 259 if (offsetParent->isBox() && !offsetParent->isBody()) |
| 260 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); | 260 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); |
| 261 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { | 261 if (!isOutOfFlowPositioned() || flowThreadContainingBlock()) { |
| 262 if (isRelPositioned()) | 262 if (isRelPositioned()) |
| 263 referencePoint.move(relativePositionOffset()); | 263 referencePoint.move(relativePositionOffset()); |
| 264 else if (isStickyPositioned()) | 264 else if (isStickyPositioned()) |
| 265 referencePoint.move(stickyPositionOffset()); | 265 referencePoint.move(stickyPositionOffset()); |
| 266 | 266 |
| 267 RenderObject* current; | 267 RenderObject* current; |
| 268 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { | 268 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { |
| 269 // FIXME: What are we supposed to do inside SVG content? | 269 // FIXME: What are we supposed to do inside SVG content? |
| 270 if (!isOutOfFlowPositioned()) { | 270 if (!isOutOfFlowPositioned()) { |
| 271 if (current->isBox() && !current->isTableRow()) | 271 if (current->isBox() && !current->isTableRow()) |
| 272 referencePoint.moveBy(toRenderBox(current)->topLeftLocat
ion()); | 272 referencePoint.moveBy(toRenderBox(current)->topLeftLocat
ion()); |
| 273 referencePoint.move(current->parent()->offsetForColumns(refe
rencePoint)); | 273 referencePoint.move(current->parent()->columnOffset(referenc
ePoint)); |
| 274 } | 274 } |
| 275 } | 275 } |
| 276 | 276 |
| 277 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent
->isPositioned()) | 277 if (offsetParent->isBox() && offsetParent->isBody() && !offsetParent
->isPositioned()) |
| 278 referencePoint.moveBy(toRenderBox(offsetParent)->topLeftLocation
()); | 278 referencePoint.moveBy(toRenderBox(offsetParent)->topLeftLocation
()); |
| 279 } | 279 } |
| 280 } | 280 } |
| 281 | 281 |
| 282 return referencePoint; | 282 return referencePoint; |
| 283 } | 283 } |
| (...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2824 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2824 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2825 for (RenderObject* child = startChild; child && child != endChild; ) { | 2825 for (RenderObject* child = startChild; child && child != endChild; ) { |
| 2826 // Save our next sibling as moveChildTo will clear it. | 2826 // Save our next sibling as moveChildTo will clear it. |
| 2827 RenderObject* nextSibling = child->nextSibling(); | 2827 RenderObject* nextSibling = child->nextSibling(); |
| 2828 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2828 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2829 child = nextSibling; | 2829 child = nextSibling; |
| 2830 } | 2830 } |
| 2831 } | 2831 } |
| 2832 | 2832 |
| 2833 } // namespace WebCore | 2833 } // namespace WebCore |
| OLD | NEW |