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

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

Issue 2708883005: Handle nested position:sticky elements correctly (main thread) (Closed)
Patch Set: Address reviewer comments 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 2058 matching lines...) Expand 10 before | Expand all | Expand 10 after
2069 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint()); 2069 IntPoint centerPoint = roundedIntPoint(transformState.mappedPoint());
2070 transformState.move(toLayoutBox(container)->flipForWritingMode( 2070 transformState.move(toLayoutBox(container)->flipForWritingMode(
2071 LayoutPoint(centerPoint)) - 2071 LayoutPoint(centerPoint)) -
2072 centerPoint); 2072 centerPoint);
2073 } 2073 }
2074 mode &= ~ApplyContainerFlip; 2074 mode &= ~ApplyContainerFlip;
2075 } 2075 }
2076 } 2076 }
2077 2077
2078 LayoutSize containerOffset = offsetFromContainer(container); 2078 LayoutSize containerOffset = offsetFromContainer(container);
2079
2080 // TODO(smcgruer): This is inefficient. Instead we should avoid including
2081 // offsetForInFlowPosition in offsetFromContainer when ignoring sticky.
2082 if (isBoxModelObject() && isStickyPositioned() &&
2083 (mode & IgnoreStickyOffset)) {
flackr 2017/02/24 01:33:33 nit: Maybe do the mode check first since most of t
smcgruer 2017/02/24 14:17:43 Done. Also removed the brackets to let it fit on o
2084 containerOffset -= toLayoutBoxModelObject(this)->offsetForInFlowPosition();
2085 }
2086
2079 if (isLayoutFlowThread()) { 2087 if (isLayoutFlowThread()) {
2080 // So far the point has been in flow thread coordinates (i.e. as if 2088 // So far the point has been in flow thread coordinates (i.e. as if
2081 // everything in the fragmentation context lived in one tall single column). 2089 // everything in the fragmentation context lived in one tall single column).
2082 // Convert it to a visual point now, since we're about to escape the flow 2090 // Convert it to a visual point now, since we're about to escape the flow
2083 // thread. 2091 // thread.
2084 containerOffset += columnOffset(LayoutPoint(transformState.mappedPoint())); 2092 containerOffset += columnOffset(LayoutPoint(transformState.mappedPoint()));
2085 } 2093 }
2086 2094
2087 // Text objects just copy their parent's computed style, so we need to ignore 2095 // Text objects just copy their parent's computed style, so we need to ignore
2088 // them. 2096 // them.
(...skipping 1433 matching lines...) Expand 10 before | Expand all | Expand 10 after
3522 const blink::LayoutObject* root = object1; 3530 const blink::LayoutObject* root = object1;
3523 while (root->parent()) 3531 while (root->parent())
3524 root = root->parent(); 3532 root = root->parent();
3525 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0); 3533 root->showLayoutTreeAndMark(object1, "*", object2, "-", 0);
3526 } else { 3534 } else {
3527 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)"); 3535 WTFLogAlways("%s", "Cannot showLayoutTree. Root is (nil)");
3528 } 3536 }
3529 } 3537 }
3530 3538
3531 #endif 3539 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698