Closed Bug 1484849 Opened 6 years ago Closed 6 years ago

history.go(0) should reload the current page and not involve the entire session history

Categories

(Core :: DOM: Navigation, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla64
Tracking Status
firefox64 --- fixed

People

(Reporter: perry, Assigned: perry)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Blocks bug 1456479 because history.go(0) [0] reloads the entire outer window, restarting the WPTs and infinite-looping rather than just reloading the inner iframe.

[0] https://searchfox.org/mozilla-central/rev/71ef4447db179639be9eff4471f32a95423962d7/testing/web-platform/tests/service-workers/service-worker/fetch-event.https.html#526
Did you test what other browsers do?
(HTML spec's session history definition isn't web compatible and doesn't match even closely to any browser implementation.)
(In reply to Olli Pettay [:smaug] from comment #3)
> Did you test what other browsers do?
> (HTML spec's session history definition isn't web compatible and doesn't
> match even closely to any browser implementation.)

On macOS, both Chrome and Safari only reload the iframe without reloading the outer window. I have a short fix to account for this case that doesn't seem to break any WPT: https://treeherder.mozilla.org/#/jobs?repo=try&revision=49fc1171659fc8f53ba635cf86efeb04de0ab7cd
Assignee: nobody → perry
Status: NEW → ASSIGNED
Priority: -- → P2
Given that other browsers have this behavior, the proposed/candidate change didn't break any tests [0], and the spec indicates "When the go(delta) method is invoked, if delta is zero, the user agent must act as if the location.reload() method was called instead" [1], should we go forward with a fix?

[0] https://treeherder.mozilla.org/#/jobs?repo=try&revision=c96dcfab43a31305090b2081553f9eac4a0c82b5
[1] https://html.spec.whatwg.org/multipage/history.html#the-history-interface (need to scroll down a bit)
Flags: needinfo?(bugs)
Yeah, ok, sounds reasonable. Need to ensure there are some wpt tests for this.
Flags: needinfo?(bugs)
Pushed by rvandermeulen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/858b41d7b9ed
history.go(0) should reload the current page and not involve the entire session history r=smaug
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/858b41d7b9ed
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/13480 for changes under testing/web-platform/tests
Seems to have failed the stability check.
ERROR:/home/travis/build/web-platform-tests/wpt/tools/ci:| `/html/browsers/history/the-history-interface/iframe_history_go_0.html` | `iframe's history.go(0) performs a location.reload()` | **TIMEOUT: 5/10, MISSING: 5/10** | `Test timed out` |
Flags: needinfo?(perry)
I re-triggered the travis CI job because there was an error that made it look like a test infra failure due to a marionette related race not having something clobbered into a global at the right time:
JavaScript error: tools/wptrunner/wptrunner/executors/executormarionette.py, line 70: TypeError: window.win.timeout is not a function

The run succeeded.  So now the question is whether the bot will notice or we should hit the merge button ourselves...
Flags: needinfo?(perry)
I hit the merge button at https://github.com/web-platform-tests/wpt/pull/13480 and filed bug 1498655 on the marionette/wptrunner failure.
See Also: → 1498655
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: