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

Side by Side Diff: third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp

Issue 2733633002: Handle nested position:sticky elements correctly (compositor) (Closed)
Patch Set: Addressed the easier reviewer comments. Created 3 years, 9 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/page/scrolling/StickyPositionScrollingConstraints.h" 5 #include "core/page/scrolling/StickyPositionScrollingConstraints.h"
6 6
7 namespace blink { 7 namespace blink {
8 8
9 FloatSize StickyPositionScrollingConstraints::computeStickyOffset( 9 FloatSize StickyPositionScrollingConstraints::computeStickyOffset(
10 const FloatRect& viewportRect, 10 const FloatRect& viewportRect,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 boxRect.move(0, topDelta); 74 boxRect.move(0, topDelta);
75 } 75 }
76 76
77 FloatSize stickyOffset = boxRect.location() - stickyBoxRect.location(); 77 FloatSize stickyOffset = boxRect.location() - stickyBoxRect.location();
78 78
79 m_totalStickyBoxStickyOffset = ancestorStickyBoxOffset + stickyOffset; 79 m_totalStickyBoxStickyOffset = ancestorStickyBoxOffset + stickyOffset;
80 m_totalContainingBlockStickyOffset = 80 m_totalContainingBlockStickyOffset =
81 ancestorStickyBoxOffset + ancestorContainingBlockOffset + stickyOffset; 81 ancestorStickyBoxOffset + ancestorContainingBlockOffset + stickyOffset;
82 82
83 m_localStickyOffset = stickyOffset;
84
83 return stickyOffset; 85 return stickyOffset;
84 } 86 }
85 87
86 } // namespace blink 88 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698