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 |