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

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: Merge, convert pixel to ref tests, and address comments. 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
« no previous file with comments | « Source/core/layout/TracedLayoutObject.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 } 779 }
780 780
781 // Subtract our parent's scroll offset. 781 // Subtract our parent's scroll offset.
782 if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPosi tioned() ? enclosingPositionedAncestor() : nullptr) { 782 if (DeprecatedPaintLayer* positionedParent = layoutObject()->isOutOfFlowPosi tioned() ? enclosingPositionedAncestor() : nullptr) {
783 // For positioned layers, we subtract out the enclosing positioned layer 's scroll offset. 783 // For positioned layers, we subtract out the enclosing positioned layer 's scroll offset.
784 if (positionedParent->layoutObject()->hasOverflowClip()) { 784 if (positionedParent->layoutObject()->hasOverflowClip()) {
785 IntSize offset = positionedParent->layoutBox()->scrolledContentOffse t(); 785 IntSize offset = positionedParent->layoutBox()->scrolledContentOffse t();
786 localPoint -= offset; 786 localPoint -= offset;
787 } 787 }
788 788
789 if (positionedParent->layoutObject()->isRelPositioned() && positionedPar ent->layoutObject()->isLayoutInline()) { 789 if (positionedParent->layoutObject()->isInFlowPositioned() && positioned Parent->layoutObject()->isLayoutInline()) {
790 LayoutSize offset = toLayoutInline(positionedParent->layoutObject()) ->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject())); 790 LayoutSize offset = toLayoutInline(positionedParent->layoutObject()) ->offsetForInFlowPositionedInline(*toLayoutBox(layoutObject()));
791 localPoint += offset; 791 localPoint += offset;
792 } 792 }
793 } else if (parent() && parent()->layoutObject()->hasOverflowClip()) { 793 } else if (parent() && parent()->layoutObject()->hasOverflowClip()) {
794 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset(); 794 IntSize scrollOffset = parent()->layoutBox()->scrolledContentOffset();
795 localPoint -= scrollOffset; 795 localPoint -= scrollOffset;
796 } 796 }
797 797
798 bool positionOrOffsetChanged = false; 798 bool positionOrOffsetChanged = false;
799 if (layoutObject()->isRelPositioned()) { 799 if (layoutObject()->isInFlowPositioned()) {
800 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition(); 800 LayoutSize newOffset = layoutObject()->offsetForInFlowPosition();
801 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition; 801 positionOrOffsetChanged = newOffset != m_offsetForInFlowPosition;
802 m_offsetForInFlowPosition = newOffset; 802 m_offsetForInFlowPosition = newOffset;
803 localPoint.move(m_offsetForInFlowPosition); 803 localPoint.move(m_offsetForInFlowPosition);
804 } else { 804 } else {
805 m_offsetForInFlowPosition = LayoutSize(); 805 m_offsetForInFlowPosition = LayoutSize();
806 } 806 }
807 807
808 // FIXME: We'd really like to just get rid of the concept of a layer rectang le and rely on the layoutObjects. 808 // FIXME: We'd really like to just get rid of the concept of a layer rectang le and rely on the layoutObjects.
809 localPoint.moveBy(-inlineBoundingBoxOffset); 809 localPoint.moveBy(-inlineBoundingBoxOffset);
(...skipping 1931 matching lines...) Expand 10 before | Expand all | Expand 10 after
2741 2741
2742 void showLayerTree(const blink::LayoutObject* layoutObject) 2742 void showLayerTree(const blink::LayoutObject* layoutObject)
2743 { 2743 {
2744 if (!layoutObject) { 2744 if (!layoutObject) {
2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n"); 2745 fprintf(stderr, "Cannot showLayerTree. Root is (nil)\n");
2746 return; 2746 return;
2747 } 2747 }
2748 showLayerTree(layoutObject->enclosingLayer()); 2748 showLayerTree(layoutObject->enclosingLayer());
2749 } 2749 }
2750 #endif 2750 #endif
OLDNEW
« no previous file with comments | « Source/core/layout/TracedLayoutObject.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698