New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 712878 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Multiple renderer-initiated history navigations don't work properly

Project Member Reported by creis@chromium.org, Apr 18 2017

Issue description

Chrome Version: 59.0.3068.0 Canary, 57.0.2987.133 Stable
OS: Win10, Linux

What steps will reproduce the problem?
(1) Visit http://csreis.github.io
(2) Run the example from https://developer.mozilla.org/en-US/docs/Web/Events/popstate in DevTools, all in one block.
window.onpopstate = function(event) {
  console.log("location: " + document.location + ", state: " + JSON.stringify(event.state));
};
history.pushState({page: 1}, "title 1", "?page=1");
history.pushState({page: 2}, "title 2", "?page=2");
history.replaceState({page: 3}, "title 3", "?page=3");
history.back(); // Logs "location: http://example.com/example.html?page=1, state: {"page":1}"
history.back(); // Logs "location: http://example.com/example.html, state: null
history.go(2);  // Logs "location: http://example.com/example.html?page=3, state: {"page":3}

What is the expected result?
As shown in the comments above, you should see output for page:1, null, and page:3.

What happens instead?
You see output for page:1 and null, but not page:3.  The browser has gone back two entries in history (one at a time) but did not go forward two entries.

This is likely due to history navigations becoming asynchronous in M54, in order to support out-of-process iframes. There's some unexplained behavior if you add timers, though, so it's worth figuring out how this is behaving in the code.  (It also varies across browsers, though Chrome appears to have the worst behavior here.)
 

Sign in to add a comment