Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 6d6bfe8ade28a46afc810aa91dd5f0b48562446b
      
https://github.com/WebKit/WebKit/commit/6d6bfe8ade28a46afc810aa91dd5f0b48562446b
  Author: Rupin Mittal <[email protected]>
  Date:   2026-03-18 (Wed, 18 Mar 2026)

  Changed paths:
    M Source/WebCore/loader/HistoryController.cpp
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    M Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
    A Tools/TestWebKitAPI/Tests/WebKitCocoa/NavigationAPI.mm
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm

  Log Message:
  -----------
  [Navigation API] navigation.currentEntry.key doesn't change in private windows
https://bugs.webkit.org/show_bug.cgi?id=308115
rdar://171147417

Reviewed by Basuke Suzuki.

When history.pushState() is called, we call HistoryController::pushState(),
which updates the current entry held by the Navigation object by calling
Navigation::updateForNavigation().

For private windows, pushState returns early before calling updateForNavigation
because canRecordHistoryForFrame() returns false. Private windows use an 
ephemeral
data store and set allowPrivacySensitiveOperationsInNonPersistentDataStores to 
false.

To ensure that updateForNavigation() is called and the current entry is updated,
we now call updateForNavigation() before canRecordHistoryForFrame().

This is tested by a new API test:
TEST(NavigationAPI, 
PushStateUpdatesCurrentEntryKeyWithoutAllowPrivacySensitiveOperationsInNonPersistentDataStores)

* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::pushState):
* Tools/TestWebKitAPI/SourcesCocoa.txt:
* Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/NavigationAPI.mm: Added.
(TestWebKitAPI::TEST(NavigationAPI, 
PushStateUpdatesCurrentEntryKeyWithoutAllowPrivacySensitiveOperationsInNonPersistentDataStores)):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/PasteHTML.mm:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/SiteIsolationUtilities.mm:

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



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

Reply via email to