Before this change, Chromium would fire hashchange asynchronously (after a task), and delay popstate until the load event. This means the event ordering could be either [hashchange, popstate], or [popstate, hashchange], depending on how long the document took to load. After this change, Chromium will match Firefox and always fire popstate immediately upon URL changes, i.e. the order will always be [popstate, hashchange].
Before this change, event ordering was nondeterministic, and depended on how HTML parser tasks interleaved with the task posted for hashchange. Indeed, the ordering for short documents recently changed due to updates to Chromium's HTML parser architecture; see https://crbug.com/1254926. By aligning with Firefox, we get a simpler model where the event ordering is always deterministic. This is especially true in edge cases such as multiple fragment changes during loading.
Final published standard: Recommendation, Living Standard, Candidate Recommendation, or similar final form
Status in Chromium
Enabled by default
Consensus & Standardization
- No signal
- No signals
Search tagspopstate, hashchange, load,
Last updated on 2022-05-15