2 <link rel=
"help" href=
"http://url.spec.whatwg.org/#dom-url-search">
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
8 var url
= new URL('http://www.domain.com/');
9 assert_equals(url
.search
, '');
11 url
= new URL('http://www.domain.com/?');
12 assert_equals(url
.search
, '');
14 url
= new URL('http://www.domain.com/?a');
15 assert_equals(url
.search
, '?a');
18 assert_equals(url
.search
, '');
19 assert_equals(url
.toString(), 'http://www.domain.com/');
22 assert_equals(url
.search
, '');
23 assert_equals(url
.toString(), 'http://www.domain.com/');
26 assert_equals(url
.search
, '?a');
29 assert_equals(url
.search
, '?a');
32 assert_equals(url
.search
, '?a%23b');
35 assert_equals(url
.search
, '?a?b');
39 var url
= new URL('mailto:foo@bar.com');
40 assert_equals(url
.search
, '');
43 assert_equals(url
.search
, '?a');
44 }, 'non hierarchical');
47 var url
= new URL('http://abc.de:8080/path/file?query#fragment');
49 assert_equals(url
.search
, '');
51 url
.search
= 'changed';
52 assert_equals(url
.search
, '');
53 assert_equals(url
.href
, 'invalid');
54 }, 'search property invalid URL');