summaryrefslogtreecommitdiff
path: root/layout/generic/nsGfxScrollFrame.h
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-09-30 12:24:19 +0000
committerMoonchild <moonchild@palemoon.org>2022-09-30 12:24:19 +0000
commitbdc924d25ee6d0bbe6c780c1d88b60db573562e7 (patch)
tree426c983ca8bb4dd32d4f8db93625a9a07e11367d /layout/generic/nsGfxScrollFrame.h
parentb83dd4e5e8b95f61fa2c25b1635793f919e4f101 (diff)
downloaduxp-bdc924d25ee6d0bbe6c780c1d88b60db573562e7.tar.gz
WIP: basic scroll-anchoring attempt.scroll-anchoring-wip
This is incomplete and won't build due to prerequisites.
Diffstat (limited to 'layout/generic/nsGfxScrollFrame.h')
-rw-r--r--layout/generic/nsGfxScrollFrame.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/layout/generic/nsGfxScrollFrame.h b/layout/generic/nsGfxScrollFrame.h
index 41957d5e55..49e22b9224 100644
--- a/layout/generic/nsGfxScrollFrame.h
+++ b/layout/generic/nsGfxScrollFrame.h
@@ -458,6 +458,11 @@ public:
return mSuppressScrollbarRepaints;
}
+
+ void ScrollAnchorWillDestroy();
+
+ void ApplyScrollAnchorOffsetAdjustment();
+
// owning references to the nsIAnonymousContentCreator-built content
nsCOMPtr<nsIContent> mHScrollbarContent;
nsCOMPtr<nsIContent> mVScrollbarContent;
@@ -472,6 +477,7 @@ public:
nsIFrame* mScrolledFrame;
nsIFrame* mScrollCornerBox;
nsIFrame* mResizerBox;
+ nsIFrame* mAnchorNode;
nsContainerFrame* mOuter;
RefPtr<AsyncScroll> mAsyncScroll;
RefPtr<AsyncSmoothMSDScroll> mAsyncSmoothMSDScroll;
@@ -500,6 +506,11 @@ public:
// other than trying to restore mRestorePos.
nsPoint mLastPos;
+ // The last scroll position of the scroll anchor node. This is in the same
+ // coordinate space as mScrollPort, that is, relative to the parent of this
+ // scrollable frame.
+ nsPoint mLastAnchorPos;
+
nsExpirationState mActivityExpirationState;
nsCOMPtr<nsITimer> mScrollActivityTimer;
@@ -619,6 +630,9 @@ protected:
bool mOldSuppressValue;
};
+ void UpdateScrollAnchor();
+ nsIFrame* SelectScrollAnchorImpl(nsIFrame* aNode);
+
/**
* @note This method might destroy the frame, pres shell and other objects.
*/
@@ -1047,6 +1061,14 @@ public:
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
+ virtual void ScrollAnchorWillDestroy() override {
+ mHelper.ScrollAnchorWillDestroy();
+ }
+
+ virtual void ApplyScrollAnchorOffsetAdjustment() override {
+ mHelper.ApplyScrollAnchorOffsetAdjustment();
+ }
+
protected:
nsHTMLScrollFrame(nsStyleContext* aContext, bool aIsRoot);
void SetSuppressScrollbarUpdate(bool aSuppress) {
@@ -1471,6 +1493,14 @@ public:
virtual nsresult GetFrameName(nsAString& aResult) const override;
#endif
+ virtual void ScrollAnchorWillDestroy() override {
+ mHelper.ScrollAnchorWillDestroy();
+ }
+
+ virtual void ApplyScrollAnchorOffsetAdjustment() override {
+ mHelper.ApplyScrollAnchorOffsetAdjustment();
+ }
+
protected:
nsXULScrollFrame(nsStyleContext* aContext, bool aIsRoot,
bool aClipAllDescendants);