Closed Bug 1780701 Opened 2 years ago Closed 2 years ago

Double tap triggers scroll snap on zoomed document

Categories

(Core :: Layout: Scrolling and Overflow, defect, P3)

defect

Tracking

()

VERIFIED FIXED
105 Branch
Tracking Status
firefox105 --- verified

People

(Reporter: hiro, Assigned: hiro)

References

(Blocks 1 open bug, Regressed 1 open bug)

Details

Attachments

(3 files)

STR;

  1. Open the attachment
  2. Zoom in the content
  3. Scroll down a bit to see the green box
  4. Double tap

Double tap results scrolling to (0, 0) position on my Mac.

The snap is triggered by this nsIScrollableFrame::ScrollSnap() call in nsIFrame::HandleRelease, the comment for the call explains it's for autoscrolling. I don't quite understand why it gets called on double tap.

CCing Timothy, he might know something why nsIFrame::HandleRelease gets called or he might have seen similar things.

Phew, it turned out this problem has been there before re-snapping feature.

Blocks: css-scroll-snap
No longer blocks: 1530253

I am suspecting the root cause of this bug is bug 1665932.

See Also: → 1665932

Šime, I just saw your comment in bug 1779909 comment 20, if the issue happens only with scroll-behavior: smooth, it's pretty likely to be the same root cause of bug 1665932.

And I just figured out a way to fix it specific to scroll-snap. Here is a build with the fix. Mind trying to see whether the issue you are seeing is fixed or not? Thanks

https://treeherder.mozilla.org/jobs?repo=try&revision=02d917f5c32c8cfa556397553f4f0d2aa81457e0&selectedTaskRun=R82HjquRSLKZRztomrvoaQ.0

Flags: needinfo?(sime.vidas)

Unfortunately, the issue still occurs. I installed target.dmg from your link and performed the steps from https://bugzilla.mozilla.org/show_bug.cgi?id=1779909#c20.

Flags: needinfo?(sime.vidas)

mSnapTargets stores the ids for all candidate snap taget elements in this scroll
container. Before this change, we collect the ids when we snap or re-snap on the
main-thread. It's used to check whether the last snap target ids comming from
APZ are not stale or not. So if we haven't done any snapping or re-snapping on
the main-thread, we mis-consider all incoming last snap target ids are stale,
thus we fail to re-snap to the position where we snapped on APZ. This issue
had been wall-papered, will be revealed by the next change in this commit series
(we had been unnecessary snappings and re-snappings).

Assignee: nobody → hikezoe.birchill
Status: NEW → ASSIGNED

(In reply to Šime Vidas from comment #4)

Unfortunately, the issue still occurs. I installed target.dmg from your link and performed the steps from https://bugzilla.mozilla.org/show_bug.cgi?id=1779909#c20.

Thanks for testing. That's unfortunate.

I found another issue while I was trying to make a test for this bug pass locally, I guess it's unlikely related to the issue you are seeing, though.

Pushed by hikezoe.birchill@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/00746ffaaf58
Collect mSnapTargets even if ComputeScrollSnapInfo gets called for ScrollMetadata. r=botond
https://hg.mozilla.org/integration/autoland/rev/1d599dd89c5f
Skip returning the snap target if the snap position is same as the scroll destination. r=botond
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 105 Branch
QA Whiteboard: [qa-105b-p2]

Reproduced the initial issue using old Nightly from (2022-07-21) and the steps from comment 0. Verified that using latest Firefox 105.0 RC on macOS 11 this is no longer reproducible.

Status: RESOLVED → VERIFIED
Regressions: 1848917
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: