Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(346)

Side by Side Diff: Source/core/paint/DeprecatedPaintLayer.cpp

Issue 1212893005: Add position: sticky as supported position value when CSSStickyPosition is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 1929 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 2736
2737 void showLayerTree(const blink::LayoutObject* layoutObject) 2737 void showLayerTree(const blink::LayoutObject* layoutObject)
2738 { 2738 {
2739 if (!layoutObject) { 2739 if (!layoutObject) {
2740 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2740 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2741 return; 2741 return;
2742 } 2742 }
2743 showLayerTree(layoutObject->enclosingLayer()); 2743 showLayerTree(layoutObject->enclosingLayer());
2744 } 2744 }
2745 #endif 2745 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698