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

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: Make sticky vertical ref tests expectations not dependent on font size. Created 4 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 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 5ba25a8fdee4bff2c47eab9de4d093e6609fadee..c9bc87ef4fc426708f524ffd68dd94fce1716073 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
@@ -341,6 +352,10 @@ public:
bool shouldRebuildVerticalScrollbarLayer() const { return m_rebuildVerticalScrollbarLayer; }
void resetRebuildScrollbarLayerFlags();
+ StickyConstraintsMap& stickyConstraintsMap() { return ensureRareData().m_stickyConstraintsMap; }
+ void invalidateAllStickyConstraints();
+ void invalidateStickyConstraintsFor(PaintLayer*, bool needsCompositingUpdate = true);
+
DECLARE_VIRTUAL_TRACE();
private:
@@ -376,6 +391,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(); }
@@ -422,6 +449,8 @@ private:
ScrollAnchor m_scrollAnchor;
+ OwnPtr<PaintLayerScrollableAreaRareData> m_rareData;
+
#if ENABLE(ASSERT)
bool m_hasBeenDisposed;
#endif
« no previous file with comments | « third_party/WebKit/Source/core/paint/PaintLayer.cpp ('k') | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698