This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
When UAs navigate to fragment identifiers they seem to do it in a sync way i.e. location.hash = "#bar" //location.hash is now "#bar" However the hashchange event seems to be queued rather than fired synchronously so that location.hash = "foo" onhashchange = function(e) {document.body.innerHTML += "<p> " + e.oldURL + " " + e.newURL} location.hash = "bar" causes the event to be fired twice. For other navigations, the async behaviour seems to be correct.
Also, the scrolling seems to happen synchronously
This bug was cloned to create bug 18178 as part of operation convergence.
And the popstate event is async.
There seem to be multiple bugs here. Do you have some test cases? Are things like pending history.back() calls aborted as well? Is the new session history entry added synchronously or asynchronously? (Might be able to tell by judicious use of back()/forwards() after the setter is invoked.) I guess the "Traverse the History" algorithm needs to be given a flag to decide whether the events are sync or async? That's unfortunate. Are the events synchronous in the same task? Or two different tasks?
Checked in as WHATWG revision r7846. Check-in comment: Try to match reality better for dynamic location.hash navigation. http://html5.org/tools/web-apps-tracker?from=7845&to=7846