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

Unified Diff: third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h

Issue 1308273010: Adapt and reland old position sticky implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: WIP - fix on release, still hits CHECK in LayoutGeometryMap.cpp:156 Created 4 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/paint/PaintLayerScrollableArea.h
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
index ebd01e1c347157c9bcc6d275efdeee30a85b7051..a89baf3a0edce423476ba93e26ea6d9c2cb35c6d 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h
@@ -63,6 +63,17 @@ class LayoutBox;
class PaintLayer;
class LayoutScrollbarPart;
+typedef WTF::HashMap<PaintLayer*, StickyPositionScrollingConstraints> StickyConstraintsMap;
+
+struct PaintLayerScrollableAreaRareData {
+ WTF_MAKE_NONCOPYABLE(PaintLayerScrollableAreaRareData);
+ USING_FAST_MALLOC(PaintLayerScrollableAreaRareData);
+public:
+ PaintLayerScrollableAreaRareData() {}
+
+ StickyConstraintsMap m_stickyConstraintsMap;
+};
+
// PaintLayerScrollableArea represents the scrollable area of a LayoutBox.
//
// To be scrollable, an element requires ‘overflow’ != visible. Note that this
@@ -337,6 +348,9 @@ public:
ScrollAnchor& scrollAnchor() { return m_scrollAnchor; }
bool isPaintLayerScrollableArea() const override { return true; }
+ StickyConstraintsMap& stickyConstraintsMap() { return ensureRareData().m_stickyConstraintsMap; }
+ void invalidateStickyConstraints();
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -373,6 +387,18 @@ private:
void updateCompositingLayersAfterScroll();
+ PaintLayerScrollableAreaRareData* rareData()
+ {
+ return m_rareData.get();
+ }
+
+ PaintLayerScrollableAreaRareData& ensureRareData()
+ {
+ if (!m_rareData)
+ m_rareData = adoptPtr(new PaintLayerScrollableAreaRareData());
+ return *m_rareData.get();
+ }
+
// PaintInvalidationCapableScrollableArea
LayoutBox& boxForScrollControlPaintInvalidation() const { return box(); }
@@ -413,6 +439,8 @@ private:
ScrollAnchor m_scrollAnchor;
+ OwnPtr<PaintLayerScrollableAreaRareData> m_rareData;
+
#if ENABLE(ASSERT)
bool m_hasBeenDisposed;
#endif

Powered by Google App Engine
This is Rietveld 408576698