-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Properly assign history policy container #8767
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks very reasonable to me. Thanks a lot for the extensive justification and archeology!!
@antosart, your review would also be useful.
I think we still need to evaluate whether or not https://html.spec.whatwg.org/#the-javascript:-url-special-case:document-state-history-policy-container is a valid cloning of the history policy container. If a history policy container should only ever be stored on documents whose URLs are local schemes, and On the other hand, if I understand correctly, the URL of documents resulting from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanation and for the quick fix. This all makes sense to me,, also the story about javascript URLs. I think this does what we want it to do.
@@ -89964,7 +89963,8 @@ location.href = '#foo';</code></pre> | |||
|
|||
<dt><span data-x="document-state-history-policy-container">history policy container</span></dt> | |||
<dd>a <span data-x="clone a policy container">clone</span> of the <var>oldDocState</var>'s | |||
<span data-x="document-state-history-policy-container">history policy container</span></dd> | |||
<span data-x="document-state-history-policy-container">history policy container</span> if it is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: we could change "clone a policy container" to return null if the argument is null, since you are doing this already twice in this PR. I don't know what the spec editors would prefer here, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's a good point. Since there are only two occurrences, and I like the simplicity of shielding the "clone" algorithm from handling null input, I'm fine with what's currently here, but will change it if @domenic has opinions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm on the fence personally. Let's keep it as-is, but also keep an eye out for a third case.
Consider the cross-document navigation case before the navigation & session history rewrite. The #navigate algorithm took a manually-supplied historyPolicyContainer that was only supplied by history traversals, so in the normal navigation flow it is null. Then, navigation params had a non-null policy container member that was assigned in #process-a-navigate-fetch to the result of determining which of the four usual policy containers is suitable, one of which is the manually-supplied historyPolicyContainer (that again, was only set for traversals).
Later, we'd end up in #update-the-session-history-with-the-new-page where we create for the first time the new session history entry, its policy container populated (#navigating-across-documents:she-policy-container-2 in the pre-rewrite spec) with the navigation params's iff the URL required so.
After #6315, the new spec is broken in several ways as described by #8725.
To fix the new spec's document state's history policy container, this PR:
"default"
case), and (b) appended the session history entry to the list of entries. With this PR, the new spec does it then as well./browsing-the-web.html ( diff )