Closed Bug 1546057 Opened 7 months ago Closed 7 months ago

Don't snap back if scrollTo (or APZC) tries to scroll to positions where the positions are out of scrollable area and if snapping target elements covers the snapport

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla68
Tracking Status
firefox68 --- fixed

People

(Reporter: hiro, Assigned: hiro)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

Attached file scroll-snap-type.html

Steps to reproduce

  1. Open the attaching file
  2. Open the devtools console
  3. Run scroller.scrollTo(0, 1400)

1400px is actually out of the boundary of the scroller element, the bottom edge is actually 1300px, but you will see the scroller element snaps to 1000px instead.

This is also one of the causes of the example in bug 1531589 comment 2.

Interestingly, Chrome has the same issue. :)

https://treeherder.mozilla.org/#/jobs?repo=try&revision=951a0dc97c8021f7c099543b783b79464e4c8f2c

Note that I guess this will also fix the weird bound back effect reported in bug 1545316 comment 0.

Pushed by hikezoe@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/eda47278259f
Use the clamped destination position for overflow checks. r=botond
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16538 for changes under testing/web-platform/tests
You need to log in before you can comment on or make changes to this bug.