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 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
881 // Subtract our parent's scroll offset. | 881 // Subtract our parent's scroll offset. |
882 if (renderer()->isOutOfFlowPositioned() && enclosingPositionedAncestor()) { | 882 if (renderer()->isOutOfFlowPositioned() && enclosingPositionedAncestor()) { |
883 RenderLayer* positionedParent = enclosingPositionedAncestor(); | 883 RenderLayer* positionedParent = enclosingPositionedAncestor(); |
884 | 884 |
885 // For positioned layers, we subtract out the enclosing positioned layer
's scroll offset. | 885 // For positioned layers, we subtract out the enclosing positioned layer
's scroll offset. |
886 if (positionedParent->renderer()->hasOverflowClip()) { | 886 if (positionedParent->renderer()->hasOverflowClip()) { |
887 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf
fset(); | 887 LayoutSize offset = positionedParent->renderBox()->scrolledContentOf
fset(); |
888 localPoint -= offset; | 888 localPoint -= offset; |
889 } | 889 } |
890 | 890 |
891 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()-
>isInFlowPositioned() && positionedParent->renderer()->isRenderInline()) { | 891 if (renderer()->isOutOfFlowPositioned() && positionedParent->renderer()-
>isRelPositioned() && positionedParent->renderer()->isRenderInline()) { |
892 LayoutSize offset = toRenderInline(positionedParent->renderer())->of
fsetForInFlowPositionedInline(*toRenderBox(renderer())); | 892 LayoutSize offset = toRenderInline(positionedParent->renderer())->of
fsetForInFlowPositionedInline(*toRenderBox(renderer())); |
893 localPoint += offset; | 893 localPoint += offset; |
894 } | 894 } |
895 } else if (parent()) { | 895 } else if (parent()) { |
896 if (hasCompositedLayerMapping()) { | 896 if (hasCompositedLayerMapping()) { |
897 // FIXME: Composited layers ignore pagination, so about the best we
can do is make sure they're offset into the appropriate column. | 897 // FIXME: Composited layers ignore pagination, so about the best we
can do is make sure they're offset into the appropriate column. |
898 // They won't split across columns properly. | 898 // They won't split across columns properly. |
899 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isD
ocumentElement() && renderer()->view()->hasColumns()) | 899 if (!parent()->renderer()->hasColumns() && parent()->renderer()->isD
ocumentElement() && renderer()->view()->hasColumns()) |
900 localPoint += renderer()->view()->columnOffset(localPoint); | 900 localPoint += renderer()->view()->columnOffset(localPoint); |
901 else | 901 else |
902 localPoint += parent()->renderer()->columnOffset(localPoint); | 902 localPoint += parent()->renderer()->columnOffset(localPoint); |
903 } | 903 } |
904 | 904 |
905 if (parent()->renderer()->hasOverflowClip()) { | 905 if (parent()->renderer()->hasOverflowClip()) { |
906 IntSize scrollOffset = parent()->renderBox()->scrolledContentOffset(
); | 906 IntSize scrollOffset = parent()->renderBox()->scrolledContentOffset(
); |
907 localPoint -= scrollOffset; | 907 localPoint -= scrollOffset; |
908 } | 908 } |
909 } | 909 } |
910 | 910 |
911 bool positionOrOffsetChanged = false; | 911 bool positionOrOffsetChanged = false; |
912 if (renderer()->isInFlowPositioned()) { | 912 if (renderer()->isRelPositioned()) { |
913 LayoutSize newOffset = toRenderBoxModelObject(renderer())->offsetForInFl
owPosition(); | 913 LayoutSize newOffset = toRenderBoxModelObject(renderer())->offsetForInFl
owPosition(); |
914 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; | 914 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; |
915 m_offsetForInFlowPosition = newOffset; | 915 m_offsetForInFlowPosition = newOffset; |
916 localPoint.move(m_offsetForInFlowPosition); | 916 localPoint.move(m_offsetForInFlowPosition); |
917 } else { | 917 } else { |
918 m_offsetForInFlowPosition = LayoutSize(); | 918 m_offsetForInFlowPosition = LayoutSize(); |
919 } | 919 } |
920 | 920 |
921 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the renderers. | 921 // FIXME: We'd really like to just get rid of the concept of a layer rectang
le and rely on the renderers. |
922 localPoint -= inlineBoundingBoxOffset; | 922 localPoint -= inlineBoundingBoxOffset; |
(...skipping 2827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3750 } | 3750 } |
3751 } | 3751 } |
3752 | 3752 |
3753 void showLayerTree(const WebCore::RenderObject* renderer) | 3753 void showLayerTree(const WebCore::RenderObject* renderer) |
3754 { | 3754 { |
3755 if (!renderer) | 3755 if (!renderer) |
3756 return; | 3756 return; |
3757 showLayerTree(renderer->enclosingLayer()); | 3757 showLayerTree(renderer->enclosingLayer()); |
3758 } | 3758 } |
3759 #endif | 3759 #endif |
OLD | NEW |