[webkit-changes] [WebKit/WebKit] 686240: Replace unique frame names with frame identifiers ...

Charlie Wolfe noreply at github.com
Fri May 10 14:22:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 686240cb98d8182dc675f6a2aac9abd2704984ec
      https://github.com/WebKit/WebKit/commit/686240cb98d8182dc675f6a2aac9abd2704984ec
  Author: Charlie Wolfe <charliew at apple.com>
  Date:   2024-05-10 (Fri, 10 May 2024)

  Changed paths:
    M Source/WebCore/history/HistoryItem.cpp
    M Source/WebCore/history/HistoryItem.h
    M Source/WebCore/loader/HistoryController.cpp
    M Source/WebCore/page/FrameTree.cpp
    M Source/WebCore/page/FrameTree.h
    M Source/WebCore/testing/Internals.cpp
    M Source/WebKit/Shared/SessionState.h
    M Source/WebKit/Shared/SessionState.serialization.in
    M Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp
    M Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm

  Log Message:
  -----------
  Replace unique frame names with frame identifiers in the history controller
https://bugs.webkit.org/show_bug.cgi?id=273995
rdar://127870100

Reviewed by Alex Christensen.

With site isolation, unique frame names should not be used to identify frames. This patch replaces most
of their usage in the history controller with frame identifiers. We cannot remove unique frame names from
`HistoryItem` because logic in `FrameLoader::loadURLIntoChildFrame` requires us to match current frames
with frames from a previous page. Unique frame names are also still used from session state and history
test output.

This also fixes a bug introduced by 277393 at main, where shifting frames after a navigation could cause
the back/forward list to target an incorrect frame.

* Source/WebCore/history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::addChildItem):
(WebCore::HistoryItem::childItemWithFrameID):
* Source/WebCore/history/HistoryItem.h:
(WebCore::HistoryItem::frameID const):
(WebCore::HistoryItem::setFrameID):
* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::initializeItem):
(WebCore::HistoryController::recursiveSetProvisionalItem):
(WebCore::HistoryController::recursiveGoToItem):
* Source/WebCore/page/FrameTree.cpp:
(WebCore::FrameTree::childByFrameID const):
(WebCore::FrameTree::childByUniqueName const): Deleted.
* Source/WebCore/page/FrameTree.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::Internals::formControlStateOfPreviousHistoryItem):
(WebCore::Internals::setFormControlStateOfPreviousHistoryItem):
* Source/WebKit/Shared/SessionState.h:
* Source/WebKit/Shared/SessionState.serialization.in:
* Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toFrameState):
(WebKit::applyFrameState):
* Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm:
(TEST(WKBackForwardList, BackForwardListRemoveAndAddSubframes)):

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



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


More information about the webkit-changes mailing list