WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
309429
[Scroll anchoring] css/css-scroll-anchoring/position-change-heuristic.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=309429
Summary
[Scroll anchoring] css/css-scroll-anchoring/position-change-heuristic.html is...
Simon Fraser (smfr)
Reported
2026-03-07 17:15:11 PST
css/css-scroll-anchoring/position-change-heuristic.html often fails with: FAIL Position changes in document scroller. assert_equals: expected 225 but got 200 when running: runCase from fixed to absolute - expectSuppression false
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-03-07 17:15:17 PST
<
rdar://problem/171998007
>
Simon Fraser (smfr)
Comment 2
2026-03-07 17:17:25 PST
This happens because the scroll anchoring logic runs in the middle of `updateScrollbars` in response to a content size change: ``` frame #0: 0x000000030757b750 WebCore`WebCore::ScrollView::setScrollOffset(this=0x000000013e2c0800, offset={ x = 0, y = 225 }) at ScrollView.cpp:457:30 frame #1: 0x00000003001ad9f8 WebCore`WebCore::ScrollableArea::scrollPositionChanged(this=0x000000013e2c0800, position={ x = 0, y = 225 }) at ScrollableArea.cpp:233:5 frame #2: 0x0000000307581804 WebCore`WebCore::ScrollableArea::notifyScrollPositionChanged(this=0x000000013e2c0800, position={ x = 0, y = 225 }) at ScrollableArea.cpp:225:5 frame #3: 0x00000003073ff0fc WebCore`WebCore::AsyncScrollingCoordinator::reconcileScrollingState(this=0x0000000118208220, frameView=0x000000013e2c0800, scrollPosition={ x = 0.0, y = 225.0 }, layoutViewportOriginOrOverrideRect=0x000000016ae8b8c0, scrollType=Programmatic, viewportRectStability=Stable, scrollingLayerPositionAction=Set) at AsyncScrollingCoordinator.cpp:879:15 frame #4: 0x00000003073fe46c WebCore`WebCore::AsyncScrollingCoordinator::updateScrollPositionAfterAsyncScroll(this=0x0000000118208220, nodeID=WebCore::ScrollingNodeID @ 0x000000016ae8b988, scrollPosition={ x = 0.0, y = 225.0 }, layoutViewportOrigin= Has Value=false , updateLayerPositionAction=Set, scrollType=Programmatic, viewportRectStability=Stable) at AsyncScrollingCoordinator.cpp:842:9 frame #5: 0x00000003073fd924 WebCore`WebCore::AsyncScrollingCoordinator::applyScrollPositionUpdate(this=0x0000000118208220, update=0x000000016ae8bc90, scrollType=Programmatic, viewportStability=Stable) at AsyncScrollingCoordinator.cpp:707:13 frame #6: 0x00000003073fe0f4 WebCore`WebCore::AsyncScrollingCoordinator::applyScrollUpdate(this=0x0000000118208220, update=0x000000016ae8bc90, scrollType=Programmatic, viewportStability=Stable) at AsyncScrollingCoordinator.cpp:696:5 frame #7: 0x00000003073fbc88 WebCore`WebCore::AsyncScrollingCoordinator::requestScrollToPosition(this=0x0000000118208220, scrollableArea=0x000000013e2c0800, scrollPosition={ x = 0, y = 225 }, options=0x000000016ae8bfec) at AsyncScrollingCoordinator.cpp:413:9 frame #8: 0x0000000307172528 WebCore`WebCore::LocalFrameView::requestScrollToPosition(this=0x000000013e2c0800, position={ x = 0, y = 225 }, options=0x000000016ae8bfec) at LocalFrameView.cpp:3894:38 frame #9: 0x00000003074077b0 WebCore`WebCore::ScrollAnchoringController::adjustScrollPositionForAnchoring(this=0x00000001181cc180) at ScrollAnchoringController.cpp:659:34 frame #10: 0x0000000307581ca0 WebCore`WebCore::ScrollableArea::adjustScrollAnchoringPosition(this=0x000000013e2c0800) at ScrollableArea.cpp:305:21 frame #11: 0x0000000307176550 WebCore`WebCore::LocalFrameView::adjustScrollAnchoringPositionForScrollableAreas(this=0x000000013e2c0800) at LocalFrameView.cpp:4788:24 frame #12: 0x0000000307175b4c WebCore`WebCore::LocalFrameView::performPostLayoutTasks(this=0x000000013e2c0800) at LocalFrameView.cpp:4725:5 frame #13: 0x0000000307182a48 WebCore`WebCore::LocalFrameViewLayoutContext::runPostLayoutTasks(this=0x000000013e2c0970) at LocalFrameViewLayoutContext.cpp:332:22 frame #14: 0x0000000307184698 WebCore`WebCore::LocalFrameViewLayoutContext::runOrScheduleAsynchronousTasks(this=0x000000013e2c0970, canDeferUpdateLayerPositions=false) at LocalFrameViewLayoutContext.cpp:318:5 frame #15: 0x0000000307183bb8 WebCore`WebCore::LocalFrameViewLayoutContext::performLayout(this=0x000000013e2c0970, canDeferUpdateLayerPositions=false) at LocalFrameViewLayoutContext.cpp:294:9 frame #16: 0x0000000307155fb4 WebCore`WebCore::LocalFrameViewLayoutContext::layout(this=0x000000013e2c0970, canDeferUpdateLayerPositions=false) at LocalFrameViewLayoutContext.cpp:158:5 frame #17: 0x0000000307172c7c WebCore`WebCore::LocalFrameView::updateContentsSize(this=0x000000013e2c0800) at LocalFrameView.cpp:3995:25 * frame #18: 0x00000003000ef9a4 WebCore`WebCore::ScrollView::updateScrollbars(this=0x000000013e2c0800, desiredPosition={ x = 0, y = 200 }) at ScrollView.cpp:733:13 frame #19: 0x00000003000704ec WebCore`WebCore::ScrollView::setContentsSize(this=0x000000013e2c0800, newSize={ width = 793, height = 4016 }) at ScrollView.cpp:412:9 frame #20: 0x000000030715ce68 WebCore`WebCore::LocalFrameView::setContentsSize(this=0x000000013e2c0800, size={ width = 793, height = 4016 }) at LocalFrameView.cpp:550:17 frame #21: 0x0000000307152acc WebCore`WebCore::LocalFrameView::adjustViewSize(this=0x000000013e2c0800) at LocalFrameView.cpp:586:5 frame #22: 0x0000000307183a34 WebCore`WebCore::LocalFrameViewLayoutContext::performLayout(this=0x000000013e2c0970, canDeferUpdateLayerPositions=false) at LocalFrameViewLayoutContext.cpp:281:30 frame #23: 0x0000000307155fb4 WebCore`WebCore::LocalFrameViewLayoutContext::layout(this=0x000000013e2c0970, canDeferUpdateLayerPositions=false) at LocalFrameViewLayoutContext.cpp:158:5 frame #24: 0x0000000305d83138 WebCore`WebCore::Document::updateLayout(this={ origin = , url = , inMainFrame = Detached, backForwardCacheState = NotInBackForwardCache }, layoutOptions={ size = 3 }, context=0x00000001182f80e0) at Document.cpp:3168:32 frame #25: 0x0000000305d7f05c WebCore`WebCore::Document::updateLayoutIgnorePendingStylesheets(this={ origin = , url = , inMainFrame = Detached, backForwardCacheState = NotInBackForwardCache }, layoutOptions={ size = 3 }, context=0x00000001182f80e0) at Document.cpp:3049:12 frame #26: 0x0000000305ef6d70 WebCore`WebCore::Element::scrollTop(this=0x00000001182f80e0) at Element.cpp:1707:15 frame #27: 0x0000000301896210 WebCore`WebCore::jsElement_scrollTopGetter(lexicalGlobalObject=0x000000013ec20088, thisObject=0x000000011838ddc8) at JSElement.cpp:3231:89 ``` but ScrollView::updateScrollbars stores the current scroll position in `desiredPosition` so clobbers the scroll position computed for anchoring.
Simon Fraser (smfr)
Comment 3
2026-03-07 20:15:53 PST
Pull request:
https://github.com/WebKit/WebKit/pull/60144
EWS
Comment 4
2026-03-09 09:58:20 PDT
Committed
308920@main
(96c4a7386d59): <
https://commits.webkit.org/308920@main
> Reviewed commits have been landed. Closing PR #60144 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug