| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 // return the distance between the canvas origin and the left border edge | 168 // return the distance between the canvas origin and the left border edge |
| 169 // of the element and stop this algorithm. | 169 // of the element and stop this algorithm. |
| 170 Element* element = offsetParent(); | 170 Element* element = offsetParent(); |
| 171 if (!element) | 171 if (!element) |
| 172 return referencePoint; | 172 return referencePoint; |
| 173 | 173 |
| 174 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject
()) { | 174 if (const RenderBoxModelObject* offsetParent = element->renderBoxModelObject
()) { |
| 175 if (offsetParent->isBox()) | 175 if (offsetParent->isBox()) |
| 176 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); | 176 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); |
| 177 if (!isOutOfFlowPositioned()) { | 177 if (!isOutOfFlowPositioned()) { |
| 178 if (isRelPositioned()) | |
| 179 referencePoint.move(relativePositionOffset()); | |
| 180 | |
| 181 RenderObject* current; | 178 RenderObject* current; |
| 182 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { | 179 for (current = parent(); current != offsetParent && current->parent(
); current = current->parent()) { |
| 183 // FIXME: What are we supposed to do inside SVG content? | 180 // FIXME: What are we supposed to do inside SVG content? |
| 184 if (!isOutOfFlowPositioned()) { | 181 if (!isOutOfFlowPositioned()) { |
| 185 if (current->isBox()) | 182 if (current->isBox()) |
| 186 referencePoint.moveBy(toRenderBox(current)->location()); | 183 referencePoint.moveBy(toRenderBox(current)->location()); |
| 187 } | 184 } |
| 188 } | 185 } |
| 189 } | 186 } |
| 190 } | 187 } |
| 191 | 188 |
| 192 return referencePoint; | 189 return referencePoint; |
| 193 } | 190 } |
| 194 | 191 |
| 195 LayoutSize RenderBoxModelObject::offsetForInFlowPosition() const | |
| 196 { | |
| 197 return isRelPositioned() ? relativePositionOffset() : LayoutSize(); | |
| 198 } | |
| 199 | |
| 200 LayoutUnit RenderBoxModelObject::offsetLeft() const | 192 LayoutUnit RenderBoxModelObject::offsetLeft() const |
| 201 { | 193 { |
| 202 // Note that RenderInline and RenderBox override this to pass a different | 194 // Note that RenderInline and RenderBox override this to pass a different |
| 203 // startPoint to adjustedPositionRelativeToOffsetParent. | 195 // startPoint to adjustedPositionRelativeToOffsetParent. |
| 204 return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x(); | 196 return adjustedPositionRelativeToOffsetParent(LayoutPoint()).x(); |
| 205 } | 197 } |
| 206 | 198 |
| 207 LayoutUnit RenderBoxModelObject::offsetTop() const | 199 LayoutUnit RenderBoxModelObject::offsetTop() const |
| 208 { | 200 { |
| 209 // Note that RenderInline and RenderBox override this to pass a different | 201 // Note that RenderInline and RenderBox override this to pass a different |
| (...skipping 2194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2404 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2396 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
| 2405 for (RenderObject* child = slowFirstChild(); child; ) { | 2397 for (RenderObject* child = slowFirstChild(); child; ) { |
| 2406 // Save our next sibling as moveChildTo will clear it. | 2398 // Save our next sibling as moveChildTo will clear it. |
| 2407 RenderObject* nextSibling = child->nextSibling(); | 2399 RenderObject* nextSibling = child->nextSibling(); |
| 2408 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2400 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
| 2409 child = nextSibling; | 2401 child = nextSibling; |
| 2410 } | 2402 } |
| 2411 } | 2403 } |
| 2412 | 2404 |
| 2413 } // namespace blink | 2405 } // namespace blink |
| OLD | NEW |