Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Back button needs to be pressed twice to go back on https://www.livei…
…lpalazzoapartments.com https://bugs.webkit.org/show_bug.cgi?id=260682 rdar://113772385 Reviewed by Brent Fulgham. WebKit normally ignores history entries added by the JavaScript without user interaction when navigating back or forward. Here, the site is adding a history entry using `history.pushState()`, without user interaction but it was incorrectly not getting ignored when navigating back. The reason for this is that they are calling `history.pushState()` from a subframe. Navigations in subframes still create a top-level back/forward list item. However, we had a bug in HistoryController::pushState() where we would set the `wasCreatedByJSWithoutUserInteraction` flag on m_currentItem instead of topItem. topItem and m_currentItem are the same when `history.pushState()` gets called on the main frame but not in this case. * Source/WebCore/loader/HistoryController.cpp: (WebCore::FrameLoader::HistoryController::pushState): * Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm: (TEST): Canonical link: https://commits.webkit.org/267287@main
- Loading branch information