Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

noamr
Copy link
Collaborator

@noamr noamr commented Feb 4, 2025

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 )

Copy link
Member

@domenic domenic left a comment

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.

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
Copy link
Member

@domenic domenic left a comment

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.

source Outdated
@@ -102155,18 +102153,18 @@ location.href = '#foo';</code></pre>

<li><p>Invoke <span>WebDriver BiDi history updated</span> with <var>navigable</var>.</p></li>
</ol>
</li>
</li>
Copy link
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
Collaborator 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
Copy link
Collaborator Author

noamr commented Feb 19, 2025

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
2 checks passed
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
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