Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7ac7ce74ec82f418137c38209dc2d314000dca47
      
https://github.com/WebKit/WebKit/commit/7ac7ce74ec82f418137c38209dc2d314000dca47
  Author: Simon Fraser <[email protected]>
  Date:   2026-07-07 (Tue, 07 Jul 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/scroll-padding-change-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/scroll-padding-change.html
    M Source/WebCore/page/scrolling/ScrollAnchoringController.cpp
    M Source/WebCore/page/scrolling/ScrollAnchoringController.h

  Log Message:
  -----------
  [Scroll anchoring] nfl.com scroll position jumps when hovering the top bar 
(changing scroll-padding)
https://bugs.webkit.org/show_bug.cgi?id=318756
rdar://180597852

Reviewed by Dan Glastonbury.

The scroll anchoring code re-used `computeScrollerRelativeRects()` for both 
anchor selection, and
scroll anchoring adjustment. However, only anchor selection should respect 
`scroll-padding`; this caused
an erroneous scroll anchoring adjustment on nfl.com when the page changes 
`scroll-padding` on the root
when the top bar is hovered.

Fix by passing in a flag to say whether `scroll-padding` should be respected; 
off for anchor adjustment,
and on for anchor selection.

Test: 
imported/w3c/web-platform-tests/css/css-scroll-anchoring/scroll-padding-change.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/scroll-padding-change-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-scroll-anchoring/scroll-padding-change.html:
 Added.
* Source/WebCore/page/scrolling/ScrollAnchoringController.cpp:
(WebCore::ScrollAnchoringController::computeScrollerRelativeRects const):
(WebCore::ScrollAnchoringController::computeOffsetFromOwningScroller const):
(WebCore::ScrollAnchoringController::examineAnchorCandidate const):
* Source/WebCore/page/scrolling/ScrollAnchoringController.h:

Canonical link: https://commits.webkit.org/316662@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to