Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0155b492695bf89b082d19f991ebbe6e642c83f2
https://github.com/WebKit/WebKit/commit/0155b492695bf89b082d19f991ebbe6e642c83f2
Author: Simon Fraser <[email protected]>
Date: 2026-03-07 (Sat, 07 Mar 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/anchor-updates-after-explicit-scroll-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/clipped-scrollers-skipped-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/device-pixel-adjustment-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/history-restore-anchors-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/opt-out-expected.txt
M
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/start-edge-in-block-layout-direction-expected.txt
M LayoutTests/platform/ios/TestExpectations
M Source/WebCore/page/scrolling/ScrollAnchoringController.cpp
M Source/WebCore/page/scrolling/ScrollAnchoringController.h
Log Message:
-----------
[Scroll anchoring] Fix anchoring in different writing modes
https://bugs.webkit.org/show_bug.cgi?id=309422
rdar://171988494
Reviewed by Alan Baradlay.
Scroll anchoring anchors in the block progression direction only, and anchors
using the block start edge of the
anchor relative to the block start edge of the scrolled content. So fix
`ScrollAnchoringController::computeOffsetFromOwningScroller()` to compute using
the appropriate corners.
We have to fix the "has the scroller scrolled away from zero" using scroll
positions, and consulting the
appropriate axis, and ensure that we only adjust in the block progression axis.
This primarily fixes
`css/css-scroll-anchoring/start-edge-in-block-layout-direction.html`. Clean up
some
other expectations based on the current behavior.
[1] https://drafts.csswg.org/css-scroll-anchoring/#scroll-adjustment
* LayoutTests/TestExpectations:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/anchor-updates-after-explicit-scroll-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/clipped-scrollers-skipped-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/device-pixel-adjustment-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/history-restore-anchors-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/opt-out-expected.txt:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/start-edge-in-block-layout-direction-expected.txt:
* LayoutTests/platform/ios/TestExpectations:
* Source/WebCore/page/scrolling/ScrollAnchoringController.cpp:
(WebCore::hasScrolledFromOriginInBlockDirection):
(WebCore::constrainedToBlockDirection):
(WebCore::inlineAndBlockStartCorner):
(WebCore::ScrollAnchoringController::shouldMaintainScrollAnchor const):
(WebCore::ScrollAnchoringController::computeScrollerRelativeRects const):
(WebCore::ScrollAnchoringController::computeOffsetFromOwningScroller const):
(WebCore::ScrollAnchoringController::chooseAnchorElement):
(WebCore::ScrollAnchoringController::updateBeforeLayout):
(WebCore::ScrollAnchoringController::adjustScrollPositionForAnchoring):
* Source/WebCore/page/scrolling/ScrollAnchoringController.h:
Canonical link: https://commits.webkit.org/308878@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications