-
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
navigate() should not use parse a URL #9708
Comments
I think I support this, but I would feel better if this was not literally the first such API. I think we have plenty of other precedents right? Like fetch() maybe? I wonder if implementations are generally sloppy about this... might be worth writing tests for a lot of newer APIs. |
Yeah, everything in Fetch should be good, but it's probably buggy. I suspect we can still get some of that changed. web-platform-tests/wpt#4934 (comment) has my progress on the general topic (with help from you, @zcorpan, and others for review and such). |
Seems to be mostly good: web-platform-tests/wpt#41894. |
Tests for some of the others in https://dontcallmedom.github.io/webdex/u.html#URL%20parser%40%40url%25%25dfn , e.g. I was thinking as part of this change we should add a note to "parse a URL" and "parse and serialize a URL". Something like:
|
My thinking is that the next step is changing the name of these algorithms to "legacy" and add new algorithms that take a document/environment, but don't take the encoding into account. As it's much nicer to use an algorithm like this than grab the base URL from somewhere. (Exporting the base URL directly was probably a mistake?) And I wonder if we can even refactor further to never have an encoding of an environment as workers are supposed to be always UTF-8. |
We have coverage for |
Sounds reasonable, although I don't think we should necessarily make new HTML attributes always use UTF-8, so "legacy" might be a bit strong. |
Fair, maybe "parse a URL" and "HTML-parse a URL", although I also would not necessarily mind moving away from it more. Mostly you have to parse eagerly anyway and after that it no longer matters so it's quite easy to switch for new things. |
I think we should make new APIs use UTF-8 exclusively.
cc @zcorpan @domenic
(But maybe don't fix it right away as I'll refactor parse a URL first.)
The text was updated successfully, but these errors were encountered: