Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 33949082ab255880a03914cc24250decbed7f511
https://github.com/WebKit/WebKit/commit/33949082ab255880a03914cc24250decbed7f511
Author: Simon Fraser <[email protected]>
Date: 2026-02-11 (Wed, 11 Feb 2026)
Changed paths:
M LayoutTests/TestExpectations
M Source/WebCore/page/LocalFrameView.cpp
M Source/WebCore/page/scrolling/ScrollAnchoringController.cpp
Log Message:
-----------
[Scroll anchoring] Implement the priority candidate algorithm
https://bugs.webkit.org/show_bug.cgi?id=307520
rdar://170116064
Reviewed by Alan Baradlay.
Do a simple implementation of "priority candidates"[1] for scroll anchoring,
which currently
looks for the focused element.
This revealed an issue where, when
`ScrollAnchoringController::updateBeforeLayout()` runs for
interleaved layouts, we could hit a `inStyleRecalc()` assertion. Fix by
checking `isInStyleInterleavedLayout()`
before calling `updateScrollAnchoringBeforeLayoutForScrollableAreas()`.
This fixes `editing/execCommand/insert-line-break-no-scroll.html` and
`css/css-scroll-anchoring/contenteditable-near-cursor.tentative.html`.
Some testing showed that
`css/css-anchor-position/position-area-scrolling-004.tentative.html` is failing,
tracked by webkit.org/b/307519.
[1] https://drafts.csswg.org/css-scroll-anchoring/#anchor-priority-candidates
* LayoutTests/TestExpectations:
* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::willDoLayout):
* Source/WebCore/page/scrolling/ScrollAnchoringController.cpp:
(WebCore::priorityCandidateForElement):
(WebCore::ScrollAnchoringController::findPriorityCandidate):
Canonical link: https://commits.webkit.org/307289@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications