Bug 1717968 [wpt PR 29471] - Allow navigating parent and child during history travers...
commitdf1831bea94ea8a374dd85b77e75b7cd1c7b8cc3
authorNate Chapin <japhet@chromium.org>
Fri, 25 Jun 2021 22:19:42 +0000 (25 22:19 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Sat, 26 Jun 2021 22:33:43 +0000 (26 22:33 +0000)
treebad94ab905665970bb8724a2ef9f3aa015a0fe97
parent7e4d8eb6f033da1abe848fbb55a17de35fb7f394
Bug 1717968 [wpt PR 29471] - Allow navigating parent and child during history traversal, a=testonly

Automatic update from web-platform-tests
Allow navigating parent and child during history traversal

This is a behavior we've wanted for years, but which could cause
serious breakage in the absence of FrameNavigationEntries being
shared across multiple NavigationEntries. That was implemented in
https://chromium-review.googlesource.com/c/chromium/src/+/2910529

Normally, when sharing FrameNavigationEntries, we "fork" the entry
when it is updated due to navigating cross-document (unless reloading
the same url). However, this does not work well when navigating away
from an initial empty document, because we want to hide any empty
documents at the start of an iframe's lifetime. In particular, in the
case where an iframe and the main frame racily navigate, we can end
up with an initial empty document's FNE shared across 2 different
NavigationEntries. It is important that when the first real navigation
takes place, we update the existing entry rather than fork,
so that the initial empty document is overwritten in both places.
Therefore, add a special case in
NavigationControllerImpl::RendererDidNavigateAutoSubrame, to ensure
an initial empty document is always updated rather than replaced.

Bug: 542299, 598043
Change-Id: I4113cbbcb8dd5d5065e88ad8f5761acc09847543
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2953549
Commit-Queue: Nate Chapin <japhet@chromium.org>
Reviewed-by: Charlie Reis <creis@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#896133}

--

wpt-commits: 3b1c1631085e7af5f48d0e38c6a84410c2a9e96c
wpt-pr: 29471
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigate-parent-while-child-loading.html [new file with mode: 0644]
testing/web-platform/tests/html/browsers/browsing-the-web/history-traversal/history-traversal-navigates-multiple-frames.html [new file with mode: 0644]