Update the navigation API when a same-document reload occurs#10989
Conversation
This performs the subset of the "URL and history update steps" that are applicable to reload navigations, in the "inner `navigate` event firing algorithm". Closes whatwg#10621
1bad4e2 to
615797c
Compare
domenic
left a comment
There was a problem hiding this comment.
Normative content looks good, thanks for working on this. Please be sure to fill out the template with the Chromium bug and some of the tests linked from #10621.
(If we are up for adding more tests, e.g. to test that popstate doesn't fire, that would be excellent. Maybe by completing the TODO in https://github.com/web-platform-tests/wpt/tree/master/navigation-api/ordering-and-transition#navigation-api-orderingtransition-tests to generically add popstate/hashchange test ordering to all those tests.)
For WebKit and Gecko bugs we can just link to the generic navigation API implementation bugs.
As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989
Done
Added a test (see OP)
Done |
…50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989
When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe
When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299859 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1425920}
When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299859 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1425920}
When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299859 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1425920}
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793 UltraBlame original commit: 0b3df17674a5b7f25c03802ee90795df528c0b5c
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793 UltraBlame original commit: 0b3df17674a5b7f25c03802ee90795df528c0b5c
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793 UltraBlame original commit: 0b3df17674a5b7f25c03802ee90795df528c0b5c
…te firing behavior, a=testonly Automatic update from web-platform-tests Navigation API: match the spec on popstate firing behavior When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299859 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1425920} -- wpt-commits: 1786c24ad28fd6d2ed33b5f1d9946f2fa75bd648 wpt-pr: 51003
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793
…te firing behavior, a=testonly Automatic update from web-platform-tests Navigation API: match the spec on popstate firing behavior When intercepting a navigation with the navigate event, the popstate event should only be fired if the navigation was a traversal (necessarily same-document, since cross-document traversals aren't interceptible), or if the navigation was a same-document fragment navigation (i.e., not originating from the history API or the navigation API). Follows whatwg/html#10989 and whatwg/html#10919 Fixed: 397377454, 398276373 Change-Id: I0f953cd10a8f2a80af0822e9ceafaaac965758fe Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6299859 Reviewed-by: Domenic Denicola <domenic@chromium.org> Commit-Queue: Nate Chapin <japhet@chromium.org> Cr-Commit-Position: refs/heads/main@{#1425920} -- wpt-commits: 1786c24ad28fd6d2ed33b5f1d9946f2fa75bd648 wpt-pr: 51003
…on't fire a popstate event, a=testonly Automatic update from web-platform-tests Navigation API: test that soft reloads don't fire a popstate event (#50793) As per the spec clarification, soft reloads should only update the navigation API entries but not fire history events. See whatwg/html#10989 -- wpt-commits: c7802d189273274933bf21947d519505cf521f4d wpt-pr: 50793
When performing a soft reload (
navigation.reload()orlocation.reload()), the navigation API entries need to be updated to reflect the new state.Note that
popstateand other traversal-related side effects should not occur.Closes #10621
sourceElementmozilla/standards-positions#1154(See WHATWG Working Mode: Changes for more details.)
/nav-history-apis.html ( diff )