Change URL parsing sequence for window open steps #10683
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.
Previously, we would only check at the last minute. This would be buggy in the case where we create a new navigable, and then throw an exception. Instead we should be sure to throw before creating a new navigable.
In addition to fixing this somewhat-obviously-wrong bug, this also causes URL parsing to happen even in cases where a named window is targeted, but no window with that name exists. Previously, the window open steps would do nothing in such cases; now, they throw an exception when given an unparseable URL.
Closes #10681.
@shannonbooth, your review would be appreciated. Also, are you interested in helping to write web platform tests for the normative change described above, about adding validation? I checked by source inspection that it matches how Chromium behaves, but depending on the results we might need to do more work to match the browser majority here.
(See WHATWG Working Mode: Changes for more details.)
/nav-history-apis.html ( diff )