-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[URL] Ensure that path-only URLs do not have their paths erased by th… #27720
Conversation
The first added test (special URLs) is just documenting the status-quo, since there didn't seem to be a test for what happens if you set an empty string. The second one shows the new behaviour I propose on adding to the standard. |
029cfbb
to
428e307
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed that the third test added here fails without the change and passes with it, in jsdom/whatwg-url.
"href": "foo:/", | ||
"pathname": "/" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add a test where the new pathname
value is non-empty but rootless, like "test"
? A root should be automatically created in that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we also add a test setting a path on a URL without a host? My initial late-night implementation of this change would've failed that test. Like this:
-
{
-
"comment": "Non-special URLs can have their paths erased",
-
"href": "foo:///some/path",
-
"new_value": "",
-
"expected": {
-
"href": "foo://",
-
"pathname": ""
-
}
-
},
As that would make them cannot-be-a-base URLs. Tests: web-platform-tests/wpt#27720. Fixes #581.
Ah, I merged the specification PR but I missed the outstanding comment here. @karwa do you still want to add that additional test? |
I added the additional requested tests, once someone reviewed them this should be good to go. |
Apologies, I missed this - thanks for adding the tests, @annevk |
…e pathname setter.
See: whatwg/url#582