Skip to content

Commit

Permalink
kurl: remove tabs and newlines from setter inputs
Browse files Browse the repository at this point in the history
This makes setters of Location.search, HTMLAnchorElement.hash,
URL.pathname, etc., remove tabs and newlines. This aligns with the
WHATWG URL Standard and Safari, as well as Firefox partially.

There are a few exceptions. SetProtocol is unchanged due to an upstream
spec issue [1]. SetUser and SetPass should not remove tabs and newlines
per spec.

[1]: whatwg/url#609

Bug: 1214932
Change-Id: I3bcb6fa9e3b61ee5a0a03b13eca93d42912afb22
  • Loading branch information
TimothyGu authored and chromium-wpt-export-bot committed Jun 1, 2021
1 parent e021a4c commit 42af65a
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
}
</script>"></iframe>
<script>
// Tests with '\x0A' (i.e., '\n') don't conform to the URL Standard as of the
// time of writing, as according to spec they should be ignored.
// See https://github.com/whatwg/url/issues/609.

let broken = [
'\x00',
'\x01',
Expand Down Expand Up @@ -93,7 +97,7 @@
async_test((t) => {
self.onload = t.step_func(() => {
self.onmessage = t.step_func((e) => {
assert_array_equals(e.data, ("SyntaxError ".repeat(49) + "SyntaxError").split(" "))
assert_array_equals(e.data, broken.map(() => "SyntaxError"))
c++
if(c === 2) {
t.done()
Expand Down

0 comments on commit 42af65a

Please sign in to comment.