Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b8c772853573b3ad3fe83cdb92b49bf72cdafea7
      
https://github.com/WebKit/WebKit/commit/b8c772853573b3ad3fe83cdb92b49bf72cdafea7
  Author: Brady Eidson <[email protected]>
  Date:   2026-05-19 (Tue, 19 May 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/C/WKBackForwardListRef.cpp
    M Source/WebKit/UIProcess/API/glib/WebKitBackForwardList.cpp
    M Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp
    M Source/WebKit/UIProcess/WebBackForwardList.cpp
    M Source/WebKit/UIProcess/WebBackForwardList.h
    M Source/WebKit/UIProcess/WebBackForwardList.swift
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKBackForwardListTests.mm

  Log Message:
  -----------
  backListCount()/forwardListCount() don't match the sizes of the backList() 
and forwardList() arrays
rdar://176640408
https://bugs.webkit.org/show_bug.cgi?id=315072

Reviewed by Chris Dumez.

This broke with the "Skip back/forward items at the API level" changes in 
311688@main and 311799@main

After those changes, the backList()/forwardList() would return arrays with 
skipped items, but the old
"get me the back/forward list count" APIs didn't do the skipping.

Some clients were mixing and matching those, and they were having a bad time.

This PR does some renaming for clarity, and makes the "count" methods just 
return the size of the
calculated array, ensuring the same calculations are used across the board.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKBackForwardListTests.mm

* Source/WebKit/UIProcess/API/C/WKBackForwardListRef.cpp:
(WKBackForwardListGetBackListCount):
(WKBackForwardListGetForwardListCount):
* Source/WebKit/UIProcess/API/glib/WebKitBackForwardList.cpp:
(webkit_back_forward_list_get_length):
(webkit_back_forward_list_get_back_list):
(webkit_back_forward_list_get_forward_list):
* Source/WebKit/UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::traverseHistoryInBrowsingContext):
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::rawBackListEntryCount const):
(WebKit::WebBackForwardList::rawForwardListEntryCount const):
(WebKit::WebBackForwardList::backListCountForAPI const):
(WebKit::WebBackForwardList::forwardListCountForAPI const):
(WebKit::WebBackForwardList::counts const):
(WebKit::WebBackForwardList::backList const):
(WebKit::WebBackForwardList::forwardList const):
(WebKit::WebBackForwardList::backListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardList::forwardListAsAPIArrayWithLimit const):
(WebKit::WebBackForwardListWrapper::backListCountForAPI const):
(WebKit::WebBackForwardListWrapper::forwardListCountForAPI const):
(WebKit::WebBackForwardListWrapper::backList const):
(WebKit::WebBackForwardListWrapper::forwardList const):
(WebKit::WebBackForwardList::backListCount const): Deleted.
(WebKit::WebBackForwardList::forwardListCount const): Deleted.
(WebKit::WebBackForwardListWrapper::backListCount const): Deleted.
(WebKit::WebBackForwardListWrapper::forwardListCount const): Deleted.
* Source/WebKit/UIProcess/WebBackForwardList.h:
* Source/WebKit/UIProcess/WebBackForwardList.swift:
(Direction.rawBackListEntryCount):
(Direction.rawForwardListEntryCount):
(Direction.backListCountForAPI):
(Direction.forwardListCountForAPI):
(Direction.counts):
(Direction.backListAsAPIArrayWithLimit(_:)):
(Direction.forwardListAsAPIArrayWithLimit(_:)):
(Direction.backListCount): Deleted.
(Direction.forwardListCount): Deleted.
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/WKBackForwardListTests.mm:
(verifyBackForwardListCountsMatchArraySizes):
(setupBackForwardListWithItemsWithoutUserGesture):
(runBackForwardNavigationSkipsItemsWithoutUserGestureCheck):
(runJSHistoryBackDoesNotSkipItemsWithoutUserGestureCheck):

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



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

Reply via email to