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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 } | 776 } |
777 | 777 |
778 // Subtract our parent's scroll offset. | 778 // Subtract our parent's scroll offset. |
779 if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPosi
tioned() ? enclosingPositionedAncestor() : nullptr) { | 779 if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPosi
tioned() ? enclosingPositionedAncestor() : nullptr) { |
780 // For positioned layers, we subtract out the enclosing positioned layer
's scroll offset. | 780 // For positioned layers, we subtract out the enclosing positioned layer
's scroll offset. |
781 if (positionedParent->layoutObject()->hasOverflowClip()) { | 781 if (positionedParent->layoutObject()->hasOverflowClip()) { |
782 IntSize offset = positionedParent->layoutBox()->scrolledContentOffse
t(); | 782 IntSize offset = positionedParent->layoutBox()->scrolledContentOffse
t(); |
783 localPoint -= offset; | 783 localPoint -= offset; |
784 } | 784 } |
785 | 785 |
786 if (positionedParent->layoutObject()->isRelPositioned() && positionedPar
ent->layoutObject()->isLayoutInline()) { | 786 if (positionedParent->layoutObject()->isInFlowPositioned() && positioned
Parent->layoutObject()->isLayoutInline()) { |
787 LayoutSize offset = toLayoutInline(positionedParent->layoutObject())
->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject())); | 787 LayoutSize offset = toLayoutInline(positionedParent->layoutObject())
->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject())); |
788 localPoint += offset; | 788 localPoint += offset; |
789 } | 789 } |
790 } else if (parent() && parent()->layoutObject()->hasOverflowClip()) { | 790 } else if (parent() && parent()->layoutObject()->hasOverflowClip()) { |
791 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset(); | 791 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset(); |
792 localPoint -= scrollOffset; | 792 localPoint -= scrollOffset; |
793 } | 793 } |
794 | 794 |
795 bool positionOrOffsetChanged = false; | 795 bool positionOrOffsetChanged = false; |
796 if (layoutObject()->isRelPositioned()) { | 796 if (layoutObject()->isInFlowPositioned()) { |
797 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); | 797 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); |
798 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; | 798 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; |
799 m_offsetForInFlowPosition = newOffset; | 799 m_offsetForInFlowPosition = newOffset; |
800 localPoint.move(m_offsetForInFlowPosition); | 800 localPoint.move(m_offsetForInFlowPosition); |
801 } else { | 801 } else { |
802 m_offsetForInFlowPosition = LayoutSize(); | 802 m_offsetForInFlowPosition = LayoutSize(); |
803 } | 803 } |
804 | 804 |
805 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the layoutObjects. | 805 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the layoutObjects. |
806 localPoint.moveBy(-inlineBoundingBoxOffset); | 806 localPoint.moveBy(-inlineBoundingBoxOffset); |
(...skipping 1930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2737 | 2737 |
2738 void showLayerTree(const blink::LayoutObject* layoutObject) | 2738 void showLayerTree(const blink::LayoutObject* layoutObject) |
2739 { | 2739 { |
2740 if (!layoutObject) { | 2740 if (!layoutObject) { |
2741 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); | 2741 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); |
2742 return; | 2742 return; |
2743 } | 2743 } |
2744 showLayerTree(layoutObject->enclosingLayer()); | 2744 showLayerTree(layoutObject->enclosingLayer()); |
2745 } | 2745 } |
2746 #endif | 2746 #endif |
OLD | NEW |