commit 807658efa8c0c99e018d2b8c0fc456be20448dd6 parent 23486e9fef03799f9784cce4a9bb735a5a43b2ef Author: Botond Ballo <botond@mozilla.com> Date: Thu, 13 Nov 2025 04:59:03 +0000 Bug 1730749 - Reimplement nsDisplayStickyPosition::UpdateScrollData to get the animation id from WebRenderUserData instead. r=mstange This paves the way for moving the code that creates the animation id to earlier during WebRender display list building, where we won't have the sticky item available to store the animation id on it. Differential Revision: https://phabricator.services.mozilla.com/D254145 Diffstat:
| M | layout/painting/nsDisplayList.cpp | | | 11 | ++++++++++- |
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp @@ -6109,7 +6109,16 @@ bool nsDisplayStickyPosition::UpdateScrollData( } if (ShouldGetStickyAnimationId()) { - aLayerData->SetStickyPositionAnimationId(mWrStickyAnimationId); + // TODO(follow-up to bug 1730749): Should there be a + // "GetWebRenderUserData" method we should be calling here, rather than + // "CreateOrRecycle"? + RefPtr<WebRenderAPZAnimationData> animationData = + aData->GetManager() + ->CommandBuilder() + .CreateOrRecycleWebRenderUserData<WebRenderAPZAnimationData>( + this); + MOZ_ASSERT(animationData); + aLayerData->SetStickyPositionAnimationId(animationData->GetAnimationId()); } } // Return true if either there is a dynamic toolbar affecting this sticky