document.open(): Align history/URL behavior with spec #12933
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change aligns document.open() with the current HTML Standard, which
mandates that in addition to setting the document's URL to the last-entered
document's, the document's current history item's URL must also be updated à la
history.replaceState().
To accomplish that, this CL reuses the logic in History::StateObjectAdded(),
including the throttling behavior, for Document::open() as well. The update
steps are run unconditionally, no matter what the document's current URL is, in
order to have consistent behavior for other things in the history entry like
POST form data, which document.open() now erases.
This also means that document.open() now also counts as a navigation, just like
history.replaceState(). Several browsertests are updated as such.
In this CL, we also enables some WPTs that were previously disabled; in
particular, reload.window.html has been enabled to converge to WebKit's
behavior.
Bug: 68833, 866274
Change-Id: Iea6d665fd97bcaee44bcfaa45f8e92c356003d8a
Reviewed-on: https://chromium-review.googlesource.com/1188643
WPT-Export-Revision: e1658d10c1ee06f15e4268a812bebea2ef3dbe70