I have noticed a discrepancy between session history traversal algorithm and history.pushState algorithm in their order of setting a) current entry b) history.state c) Document object's latest entry
In history.pushState algorithm the order is:
a) step 7.5
b) step 11
c) step 12
while in session history traversal the order is:
b) step 11
c) step 13
a) step 15
I cannot think of any reason why these orders should be different. We should actually make them consistent and I think the former order (a,b,c) is the correct one.
This is particularly necessary because in history traversal algorithm, we dispatch a popstate event between step 13 & step 15 which means that the script may see an inconsistent world where history.state is updated but current entry is not which can affect History APIs as they operate on current entry.