[webkit-changes] [WebKit/WebKit] 4ef4b6: Ignore the “title” argument to history.pushState()...

sideshowbarker noreply at github.com
Mon Jan 29 05:03:52 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 4ef4b65d33f45734ad3c6cbc7f2fe0dda17051bc
      https://github.com/WebKit/WebKit/commit/4ef4b65d33f45734ad3c6cbc7f2fe0dda17051bc
  Author: Michael[tm] Smith <mike at w3.org>
  Date:   2024-01-29 (Mon, 29 Jan 2024)

  Changed paths:
    M LayoutTests/loader/stateobjects/pushstate-size-expected.txt
    M LayoutTests/loader/stateobjects/pushstate-size-iframe-expected.txt
    M Source/WebCore/history/HistoryItem.cpp
    M Source/WebCore/history/HistoryItem.h
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebCore/loader/HistoryController.cpp
    M Source/WebCore/loader/HistoryController.h
    M Source/WebCore/page/History.cpp
    M Source/WebCore/page/History.h
    M Source/WebCore/page/History.idl
    M Source/WebKit/Shared/WebBackForwardListItem.h
    M Source/WebKit/UIProcess/API/C/WKBackForwardListItemRef.cpp
    M Source/WebKit/UIProcess/API/C/WKBackForwardListItemRef.h
    M Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItem.h
    M Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItem.mm
    M Source/WebKit/UIProcess/API/glib/WebKitBackForwardListItem.cpp
    M Source/WebKit/UIProcess/API/glib/WebKitBackForwardListItem.h.in
    M Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp
    M Source/WebKitLegacy/mac/History/HistoryPropertyList.mm
    M Source/WebKitLegacy/mac/History/WebHistory.mm
    M Source/WebKitLegacy/mac/History/WebHistoryItem.mm
    M Source/WebKitLegacy/mac/History/WebHistoryItemInternal.h
    M Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
    M Tools/MiniBrowser/gtk/BrowserWindow.c
    M Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm
    M Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp

  Log Message:
  -----------
  Ignore the “title” argument to history.pushState()/history.replaceState()
https://bugs.webkit.org/show_bug.cgi?id=223190

Reviewed by Chris Dumez and Michael Catanzaro.

This change causes WebKit to ignore the second argument to history.pushState()
and history.replaceState(), making WebKit consistent with the current behavior
in Gecko and Blink, and consistent with the current spec.

That argument previously set the title for the history item, but in
https://github.com/whatwg/html/pull/6482 was removed from the spec –
which now at https://html.spec.whatwg.org/#the-history-interface:dom-history-pushstate
defines the argument as “unused”, and specifies no processing
requirements for it.

Otherwise, without this change, the WebKit behavior is inconsistent with
the current behavior in Gecko and Blink, and inconsistent with the
current requirements defined in the spec.

Note that this change also reverts https://commits.webkit.org/259367@main —
because, since the title is being removed from history items, and no
longer used, there’s no longer any need to truncate it, nor any need for
the associated test.

* LayoutTests/loader/stateobjects/pushstate-size-expected.txt:
* LayoutTests/loader/stateobjects/pushstate-size-iframe-expected.txt:
* Source/WebCore/history/HistoryItem.cpp:
(WebCore::HistoryItem::HistoryItem):
(WebCore::HistoryItem::reset):
(WebCore::HistoryItem::title const): Deleted.
(WebCore::HistoryItem::alternateTitle const): Deleted.
(WebCore::HistoryItem::setAlternateTitle): Deleted.
(WebCore::HistoryItem::setTitle): Deleted.
* Source/WebCore/history/HistoryItem.h:
(WebCore::HistoryItem::create):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::didChangeTitle):
* Source/WebCore/loader/HistoryController.cpp:
(WebCore::HistoryController::initializeItem):
(WebCore::HistoryController::pushState):
(WebCore::HistoryController::replaceState):
(WebCore::HistoryController::setCurrentItemTitle): Deleted.
* Source/WebCore/loader/HistoryController.h:
* Source/WebCore/page/History.cpp:
(WebCore::History::stateObjectAdded):
* Source/WebCore/page/History.h:
(WebCore::History::pushState):
(WebCore::History::replaceState):
* Source/WebCore/page/History.idl:
* Source/WebKit/Shared/WebBackForwardListItem.h:
(WebKit::WebBackForwardListItem::url const):
(WebKit::WebBackForwardListItem::title const): Deleted.
* Source/WebKit/UIProcess/API/C/WKBackForwardListItemRef.cpp:
(WKBackForwardListItemCopyTitle):
* Source/WebKit/UIProcess/API/C/WKBackForwardListItemRef.h:
* Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItem.h:
* Source/WebKit/UIProcess/API/Cocoa/WKBackForwardListItem.mm:
(-[WKBackForwardListItem title]):
* Source/WebKit/UIProcess/API/glib/WebKitBackForwardListItem.cpp:
(webkit_back_forward_list_item_get_title):
* Source/WebKit/UIProcess/API/glib/WebKitBackForwardListItem.h.in:
* Source/WebKit/WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toBackForwardListItemState):
(WebKit::applyFrameState):
(WebKit::toHistoryItem):
* Source/WebKitLegacy/mac/History/HistoryPropertyList.mm:
(HistoryPropertyListWriter::writeHistoryItem):
* Source/WebKitLegacy/mac/History/WebHistory.mm:
(-[WebHistoryPrivate visitedURL:withTitle:]):
* Source/WebKitLegacy/mac/History/WebHistoryItem.mm:
(-[WebHistoryItem initWithURLString:title:lastVisitedTimeInterval:]):
(-[WebHistoryItem initWithURLString:title:displayTitle:lastVisitedTimeInterval:]):
(-[WebHistoryItem _visited]):
(-[WebHistoryItem title]): Deleted.
(-[WebHistoryItem setAlternateTitle:]): Deleted.
(-[WebHistoryItem alternateTitle]): Deleted.
(-[WebHistoryItem setTitle:]): Deleted.
(-[WebHistoryItem _visitedWithTitle:]): Deleted.
* Source/WebKitLegacy/mac/History/WebHistoryItemInternal.h:
* Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::setTitle):
* Tools/MiniBrowser/gtk/BrowserWindow.c:
(browserWindowCreateBackForwardMenu):
* Tools/TestWebKitAPI/Tests/WebKit/WKBackForwardListTests.mm:
(TEST):
* Tools/TestWebKitAPI/Tests/WebKitGLib/TestBackForwardList.cpp:
(testBackForwardListNavigation):
(testWebKitWebViewSessionState):

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




More information about the webkit-changes mailing list