-
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 and HTML: correct protocol setter tests #38032
Conversation
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.
LGTM but some suggestions for improved coverage / better assertion messages
assert_equals(self[index].location.protocol, "http:"); | ||
}); | ||
self[index].location.protocol = val; | ||
}, `Set location.protocol to ${encodeURI(val)} (percent-encoded)`); |
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.
You're actually setting it to the outputted value percent-decoded, right?
Note that you might be able to get away with no encoding in the assert message at all; I kind of remember the WPT harness doing some escaping for us.
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.
Yeah. It doesn't seem to do any escaping if I remove encodeURI()
. It does seem like I could also invoke escape()
but that appears to do the same thing for these inputs.
I'll update the message to "(percent-encoded here for clarity)".
html/browsers/history/the-location-interface/location-protocol-setter.html
Outdated
Show resolved
Hide resolved
@annevk does the flakiness of /html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html make any sense to you? |
I have updated the timeout to match the |
These tests were introduced in the web-platform-tests#38032 According to the URL specification U+000D is a newline character and must be removed before further processing.
These tests were introduced in the #38032. U+000D is a newline character and must be removed before further processing. Closes #38182. Co-authored-by: Anne van Kesteren <[email protected]>
Automatic update from web-platform-tests URL: fix setters tests These tests were introduced in the web-platform-tests/wpt#38032. U+000D is a newline character and must be removed before further processing. Closes #38182. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: f1ade799d04b72b0ff75c13e988744c2cd873741 wpt-pr: 38150
Automatic update from web-platform-tests URL: fix setters tests These tests were introduced in the web-platform-tests/wpt#38032. U+000D is a newline character and must be removed before further processing. Closes #38182. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: f1ade799d04b72b0ff75c13e988744c2cd873741 wpt-pr: 38150
https://bugs.webkit.org/show_bug.cgi?id=251087 rdar://104599983 Reviewed by Alex Christensen. Our URL parser was already skipping newlines and tabs in the scheme while parsing. However, URL::setProtocol() would call URLParser::maybeCanonicalizeScheme() before parsing and this function would fail if the protocol contains any newlines or tabs. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter.html: Resync tests after web-platform-tests/wpt#38032. * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any.worker-expected.txt: Rebaseline tests that are now passing. * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::maybeCanonicalizeScheme): Update URLParser::maybeCanonicalizeScheme() to allow for newlines and tabs in the scheme since it is allowed by the specification and our URL parser actually handles them fine. Canonical link: https://commits.webkit.org/261017@main
These tests were introduced in the #38032. U+000D is a newline character and must be removed before further processing. Closes #38182. Co-authored-by: Anne van Kesteren <[email protected]>
…gi?id=251087 Strip tab and newline from Location/URL/<a>/<area>'s protocol setter https://bugs.webkit.org/show_bug.cgi?id=251087 rdar://104599983 Reviewed by Alex Christensen. Our URL parser was already skipping newlines and tabs in the scheme while parsing. However, URL::setProtocol() would call URLParser::maybeCanonicalizeScheme() before parsing and this function would fail if the protocol contains any newlines or tabs. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter.html: Resync tests after web-platform-tests/wpt#38032. * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any.worker-expected.txt: Rebaseline tests that are now passing. * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::maybeCanonicalizeScheme): Update URLParser::maybeCanonicalizeScheme() to allow for newlines and tabs in the scheme since it is allowed by the specification and our URL parser actually handles them fine. Canonical link: https://commits.webkit.org/261017@main
…gi?id=251087 Strip tab and newline from Location/URL/<a>/<area>'s protocol setter https://bugs.webkit.org/show_bug.cgi?id=251087 rdar://104599983 Reviewed by Alex Christensen. Our URL parser was already skipping newlines and tabs in the scheme while parsing. However, URL::setProtocol() would call URLParser::maybeCanonicalizeScheme() before parsing and this function would fail if the protocol contains any newlines or tabs. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html: * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-sameish.html: Added. * LayoutTests/imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter.html: Resync tests after web-platform-tests/wpt#38032. * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any-expected.txt: * LayoutTests/imported/w3c/web-platform-tests/url/url-setters-stripping.any.worker-expected.txt: Rebaseline tests that are now passing. * Source/WTF/wtf/URLParser.cpp: (WTF::URLParser::maybeCanonicalizeScheme): Update URLParser::maybeCanonicalizeScheme() to allow for newlines and tabs in the scheme since it is allowed by the specification and our URL parser actually handles them fine. Canonical link: https://commits.webkit.org/261017@main
Automatic update from web-platform-tests URL: fix setters tests These tests were introduced in the web-platform-tests/wpt#38032. U+000D is a newline character and must be removed before further processing. Closes #38182. Co-authored-by: Anne van Kesteren <[email protected]> -- wpt-commits: f1ade799d04b72b0ff75c13e988744c2cd873741 wpt-pr: 38150
For whatwg/url#609.