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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/LayoutObject.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index ac03b02a63fada3e05335e07899878a16129e44e..e3ea827488c73a368b7a10b9d4f0a0f1ca65b148 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -2076,6 +2076,14 @@ void LayoutObject::mapLocalToAncestor(const LayoutBoxModelObject* ancestor,
}
LayoutSize containerOffset = offsetFromContainer(container);
+
+ // TODO(smcgruer): This is inefficient. Instead we should avoid including
+ // offsetForInFlowPosition in offsetFromContainer when ignoring sticky.
+ if (isBoxModelObject() && isStickyPositioned() &&
+ (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
+ containerOffset -= toLayoutBoxModelObject(this)->offsetForInFlowPosition();
+ }
+
if (isLayoutFlowThread()) {
// So far the point has been in flow thread coordinates (i.e. as if
// everything in the fragmentation context lived in one tall single column).

Powered by Google App Engine
This is Rietveld 408576698