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

URLUtils is wrong for Location object #61

Closed
annevk opened this issue Aug 14, 2015 · 7 comments
Closed

URLUtils is wrong for Location object #61

annevk opened this issue Aug 14, 2015 · 7 comments

Comments

@annevk
Copy link
Member

annevk commented Aug 14, 2015

The Location object probably requires special treatment since setting its setters do not actually change the underlying URL directly. They just cause navigation. And the last navigation seems to win, too:

location.pathname = "x"
location.protocol = "https"

Navigates to a URL with a new scheme, not a new path.

@annevk
Copy link
Member Author

annevk commented Aug 14, 2015

Location.prototype.protocol is also special in that it throws for invalid schemes. But it also ignores schemes that are not compatible. Effectively only https, http, and ftp seem to function. See this older bug report https://www.w3.org/Bugs/Public/show_bug.cgi?id=23523 by @arv which I'll close in favor of this issue.

annevk added a commit to whatwg/html that referenced this issue Oct 1, 2015
This fixes the HTML standard side of these issues:

* whatwg/url#61
* whatwg/url#62

There is still some cleanup work left on the URL side, e.g., making
sure the basic URL parser returns failure for certain conditions when
override state is scheme start state.
annevk added a commit to whatwg/html that referenced this issue Oct 2, 2015
This fixes the HTML standard side of these issues:

* whatwg/url#61
* whatwg/url#62

There is still some cleanup work left on the URL side, e.g., making
sure the basic URL parser returns failure for certain conditions when
override state is scheme start state.
annevk added a commit to whatwg/html that referenced this issue Oct 6, 2015
This fixes the HTML standard side of these issues:

* whatwg/url#61
* whatwg/url#62

There is still some cleanup work left on the URL side, e.g., making
sure the basic URL parser returns failure for certain conditions when
override state is scheme start state.
annevk added a commit to whatwg/html that referenced this issue Oct 6, 2015
This fixes the HTML standard side of these issues:

* whatwg/url#61
* whatwg/url#62

There is still some cleanup work left on the URL side, e.g., making
sure the basic URL parser returns failure for certain conditions when
override state is scheme start state.
annevk added a commit that referenced this issue Oct 12, 2015
This fixes #62, but #61 still needs some work.
@domenic
Copy link
Member

domenic commented Apr 15, 2016

This has been fixed in HTML.

@domenic domenic closed this as completed Apr 15, 2016
@annevk
Copy link
Member Author

annevk commented Apr 16, 2016

I think the invalid protocols still needs to be fixed unfortunately. Requires some further study.

@annevk
Copy link
Member Author

annevk commented Jan 3, 2017

Looking at the setter in https://html.spec.whatwg.org/multipage/browsers.html#dom-location-protocol it seems to anticipate a change in the URL Standard where we sometimes return failure for bogus schemes. That will then result in an exception.

I've also noticed that browsers will change the scheme of data URLs and attempt to navigate, which would go against the HTML Standard. They also appear to use DOMException "SyntaxError" rather than TypeError. The exception we should probably change in the HTML Standard, but browsers might want to update to change the scheme less overall.

@annevk
Copy link
Member Author

annevk commented Jan 4, 2017

Once those tests lands this can be closed once bugs have been filed against browsers.

annevk added a commit to whatwg/html that referenced this issue Jan 5, 2017
This matches Chrome and Safari. Edge and Firefox use an internal error
that needs to change either way.

Tests: web-platform-tests/wpt#4412.

Additional context: whatwg/url#61.
domenic pushed a commit to whatwg/html that referenced this issue Jan 5, 2017
This matches Blink and WebKit. Edge and Gecko use an internal error
that needs to change either way.

Tests: web-platform-tests/wpt#4412.

Additional context: whatwg/url#61.
domenic pushed a commit to web-platform-tests/wpt that referenced this issue Jan 5, 2017
@annevk
Copy link
Member Author

annevk commented Jan 5, 2017

annevk added a commit to web-platform-tests/wpt that referenced this issue Jan 5, 2017
@annevk annevk closed this as completed Jan 5, 2017
alice pushed a commit to alice/html that referenced this issue Jan 8, 2019
This matches Blink and WebKit. Edge and Gecko use an internal error
that needs to change either way.

Tests: web-platform-tests/wpt#4412.

Additional context: whatwg/url#61.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants