Skip to content

Update the navigation API when a same-document reload occurs#10989

Merged
domenic merged 5 commits into
whatwg:mainfrom
noamr:nav-commit-reload
Feb 20, 2025
Merged

Update the navigation API when a same-document reload occurs#10989
domenic merged 5 commits into
whatwg:mainfrom
noamr:nav-commit-reload

Conversation

@noamr

@noamr noamr commented Feb 4, 2025

Copy link
Copy Markdown
Contributor

When performing a soft reload (navigation.reload() or location.reload()), the navigation API entries need to be updated to reflect the new state.

Note that popstate and other traversal-related side effects should not occur.

Closes #10621

(See WHATWG Working Mode: Changes for more details.)


/nav-history-apis.html ( diff )

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks so much for working on this! I'm curious if @rwlbuis is able to check this out as well.

Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
Comment thread source Outdated
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
@noamr noamr force-pushed the nav-commit-reload branch from 1bad4e2 to 615797c Compare February 18, 2025 13:34

@domenic domenic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Comment thread source Outdated
Comment thread source Outdated
<li><p>Invoke <span>WebDriver BiDi history updated</span> with <var>navigable</var>.</p></li>
</ol>
</li>
</li>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Undo all these whitespace changes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

noamr added a commit to web-platform-tests/wpt that referenced this pull request Feb 19, 2025
As per the spec clarification, soft reloads should only update
the navigation API entries but not fire history events.

See whatwg/html#10989
@noamr

noamr commented Feb 19, 2025

Copy link
Copy Markdown
Contributor Author

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.

Done

(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.)

Added a test (see OP)

For WebKit and Gecko bugs we can just link to the generic navigation API implementation bugs.

Done

@domenic domenic merged commit 3a2a05d into whatwg:main Feb 20, 2025
noamr added a commit to web-platform-tests/wpt that referenced this pull request Feb 20, 2025
…50793)

As per the spec clarification, soft reloads should only update
the navigation API entries but not fire history events.

See whatwg/html#10989
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2025
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
aarongable pushed a commit to chromium/chromium that referenced this pull request Feb 27, 2025
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2025
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}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this pull request Feb 27, 2025
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}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Feb 28, 2025
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Mar 1, 2025
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Mar 1, 2025
…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
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Mar 1, 2025
…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
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Mar 4, 2025
…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
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Mar 5, 2025
…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
jamienicol pushed a commit to jamienicol/gecko that referenced this pull request Mar 5, 2025
…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
glandium pushed a commit to mozilla-firefox/firefox that referenced this pull request Apr 1, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Behaviour of "reload" navigationType in " inner navigate event firing algorithm" algorithm

2 participants