-
Notifications
You must be signed in to change notification settings - Fork 150
Ensure opaque paths always roundtrip #844
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
Conversation
@karwa @hayatoito @valenting what do you think? We should be able to make test changes again so would be great to hear what the interest in this change is. |
I'm supportive of this change. It's a nice simplification, and slightly better than having to strip spaces from the path when clearing the search or hash. I plan to be making these changes in Firefox once WPT tests are available. |
(thanks for this, and apologies for the long delay!) +1. This is a lot more predictable for users. I hope it is web-compatible. I understand that there are use-cases which unfortunately require that unescaped spaces are preserved (e.g. |
Unfortunately I think I need a bit more assurance that everyone is still willing to try this after encountering some unexpected |
In fdaa0e5 we tackled a problem whereby removing the fragment or query from a URL with an opaque path through the API would not make the URL roundtrip due to the opaque path being able to end in non-percent-encoded spaces. However, this failed to address other ways of serializing the URL. As such this is a new approach whereby opaque paths simply cannot end with non-percent-encoded spaces. Enforcing this in the URL parser allows us to completely revert the aforementioned commit, greatly simplifying the API implementation. Fixes #784.
I guess this also obsoletes #785. |
https://bugs.webkit.org/show_bug.cgi?id=289160 rdar://146848690 Reviewed by Alex Christensen. Instead of attempting to account for opaque paths sometimes ending in spaces in the API implementation and failing because that did not account for serialization, this new approach always percent-encodes the final space of the path. This is thought to be the least invasive change that is hopefully web-compatible. This is standardized here: whatwg/url#844 Test changes are upstreamed here: web-platform-tests/wpt#51129 * LayoutTests/fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt: * LayoutTests/http/tests/security/no-popup-from-sandbox-top-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-origin-xhtml-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element-xhtml_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/a-element_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/resources/setters_tests.json: * LayoutTests/imported/w3c/web-platform-tests/url/resources/urltestdata.json: * LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any.worker_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-constructor.any_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-origin.any.worker-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-a-area.window-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any.worker_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters.any_exclude=(file_javascript_mailto)-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any.js: (test): * LayoutTests/imported/w3c/web-platform-tests/url/urlsearchparams-delete.any.worker-expected.txt: * Source/WTF/wtf/URL.cpp: (WTF::URL::removeFragmentIdentifier): (WTF::URL::removeQueryAndFragmentIdentifier): (WTF::URL::setQuery): (WTF::URL::maybeTrimTrailingSpacesFromOpaquePath): Deleted. * Source/WTF/wtf/URL.h: * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::parse): Canonical link: https://commits.webkit.org/292146@main
…from opaque paths, a=testonly Automatic update from web-platform-tests URL: ensure opaque paths always roundtrip For whatwg/url#844. -- wpt-commits: 048018b5af85f8d47b8a704b48cf6f9c0a461876 wpt-pr: 51129
In fdaa0e5 we tackled a problem whereby removing the fragment or query from a URL with an opaque path through the API would not make the URL roundtrip due to the opaque path being able to end in non-percent-encoded spaces.
However, this failed to address other ways of serializing the URL. As such this is a new approach whereby opaque paths simply cannot end with non-percent-encoded spaces. Enforcing this in the URL parser allows us to completely revert the aforementioned commit, greatly simplifying the API implementation.
Fixes #784.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff