Closed Bug 2038478 Opened 4 months ago Closed 4 months ago

Update the new snap target ids properly even if the destination is unchanged in SmoothScrollTo

Categories

(Core :: Panning and Zooming, defect, P2)

defect

Tracking

()

RESOLVED FIXED
152 Branch
Tracking Status
firefox152 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

Details

Attachments

(1 file)

The code in question is:

https://searchfox.org/firefox-main/rev/574d441bd2fdc78f8487aa317ea2f56aad28621f/gfx/layers/apz/src/AsyncPanZoomController.cpp#4270-4272

if (ConvertDestinationToDelta(aDestination.mPosition) == ParentLayerPoint()) {
  return;
}

If we have valid snap target ids, we need to use them for the next re-snapping opportunity.

This bug is one of the causes of test failures caused by D294084.

Blocks: 2038480

When the destination passed to SmoothScrollTo is at the current scroll
position, the function returns early to avoid triggering a spurious
scrollend event. However, this also skips updating mLastSnapTargetIds,
so the snap target identifiers reported by the next CSSScrollSnapEvent
can be stale even though we just resolved to a snap target.

Move the destination's target IDs into mLastSnapTargetIds before the
early return so snap target tracking remains correct regardless of
whether the snap actually produces motion.

Assignee: nobody → hikezoe.birchill
Attachment #9584870 - Attachment description: WIP: Bug 2038478 - Update mLastSnapTargetIds when SmoothScrollTo exits early without scrolling. r?botond → Bug 2038478 - Update mLastSnapTargetIds when SmoothScrollTo exits early without scrolling. r?botond
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P2
Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 152 Branch
QA Whiteboard: [qa-triage-done-c153/b152]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: