diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:37 +0000 |
commit | a90a5cba08fdf6c0ceb95101c275108a152a3aed (patch) | |
tree | 532507288f3defd7f4dcf1af49698bcb76034855 /layout/painting/nsDisplayList.h | |
parent | Adding debian version 126.0.1-1. (diff) | |
download | firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.tar.xz firefox-a90a5cba08fdf6c0ceb95101c275108a152a3aed.zip |
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/painting/nsDisplayList.h')
-rw-r--r-- | layout/painting/nsDisplayList.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index acda6ea863..9862415f61 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -5475,7 +5475,7 @@ class nsDisplayOwnLayer : public nsDisplayWrapList { bool IsFixedPositionLayer() const; bool IsStickyPositionLayer() const; bool HasDynamicToolbar() const; - virtual bool ShouldGetFixedOrStickyAnimationId() { return false; } + virtual bool ShouldGetFixedAnimationId() { return false; } bool CreatesStackingContextHelper() override { return true; } @@ -5491,6 +5491,16 @@ class nsDisplayOwnLayer : public nsDisplayWrapList { */ layers::ScrollbarData mScrollbarData; bool mForceActive; + + // Used for APZ to animate this layer for purposes such as + // pinch-zooming or scrollbar thumb movement. Note that setting this + // creates a WebRender ReferenceFrame spatial node, and should only + // be used for display items that establish a Gecko reference frame + // as well (or leaf items like scrollbar thumb nodes where it does not + // matter). + // FIXME: This is currently also used for adjusting position:fixed items + // for dynamic toolbar movement. This may be a problem as position:fixed + // items do not establish Gecko reference frames. uint64_t mWrAnimationId; }; @@ -5550,7 +5560,8 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer { : nsDisplayOwnLayer(aBuilder, aOther), mContainerASR(aOther.mContainerASR), mClippedToDisplayPort(aOther.mClippedToDisplayPort), - mShouldFlatten(false) { + mShouldFlatten(false), + mWrStickyAnimationId(0) { MOZ_COUNT_CTOR(nsDisplayStickyPosition); } @@ -5575,7 +5586,6 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer { bool UpdateScrollData(layers::WebRenderScrollData* aData, layers::WebRenderLayerScrollData* aLayerData) override; - bool ShouldGetFixedOrStickyAnimationId() override; const ActiveScrolledRoot* GetContainerASR() const { return mContainerASR; } @@ -5591,6 +5601,8 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer { return mShouldFlatten; } + bool ShouldGetStickyAnimationId() const; + private: NS_DISPLAY_ALLOW_CLONING() @@ -5620,6 +5632,13 @@ class nsDisplayStickyPosition : public nsDisplayOwnLayer { // True if this item should be flattened away. bool mShouldFlatten; + + // Used for APZ to animate the sticky element in the compositor + // for purposes such as dynamic toolbar movement and (in the future) + // overscroll-related adjustment. Unlike nsDisplayOwnLayer::mWrAnimationId, + // this does not create a WebRender ReferenceFrame, which is important + // because sticky elements do not establish Gecko reference frames either. + uint64_t mWrStickyAnimationId; }; class nsDisplayFixedPosition : public nsDisplayOwnLayer { @@ -5661,7 +5680,7 @@ class nsDisplayFixedPosition : public nsDisplayOwnLayer { nsDisplayListBuilder* aDisplayListBuilder) override; bool UpdateScrollData(layers::WebRenderScrollData* aData, layers::WebRenderLayerScrollData* aLayerData) override; - bool ShouldGetFixedOrStickyAnimationId() override; + bool ShouldGetFixedAnimationId() override; void WriteDebugInfo(std::stringstream& aStream) override; protected: |