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

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

Issue 2911463002: Unify the calculation of main thread offset of sticky element (Closed)
Patch Set: Bug fix Created 3 years, 6 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/page/scrolling/StickyPositionScrollingConstraints.cpp
diff --git a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp
index f099cdce40417819ed11a11f133cdf54b503a75f..61150ecbbc4485b164011349d4eae3a78b547eee 100644
--- a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp
+++ b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.cpp
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "core/page/scrolling/StickyPositionScrollingConstraints.h"
+#include "core/paint/PaintLayer.h"
namespace blink {
@@ -88,4 +89,16 @@ FloatSize StickyPositionScrollingConstraints::ComputeStickyOffset(
return sticky_offset;
}
+FloatSize StickyPositionScrollingConstraints::GetOffsetForStickyPosition(
+ const StickyConstraintsMap& constraints_map) const {
+ FloatSize nearest_sticky_box_shifting_sticky_box_constraints_offset;
+ if (nearest_sticky_box_shifting_sticky_box_) {
+ nearest_sticky_box_shifting_sticky_box_constraints_offset =
+ constraints_map.at(nearest_sticky_box_shifting_sticky_box_->Layer())
+ .GetTotalStickyBoxStickyOffset();
+ }
+ return total_sticky_box_sticky_offset_ -
+ nearest_sticky_box_shifting_sticky_box_constraints_offset;
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698