Closed Bug 1811945 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 38125 - Move renderer-side same-url-replacement enforcement to LocalFrame::NavigationShouldReplaceCurrentHistoryEntry

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox111 fixed)

RESOLVED FIXED
111 Branch
Tracking Status
firefox111 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 38125 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/38125
Details from upstream follow.

Nate Chapin <japhet@chromium.org> wrote:

Move renderer-side same-url-replacement enforcement to LocalFrame::NavigationShouldReplaceCurrentHistoryEntry

When we navigate to the current url, we treat it as a replacing
navigation, rather than pushing a new history entry. The browser
process enforces this most of the time, but there's a special case
to enforce it in the renderer for synchronous same-document commits.
This renderer process special case is in a weird place late in the
commit process.

The late timing is also a problem because the navigation API wants
to report whether the navigation will replace the current history
entry when it fires the navigate event. The navigate event fires
before we enforce this policy currently.

By moving same-url replacement to
LocalFrame::NavigationShouldReplaceCurrentHistoryEntry,
we duplicate some logic between the renderer and the browser
process, but we consistently switch the navigation to be replacing
before the navigate event fires, ensure we expose the correct
navigation type to JS.

Change-Id: I8859ac19fddbfc2f9aa42cad8e19b537df9679b1

Reviewed-on: https://chromium-review.googlesource.com/4189640
WPT-Export-Revision: 096b3a94881db9948212cab45a11e2eb505ab752

CI Results

Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 2 tests and 1 subtests

Status Summary

Firefox

OK : 2
FAIL: 2

Chrome

OK : 2
FAIL: 2

Safari

OK : 2
FAIL: 2

Links

GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/d23abe311265
[wpt PR 38125] - Move renderer-side same-url-replacement enforcement to LocalFrame::NavigationShouldReplaceCurrentHistoryEntry, a=testonly
https://hg.mozilla.org/integration/autoland/rev/abc7085b6a73
[wpt PR 38125] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 111 Branch
You need to log in before you can comment on or make changes to this bug.