Closed Bug 1794328 Opened 2 years ago Closed 2 years ago

Honor general.smoothScroll pref on `GoToAnchor` etc.

Categories

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

Firefox 105
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: erwinm, Assigned: dlrobertson)

References

Details

Steps to reproduce:

I turn ui.prefersReducedMotion on (1) and general.smoothScroll off (false), because "smooth" and "ease" effects give me nasty migraines. Many

  1. Open about:preferences, search for scroll, turn smooth scroll and autoscroll off.

  2. Visit this site, mentioned in bug 279629: https://www.kryogenix.org/code/browser/smoothscroll

  3. Select any of the anchors on the page.

Actual results:

  1. Animated scrolling, pain.

Expected results:

  1. Instant jump.

Possibly regressed by bug 1010538, but the old versions just crash, without letting me test anything.

The Bugbug bot thinks this bug should belong to the 'Core::Panning and Zooming' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Panning and Zooming
Product: Firefox → Core

Just to follow up your post on Reddit, I'm not sure if anchor navigation is the only issue on Google Docs. I noticed that PgUp/PgDn also scrolls smoothly regardless of accessibility/scroll settings. Are you able to reproduce that too?

I've had trouble on other sites, but can't tell there.

Severity: -- → S3
Component: Panning and Zooming → Layout: Scrolling and Overflow
Priority: -- → P3
Summary: If users disable "smooth" scrolling, in-page anchors can now inflict "smooth" scrolling → Honer general.smoothScroll pref on `GoToAnchor` etc.
Summary: Honer general.smoothScroll pref on `GoToAnchor` etc. → Honor general.smoothScroll pref on `GoToAnchor` etc.

Becauseof the migraines, and the lack of an adequate workaround, I think S2 makes more sense than S3.

Discussed with APZ team:

  • Raising priority to P2
  • Added this to our upcoming stabilization sprint
  • When fixing, will see if the related bugs bug 1743045 and bug 1753565 can be fixed at the same time
Priority: P3 → P2
See Also: → 1743045, 1753565

Started looking into this, and I'm not sure how we'd address this for https://www.kryogenix.org/code/browser/smoothscroll. As seen in https://www.kryogenix.org/code/browser/smoothscroll/smoothscroll.js, the author manually implements the animated scroll. For bug 1743045, we can choose to perform an instant scrollIntoView, but here the author performs several instant scrolls to simulate a smooth scroll. Am I misunderstanding the purpose of this issue or misreading the intent of the example page?

It's possible that the bug title has become out of sync with the original issue that motivated the report.

In our discussion mentioned in comment 5, I was going by the bug title, which referenced GoToAnchor, our internal function used when navigating to an anchor link. It should be fairly straightforward to make sure that the scrolling performed in that function respects the general.smoothScroll preference if it doesn't already.

A page that simulates a smooth scroll with multiple instant scrolls in JS is a different matter. In that case, I don't think there's any mitigation we can deploy on the browser side; all we can do is suggest that our WebCompat team reach out to the page authors and encourage them to respect the prefers-reduced-motion media query (which can be checked from JS) when writing such effects.

Thanks for the explanation. GoToAnchor will call ScrollToShowRect, which should eventually call ScrollToShowRect, which was recently changed to honor general.smoothScroll with this change that was suggested by Hiro. Basic anchor link tests I've run locally do not trigger smooth scrolling, so I think this can be resolved as a duplicate of bug 1743045.

Though I do always wonder whether we should duplicate or not in such cases, in this specific case I'd rather keep this bug separate since GoToAnchor is a slightly different functionality. Anyway, thanks Dan, great work!

Assignee: nobody → drobertson
Status: UNCONFIRMED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Depends on: 1743045
See Also: 1743045
You need to log in before you can comment on or make changes to this bug.