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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 && (!containingBlock->style()->height().isAuto() | 510 && (!containingBlock->style()->height().isAuto() |
511 || !style()->bottom().isPercent() | 511 || !style()->bottom().isPercent() |
512 || containingBlock->stretchesToViewport())) | 512 || containingBlock->stretchesToViewport())) |
513 offset.expand(0, -valueForLength(style()->bottom(), containingBlock->ava
ilableHeight(), view())); | 513 offset.expand(0, -valueForLength(style()->bottom(), containingBlock->ava
ilableHeight(), view())); |
514 | 514 |
515 return offset; | 515 return offset; |
516 } | 516 } |
517 | 517 |
518 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
ayoutPoint& startPoint) const | 518 LayoutPoint RenderBoxModelObject::adjustedPositionRelativeToOffsetParent(const L
ayoutPoint& startPoint) const |
519 { | 519 { |
520 // If the element is the HTML body element or does not have an associated bo
x | 520 // If the element is the HTML body element or doesn't have a parent |
521 // return 0 and stop this algorithm. | 521 // return 0 and stop this algorithm. |
522 if (isBody()) | 522 if (isBody() || !parent()) |
523 return LayoutPoint(); | 523 return LayoutPoint(); |
524 | 524 |
525 LayoutPoint referencePoint = startPoint; | 525 LayoutPoint referencePoint = startPoint; |
526 referencePoint.move(parent()->offsetForColumns(referencePoint)); | 526 referencePoint.move(parent()->offsetForColumns(referencePoint)); |
527 | 527 |
528 // If the offsetParent of the element is null, or is the HTML body element, | 528 // If the offsetParent of the element is null, or is the HTML body element, |
529 // return the distance between the canvas origin and the left border edge | 529 // return the distance between the canvas origin and the left border edge |
530 // of the element and stop this algorithm. | 530 // of the element and stop this algorithm. |
531 if (const RenderBoxModelObject* offsetParent = this->offsetParent()) { | 531 if (const RenderBoxModelObject* offsetParent = this->offsetParent()) { |
532 if (offsetParent->isBox() && !offsetParent->isBody()) | 532 if (offsetParent->isBox() && !offsetParent->isBody()) |
533 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); | 533 referencePoint.move(-toRenderBox(offsetParent)->borderLeft(), -toRen
derBox(offsetParent)->borderTop()); |
534 if (!isPositioned()) { | 534 if (!isPositioned()) { |
(...skipping 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2769 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); | 2769 ASSERT(!beforeChild || toBoxModelObject == beforeChild->parent()); |
2770 for (RenderObject* child = startChild; child && child != endChild; ) { | 2770 for (RenderObject* child = startChild; child && child != endChild; ) { |
2771 // Save our next sibling as moveChildTo will clear it. | 2771 // Save our next sibling as moveChildTo will clear it. |
2772 RenderObject* nextSibling = child->nextSibling(); | 2772 RenderObject* nextSibling = child->nextSibling(); |
2773 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); | 2773 moveChildTo(toBoxModelObject, child, beforeChild, fullRemoveInsert); |
2774 child = nextSibling; | 2774 child = nextSibling; |
2775 } | 2775 } |
2776 } | 2776 } |
2777 | 2777 |
2778 } // namespace WebCore | 2778 } // namespace WebCore |
OLD | NEW |