Skip to content

[Scroll anchoring] Enable in stable - #58575

Merged
webkit-commit-queue merged 1 commit into
WebKit:mainfrom
smfr:eng/Scroll-anchoring-Enable-in-stable
Feb 13, 2026
Merged

webkit-commit-queue merged 1 commit into
WebKit:mainfrom
smfr:eng/Scroll-anchoring-Enable-in-stable

Conversation

@smfr

@smfr smfr commented Feb 13, 2026 •

Copy link
Copy Markdown
Contributor

@smfr smfr self-assigned this Feb 13, 2026
@smfr smfr added the Scrolling Bugs related to main thread and off-main thread scrolling label Feb 13, 2026
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Feb 13, 2026
@smfr smfr added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels Feb 13, 2026
https://bugs.webkit.org/show_bug.cgi?id=307734
rdar://170279026

Reviewed by Tim Nguyen and Abrar Rahman Protyasha.

Enable scroll anchoring in stable.

* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:

Canonical link: https://commits.webkit.org/307475@main
@webkit-commit-queue
webkit-commit-queue force-pushed the eng/Scroll-anchoring-Enable-in-stable branch from 17ce670 to c4baf2d Compare February 13, 2026 15:52
@webkit-commit-queue

Copy link
Copy Markdown
Collaborator

Committed 307475@main (c4baf2d): https://commits.webkit.org/307475@main

Reviewed commits have been landed. Closing PR #58575 and removing active labels.

@webkit-commit-queue
webkit-commit-queue merged commit c4baf2d into WebKit:main Feb 13, 2026
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Feb 13, 2026
krassowski added a commit to jupyterlab/jupyterlab that referenced this pull request Mar 6, 2026
…ull` windowing mode (#18522)

## References

- Includes #18504
- Fixes #18470
- Closes #18511
- Closes #18468

Quotes below are @jasongrout's description copied from #18504

> This is a follow up to
#18503, which this PR
includes. After #18503, the viewport does not shift based on changes
happening outside the viewport, but the active cell can still shift when
content inside the viewport changes. This PR resolves this issue.
>
> Addresses
#18468 (comment)


## Code changes

- drop the custom scrollback implementation for windowing modes other
than `full` in favor of native scroll anchoring with better behaviour
implemented as:
> Make active cells (or descendants thereof) the only elements able to
be scroll anchors in the notebook. This means that the browser will not
anchor the scroll to an element inside an inactive cell.
- increase the timeout used to deactivate the scrollback (acting the
same as anchor but in `full` windowing mode) to 3 seconds without
motion; we could probably make it infinite but I am not confident enough
with the implementation to do so yet; 3 seconds appears to be a
reasonable threshold
- resolve the promise returned by `scrollToItem` method as soon as
scrolling end, not when the timeout used for scrollback method of `full`
windowing mode expires
- separate the test for anchoring from the test of scrolling cell we
advanced to into view; previously a single test was testing both
behaviours in a way which was hard to wrap one's head around
- improve the reliability of the `positionCellPartiallyBelowViewport`
utility which lead to flaky test due to imprecision of mouse wheel
operations

## User-facing changes

The active cell will be kept in view more reliably, using
browser-platform native solution rather than workarounds, fixing some
edge cases with scrolling.

> In Chrome-based browsers or Firefox, the active cell should not be
shifted up or down by other cells changing their size or gaining new
output. [...]
>
> Before:
>
>
https://github.com/user-attachments/assets/67c94546-b131-498c-8b0d-891bfd81cdb8
>
> After:
> 
>
https://github.com/user-attachments/assets/297e2dff-8190-4c77-8751-869fac6b9892
>
> Note that the browser decides that when you are scrolled all the way
to the very top, you should stay at the top. The moment you scroll just
a bit down, the active cell is then anchored in the viewport.

Safari users won't see the benefit until they upgrade to a future
version which enables support for `overflow-anchor`. This was recently
enabled in Safari Technology Preview v238:
- WebKit/WebKit#58575
-
https://developer.apple.com/documentation/safari-technology-preview-release-notes/stp-release-238
- https://caniuse.com/?search=overflow-anchor
- The earliest non-TP Safari version that could support
`overflow-anchor` would likely be 26.5, TBC

## Backwards-incompatible changes

None

## AI usage

No

---------

Co-authored-by: Jason Grout <[email protected]>
@smfr
smfr deleted the eng/Scroll-anchoring-Enable-in-stable branch November 18, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scrolling Bugs related to main thread and off-main thread scrolling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants