[webkit-changes] [WebKit/WebKit] cbf0c9: `history.scrollRestoration = 'manual'` should not ...

Chris Dumez noreply at github.com
Tue Dec 12 22:18:55 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: cbf0c91dd0ee88be69b552f4b18bbb148ce55013
      https://github.com/WebKit/WebKit/commit/cbf0c91dd0ee88be69b552f4b18bbb148ce55013
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-12-12 (Tue, 12 Dec 2023)

  Changed paths:
    A LayoutTests/fast/scrolling/resources/test-page-with-anchor.html
    A LayoutTests/fast/scrolling/scroll-restoration-manual-initial-load-expected.txt
    A LayoutTests/fast/scrolling/scroll-restoration-manual-initial-load.html
    M Source/WebCore/loader/FrameLoader.cpp

  Log Message:
  -----------
  `history.scrollRestoration = 'manual'` should not prevent scrolling when navigating to a fragment URL
https://bugs.webkit.org/show_bug.cgi?id=266299
rdar://108846524

Reviewed by Darin Adler and Simon Fraser.

When navigating to a fragment URL, `history.scrollRestoration = 'manual'` should only
prevent automatic scrolling to the fragment is the navigation is a history navigation.

Previously, we mistakenly applied to logic to any navigation type.

* LayoutTests/fast/scrolling/resources/test-page-with-anchor.html: Added.
* LayoutTests/fast/scrolling/scroll-restoration-manual-initial-load.html: Added.
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadInSameDocument):
(WebCore::FrameLoader::scrollToFragmentWithParentBoundary):
(WebCore::itemAllowsScrollRestoration): Deleted.
(WebCore::isSameDocumentReload): Deleted.
* Source/WebCore/loader/FrameLoader.h:

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




More information about the webkit-changes mailing list