[webkit-changes] [WebKit/WebKit] 91c8c8: Cherry-pick 252432.826 at safari-7614-branch (baca9af...

Chris Dumez noreply at github.com
Tue Jan 24 16:54:03 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 91c8c8744db1506c01a913220608cc3d33a75a09
      https://github.com/WebKit/WebKit/commit/91c8c8744db1506c01a913220608cc3d33a75a09
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-01-24 (Tue, 24 Jan 2023)

  Changed paths:
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/HistoryController.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm

  Log Message:
  -----------
  Cherry-pick 252432.826 at safari-7614-branch (baca9afc289e). rdar://104600755

    Properly mark history items added without user gesture
    https://bugs.webkit.org/show_bug.cgi?id=247909
    rdar://100579077

    Reviewed by Geoffrey Garen.

    We recently introduced logic to mark history items as "created by JavaScript
    without a user gesture" so that those could be skipped when the user navigates
    back/forward via the browser UI.

    However, which history items we marked with such flag was a little unexpected
    and didn't quite match what Chrome did to address the same problem.

    In particular, if on URL1 and then calling `pushState(null, null, 'a')` in JS
    without a user gesture. We would previously mark the HistoryItem for URL1 as
    created without a user gesture, instead of marking the one for URL1#a. URL1#a
    is the actual HistoryItem created by JS so it makes more sense to mark this
    one (which also matches Chrome's behavior).

    * Source/WebCore/loader/FrameLoader.cpp:
    (WebCore::FrameLoader::loadInSameDocument):
    * Source/WebCore/loader/HistoryController.cpp:
    (WebCore::FrameLoader::HistoryController::pushState):
    * Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardList.mm:
    (TEST):

    Canonical link: https://commits.webkit.org/252432.826@safari-7614-branch

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




More information about the webkit-changes mailing list