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

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

Issue 2911463002: Unify the calculation of main thread offset of sticky element (Closed)
Patch Set: Pass in constraints_map instead of ancestor_overflow_layer && nit Created 3 years, 7 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.h
diff --git a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
index 330d2d86334c79ac8050a50cc8565bc97c06bfeb..8da5815be353549715c06d17a71eedaaed59ffb1 100644
--- a/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
+++ b/third_party/WebKit/Source/core/page/scrolling/StickyPositionScrollingConstraints.h
@@ -7,10 +7,16 @@
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/FloatSize.h"
+#include "platform/wtf/HashMap.h"
namespace blink {
class LayoutBoxModelObject;
+class PaintLayer;
+class StickyPositionScrollingConstraints;
+
+typedef WTF::HashMap<PaintLayer*, StickyPositionScrollingConstraints>
+ StickyConstraintsMap;
class StickyPositionScrollingConstraints final {
public:
@@ -113,6 +119,8 @@ class StickyPositionScrollingConstraints final {
return total_containing_block_sticky_offset_;
}
+ FloatSize GetLocalStickyOffset(const StickyConstraintsMap&) const;
chrishtr 2017/06/05 17:17:34 Document clearly what this returns. Not your faul
yigu 2017/06/05 18:16:34 Added a TODO for adding the class-level comment wi
+
const LayoutBoxModelObject* NearestStickyAncestor() const {
// If we have one or more sticky ancestor elements between ourselves and our
// containing block, |m_nearestStickyBoxShiftingStickyBox| points to the

Powered by Google App Engine
This is Rietveld 408576698