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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutObject.cpp

Issue 2636253002: Handle nested position:sticky elements (Closed)
Patch Set: Rebase Created 3 years, 10 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) 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) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com) 5 * (C) 2004 Allan Sandfeld Jensen (kde@carewolf.com)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * Copyright (C) 2009 Google Inc. All rights reserved. 8 * Copyright (C) 2009 Google Inc. All rights reserved.
9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved.
10 * (http://www.torchmobile.com/) 10 * (http://www.torchmobile.com/)
(...skipping 2056 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 2067 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
2068 transformState.move(toLayoutBox(container)->flipForWritingMode( 2068 transformState.move(toLayoutBox(container)->flipForWritingMode(
2069 LayoutPoint(centerPoint)) - 2069 LayoutPoint(centerPoint)) -
2070 centerPoint); 2070 centerPoint);
2071 } 2071 }
2072 mode &= ~ApplyContainerFlip; 2072 mode &= ~ApplyContainerFlip;
2073 } 2073 }
2074 } 2074 }
2075 2075
2076 LayoutSize containerOffset = offsetFromContainer(container); 2076 LayoutSize containerOffset = offsetFromContainer(container);
2077
2078 // TODO(smcgruer): Don't include offsetForInFlowPosition in
2079 // offsetFromContainer when IgnoreStickyOffset is set.
2080 if (isBoxModelObject() && isStickyPositioned() &&
2081 (mode & IgnoreStickyOffset)) {
2082 containerOffset -= toLayoutBoxModelObject(this)->offsetForInFlowPosition();
2083 }
2084
2077 if (isLayoutFlowThread()) { 2085 if (isLayoutFlowThread()) {
2078 // So far the point has been in flow thread coordinates (i.e. as if 2086 // So far the point has been in flow thread coordinates (i.e. as if
2079 // everything in the fragmentation context lived in one tall single column). 2087 // everything in the fragmentation context lived in one tall single column).
2080 // Convert it to a visual point now, since we're about to escape the flow 2088 // Convert it to a visual point now, since we're about to escape the flow
2081 // thread. 2089 // thread.
2082 containerOffset += columnOffset(LayoutPoint(transformState.mappedPoint())); 2090 containerOffset += columnOffset(LayoutPoint(transformState.mappedPoint()));
2083 } 2091 }
2084 2092
2085 // Text objects just copy their parent's computed style, so we need to ignore 2093 // Text objects just copy their parent's computed style, so we need to ignore
2086 // them. 2094 // them.
(...skipping 1408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3495 const blink::LayoutObject* root = object1; 3503 const blink::LayoutObject* root = object1;
3496 while (root->parent()) 3504 while (root->parent())
3497 root = root->parent(); 3505 root = root->parent();
3498 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3506 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3499 } else { 3507 } else {
3500 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3508 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3501 } 3509 }
3502 } 3510 }
3503 3511
3504 #endif 3512 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698