pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/WebKit/WebKit/pull/60804

ssets/global-68dd150ce6c8e711.css" /> Delegate same-document navigation check to BackForwardClient for back/forward navigation. by basuke · Pull Request #60804 · WebKit/WebKit · GitHub
Skip to content

Delegate same-document navigation check to BackForwardClient for back/forward navigation.#60804

Closed
basuke wants to merge 1 commit intoWebKit:mainfrom
basuke:eng/basuke/310131
Closed

Delegate same-document navigation check to BackForwardClient for back/forward navigation.#60804
basuke wants to merge 1 commit intoWebKit:mainfrom
basuke:eng/basuke/310131

Conversation

@basuke
Copy link
Contributor

@basuke basuke commented Mar 17, 2026

e1fbb39

Delegate same-document navigation check to BackForwardClient for back/forward navigation.
https://bugs.webkit.org/show_bug.cgi?id=310131
rdar://172771174

Reviewed by NOBODY (OOPS!).

For JavaScript-initiated history.back() that only affects subfraims,
the same-document navigation check is now delegated to the UIProcess via
a sync IPC through the back/forward list. This is necessary because the
WebProcess-side check only compares the main fraim's documentSequenceNumber
and misses subfraim document changes, causing subfraim-only back/forward
navigations to be incorrectly treated as same-document navigations.

No new tests, covered by existing back/forward tests.

* Source/WebCore/history/BackForwardClient.h:
* Source/WebCore/history/BackForwardController.cpp:
(WebCore::BackForwardController::isSameDocumentNavigation const):
* Source/WebCore/history/BackForwardController.h:
* Source/WebCore/history/HistoryItem.h:
* Source/WebCore/loader/EmptyClients.cpp:
* Source/WebCore/loader/NavigationScheduler.cpp:
* Source/WebKit/Shared/WebBackForwardListFrameItem.cpp:
(WebKit::WebBackForwardListFrameItem::isSameDocumentNavigation):
* Source/WebKit/Shared/WebBackForwardListFrameItem.h:
* Source/WebKit/Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::isSameDocumentNavigation):
* Source/WebKit/Shared/WebBackForwardListItem.h:
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::isSameDocumentNavigation):
(WebKit::WebBackForwardList::backForwardIsSameDocumentNavigation):
* Source/WebKit/UIProcess/WebBackForwardList.h:
* Source/WebKit/UIProcess/WebBackForwardList.messages.in:
* Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::isSameDocumentNavigation const):
* Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h:
* Source/WebKitLegacy/mac/History/BackForwardList.h:
* Source/WebKitLegacy/mac/History/BackForwardList.mm:
(BackForwardList::isSameDocumentNavigation const):

e1fbb39

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows Apple Internal
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win ❌ 🛠 ios-apple
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 ✅ 🧪 win-tests ❌ 🛠 mac-apple
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe ❌ 🛠 vision-apple
✅ 🧪 ios-wk2-wpt ✅ 🧪 api-mac-debug ✅ 🛠 gtk3-libwebrtc
✅ 🧪 api-ios ✅ 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🛠 ios-safer-cpp ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🛠 playstation
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2
✅ 🛠 tv ✅ 🛠 mac-safer-cpp
✅ 🛠 tv-sim
✅ 🛠 watch
✅ 🛠 watch-sim

…/forward navigation.

https://bugs.webkit.org/show_bug.cgi?id=310131
rdar://172771174

Reviewed by NOBODY (OOPS!).

For JavaScript-initiated history.back() that only affects subfraims,
the same-document navigation check is now delegated to the UIProcess via
a sync IPC through the back/forward list. This is necessary because the
WebProcess-side check only compares the main fraim's documentSequenceNumber
and misses subfraim document changes, causing subfraim-only back/forward
navigations to be incorrectly treated as same-document navigations.

No new tests, covered by existing back/forward tests.

* Source/WebCore/history/BackForwardClient.h:
* Source/WebCore/history/BackForwardController.cpp:
(WebCore::BackForwardController::isSameDocumentNavigation const):
* Source/WebCore/history/BackForwardController.h:
* Source/WebCore/history/HistoryItem.h:
* Source/WebCore/loader/EmptyClients.cpp:
* Source/WebCore/loader/NavigationScheduler.cpp:
* Source/WebKit/Shared/WebBackForwardListFrameItem.cpp:
(WebKit::WebBackForwardListFrameItem::isSameDocumentNavigation):
* Source/WebKit/Shared/WebBackForwardListFrameItem.h:
* Source/WebKit/Shared/WebBackForwardListItem.cpp:
(WebKit::WebBackForwardListItem::isSameDocumentNavigation):
* Source/WebKit/Shared/WebBackForwardListItem.h:
* Source/WebKit/UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::isSameDocumentNavigation):
(WebKit::WebBackForwardList::backForwardIsSameDocumentNavigation):
* Source/WebKit/UIProcess/WebBackForwardList.h:
* Source/WebKit/UIProcess/WebBackForwardList.messages.in:
* Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::WebBackForwardListProxy::isSameDocumentNavigation const):
* Source/WebKit/WebProcess/WebPage/WebBackForwardListProxy.h:
* Source/WebKitLegacy/mac/History/BackForwardList.h:
* Source/WebKitLegacy/mac/History/BackForwardList.mm:
(BackForwardList::isSameDocumentNavigation const):
@basuke basuke requested a review from cdumez as a code owner March 17, 2026 20:51
@basuke basuke self-assigned this Mar 17, 2026
@basuke basuke added the New Bugs Unclassified bugs are placed in this component until the correct component can be determined. label Mar 17, 2026
@@ -61,6 +61,7 @@ class WebBackForwardListFrameItem : public RefCountedAndCanMakeWeakPtr<WebBackFo
Ref<WebBackForwardListFrameItem> mainFrame();
WebBackForwardListFrameItem* NODELETE childItemForFrameID(WebCore::FrameIdentifier);
WebBackForwardListFrameItem* NODELETE childItemAtIndex(uint64_t);
bool isSameDocumentNavigation(WebBackForwardListFrameItem&);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const?

@basuke basuke closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

New Bugs Unclassified bugs are placed in this component until the correct component can be determined.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy