blob: 664b6c7fb93135c81df3fafe47eb2afd2b551aa4 [file] [log] [blame]
Test setting the hash attribute of the URL in HTMLAnchorElement.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Hash value does not start with '#'
PASS a.href is 'https://www.mydomain.com:8080/path/testurl.html#hash-value'
Hash value starts with '#'
PASS a.href is 'file:///path/testurl.html#hash_value'
'?' in hash value
PASS a.href is 'http://www.mydomain.com/path/testurl.html#hash?value'
'#' in hash value, and illegal characters in hostname
FAIL a.href should be https://www.my"d(){}|~om?ain#com/path/testurl.html#middle. Was https://www.my%22d%28%29%7B%7D%7C%7Eom/?ain#hash#value.
Set hash to null
FAIL a.href should be https://www.mydomain.com/path/testurl.html#. Was https://www.mydomain.com/path/testurl.html.
Set hash to empty string
PASS a.href is 'https://www.mydomain.com/path/testurl.html#'
Add hash to mailto: protocol
FAIL a.href should be mailto:e-mail_address@goes_here#hash-value. Was mailto:e-mail_address@goes_here.
Add hash to file: protocol
PASS a.href is 'file:///some%20path#hash value'
Set hash to '#'
PASS a.href is 'http://mydomain.com/#'
Add hash to non-standard protocol
FAIL a.href should be foo:bar#hash. Was foo:bar.
PASS successfullyParsed is true
TEST COMPLETE