2 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
4 "input": "http://example\t.\norg",
5 "base": "http://example.org/foo/bar",
6 "href": "http://example.org/",
7 "origin": "http://example.org",
11 "host": "example.org",
12 "hostname": "example.org",
19 "input": "http://user:pass@foo:21/bar;par?b#c",
20 "base": "http://example.org/foo/bar",
21 "href": "http://user:pass@foo:21/bar;par?b#c",
22 "origin": "http://foo:21",
29 "pathname": "/bar;par",
34 "input": "http:foo.com",
35 "base": "http://example.org/foo/bar",
36 "href": "http://example.org/foo/foo.com",
37 "origin": "http://example.org",
41 "host": "example.org",
42 "hostname": "example.org",
44 "pathname": "/foo/foo.com",
49 "input": "\t :foo.com \n",
50 "base": "http://example.org/foo/bar",
51 "href": "http://example.org/foo/:foo.com",
52 "origin": "http://example.org",
56 "host": "example.org",
57 "hostname": "example.org",
59 "pathname": "/foo/:foo.com",
65 "base": "http://example.org/foo/bar",
66 "href": "http://example.org/foo/foo.com",
67 "origin": "http://example.org",
71 "host": "example.org",
72 "hostname": "example.org",
74 "pathname": "/foo/foo.com",
79 "input": "a:\t foo.com",
80 "base": "http://example.org/foo/bar",
89 "pathname": " foo.com",
94 "input": "http://f:21/ b ? d # e ",
95 "base": "http://example.org/foo/bar",
96 "href": "http://f:21/%20b%20?%20d%20# e",
97 "origin": "http://f:21",
104 "pathname": "/%20b%20",
105 "search": "?%20d%20",
109 "input": "http://f:/c",
110 "base": "http://example.org/foo/bar",
111 "href": "http://f/c",
112 "origin": "http://f",
124 "input": "http://f:0/c",
125 "base": "http://example.org/foo/bar",
126 "href": "http://f:0/c",
127 "origin": "http://f:0",
139 "input": "http://f:00000000000000/c",
140 "base": "http://example.org/foo/bar",
141 "href": "http://f:0/c",
142 "origin": "http://f:0",
154 "input": "http://f:00000000000000000000080/c",
155 "base": "http://example.org/foo/bar",
156 "href": "http://f/c",
157 "origin": "http://f",
169 "input": "http://f:b/c",
170 "base": "http://example.org/foo/bar",
174 "input": "http://f: /c",
175 "base": "http://example.org/foo/bar",
179 "input": "http://f:\n/c",
180 "base": "http://example.org/foo/bar",
181 "href": "http://f/c",
182 "origin": "http://f",
194 "input": "http://f:fifty-two/c",
195 "base": "http://example.org/foo/bar",
199 "input": "http://f:999999/c",
200 "base": "http://example.org/foo/bar",
204 "input": "http://f: 21 / b ? d # e ",
205 "base": "http://example.org/foo/bar",
210 "base": "http://example.org/foo/bar",
211 "href": "http://example.org/foo/bar",
212 "origin": "http://example.org",
216 "host": "example.org",
217 "hostname": "example.org",
219 "pathname": "/foo/bar",
225 "base": "http://example.org/foo/bar",
226 "href": "http://example.org/foo/bar",
227 "origin": "http://example.org",
231 "host": "example.org",
232 "hostname": "example.org",
234 "pathname": "/foo/bar",
239 "input": ":foo.com/",
240 "base": "http://example.org/foo/bar",
241 "href": "http://example.org/foo/:foo.com/",
242 "origin": "http://example.org",
246 "host": "example.org",
247 "hostname": "example.org",
249 "pathname": "/foo/:foo.com/",
254 "input": ":foo.com\\",
255 "base": "http://example.org/foo/bar",
256 "href": "http://example.org/foo/:foo.com/",
257 "origin": "http://example.org",
261 "host": "example.org",
262 "hostname": "example.org",
264 "pathname": "/foo/:foo.com/",
270 "base": "http://example.org/foo/bar",
271 "href": "http://example.org/foo/:",
272 "origin": "http://example.org",
276 "host": "example.org",
277 "hostname": "example.org",
279 "pathname": "/foo/:",
285 "base": "http://example.org/foo/bar",
286 "href": "http://example.org/foo/:a",
287 "origin": "http://example.org",
291 "host": "example.org",
292 "hostname": "example.org",
294 "pathname": "/foo/:a",
300 "base": "http://example.org/foo/bar",
301 "href": "http://example.org/foo/:/",
302 "origin": "http://example.org",
306 "host": "example.org",
307 "hostname": "example.org",
309 "pathname": "/foo/:/",
315 "base": "http://example.org/foo/bar",
316 "href": "http://example.org/foo/:/",
317 "origin": "http://example.org",
321 "host": "example.org",
322 "hostname": "example.org",
324 "pathname": "/foo/:/",
330 "base": "http://example.org/foo/bar",
331 "href": "http://example.org/foo/:#",
332 "origin": "http://example.org",
336 "host": "example.org",
337 "hostname": "example.org",
339 "pathname": "/foo/:",
345 "base": "http://example.org/foo/bar",
346 "href": "http://example.org/foo/bar#",
347 "origin": "http://example.org",
351 "host": "example.org",
352 "hostname": "example.org",
354 "pathname": "/foo/bar",
360 "base": "http://example.org/foo/bar",
361 "href": "http://example.org/foo/bar#/",
362 "origin": "http://example.org",
366 "host": "example.org",
367 "hostname": "example.org",
369 "pathname": "/foo/bar",
375 "base": "http://example.org/foo/bar",
376 "href": "http://example.org/foo/bar#\\",
377 "origin": "http://example.org",
381 "host": "example.org",
382 "hostname": "example.org",
384 "pathname": "/foo/bar",
390 "base": "http://example.org/foo/bar",
391 "href": "http://example.org/foo/bar#;?",
392 "origin": "http://example.org",
396 "host": "example.org",
397 "hostname": "example.org",
399 "pathname": "/foo/bar",
405 "base": "http://example.org/foo/bar",
406 "href": "http://example.org/foo/bar?",
407 "origin": "http://example.org",
411 "host": "example.org",
412 "hostname": "example.org",
414 "pathname": "/foo/bar",
420 "base": "http://example.org/foo/bar",
421 "href": "http://example.org/",
422 "origin": "http://example.org",
426 "host": "example.org",
427 "hostname": "example.org",
435 "base": "http://example.org/foo/bar",
436 "href": "http://example.org/foo/:23",
437 "origin": "http://example.org",
441 "host": "example.org",
442 "hostname": "example.org",
444 "pathname": "/foo/:23",
450 "base": "http://example.org/foo/bar",
451 "href": "http://example.org/:23",
452 "origin": "http://example.org",
456 "host": "example.org",
457 "hostname": "example.org",
465 "base": "http://example.org/foo/bar",
466 "href": "http://example.org/foo/::",
467 "origin": "http://example.org",
471 "host": "example.org",
472 "hostname": "example.org",
474 "pathname": "/foo/::",
480 "base": "http://example.org/foo/bar",
481 "href": "http://example.org/foo/::23",
482 "origin": "http://example.org",
486 "host": "example.org",
487 "hostname": "example.org",
489 "pathname": "/foo/::23",
495 "base": "http://example.org/foo/bar",
509 "input": "http://a:b@c:29/d",
510 "base": "http://example.org/foo/bar",
511 "href": "http://a:b@c:29/d",
512 "origin": "http://c:29",
524 "input": "http::@c:29",
525 "base": "http://example.org/foo/bar",
526 "href": "http://example.org/foo/:@c:29",
527 "origin": "http://example.org",
531 "host": "example.org",
532 "hostname": "example.org",
534 "pathname": "/foo/:@c:29",
539 "input": "http://&a:foo(b]c@d:2/",
540 "base": "http://example.org/foo/bar",
541 "href": "http://&a:foo(b%5Dc@d:2/",
542 "origin": "http://d:2",
545 "password": "foo(b%5Dc",
554 "input": "http://::@c@d:2",
555 "base": "http://example.org/foo/bar",
556 "href": "http://:%3A%40c@d:2/",
557 "origin": "http://d:2",
560 "password": "%3A%40c",
569 "input": "http://foo.com:b@d/",
570 "base": "http://example.org/foo/bar",
571 "href": "http://foo.com:b@d/",
572 "origin": "http://d",
574 "username": "foo.com",
584 "input": "http://foo.com/\\@",
585 "base": "http://example.org/foo/bar",
586 "href": "http://foo.com//@",
587 "origin": "http://foo.com",
592 "hostname": "foo.com",
599 "input": "http:\\\\foo.com\\",
600 "base": "http://example.org/foo/bar",
601 "href": "http://foo.com/",
602 "origin": "http://foo.com",
607 "hostname": "foo.com",
614 "input": "http:\\\\a\\b:c\\d@foo.com\\",
615 "base": "http://example.org/foo/bar",
616 "href": "http://a/b:c/d@foo.com/",
617 "origin": "http://a",
624 "pathname": "/b:c/d@foo.com/",
630 "base": "http://example.org/foo/bar",
644 "input": "foo:/bar.com/",
645 "base": "http://example.org/foo/bar",
646 "href": "foo:/bar.com/",
654 "pathname": "/bar.com/",
659 "input": "foo://///////",
660 "base": "http://example.org/foo/bar",
661 "href": "foo://///////",
669 "pathname": "///////",
674 "input": "foo://///////bar.com/",
675 "base": "http://example.org/foo/bar",
676 "href": "foo://///////bar.com/",
684 "pathname": "///////bar.com/",
689 "input": "foo:////://///",
690 "base": "http://example.org/foo/bar",
691 "href": "foo:////://///",
699 "pathname": "//://///",
705 "base": "http://example.org/foo/bar",
719 "input": "//foo/bar",
720 "base": "http://example.org/foo/bar",
721 "href": "http://foo/bar",
722 "origin": "http://foo",
734 "input": "http://foo/path;a??e#f#g",
735 "base": "http://example.org/foo/bar",
736 "href": "http://foo/path;a??e#f#g",
737 "origin": "http://foo",
744 "pathname": "/path;a",
749 "input": "http://foo/abcd?efgh?ijkl",
750 "base": "http://example.org/foo/bar",
751 "href": "http://foo/abcd?efgh?ijkl",
752 "origin": "http://foo",
760 "search": "?efgh?ijkl",
764 "input": "http://foo/abcd#foo?bar",
765 "base": "http://example.org/foo/bar",
766 "href": "http://foo/abcd#foo?bar",
767 "origin": "http://foo",
779 "input": "[61:24:74]:98",
780 "base": "http://example.org/foo/bar",
781 "href": "http://example.org/foo/[61:24:74]:98",
782 "origin": "http://example.org",
786 "host": "example.org",
787 "hostname": "example.org",
789 "pathname": "/foo/[61:24:74]:98",
794 "input": "http:[61:27]/:foo",
795 "base": "http://example.org/foo/bar",
796 "href": "http://example.org/foo/[61:27]/:foo",
797 "origin": "http://example.org",
801 "host": "example.org",
802 "hostname": "example.org",
804 "pathname": "/foo/[61:27]/:foo",
809 "input": "http://[1::2]:3:4",
810 "base": "http://example.org/foo/bar",
814 "input": "http://2001::1",
815 "base": "http://example.org/foo/bar",
819 "input": "http://2001::1]",
820 "base": "http://example.org/foo/bar",
824 "input": "http://2001::1]:80",
825 "base": "http://example.org/foo/bar",
829 "input": "http://[2001::1]",
830 "base": "http://example.org/foo/bar",
831 "href": "http://[2001::1]/",
832 "origin": "http://[2001::1]",
837 "hostname": "[2001::1]",
844 "input": "http://[::127.0.0.1]",
845 "base": "http://example.org/foo/bar",
846 "href": "http://[::7f00:1]/",
847 "origin": "http://[::7f00:1]",
851 "host": "[::7f00:1]",
852 "hostname": "[::7f00:1]",
859 "input": "http://[0:0:0:0:0:0:13.1.68.3]",
860 "base": "http://example.org/foo/bar",
861 "href": "http://[::d01:4403]/",
862 "origin": "http://[::d01:4403]",
866 "host": "[::d01:4403]",
867 "hostname": "[::d01:4403]",
874 "input": "http://[2001::1]:80",
875 "base": "http://example.org/foo/bar",
876 "href": "http://[2001::1]/",
877 "origin": "http://[2001::1]",
882 "hostname": "[2001::1]",
889 "input": "http:/example.com/",
890 "base": "http://example.org/foo/bar",
891 "href": "http://example.org/example.com/",
892 "origin": "http://example.org",
896 "host": "example.org",
897 "hostname": "example.org",
899 "pathname": "/example.com/",
904 "input": "ftp:/example.com/",
905 "base": "http://example.org/foo/bar",
906 "href": "ftp://example.com/",
907 "origin": "ftp://example.com",
911 "host": "example.com",
912 "hostname": "example.com",
919 "input": "https:/example.com/",
920 "base": "http://example.org/foo/bar",
921 "href": "https://example.com/",
922 "origin": "https://example.com",
923 "protocol": "https:",
926 "host": "example.com",
927 "hostname": "example.com",
934 "input": "madeupscheme:/example.com/",
935 "base": "http://example.org/foo/bar",
936 "href": "madeupscheme:/example.com/",
938 "protocol": "madeupscheme:",
944 "pathname": "/example.com/",
949 "input": "file:/example.com/",
950 "base": "http://example.org/foo/bar",
951 "href": "file:///example.com/",
958 "pathname": "/example.com/",
963 "input": "ftps:/example.com/",
964 "base": "http://example.org/foo/bar",
965 "href": "ftps:/example.com/",
973 "pathname": "/example.com/",
978 "input": "gopher:/example.com/",
979 "base": "http://example.org/foo/bar",
980 "href": "gopher://example.com/",
981 "origin": "gopher://example.com",
982 "protocol": "gopher:",
985 "host": "example.com",
986 "hostname": "example.com",
993 "input": "ws:/example.com/",
994 "base": "http://example.org/foo/bar",
995 "href": "ws://example.com/",
996 "origin": "ws://example.com",
1000 "host": "example.com",
1001 "hostname": "example.com",
1008 "input": "wss:/example.com/",
1009 "base": "http://example.org/foo/bar",
1010 "href": "wss://example.com/",
1011 "origin": "wss://example.com",
1015 "host": "example.com",
1016 "hostname": "example.com",
1023 "input": "data:/example.com/",
1024 "base": "http://example.org/foo/bar",
1025 "href": "data:/example.com/",
1027 "protocol": "data:",
1033 "pathname": "/example.com/",
1038 "input": "javascript:/example.com/",
1039 "base": "http://example.org/foo/bar",
1040 "href": "javascript:/example.com/",
1042 "protocol": "javascript:",
1048 "pathname": "/example.com/",
1053 "input": "mailto:/example.com/",
1054 "base": "http://example.org/foo/bar",
1055 "href": "mailto:/example.com/",
1057 "protocol": "mailto:",
1063 "pathname": "/example.com/",
1068 "input": "http:example.com/",
1069 "base": "http://example.org/foo/bar",
1070 "href": "http://example.org/foo/example.com/",
1071 "origin": "http://example.org",
1072 "protocol": "http:",
1075 "host": "example.org",
1076 "hostname": "example.org",
1078 "pathname": "/foo/example.com/",
1083 "input": "ftp:example.com/",
1084 "base": "http://example.org/foo/bar",
1085 "href": "ftp://example.com/",
1086 "origin": "ftp://example.com",
1090 "host": "example.com",
1091 "hostname": "example.com",
1098 "input": "https:example.com/",
1099 "base": "http://example.org/foo/bar",
1100 "href": "https://example.com/",
1101 "origin": "https://example.com",
1102 "protocol": "https:",
1105 "host": "example.com",
1106 "hostname": "example.com",
1113 "input": "madeupscheme:example.com/",
1114 "base": "http://example.org/foo/bar",
1115 "href": "madeupscheme:example.com/",
1117 "protocol": "madeupscheme:",
1123 "pathname": "example.com/",
1128 "input": "ftps:example.com/",
1129 "base": "http://example.org/foo/bar",
1130 "href": "ftps:example.com/",
1132 "protocol": "ftps:",
1138 "pathname": "example.com/",
1143 "input": "gopher:example.com/",
1144 "base": "http://example.org/foo/bar",
1145 "href": "gopher://example.com/",
1146 "origin": "gopher://example.com",
1147 "protocol": "gopher:",
1150 "host": "example.com",
1151 "hostname": "example.com",
1158 "input": "ws:example.com/",
1159 "base": "http://example.org/foo/bar",
1160 "href": "ws://example.com/",
1161 "origin": "ws://example.com",
1165 "host": "example.com",
1166 "hostname": "example.com",
1173 "input": "wss:example.com/",
1174 "base": "http://example.org/foo/bar",
1175 "href": "wss://example.com/",
1176 "origin": "wss://example.com",
1180 "host": "example.com",
1181 "hostname": "example.com",
1188 "input": "data:example.com/",
1189 "base": "http://example.org/foo/bar",
1190 "href": "data:example.com/",
1192 "protocol": "data:",
1198 "pathname": "example.com/",
1203 "input": "javascript:example.com/",
1204 "base": "http://example.org/foo/bar",
1205 "href": "javascript:example.com/",
1207 "protocol": "javascript:",
1213 "pathname": "example.com/",
1218 "input": "mailto:example.com/",
1219 "base": "http://example.org/foo/bar",
1220 "href": "mailto:example.com/",
1222 "protocol": "mailto:",
1228 "pathname": "example.com/",
1234 "base": "http://example.org/foo/bar",
1235 "href": "http://example.org/a/b/c",
1236 "origin": "http://example.org",
1237 "protocol": "http:",
1240 "host": "example.org",
1241 "hostname": "example.org",
1243 "pathname": "/a/b/c",
1249 "base": "http://example.org/foo/bar",
1250 "href": "http://example.org/a/%20/c",
1251 "origin": "http://example.org",
1252 "protocol": "http:",
1255 "host": "example.org",
1256 "hostname": "example.org",
1258 "pathname": "/a/%20/c",
1264 "base": "http://example.org/foo/bar",
1265 "href": "http://example.org/a%2fc",
1266 "origin": "http://example.org",
1267 "protocol": "http:",
1270 "host": "example.org",
1271 "hostname": "example.org",
1273 "pathname": "/a%2fc",
1278 "input": "/a/%2f/c",
1279 "base": "http://example.org/foo/bar",
1280 "href": "http://example.org/a/%2f/c",
1281 "origin": "http://example.org",
1282 "protocol": "http:",
1285 "host": "example.org",
1286 "hostname": "example.org",
1288 "pathname": "/a/%2f/c",
1294 "base": "http://example.org/foo/bar",
1295 "href": "http://example.org/foo/bar#%CE%B2",
1296 "origin": "http://example.org",
1297 "protocol": "http:",
1300 "host": "example.org",
1301 "hostname": "example.org",
1303 "pathname": "/foo/bar",
1308 "input": "data:text/html,test#test",
1309 "base": "http://example.org/foo/bar",
1310 "href": "data:text/html,test#test",
1312 "protocol": "data:",
1318 "pathname": "text/html,test",
1323 "input": "tel:1234567890",
1324 "base": "http://example.org/foo/bar",
1325 "href": "tel:1234567890",
1333 "pathname": "1234567890",
1337 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
1339 "input": "file:c:\\foo\\bar.html",
1340 "base": "file:///tmp/mock/path",
1341 "href": "file:///c:/foo/bar.html",
1342 "protocol": "file:",
1348 "pathname": "/c:/foo/bar.html",
1353 "input": " File:c|////foo\\bar.html",
1354 "base": "file:///tmp/mock/path",
1355 "href": "file:///c:////foo/bar.html",
1356 "protocol": "file:",
1362 "pathname": "/c:////foo/bar.html",
1367 "input": "C|/foo/bar",
1368 "base": "file:///tmp/mock/path",
1369 "href": "file:///C:/foo/bar",
1370 "protocol": "file:",
1376 "pathname": "/C:/foo/bar",
1381 "input": "/C|\\foo\\bar",
1382 "base": "file:///tmp/mock/path",
1383 "href": "file:///C:/foo/bar",
1384 "protocol": "file:",
1390 "pathname": "/C:/foo/bar",
1395 "input": "//C|/foo/bar",
1396 "base": "file:///tmp/mock/path",
1397 "href": "file:///C:/foo/bar",
1398 "protocol": "file:",
1404 "pathname": "/C:/foo/bar",
1409 "input": "//server/file",
1410 "base": "file:///tmp/mock/path",
1411 "href": "file://server/file",
1412 "protocol": "file:",
1416 "hostname": "server",
1418 "pathname": "/file",
1423 "input": "\\\\server\\file",
1424 "base": "file:///tmp/mock/path",
1425 "href": "file://server/file",
1426 "protocol": "file:",
1430 "hostname": "server",
1432 "pathname": "/file",
1437 "input": "/\\server/file",
1438 "base": "file:///tmp/mock/path",
1439 "href": "file://server/file",
1440 "protocol": "file:",
1444 "hostname": "server",
1446 "pathname": "/file",
1451 "input": "file:///foo/bar.txt",
1452 "base": "file:///tmp/mock/path",
1453 "href": "file:///foo/bar.txt",
1454 "protocol": "file:",
1460 "pathname": "/foo/bar.txt",
1465 "input": "file:///home/me",
1466 "base": "file:///tmp/mock/path",
1467 "href": "file:///home/me",
1468 "protocol": "file:",
1474 "pathname": "/home/me",
1480 "base": "file:///tmp/mock/path",
1482 "protocol": "file:",
1494 "base": "file:///tmp/mock/path",
1496 "protocol": "file:",
1508 "base": "file:///tmp/mock/path",
1509 "href": "file:///test",
1510 "protocol": "file:",
1516 "pathname": "/test",
1521 "input": "file://test",
1522 "base": "file:///tmp/mock/path",
1523 "href": "file://test/",
1524 "protocol": "file:",
1535 "input": "file://localhost",
1536 "base": "file:///tmp/mock/path",
1538 "protocol": "file:",
1549 "input": "file://localhost/",
1550 "base": "file:///tmp/mock/path",
1552 "protocol": "file:",
1563 "input": "file://localhost/test",
1564 "base": "file:///tmp/mock/path",
1565 "href": "file:///test",
1566 "protocol": "file:",
1572 "pathname": "/test",
1578 "base": "file:///tmp/mock/path",
1579 "href": "file:///tmp/mock/test",
1580 "protocol": "file:",
1586 "pathname": "/tmp/mock/test",
1591 "input": "file:test",
1592 "base": "file:///tmp/mock/path",
1593 "href": "file:///tmp/mock/test",
1594 "protocol": "file:",
1600 "pathname": "/tmp/mock/test",
1604 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
1606 "input": "http://example.com/././foo",
1607 "base": "about:blank",
1608 "href": "http://example.com/foo",
1609 "origin": "http://example.com",
1610 "protocol": "http:",
1613 "host": "example.com",
1614 "hostname": "example.com",
1621 "input": "http://example.com/./.foo",
1622 "base": "about:blank",
1623 "href": "http://example.com/.foo",
1624 "origin": "http://example.com",
1625 "protocol": "http:",
1628 "host": "example.com",
1629 "hostname": "example.com",
1631 "pathname": "/.foo",
1636 "input": "http://example.com/foo/.",
1637 "base": "about:blank",
1638 "href": "http://example.com/foo/",
1639 "origin": "http://example.com",
1640 "protocol": "http:",
1643 "host": "example.com",
1644 "hostname": "example.com",
1646 "pathname": "/foo/",
1651 "input": "http://example.com/foo/./",
1652 "base": "about:blank",
1653 "href": "http://example.com/foo/",
1654 "origin": "http://example.com",
1655 "protocol": "http:",
1658 "host": "example.com",
1659 "hostname": "example.com",
1661 "pathname": "/foo/",
1666 "input": "http://example.com/foo/bar/..",
1667 "base": "about:blank",
1668 "href": "http://example.com/foo/",
1669 "origin": "http://example.com",
1670 "protocol": "http:",
1673 "host": "example.com",
1674 "hostname": "example.com",
1676 "pathname": "/foo/",
1681 "input": "http://example.com/foo/bar/../",
1682 "base": "about:blank",
1683 "href": "http://example.com/foo/",
1684 "origin": "http://example.com",
1685 "protocol": "http:",
1688 "host": "example.com",
1689 "hostname": "example.com",
1691 "pathname": "/foo/",
1696 "input": "http://example.com/foo/..bar",
1697 "base": "about:blank",
1698 "href": "http://example.com/foo/..bar",
1699 "origin": "http://example.com",
1700 "protocol": "http:",
1703 "host": "example.com",
1704 "hostname": "example.com",
1706 "pathname": "/foo/..bar",
1711 "input": "http://example.com/foo/bar/../ton",
1712 "base": "about:blank",
1713 "href": "http://example.com/foo/ton",
1714 "origin": "http://example.com",
1715 "protocol": "http:",
1718 "host": "example.com",
1719 "hostname": "example.com",
1721 "pathname": "/foo/ton",
1726 "input": "http://example.com/foo/bar/../ton/../../a",
1727 "base": "about:blank",
1728 "href": "http://example.com/a",
1729 "origin": "http://example.com",
1730 "protocol": "http:",
1733 "host": "example.com",
1734 "hostname": "example.com",
1741 "input": "http://example.com/foo/../../..",
1742 "base": "about:blank",
1743 "href": "http://example.com/",
1744 "origin": "http://example.com",
1745 "protocol": "http:",
1748 "host": "example.com",
1749 "hostname": "example.com",
1756 "input": "http://example.com/foo/../../../ton",
1757 "base": "about:blank",
1758 "href": "http://example.com/ton",
1759 "origin": "http://example.com",
1760 "protocol": "http:",
1763 "host": "example.com",
1764 "hostname": "example.com",
1771 "input": "http://example.com/foo/%2e",
1772 "base": "about:blank",
1773 "href": "http://example.com/foo/",
1774 "origin": "http://example.com",
1775 "protocol": "http:",
1778 "host": "example.com",
1779 "hostname": "example.com",
1781 "pathname": "/foo/",
1786 "input": "http://example.com/foo/%2e%2",
1787 "base": "about:blank",
1788 "href": "http://example.com/foo/.%2",
1789 "origin": "http://example.com",
1790 "protocol": "http:",
1793 "host": "example.com",
1794 "hostname": "example.com",
1796 "pathname": "/foo/.%2",
1801 "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
1802 "base": "about:blank",
1803 "href": "http://example.com/..bar",
1804 "origin": "http://example.com",
1805 "protocol": "http:",
1808 "host": "example.com",
1809 "hostname": "example.com",
1811 "pathname": "/..bar",
1816 "input": "http://example.com////../..",
1817 "base": "about:blank",
1818 "href": "http://example.com//",
1819 "origin": "http://example.com",
1820 "protocol": "http:",
1823 "host": "example.com",
1824 "hostname": "example.com",
1831 "input": "http://example.com/foo/bar//../..",
1832 "base": "about:blank",
1833 "href": "http://example.com/foo/",
1834 "origin": "http://example.com",
1835 "protocol": "http:",
1838 "host": "example.com",
1839 "hostname": "example.com",
1841 "pathname": "/foo/",
1846 "input": "http://example.com/foo/bar//..",
1847 "base": "about:blank",
1848 "href": "http://example.com/foo/bar/",
1849 "origin": "http://example.com",
1850 "protocol": "http:",
1853 "host": "example.com",
1854 "hostname": "example.com",
1856 "pathname": "/foo/bar/",
1861 "input": "http://example.com/foo",
1862 "base": "about:blank",
1863 "href": "http://example.com/foo",
1864 "origin": "http://example.com",
1865 "protocol": "http:",
1868 "host": "example.com",
1869 "hostname": "example.com",
1876 "input": "http://example.com/%20foo",
1877 "base": "about:blank",
1878 "href": "http://example.com/%20foo",
1879 "origin": "http://example.com",
1880 "protocol": "http:",
1883 "host": "example.com",
1884 "hostname": "example.com",
1886 "pathname": "/%20foo",
1891 "input": "http://example.com/foo%",
1892 "base": "about:blank",
1893 "href": "http://example.com/foo%",
1894 "origin": "http://example.com",
1895 "protocol": "http:",
1898 "host": "example.com",
1899 "hostname": "example.com",
1901 "pathname": "/foo%",
1906 "input": "http://example.com/foo%2",
1907 "base": "about:blank",
1908 "href": "http://example.com/foo%2",
1909 "origin": "http://example.com",
1910 "protocol": "http:",
1913 "host": "example.com",
1914 "hostname": "example.com",
1916 "pathname": "/foo%2",
1921 "input": "http://example.com/foo%2zbar",
1922 "base": "about:blank",
1923 "href": "http://example.com/foo%2zbar",
1924 "origin": "http://example.com",
1925 "protocol": "http:",
1928 "host": "example.com",
1929 "hostname": "example.com",
1931 "pathname": "/foo%2zbar",
1936 "input": "http://example.com/foo%2©zbar",
1937 "base": "about:blank",
1938 "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
1939 "origin": "http://example.com",
1940 "protocol": "http:",
1943 "host": "example.com",
1944 "hostname": "example.com",
1946 "pathname": "/foo%2%C3%82%C2%A9zbar",
1951 "input": "http://example.com/foo%41%7a",
1952 "base": "about:blank",
1953 "href": "http://example.com/foo%41%7a",
1954 "origin": "http://example.com",
1955 "protocol": "http:",
1958 "host": "example.com",
1959 "hostname": "example.com",
1961 "pathname": "/foo%41%7a",
1966 "input": "http://example.com/foo\t\u0091%91",
1967 "base": "about:blank",
1968 "href": "http://example.com/foo%C2%91%91",
1969 "origin": "http://example.com",
1970 "protocol": "http:",
1973 "host": "example.com",
1974 "hostname": "example.com",
1976 "pathname": "/foo%C2%91%91",
1981 "input": "http://example.com/foo%00%51",
1982 "base": "about:blank",
1983 "href": "http://example.com/foo%00%51",
1984 "origin": "http://example.com",
1985 "protocol": "http:",
1988 "host": "example.com",
1989 "hostname": "example.com",
1991 "pathname": "/foo%00%51",
1996 "input": "http://example.com/(%28:%3A%29)",
1997 "base": "about:blank",
1998 "href": "http://example.com/(%28:%3A%29)",
1999 "origin": "http://example.com",
2000 "protocol": "http:",
2003 "host": "example.com",
2004 "hostname": "example.com",
2006 "pathname": "/(%28:%3A%29)",
2011 "input": "http://example.com/%3A%3a%3C%3c",
2012 "base": "about:blank",
2013 "href": "http://example.com/%3A%3a%3C%3c",
2014 "origin": "http://example.com",
2015 "protocol": "http:",
2018 "host": "example.com",
2019 "hostname": "example.com",
2021 "pathname": "/%3A%3a%3C%3c",
2026 "input": "http://example.com/foo\tbar",
2027 "base": "about:blank",
2028 "href": "http://example.com/foobar",
2029 "origin": "http://example.com",
2030 "protocol": "http:",
2033 "host": "example.com",
2034 "hostname": "example.com",
2036 "pathname": "/foobar",
2041 "input": "http://example.com\\\\foo\\\\bar",
2042 "base": "about:blank",
2043 "href": "http://example.com//foo//bar",
2044 "origin": "http://example.com",
2045 "protocol": "http:",
2048 "host": "example.com",
2049 "hostname": "example.com",
2051 "pathname": "//foo//bar",
2056 "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2057 "base": "about:blank",
2058 "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2059 "origin": "http://example.com",
2060 "protocol": "http:",
2063 "host": "example.com",
2064 "hostname": "example.com",
2066 "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
2071 "input": "http://example.com/@asdf%40",
2072 "base": "about:blank",
2073 "href": "http://example.com/@asdf%40",
2074 "origin": "http://example.com",
2075 "protocol": "http:",
2078 "host": "example.com",
2079 "hostname": "example.com",
2081 "pathname": "/@asdf%40",
2086 "input": "http://example.com/你好你好",
2087 "base": "about:blank",
2088 "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2089 "origin": "http://example.com",
2090 "protocol": "http:",
2093 "host": "example.com",
2094 "hostname": "example.com",
2096 "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2101 "input": "http://example.com/‥/foo",
2102 "base": "about:blank",
2103 "href": "http://example.com/%E2%80%A5/foo",
2104 "origin": "http://example.com",
2105 "protocol": "http:",
2108 "host": "example.com",
2109 "hostname": "example.com",
2111 "pathname": "/%E2%80%A5/foo",
2116 "input": "http://example.com//foo",
2117 "base": "about:blank",
2118 "href": "http://example.com/%EF%BB%BF/foo",
2119 "origin": "http://example.com",
2120 "protocol": "http:",
2123 "host": "example.com",
2124 "hostname": "example.com",
2126 "pathname": "/%EF%BB%BF/foo",
2131 "input": "http://example.com//foo//bar",
2132 "base": "about:blank",
2133 "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
2134 "origin": "http://example.com",
2135 "protocol": "http:",
2138 "host": "example.com",
2139 "hostname": "example.com",
2141 "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
2145 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
2147 "input": "http://www.google.com/foo?bar=baz#",
2148 "base": "about:blank",
2149 "href": "http://www.google.com/foo?bar=baz#",
2150 "origin": "http://www.google.com",
2151 "protocol": "http:",
2154 "host": "www.google.com",
2155 "hostname": "www.google.com",
2158 "search": "?bar=baz",
2162 "input": "http://www.google.com/foo?bar=baz# »",
2163 "base": "about:blank",
2164 "href": "http://www.google.com/foo?bar=baz# %C2%BB",
2165 "origin": "http://www.google.com",
2166 "protocol": "http:",
2169 "host": "www.google.com",
2170 "hostname": "www.google.com",
2173 "search": "?bar=baz",
2177 "input": "data:test# »",
2178 "base": "about:blank",
2179 "href": "data:test# %C2%BB",
2181 "protocol": "data:",
2192 "input": "http://[www.google.com]/",
2193 "base": "about:blank",
2197 "input": "http://www.google.com",
2198 "base": "about:blank",
2199 "href": "http://www.google.com/",
2200 "origin": "http://www.google.com",
2201 "protocol": "http:",
2204 "host": "www.google.com",
2205 "hostname": "www.google.com",
2212 "input": "http://192.0x00A80001",
2213 "base": "about:blank",
2214 "href": "http://192.168.0.1/",
2215 "origin": "http://192.168.0.1",
2216 "protocol": "http:",
2219 "host": "192.168.0.1",
2220 "hostname": "192.168.0.1",
2227 "input": "http://www/foo%2Ehtml",
2228 "base": "about:blank",
2229 "href": "http://www/foo.html",
2230 "origin": "http://www",
2231 "protocol": "http:",
2237 "pathname": "/foo.html",
2242 "input": "http://www/foo/%2E/html",
2243 "base": "about:blank",
2244 "href": "http://www/foo/html",
2245 "origin": "http://www",
2246 "protocol": "http:",
2252 "pathname": "/foo/html",
2257 "input": "http://user:pass@/",
2258 "base": "about:blank",
2262 "input": "http://%25DOMAIN:foobar@foodomain.com/",
2263 "base": "about:blank",
2264 "href": "http://%25DOMAIN:foobar@foodomain.com/",
2265 "origin": "http://foodomain.com",
2266 "protocol": "http:",
2267 "username": "%25DOMAIN",
2268 "password": "foobar",
2269 "host": "foodomain.com",
2270 "hostname": "foodomain.com",
2277 "input": "http:\\\\www.google.com\\foo",
2278 "base": "about:blank",
2279 "href": "http://www.google.com/foo",
2280 "origin": "http://www.google.com",
2281 "protocol": "http:",
2284 "host": "www.google.com",
2285 "hostname": "www.google.com",
2292 "input": "http://foo:80/",
2293 "base": "about:blank",
2294 "href": "http://foo/",
2295 "origin": "http://foo",
2296 "protocol": "http:",
2307 "input": "http://foo:81/",
2308 "base": "about:blank",
2309 "href": "http://foo:81/",
2310 "origin": "http://foo:81",
2311 "protocol": "http:",
2322 "input": "httpa://foo:80/",
2323 "base": "about:blank",
2324 "href": "httpa://foo:80/",
2326 "protocol": "httpa:",
2337 "input": "http://foo:-80/",
2338 "base": "about:blank",
2342 "input": "https://foo:443/",
2343 "base": "about:blank",
2344 "href": "https://foo/",
2345 "origin": "https://foo",
2346 "protocol": "https:",
2357 "input": "https://foo:80/",
2358 "base": "about:blank",
2359 "href": "https://foo:80/",
2360 "origin": "https://foo:80",
2361 "protocol": "https:",
2372 "input": "ftp://foo:21/",
2373 "base": "about:blank",
2374 "href": "ftp://foo/",
2375 "origin": "ftp://foo",
2387 "input": "ftp://foo:80/",
2388 "base": "about:blank",
2389 "href": "ftp://foo:80/",
2390 "origin": "ftp://foo:80",
2402 "input": "gopher://foo:70/",
2403 "base": "about:blank",
2404 "href": "gopher://foo/",
2405 "origin": "gopher://foo",
2406 "protocol": "gopher:",
2417 "input": "gopher://foo:443/",
2418 "base": "about:blank",
2419 "href": "gopher://foo:443/",
2420 "origin": "gopher://foo:443",
2421 "protocol": "gopher:",
2432 "input": "ws://foo:80/",
2433 "base": "about:blank",
2434 "href": "ws://foo/",
2435 "origin": "ws://foo",
2447 "input": "ws://foo:81/",
2448 "base": "about:blank",
2449 "href": "ws://foo:81/",
2450 "origin": "ws://foo:81",
2462 "input": "ws://foo:443/",
2463 "base": "about:blank",
2464 "href": "ws://foo:443/",
2465 "origin": "ws://foo:443",
2477 "input": "ws://foo:815/",
2478 "base": "about:blank",
2479 "href": "ws://foo:815/",
2480 "origin": "ws://foo:815",
2492 "input": "wss://foo:80/",
2493 "base": "about:blank",
2494 "href": "wss://foo:80/",
2495 "origin": "wss://foo:80",
2507 "input": "wss://foo:81/",
2508 "base": "about:blank",
2509 "href": "wss://foo:81/",
2510 "origin": "wss://foo:81",
2522 "input": "wss://foo:443/",
2523 "base": "about:blank",
2524 "href": "wss://foo/",
2525 "origin": "wss://foo",
2537 "input": "wss://foo:815/",
2538 "base": "about:blank",
2539 "href": "wss://foo:815/",
2540 "origin": "wss://foo:815",
2552 "input": "http:/example.com/",
2553 "base": "about:blank",
2554 "href": "http://example.com/",
2555 "origin": "http://example.com",
2556 "protocol": "http:",
2559 "host": "example.com",
2560 "hostname": "example.com",
2567 "input": "ftp:/example.com/",
2568 "base": "about:blank",
2569 "href": "ftp://example.com/",
2570 "origin": "ftp://example.com",
2574 "host": "example.com",
2575 "hostname": "example.com",
2582 "input": "https:/example.com/",
2583 "base": "about:blank",
2584 "href": "https://example.com/",
2585 "origin": "https://example.com",
2586 "protocol": "https:",
2589 "host": "example.com",
2590 "hostname": "example.com",
2597 "input": "madeupscheme:/example.com/",
2598 "base": "about:blank",
2599 "href": "madeupscheme:/example.com/",
2601 "protocol": "madeupscheme:",
2607 "pathname": "/example.com/",
2612 "input": "file:/example.com/",
2613 "base": "about:blank",
2614 "href": "file:///example.com/",
2615 "protocol": "file:",
2621 "pathname": "/example.com/",
2626 "input": "ftps:/example.com/",
2627 "base": "about:blank",
2628 "href": "ftps:/example.com/",
2630 "protocol": "ftps:",
2636 "pathname": "/example.com/",
2641 "input": "gopher:/example.com/",
2642 "base": "about:blank",
2643 "href": "gopher://example.com/",
2644 "origin": "gopher://example.com",
2645 "protocol": "gopher:",
2648 "host": "example.com",
2649 "hostname": "example.com",
2656 "input": "ws:/example.com/",
2657 "base": "about:blank",
2658 "href": "ws://example.com/",
2659 "origin": "ws://example.com",
2663 "host": "example.com",
2664 "hostname": "example.com",
2671 "input": "wss:/example.com/",
2672 "base": "about:blank",
2673 "href": "wss://example.com/",
2674 "origin": "wss://example.com",
2678 "host": "example.com",
2679 "hostname": "example.com",
2686 "input": "data:/example.com/",
2687 "base": "about:blank",
2688 "href": "data:/example.com/",
2690 "protocol": "data:",
2696 "pathname": "/example.com/",
2701 "input": "javascript:/example.com/",
2702 "base": "about:blank",
2703 "href": "javascript:/example.com/",
2705 "protocol": "javascript:",
2711 "pathname": "/example.com/",
2716 "input": "mailto:/example.com/",
2717 "base": "about:blank",
2718 "href": "mailto:/example.com/",
2720 "protocol": "mailto:",
2726 "pathname": "/example.com/",
2731 "input": "http:example.com/",
2732 "base": "about:blank",
2733 "href": "http://example.com/",
2734 "origin": "http://example.com",
2735 "protocol": "http:",
2738 "host": "example.com",
2739 "hostname": "example.com",
2746 "input": "ftp:example.com/",
2747 "base": "about:blank",
2748 "href": "ftp://example.com/",
2749 "origin": "ftp://example.com",
2753 "host": "example.com",
2754 "hostname": "example.com",
2761 "input": "https:example.com/",
2762 "base": "about:blank",
2763 "href": "https://example.com/",
2764 "origin": "https://example.com",
2765 "protocol": "https:",
2768 "host": "example.com",
2769 "hostname": "example.com",
2776 "input": "madeupscheme:example.com/",
2777 "base": "about:blank",
2778 "href": "madeupscheme:example.com/",
2780 "protocol": "madeupscheme:",
2786 "pathname": "example.com/",
2791 "input": "ftps:example.com/",
2792 "base": "about:blank",
2793 "href": "ftps:example.com/",
2795 "protocol": "ftps:",
2801 "pathname": "example.com/",
2806 "input": "gopher:example.com/",
2807 "base": "about:blank",
2808 "href": "gopher://example.com/",
2809 "origin": "gopher://example.com",
2810 "protocol": "gopher:",
2813 "host": "example.com",
2814 "hostname": "example.com",
2821 "input": "ws:example.com/",
2822 "base": "about:blank",
2823 "href": "ws://example.com/",
2824 "origin": "ws://example.com",
2828 "host": "example.com",
2829 "hostname": "example.com",
2836 "input": "wss:example.com/",
2837 "base": "about:blank",
2838 "href": "wss://example.com/",
2839 "origin": "wss://example.com",
2843 "host": "example.com",
2844 "hostname": "example.com",
2851 "input": "data:example.com/",
2852 "base": "about:blank",
2853 "href": "data:example.com/",
2855 "protocol": "data:",
2861 "pathname": "example.com/",
2866 "input": "javascript:example.com/",
2867 "base": "about:blank",
2868 "href": "javascript:example.com/",
2870 "protocol": "javascript:",
2876 "pathname": "example.com/",
2881 "input": "mailto:example.com/",
2882 "base": "about:blank",
2883 "href": "mailto:example.com/",
2885 "protocol": "mailto:",
2891 "pathname": "example.com/",
2895 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
2897 "input": "http:@www.example.com",
2898 "base": "about:blank",
2899 "href": "http://www.example.com/",
2900 "origin": "http://www.example.com",
2901 "protocol": "http:",
2904 "host": "www.example.com",
2905 "hostname": "www.example.com",
2912 "input": "http:/@www.example.com",
2913 "base": "about:blank",
2914 "href": "http://www.example.com/",
2915 "origin": "http://www.example.com",
2916 "protocol": "http:",
2919 "host": "www.example.com",
2920 "hostname": "www.example.com",
2927 "input": "http://@www.example.com",
2928 "base": "about:blank",
2929 "href": "http://www.example.com/",
2930 "origin": "http://www.example.com",
2931 "protocol": "http:",
2934 "host": "www.example.com",
2935 "hostname": "www.example.com",
2942 "input": "http:a:b@www.example.com",
2943 "base": "about:blank",
2944 "href": "http://a:b@www.example.com/",
2945 "origin": "http://www.example.com",
2946 "protocol": "http:",
2949 "host": "www.example.com",
2950 "hostname": "www.example.com",
2957 "input": "http:/a:b@www.example.com",
2958 "base": "about:blank",
2959 "href": "http://a:b@www.example.com/",
2960 "origin": "http://www.example.com",
2961 "protocol": "http:",
2964 "host": "www.example.com",
2965 "hostname": "www.example.com",
2972 "input": "http://a:b@www.example.com",
2973 "base": "about:blank",
2974 "href": "http://a:b@www.example.com/",
2975 "origin": "http://www.example.com",
2976 "protocol": "http:",
2979 "host": "www.example.com",
2980 "hostname": "www.example.com",
2987 "input": "http://@pple.com",
2988 "base": "about:blank",
2989 "href": "http://pple.com/",
2990 "origin": "http://pple.com",
2991 "protocol": "http:",
2995 "hostname": "pple.com",
3002 "input": "http::b@www.example.com",
3003 "base": "about:blank",
3004 "href": "http://:b@www.example.com/",
3005 "origin": "http://www.example.com",
3006 "protocol": "http:",
3009 "host": "www.example.com",
3010 "hostname": "www.example.com",
3017 "input": "http:/:b@www.example.com",
3018 "base": "about:blank",
3019 "href": "http://:b@www.example.com/",
3020 "origin": "http://www.example.com",
3021 "protocol": "http:",
3024 "host": "www.example.com",
3025 "hostname": "www.example.com",
3032 "input": "http://:b@www.example.com",
3033 "base": "about:blank",
3034 "href": "http://:b@www.example.com/",
3035 "origin": "http://www.example.com",
3036 "protocol": "http:",
3039 "host": "www.example.com",
3040 "hostname": "www.example.com",
3047 "input": "http:/:@/www.example.com",
3048 "base": "about:blank",
3052 "input": "http://user@/www.example.com",
3053 "base": "about:blank",
3057 "input": "http:@/www.example.com",
3058 "base": "about:blank",
3062 "input": "http:/@/www.example.com",
3063 "base": "about:blank",
3067 "input": "http://@/www.example.com",
3068 "base": "about:blank",
3072 "input": "https:@/www.example.com",
3073 "base": "about:blank",
3077 "input": "http:a:b@/www.example.com",
3078 "base": "about:blank",
3082 "input": "http:/a:b@/www.example.com",
3083 "base": "about:blank",
3087 "input": "http://a:b@/www.example.com",
3088 "base": "about:blank",
3092 "input": "http::@/www.example.com",
3093 "base": "about:blank",
3097 "input": "http:a:@www.example.com",
3098 "base": "about:blank",
3099 "href": "http://a:@www.example.com/",
3100 "origin": "http://www.example.com",
3101 "protocol": "http:",
3104 "host": "www.example.com",
3105 "hostname": "www.example.com",
3112 "input": "http:/a:@www.example.com",
3113 "base": "about:blank",
3114 "href": "http://a:@www.example.com/",
3115 "origin": "http://www.example.com",
3116 "protocol": "http:",
3119 "host": "www.example.com",
3120 "hostname": "www.example.com",
3127 "input": "http://a:@www.example.com",
3128 "base": "about:blank",
3129 "href": "http://a:@www.example.com/",
3130 "origin": "http://www.example.com",
3131 "protocol": "http:",
3134 "host": "www.example.com",
3135 "hostname": "www.example.com",
3142 "input": "http://www.@pple.com",
3143 "base": "about:blank",
3144 "href": "http://www.@pple.com/",
3145 "origin": "http://pple.com",
3146 "protocol": "http:",
3150 "hostname": "pple.com",
3157 "input": "http:@:www.example.com",
3158 "base": "about:blank",
3162 "input": "http:/@:www.example.com",
3163 "base": "about:blank",
3167 "input": "http://@:www.example.com",
3168 "base": "about:blank",
3172 "input": "http://:@www.example.com",
3173 "base": "about:blank",
3174 "href": "http://:@www.example.com/",
3175 "origin": "http://www.example.com",
3176 "protocol": "http:",
3179 "host": "www.example.com",
3180 "hostname": "www.example.com",
3189 "base": "http://www.example.com/test",
3190 "href": "http://www.example.com/",
3191 "origin": "http://www.example.com",
3192 "protocol": "http:",
3195 "host": "www.example.com",
3196 "hostname": "www.example.com",
3203 "input": "/test.txt",
3204 "base": "http://www.example.com/test",
3205 "href": "http://www.example.com/test.txt",
3206 "origin": "http://www.example.com",
3207 "protocol": "http:",
3210 "host": "www.example.com",
3211 "hostname": "www.example.com",
3213 "pathname": "/test.txt",
3219 "base": "http://www.example.com/test",
3220 "href": "http://www.example.com/",
3221 "origin": "http://www.example.com",
3222 "protocol": "http:",
3225 "host": "www.example.com",
3226 "hostname": "www.example.com",
3234 "base": "http://www.example.com/test",
3235 "href": "http://www.example.com/",
3236 "origin": "http://www.example.com",
3237 "protocol": "http:",
3240 "host": "www.example.com",
3241 "hostname": "www.example.com",
3248 "input": "test.txt",
3249 "base": "http://www.example.com/test",
3250 "href": "http://www.example.com/test.txt",
3251 "origin": "http://www.example.com",
3252 "protocol": "http:",
3255 "host": "www.example.com",
3256 "hostname": "www.example.com",
3258 "pathname": "/test.txt",
3263 "input": "./test.txt",
3264 "base": "http://www.example.com/test",
3265 "href": "http://www.example.com/test.txt",
3266 "origin": "http://www.example.com",
3267 "protocol": "http:",
3270 "host": "www.example.com",
3271 "hostname": "www.example.com",
3273 "pathname": "/test.txt",
3278 "input": "../test.txt",
3279 "base": "http://www.example.com/test",
3280 "href": "http://www.example.com/test.txt",
3281 "origin": "http://www.example.com",
3282 "protocol": "http:",
3285 "host": "www.example.com",
3286 "hostname": "www.example.com",
3288 "pathname": "/test.txt",
3293 "input": "../aaa/test.txt",
3294 "base": "http://www.example.com/test",
3295 "href": "http://www.example.com/aaa/test.txt",
3296 "origin": "http://www.example.com",
3297 "protocol": "http:",
3300 "host": "www.example.com",
3301 "hostname": "www.example.com",
3303 "pathname": "/aaa/test.txt",
3308 "input": "../../test.txt",
3309 "base": "http://www.example.com/test",
3310 "href": "http://www.example.com/test.txt",
3311 "origin": "http://www.example.com",
3312 "protocol": "http:",
3315 "host": "www.example.com",
3316 "hostname": "www.example.com",
3318 "pathname": "/test.txt",
3323 "input": "中/test.txt",
3324 "base": "http://www.example.com/test",
3325 "href": "http://www.example.com/%E4%B8%AD/test.txt",
3326 "origin": "http://www.example.com",
3327 "protocol": "http:",
3330 "host": "www.example.com",
3331 "hostname": "www.example.com",
3333 "pathname": "/%E4%B8%AD/test.txt",
3338 "input": "http://www.example2.com",
3339 "base": "http://www.example.com/test",
3340 "href": "http://www.example2.com/",
3341 "origin": "http://www.example2.com",
3342 "protocol": "http:",
3345 "host": "www.example2.com",
3346 "hostname": "www.example2.com",
3353 "input": "//www.example2.com",
3354 "base": "http://www.example.com/test",
3355 "href": "http://www.example2.com/",
3356 "origin": "http://www.example2.com",
3357 "protocol": "http:",
3360 "host": "www.example2.com",
3361 "hostname": "www.example2.com",
3368 "input": "file:...",
3369 "base": "http://www.example.com/test",
3370 "href": "file:///...",
3371 "protocol": "file:",
3383 "base": "http://www.example.com/test",
3385 "protocol": "file:",
3397 "base": "http://www.example.com/test",
3398 "href": "file:///a",
3399 "protocol": "file:",
3409 "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/host.html",
3410 "Basic canonicalization, uppercase should be converted to lowercase",
3412 "input": "http://ExAmPlE.CoM",
3413 "base": "http://other.com/",
3414 "href": "http://example.com/",
3415 "origin": "http://example.com",
3416 "protocol": "http:",
3419 "host": "example.com",
3420 "hostname": "example.com",
3427 "input": "http://example example.com",
3428 "base": "http://other.com/",
3432 "input": "http://Goo%20 goo%7C|.com",
3433 "base": "http://other.com/",
3437 "input": "http://[]",
3438 "base": "http://other.com/",
3442 "input": "http://[:]",
3443 "base": "http://other.com/",
3446 "U+3000 is mapped to U+0020 (space) which is disallowed",
3448 "input": "http://GOO\u00a0\u3000goo.com",
3449 "base": "http://other.com/",
3452 "Other types of space (no-break, zero-width, zero-width-no-break) are name-prepped away to nothing. U+200B, U+2060, and U+FEFF, are ignored",
3454 "input": "http://GOO\u200b\u2060\ufeffgoo.com",
3455 "base": "http://other.com/",
3456 "href": "http://googoo.com/",
3457 "origin": "http://googoo.com",
3458 "protocol": "http:",
3461 "host": "googoo.com",
3462 "hostname": "googoo.com",
3468 "Ideographic full stop (full-width period for Chinese, etc.) should be treated as a dot. U+3002 is mapped to U+002E (dot)",
3470 "input": "http://www.foo。bar.com",
3471 "base": "http://other.com/",
3472 "href": "http://www.foo.bar.com/",
3473 "origin": "http://www.foo.bar.com",
3474 "protocol": "http:",
3477 "host": "www.foo.bar.com",
3478 "hostname": "www.foo.bar.com",
3484 "Invalid unicode characters should fail... U+FDD0 is disallowed; %ef%b7%90 is U+FDD0",
3486 "input": "http://\ufdd0zyx.com",
3487 "base": "http://other.com/",
3490 "This is the same as previous but escaped",
3492 "input": "http://%ef%b7%90zyx.com",
3493 "base": "http://other.com/",
3496 "Test name prepping, fullwidth input should be converted to ASCII and NOT IDN-ized. This is 'Go' in fullwidth UTF-8/UTF-16.",
3498 "input": "http://Go.com",
3499 "base": "http://other.com/",
3500 "href": "http://go.com/",
3501 "origin": "http://go.com",
3502 "protocol": "http:",
3506 "hostname": "go.com",
3512 "URL spec forbids the following. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24257",
3514 "input": "http://%41.com",
3515 "base": "http://other.com/",
3519 "input": "http://%ef%bc%85%ef%bc%94%ef%bc%91.com",
3520 "base": "http://other.com/",
3523 "...%00 in fullwidth should fail (also as escaped UTF-8 input)",
3525 "input": "http://%00.com",
3526 "base": "http://other.com/",
3530 "input": "http://%ef%bc%85%ef%bc%90%ef%bc%90.com",
3531 "base": "http://other.com/",
3534 "Basic IDN support, UTF-8 and UTF-16 input should be converted to IDN",
3536 "input": "http://你好你好",
3537 "base": "http://other.com/",
3538 "href": "http://xn--6qqa088eba/",
3539 "origin": "http://你好你好",
3540 "protocol": "http:",
3543 "host": "xn--6qqa088eba",
3544 "hostname": "xn--6qqa088eba",
3550 "Invalid escaped characters should fail and the percents should be escaped. https://www.w3.org/Bugs/Public/show_bug.cgi?id=24191",
3552 "input": "http://%zz%66%a.com",
3553 "base": "http://other.com/",
3556 "If we get an invalid character that has been escaped.",
3558 "input": "http://%25",
3559 "base": "http://other.com/",
3563 "input": "http://hello%00",
3564 "base": "http://other.com/",
3567 "Escaped numbers should be treated like IP addresses if they are.",
3569 "input": "http://%30%78%63%30%2e%30%32%35%30.01",
3570 "base": "http://other.com/",
3571 "href": "http://192.168.0.1/",
3572 "origin": "http://192.168.0.1",
3573 "protocol": "http:",
3576 "host": "192.168.0.1",
3577 "hostname": "192.168.0.1",
3584 "input": "http://%30%78%63%30%2e%30%32%35%30.01%2e",
3585 "base": "http://other.com/",
3586 "href": "http://192.168.0.1/",
3587 "origin": "http://192.168.0.1",
3588 "protocol": "http:",
3591 "host": "192.168.0.1",
3592 "hostname": "192.168.0.1",
3599 "input": "http://192.168.0.257",
3600 "base": "http://other.com/",
3603 "Invalid escaping should trigger the regular host error handling",
3605 "input": "http://%3g%78%63%30%2e%30%32%35%30%2E.01",
3606 "base": "http://other.com/",
3609 "Something that isn't exactly an IP should get treated as a host and spaces escaped",
3611 "input": "http://192.168.0.1 hello",
3612 "base": "http://other.com/",
3615 "Fullwidth and escaped UTF-8 fullwidth should still be treated as IP",
3617 "input": "http://0Xc0.0250.01",
3618 "base": "http://other.com/",
3619 "href": "http://192.168.0.1/",
3620 "origin": "http://192.168.0.1",
3621 "protocol": "http:",
3624 "host": "192.168.0.1",
3625 "hostname": "192.168.0.1",
3633 "input": "http://[google.com]",
3634 "base": "http://other.com/",
3639 "input": "http://foo:💩@example.com/bar",
3640 "base": "http://other.com/",
3641 "href": "http://foo:%F0%9F%92%A9@example.com/bar",
3642 "origin": "http://example.com",
3643 "protocol": "http:",
3645 "password": "%F0%9F%92%A9",
3646 "host": "example.com",
3647 "hostname": "example.com",
3653 "# resolving a fragment against any scheme succeeds",
3656 "base": "test:test",
3657 "href": "test:test#",
3659 "protocol": "test:",
3671 "base": "mailto:x@x.com",
3672 "href": "mailto:x@x.com#x",
3674 "protocol": "mailto:",
3680 "pathname": "x@x.com",
3689 "protocol": "data:",
3701 "base": "about:blank",
3702 "href": "about:blank#x",
3704 "protocol": "about:",
3710 "pathname": "blank",
3716 "base": "test:test?test",
3717 "href": "test:test?test#",
3719 "protocol": "test:",
3729 "# multiple @ in authority state",
3731 "input": "https://@test@test@example:800/",
3732 "base": "http://doesnotmatter/",
3733 "href": "https://%40test%40test@example:800/",
3734 "origin": "https://example:800",
3735 "protocol": "https:",
3736 "username": "%40test%40test",
3738 "host": "example:800",
3739 "hostname": "example",
3746 "input": "https://@@@example",
3747 "base": "http://doesnotmatter/",
3748 "href": "https://%40%40@example/",
3749 "origin": "https://example",
3750 "protocol": "https:",
3751 "username": "%40%40",
3754 "hostname": "example",
3760 "non-az-09 characters",
3762 "input": "http://`{}:`{}@h/`{}?`{}",
3763 "base": "http://doesnotmatter/",
3764 "href": "http://%60%7B%7D:%60%7B%7D@h/%60%7B%7D?`{}",
3765 "origin": "http://h",
3766 "protocol": "http:",
3767 "username": "%60%7B%7D",
3768 "password": "%60%7B%7D",
3772 "pathname": "/%60%7B%7D",
3776 "# Credentials in base",
3778 "input": "/some/path",
3779 "base": "http://user@example.org/smth",
3780 "href": "http://user@example.org/some/path",
3781 "origin": "http://example.org",
3782 "protocol": "http:",
3785 "host": "example.org",
3786 "hostname": "example.org",
3788 "pathname": "/some/path",
3794 "base": "http://user:pass@example.org:21/smth",
3795 "href": "http://user:pass@example.org:21/smth",
3796 "origin": "http://example.org:21",
3797 "protocol": "http:",
3800 "host": "example.org:21",
3801 "hostname": "example.org",
3803 "pathname": "/smth",
3808 "input": "/some/path",
3809 "base": "http://user:pass@example.org:21/smth",
3810 "href": "http://user:pass@example.org:21/some/path",
3811 "origin": "http://example.org:21",
3812 "protocol": "http:",
3815 "host": "example.org:21",
3816 "hostname": "example.org",
3818 "pathname": "/some/path",
3822 "# a set of tests designed by zcorpan for relative URLs with unknown schemes",
3835 "base": "sc:/pa/pa",
3844 "pathname": "/pa/i",
3850 "base": "sc://ho/pa",
3851 "href": "sc://ho/i",
3865 "base": "sc:///pa/pa",
3866 "href": "sc:///pa/i",
3874 "pathname": "/pa/i",
3890 "base": "sc:/pa/pa",
3905 "base": "sc://ho/pa",
3906 "href": "sc://ho/i",
3920 "base": "sc:///pa/pa",
3945 "base": "sc:/pa/pa",
3960 "base": "sc://ho/pa",
3961 "href": "sc://ho/i",
3975 "base": "sc:///pa/pa",
4000 "base": "sc:/pa/pa",
4001 "href": "sc:/pa/pa?i",
4009 "pathname": "/pa/pa",
4015 "base": "sc://ho/pa",
4016 "href": "sc://ho/pa?i",
4030 "base": "sc:///pa/pa",
4031 "href": "sc:///pa/pa?i",
4039 "pathname": "/pa/pa",
4061 "href": "sc:sd/sd#i",
4069 "pathname": "sd/sd",
4075 "base": "sc:/pa/pa",
4076 "href": "sc:/pa/pa#i",
4084 "pathname": "/pa/pa",
4090 "base": "sc://ho/pa",
4091 "href": "sc://ho/pa#i",
4105 "base": "sc:///pa/pa",
4106 "href": "sc:///pa/pa#i",
4114 "pathname": "/pa/pa",
4118 "# make sure that relative URL logic works on known typically non-relative schemes too",
4120 "input": "about:/../",
4121 "base": "about:blank",
4124 "protocol": "about:",
4135 "input": "data:/../",
4136 "base": "about:blank",
4139 "protocol": "data:",
4150 "input": "javascript:/../",
4151 "base": "about:blank",
4152 "href": "javascript:/",
4154 "protocol": "javascript:",
4165 "input": "mailto:/../",
4166 "base": "about:blank",
4169 "protocol": "mailto:",
4179 "# unknown schemes and non-ASCII domains",
4181 "input": "sc://ñ.test/",
4182 "base": "about:blank",
4183 "href": "sc://xn--ida.test/",
4188 "host": "xn--ida.test",
4189 "hostname": "xn--ida.test",
4195 "# unknown schemes and backslashes",
4197 "input": "sc:\\../",
4198 "base": "about:blank",
4207 "pathname": "\\../",
4211 "# unknown scheme with path looking like a password",
4213 "input": "sc::a@example.net",
4214 "base": "about:blank",
4215 "href": "sc::a@example.net",
4223 "pathname": ":a@example.net",
4227 "# tests from jsdom/whatwg-url designed for code coverage",
4229 "input": "http://127.0.0.1:10100/relative_import.html",
4230 "base": "about:blank",
4231 "href": "http://127.0.0.1:10100/relative_import.html",
4232 "origin": "http://127.0.0.1:10100",
4233 "protocol": "http:",
4236 "host": "127.0.0.1:10100",
4237 "hostname": "127.0.0.1",
4239 "pathname": "/relative_import.html",
4244 "input": "http://facebook.com/?foo=%7B%22abc%22",
4245 "base": "about:blank",
4246 "href": "http://facebook.com/?foo=%7B%22abc%22",
4247 "origin": "http://facebook.com",
4248 "protocol": "http:",
4251 "host": "facebook.com",
4252 "hostname": "facebook.com",
4255 "search": "?foo=%7B%22abc%22",
4259 "input": "https://localhost:3000/jqueryui@1.2.3",
4260 "base": "about:blank",
4261 "href": "https://localhost:3000/jqueryui@1.2.3",
4262 "origin": "https://localhost:3000",
4263 "protocol": "https:",
4266 "host": "localhost:3000",
4267 "hostname": "localhost",
4269 "pathname": "/jqueryui@1.2.3",
4275 "input": "h\tt\nt\rp://h\to\ns\rt:9\t0\n0\r0/p\ta\nt\rh?q\tu\ne\rry#f\tr\na\rg",
4276 "base": "about:blank",
4277 "href": "http://host:9000/path?query#frag",
4278 "origin": "http://host:9000",
4279 "protocol": "http:",
4282 "host": "host:9000",
4285 "pathname": "/path",
4289 "# Stringification of URL.searchParams",
4291 "input": "?a=b&c=d",
4292 "base": "http://example.org/foo/bar",
4293 "href": "http://example.org/foo/bar?a=b&c=d",
4294 "origin": "http://example.org",
4295 "protocol": "http:",
4298 "host": "example.org",
4299 "hostname": "example.org",
4301 "pathname": "/foo/bar",
4302 "search": "?a=b&c=d",
4303 "searchParams": "a=b&c=d",
4307 "input": "??a=b&c=d",
4308 "base": "http://example.org/foo/bar",
4309 "href": "http://example.org/foo/bar??a=b&c=d",
4310 "origin": "http://example.org",
4311 "protocol": "http:",
4314 "host": "example.org",
4315 "hostname": "example.org",
4317 "pathname": "/foo/bar",
4318 "search": "??a=b&c=d",
4319 "searchParams": "%3Fa=b&c=d",
4325 "base": "http://example.org/foo/bar",
4326 "href": "http://example.org/foo/bar",
4327 "origin": "http://example.org",
4328 "protocol": "http:",
4331 "host": "example.org",
4332 "hostname": "example.org",
4334 "pathname": "/foo/bar",
4341 "base": "https://example.org/foo/bar",
4346 "base": "https://example.org/foo/bar",
4360 "# Percent encoding of fragments",
4362 "input": "http://foo.bar/baz?qux#foo\bbar",
4363 "base": "about:blank",
4364 "href": "http://foo.bar/baz?qux#foo%08bar",
4365 "origin": "http://foo.bar",
4366 "protocol": "http:",
4370 "hostname": "foo.bar",
4375 "hash": "#foo%08bar"
4377 "# IPv6 compression and serialization",
4379 "input": "http://[fe80:cd00::1257:0:211e:729c]/",
4380 "base": "about:blank",
4381 "href": "http://[fe80:cd00::1257:0:211e:729c]/",
4382 "origin": "http://[fe80:cd00::1257:0:211e:729c]",
4383 "protocol": "http:",
4386 "host": "[fe80:cd00::1257:0:211e:729c]",
4387 "hostname": "[fe80:cd00::1257:0:211e:729c]",
4394 "# IPv6 compression and serialization: Compress sequences of two or more zeroes",
4396 "input": "http://[fe80:cd00:0:0:1257:0:211e:729c]/",
4397 "base": "about:blank",
4398 "href": "http://[fe80:cd00::1257:0:211e:729c]/",
4399 "origin": "http://[fe80:cd00::1257:0:211e:729c]",
4400 "protocol": "http:",
4403 "host": "[fe80:cd00::1257:0:211e:729c]",
4404 "hostname": "[fe80:cd00::1257:0:211e:729c]",
4411 "# IPv6 compression and serialization: Compress longest sequence of zeroes",
4413 "input": "http://[fe80:0:0:1257:0:0:0:cd00]/",
4414 "base": "about:blank",
4415 "href": "http://[fe80:0:0:1257::cd00]/",
4416 "origin": "http://[fe80:0:0:1257::cd00]",
4417 "protocol": "http:",
4420 "host": "[fe80:0:0:1257::cd00]",
4421 "hostname": "[fe80:0:0:1257::cd00]",
4428 "# IPv6 compression and serialization: Do not compress lone zeroes",
4430 "input": "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
4431 "base": "about:blank",
4432 "href": "http://[fe80:cd00:0:cde:1257:0:211e:729c]/",
4433 "origin": "http://[fe80:cd00:0:cde:1257:0:211e:729c]",
4434 "protocol": "http:",
4437 "host": "[fe80:cd00:0:cde:1257:0:211e:729c]",
4438 "hostname": "[fe80:cd00:0:cde:1257:0:211e:729c]",