Skip to content
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

Editorial: factor out and rephrase "can have its URL rewritten" #7000

Merged
merged 3 commits into from
Sep 1, 2021

Conversation

domenic
Copy link
Member

@domenic domenic commented Aug 30, 2021

This creates a dedicated algorithm that underlies whether a URL can be rewritten using history.pushState()/replaceState(). The algorithm is phrased differently, but has the same normative effect, and is clearer since it involves less negatives.

This also adds a table of examples for "can have its URL rewritten", and modernizes and expands the domintros for the pushState() and replaceState() methods.


This is extracted from #6992 and that would be a quick rebase on top of this one.


/history.html ( diff )

The actual normative change here is to allow the query component to change in the cross-origin case, not just the fragment component. However, while we're here, we pull out the algorithm into a standalone definition, and rephrase it to be clearer with fewer nested negative conditions.

This better aligns with browsers, exactly matching WebKit and being only slightly more lenient than Chromium and Gecko. See the full analysis at #6836 (comment).

This also improves the domintro for pushState()/replaceState() to be a bit more in line with modern style, and to explain the error condition.

Closes #6836.
@domenic domenic added clarification Standard could be clearer topic: history labels Aug 30, 2021
@domenic domenic requested review from annevk and rakina August 30, 2021 17:59
Copy link
Member

@rakina rakina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The weirdest result here to me is the blob URL one. I wouldn't mind blocking path changes there even if it's same origin, but I suppose it doesn't matter much anyway.

@domenic domenic merged commit b10b69b into main Sep 1, 2021
@domenic domenic deleted the rewrite-url-editorial-only branch September 1, 2021 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer topic: history
Development

Successfully merging this pull request may close these issues.

3 participants