[url-setters.html]
  type: testharness
  [Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.]
    expected: FAIL

  [Setting <a://example.net>.protocol = 'b']
    expected: FAIL

  [Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased]
    expected: FAIL

  [Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected]
    expected: FAIL

  [Setting <a://example.net>.protocol = '0b' No leading digit]
    expected: FAIL

  [Setting <a://example.net>.protocol = '+b' No leading punctuation]
    expected: FAIL

  [Setting <a://example.net>.protocol = 'bC0+-.']
    expected: FAIL

  [Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable]
    expected: FAIL

  [Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected]
    expected: FAIL

  [Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.]
    expected: FAIL

  [Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [Setting <http://:secret@example.net>.username = 'me']
    expected: FAIL

  [Setting <http://me:secret@example.net>.username = '']
    expected: FAIL

  [Setting <http://example.net>.username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [Setting <http://example.net>.password = 'secret']
    expected: FAIL

  [Setting <http://:secret@example.net>.password = '']
    expected: FAIL

  [Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [Setting <http://example.net>.password = '%c3%89té' Bytes already percent-encoded are left as-is.]
    expected: FAIL

  [Setting <view-source+http://example.net/foo>.host = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
    expected: FAIL

  [Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [Setting <view-source+http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [Setting <view-source+http://example.net/foo>.hostname = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
    expected: FAIL

  [Setting <http://example.net/path>.hostname = 'example.com:8080' Stuff after a : delimiter is ignored]
    expected: FAIL

  [Setting <http://example.net:8080/path>.hostname = 'example.com:' Stuff after a : delimiter is ignored]
    expected: FAIL

  [Setting <view-source+http://example.net/path>.hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [Setting <http://example.net:8080>.port = '' Port number is unchanged if empty in the new value. Note: this may change, see https://github.com/whatwg/url/pull/113]
    expected: FAIL

  [Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [Setting <unix:/run/foo.socket?timeout=10>.pathname = '/var/log/../run/bar.socket']
    expected: FAIL

  [Setting <http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs]
    expected: FAIL

  [Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs]
    expected: FAIL

  [Setting <a:/>.pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.]
    expected: FAIL

  [Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, except %2E.]
    expected: FAIL

  [Setting <a:/>.search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.]
    expected: FAIL

  [Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' No percent-encoding at all (!); nuls, tabs, and newlines are removed]
    expected: FAIL

  [Setting <http://example.net>.hash = '%c3%89té' Bytes already percent-encoded are left as-is]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = '' The empty string is not a valid scheme. Setter leaves the URL unchanged.]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'b']
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'b']
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'b']
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'B' Upper-case ASCII is lower-cased]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'é' Non-ASCII is rejected]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = '0b' No leading digit]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = '0b' No leading digit]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = '0b' No leading digit]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = '+b' No leading punctuation]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = '+b' No leading punctuation]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = '+b' No leading punctuation]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'bC0+-.']
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'bC0+-.']
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'bC0+-.']
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'b,c' Only some punctuation is acceptable]
    expected: FAIL

  [URL: Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected]
    expected: FAIL

  [<a>: Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected]
    expected: FAIL

  [<area>: Setting <a://example.net>.protocol = 'bé' Non-ASCII is rejected]
    expected: FAIL

  [URL: Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [<a>: Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [<area>: Setting <http://example.net>.protocol = 'b' Can’t switch from special scheme to non-special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [URL: Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.]
    expected: FAIL

  [<a>: Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.]
    expected: FAIL

  [<area>: Setting <mailto:me@example.net>.protocol = 'http' Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.]
    expected: FAIL

  [URL: Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [<a>: Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [<area>: Setting <ssh://me@example.net>.protocol = 'http' Can’t switch from non-special scheme to special. Note: this may change, see https://github.com/whatwg/url/issues/104]
    expected: FAIL

  [URL: Setting <http://:secret@example.net>.username = 'me']
    expected: FAIL

  [<a>: Setting <http://:secret@example.net>.username = 'me']
    expected: FAIL

  [<area>: Setting <http://:secret@example.net>.username = 'me']
    expected: FAIL

  [URL: Setting <http://me:secret@example.net>.username = '']
    expected: FAIL

  [<a>: Setting <http://me:secret@example.net>.username = '']
    expected: FAIL

  [<area>: Setting <http://me:secret@example.net>.username = '']
    expected: FAIL

  [URL: Setting <http://example.net>.username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [<a>: Setting <http://example.net>.username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [<area>: Setting <http://example.net>.username = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [URL: Setting <http://example.net>.password = 'secret']
    expected: FAIL

  [<a>: Setting <http://example.net>.password = 'secret']
    expected: FAIL

  [<area>: Setting <http://example.net>.password = 'secret']
    expected: FAIL

  [URL: Setting <http://:secret@example.net>.password = '']
    expected: FAIL

  [<a>: Setting <http://:secret@example.net>.password = '']
    expected: FAIL

  [<area>: Setting <http://:secret@example.net>.password = '']
    expected: FAIL

  [URL: Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [<a>: Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [<area>: Setting <http://example.net>.password = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the userinfo encode set.]
    expected: FAIL

  [URL: Setting <http://example.net>.password = '%c3%89té' Bytes already percent-encoded are left as-is.]
    expected: FAIL

  [<a>: Setting <http://example.net>.password = '%c3%89té' Bytes already percent-encoded are left as-is.]
    expected: FAIL

  [<area>: Setting <http://example.net>.password = '%c3%89té' Bytes already percent-encoded are left as-is.]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/foo>.host = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/foo>.host = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/foo>.host = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [URL: Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [<a>: Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [<area>: Setting <a:/foo>.host = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [URL: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
    expected: FAIL

  [<a>: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
    expected: FAIL

  [<area>: Setting <http://example.net>.host = '[::0:01\]:2' IPv6 address syntax is normalized]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/path>.host = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/path>.host = 'example.com:8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/foo>.hostname = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/foo>.hostname = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/foo>.hostname = '' The empty host is OK for non-special schemes]
    expected: FAIL

  [URL: Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [<a>: Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [<area>: Setting <a:/foo>.hostname = 'example.net' Path-only URLs can gain a host]
    expected: FAIL

  [URL: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
    expected: FAIL

  [<a>: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
    expected: FAIL

  [<area>: Setting <http://example.net>.hostname = '[::0:01\]' IPv6 address syntax is normalized]
    expected: FAIL

  [URL: Setting <http://example.net/path>.hostname = 'example.com:8080' Stuff after a : delimiter is ignored]
    expected: FAIL

  [<a>: Setting <http://example.net/path>.hostname = 'example.com:8080' Stuff after a : delimiter is ignored]
    expected: FAIL

  [<area>: Setting <http://example.net/path>.hostname = 'example.com:8080' Stuff after a : delimiter is ignored]
    expected: FAIL

  [URL: Setting <http://example.net:8080/path>.hostname = 'example.com:' Stuff after a : delimiter is ignored]
    expected: FAIL

  [<a>: Setting <http://example.net:8080/path>.hostname = 'example.com:' Stuff after a : delimiter is ignored]
    expected: FAIL

  [<area>: Setting <http://example.net:8080/path>.hostname = 'example.com:' Stuff after a : delimiter is ignored]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/path>.hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/path>.hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/path>.hostname = 'example.com\\stuff' \\ is not a delimiter for non-special schemes, and it’s invalid in a domain]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/path>.port = '8080stuff2' Anything other than ASCII digit stops the port parser in a setter but is not an error]
    expected: FAIL

  [<a>: Setting <mailto:me@example.net>.pathname = '/foo' Cannot-be-a-base don’t have a path]
    expected: FAIL

  [<area>: Setting <mailto:me@example.net>.pathname = '/foo' Cannot-be-a-base don’t have a path]
    expected: FAIL

  [URL: Setting <unix:/run/foo.socket?timeout=10>.pathname = '/var/log/../run/bar.socket']
    expected: FAIL

  [<a>: Setting <unix:/run/foo.socket?timeout=10>.pathname = '/var/log/../run/bar.socket']
    expected: FAIL

  [<area>: Setting <unix:/run/foo.socket?timeout=10>.pathname = '/var/log/../run/bar.socket']
    expected: FAIL

  [URL: Setting <http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs]
    expected: FAIL

  [<a>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs]
    expected: FAIL

  [<area>: Setting <http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is a segment delimiter for 'special' URLs]
    expected: FAIL

  [URL: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs]
    expected: FAIL

  [<a>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs]
    expected: FAIL

  [<area>: Setting <view-source+http://example.net/home?lang=fr#nav>.pathname = '\\a\\%2E\\b\\%2e.\\c' \\ is *not* a segment delimiter for non-'special' URLs]
    expected: FAIL

  [URL: Setting <a:/>.pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.]
    expected: FAIL

  [<a>: Setting <a:/>.pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.]
    expected: FAIL

  [<area>: Setting <a:/>.pathname = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.]
    expected: FAIL

  [URL: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, except %2E.]
    expected: FAIL

  [<a>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, except %2E.]
    expected: FAIL

  [<area>: Setting <http://example.net>.pathname = '%2e%2E%c3%89té' Bytes already percent-encoded are left as-is, except %2E.]
    expected: FAIL

  [URL: Setting <a:/>.search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.]
    expected: FAIL

  [<a>: Setting <a:/>.search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.]
    expected: FAIL

  [<area>: Setting <a:/>.search = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.]
    expected: FAIL

  [URL: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' No percent-encoding at all (!); nuls, tabs, and newlines are removed]
    expected: FAIL

  [<a>: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' No percent-encoding at all (!); nuls, tabs, and newlines are removed]
    expected: FAIL

  [<area>: Setting <a:/>.hash = '\x00\x01\t\n\r\x1f !"#$%&'()*+,-./09:;<=>?@AZ[\\\]^_`az{|}~Éé' No percent-encoding at all (!); nuls, tabs, and newlines are removed]
    expected: FAIL

  [URL: Setting <http://example.net>.hash = '%c3%89té' Bytes already percent-encoded are left as-is]
    expected: FAIL

  [<a>: Setting <http://example.net>.hash = '%c3%89té' Bytes already percent-encoded are left as-is]
    expected: FAIL

  [<area>: Setting <http://example.net>.hash = '%c3%89té' Bytes already percent-encoded are left as-is]
    expected: FAIL

