Sync web-platform-tests up to revision a5b95cb31914507088a4eda16f7674bbc6f3313f
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / url / urltestdata.json
1 [
2   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/segments.js",
3   {
4     "input": "http://example\t.\norg",
5     "base": "http://example.org/foo/bar",
6     "href": "http://example.org/",
7     "origin": "http://example.org",
8     "protocol": "http:",
9     "username": "",
10     "password": "",
11     "host": "example.org",
12     "hostname": "example.org",
13     "port": "",
14     "pathname": "/",
15     "search": "",
16     "hash": ""
17   },
18   {
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",
23     "protocol": "http:",
24     "username": "user",
25     "password": "pass",
26     "host": "foo:21",
27     "hostname": "foo",
28     "port": "21",
29     "pathname": "/bar;par",
30     "search": "?b",
31     "hash": "#c"
32   },
33   {
34     "input": "https://test:@test",
35     "base": "about:blank",
36     "href": "https://test@test/",
37     "origin": "https://test",
38     "protocol": "https:",
39     "username": "test",
40     "password": "",
41     "host": "test",
42     "hostname": "test",
43     "port": "",
44     "pathname": "/",
45     "search": "",
46     "hash": ""
47   },
48   {
49     "input": "https://:@test",
50     "base": "about:blank",
51     "href": "https://test/",
52     "origin": "https://test",
53     "protocol": "https:",
54     "username": "",
55     "password": "",
56     "host": "test",
57     "hostname": "test",
58     "port": "",
59     "pathname": "/",
60     "search": "",
61     "hash": ""
62   },
63   {
64     "input": "non-special://test:@test/x",
65     "base": "about:blank",
66     "href": "non-special://test@test/x",
67     "origin": "null",
68     "protocol": "non-special:",
69     "username": "test",
70     "password": "",
71     "host": "test",
72     "hostname": "test",
73     "port": "",
74     "pathname": "/x",
75     "search": "",
76     "hash": ""
77   },
78   {
79     "input": "non-special://:@test/x",
80     "base": "about:blank",
81     "href": "non-special://test/x",
82     "origin": "null",
83     "protocol": "non-special:",
84     "username": "",
85     "password": "",
86     "host": "test",
87     "hostname": "test",
88     "port": "",
89     "pathname": "/x",
90     "search": "",
91     "hash": ""
92   },
93   {
94     "input": "http:foo.com",
95     "base": "http://example.org/foo/bar",
96     "href": "http://example.org/foo/foo.com",
97     "origin": "http://example.org",
98     "protocol": "http:",
99     "username": "",
100     "password": "",
101     "host": "example.org",
102     "hostname": "example.org",
103     "port": "",
104     "pathname": "/foo/foo.com",
105     "search": "",
106     "hash": ""
107   },
108   {
109     "input": "\t   :foo.com   \n",
110     "base": "http://example.org/foo/bar",
111     "href": "http://example.org/foo/:foo.com",
112     "origin": "http://example.org",
113     "protocol": "http:",
114     "username": "",
115     "password": "",
116     "host": "example.org",
117     "hostname": "example.org",
118     "port": "",
119     "pathname": "/foo/:foo.com",
120     "search": "",
121     "hash": ""
122   },
123   {
124     "input": " foo.com  ",
125     "base": "http://example.org/foo/bar",
126     "href": "http://example.org/foo/foo.com",
127     "origin": "http://example.org",
128     "protocol": "http:",
129     "username": "",
130     "password": "",
131     "host": "example.org",
132     "hostname": "example.org",
133     "port": "",
134     "pathname": "/foo/foo.com",
135     "search": "",
136     "hash": ""
137   },
138   {
139     "input": "a:\t foo.com",
140     "base": "http://example.org/foo/bar",
141     "href": "a: foo.com",
142     "origin": "null",
143     "protocol": "a:",
144     "username": "",
145     "password": "",
146     "host": "",
147     "hostname": "",
148     "port": "",
149     "pathname": " foo.com",
150     "search": "",
151     "hash": ""
152   },
153   {
154     "input": "http://f:21/ b ? d # e ",
155     "base": "http://example.org/foo/bar",
156     "href": "http://f:21/%20b%20?%20d%20# e",
157     "origin": "http://f:21",
158     "protocol": "http:",
159     "username": "",
160     "password": "",
161     "host": "f:21",
162     "hostname": "f",
163     "port": "21",
164     "pathname": "/%20b%20",
165     "search": "?%20d%20",
166     "hash": "# e"
167   },
168   {
169     "input": "lolscheme:x x#x x",
170     "base": "about:blank",
171     "href": "lolscheme:x x#x x",
172     "protocol": "lolscheme:",
173     "username": "",
174     "password": "",
175     "host": "",
176     "hostname": "",
177     "port": "",
178     "pathname": "x x",
179     "search": "",
180     "hash": "#x x"
181   },
182   {
183     "input": "http://f:/c",
184     "base": "http://example.org/foo/bar",
185     "href": "http://f/c",
186     "origin": "http://f",
187     "protocol": "http:",
188     "username": "",
189     "password": "",
190     "host": "f",
191     "hostname": "f",
192     "port": "",
193     "pathname": "/c",
194     "search": "",
195     "hash": ""
196   },
197   {
198     "input": "http://f:0/c",
199     "base": "http://example.org/foo/bar",
200     "href": "http://f:0/c",
201     "origin": "http://f:0",
202     "protocol": "http:",
203     "username": "",
204     "password": "",
205     "host": "f:0",
206     "hostname": "f",
207     "port": "0",
208     "pathname": "/c",
209     "search": "",
210     "hash": ""
211   },
212   {
213     "input": "http://f:00000000000000/c",
214     "base": "http://example.org/foo/bar",
215     "href": "http://f:0/c",
216     "origin": "http://f:0",
217     "protocol": "http:",
218     "username": "",
219     "password": "",
220     "host": "f:0",
221     "hostname": "f",
222     "port": "0",
223     "pathname": "/c",
224     "search": "",
225     "hash": ""
226   },
227   {
228     "input": "http://f:00000000000000000000080/c",
229     "base": "http://example.org/foo/bar",
230     "href": "http://f/c",
231     "origin": "http://f",
232     "protocol": "http:",
233     "username": "",
234     "password": "",
235     "host": "f",
236     "hostname": "f",
237     "port": "",
238     "pathname": "/c",
239     "search": "",
240     "hash": ""
241   },
242   {
243     "input": "http://f:b/c",
244     "base": "http://example.org/foo/bar",
245     "failure": true
246   },
247   {
248     "input": "http://f: /c",
249     "base": "http://example.org/foo/bar",
250     "failure": true
251   },
252   {
253     "input": "http://f:\n/c",
254     "base": "http://example.org/foo/bar",
255     "href": "http://f/c",
256     "origin": "http://f",
257     "protocol": "http:",
258     "username": "",
259     "password": "",
260     "host": "f",
261     "hostname": "f",
262     "port": "",
263     "pathname": "/c",
264     "search": "",
265     "hash": ""
266   },
267   {
268     "input": "http://f:fifty-two/c",
269     "base": "http://example.org/foo/bar",
270     "failure": true
271   },
272   {
273     "input": "http://f:999999/c",
274     "base": "http://example.org/foo/bar",
275     "failure": true
276   },
277   {
278     "input": "http://f: 21 / b ? d # e ",
279     "base": "http://example.org/foo/bar",
280     "failure": true
281   },
282   {
283     "input": "",
284     "base": "http://example.org/foo/bar",
285     "href": "http://example.org/foo/bar",
286     "origin": "http://example.org",
287     "protocol": "http:",
288     "username": "",
289     "password": "",
290     "host": "example.org",
291     "hostname": "example.org",
292     "port": "",
293     "pathname": "/foo/bar",
294     "search": "",
295     "hash": ""
296   },
297   {
298     "input": "  \t",
299     "base": "http://example.org/foo/bar",
300     "href": "http://example.org/foo/bar",
301     "origin": "http://example.org",
302     "protocol": "http:",
303     "username": "",
304     "password": "",
305     "host": "example.org",
306     "hostname": "example.org",
307     "port": "",
308     "pathname": "/foo/bar",
309     "search": "",
310     "hash": ""
311   },
312   {
313     "input": ":foo.com/",
314     "base": "http://example.org/foo/bar",
315     "href": "http://example.org/foo/:foo.com/",
316     "origin": "http://example.org",
317     "protocol": "http:",
318     "username": "",
319     "password": "",
320     "host": "example.org",
321     "hostname": "example.org",
322     "port": "",
323     "pathname": "/foo/:foo.com/",
324     "search": "",
325     "hash": ""
326   },
327   {
328     "input": ":foo.com\\",
329     "base": "http://example.org/foo/bar",
330     "href": "http://example.org/foo/:foo.com/",
331     "origin": "http://example.org",
332     "protocol": "http:",
333     "username": "",
334     "password": "",
335     "host": "example.org",
336     "hostname": "example.org",
337     "port": "",
338     "pathname": "/foo/:foo.com/",
339     "search": "",
340     "hash": ""
341   },
342   {
343     "input": ":",
344     "base": "http://example.org/foo/bar",
345     "href": "http://example.org/foo/:",
346     "origin": "http://example.org",
347     "protocol": "http:",
348     "username": "",
349     "password": "",
350     "host": "example.org",
351     "hostname": "example.org",
352     "port": "",
353     "pathname": "/foo/:",
354     "search": "",
355     "hash": ""
356   },
357   {
358     "input": ":a",
359     "base": "http://example.org/foo/bar",
360     "href": "http://example.org/foo/:a",
361     "origin": "http://example.org",
362     "protocol": "http:",
363     "username": "",
364     "password": "",
365     "host": "example.org",
366     "hostname": "example.org",
367     "port": "",
368     "pathname": "/foo/:a",
369     "search": "",
370     "hash": ""
371   },
372   {
373     "input": ":/",
374     "base": "http://example.org/foo/bar",
375     "href": "http://example.org/foo/:/",
376     "origin": "http://example.org",
377     "protocol": "http:",
378     "username": "",
379     "password": "",
380     "host": "example.org",
381     "hostname": "example.org",
382     "port": "",
383     "pathname": "/foo/:/",
384     "search": "",
385     "hash": ""
386   },
387   {
388     "input": ":\\",
389     "base": "http://example.org/foo/bar",
390     "href": "http://example.org/foo/:/",
391     "origin": "http://example.org",
392     "protocol": "http:",
393     "username": "",
394     "password": "",
395     "host": "example.org",
396     "hostname": "example.org",
397     "port": "",
398     "pathname": "/foo/:/",
399     "search": "",
400     "hash": ""
401   },
402   {
403     "input": ":#",
404     "base": "http://example.org/foo/bar",
405     "href": "http://example.org/foo/:#",
406     "origin": "http://example.org",
407     "protocol": "http:",
408     "username": "",
409     "password": "",
410     "host": "example.org",
411     "hostname": "example.org",
412     "port": "",
413     "pathname": "/foo/:",
414     "search": "",
415     "hash": ""
416   },
417   {
418     "input": "#",
419     "base": "http://example.org/foo/bar",
420     "href": "http://example.org/foo/bar#",
421     "origin": "http://example.org",
422     "protocol": "http:",
423     "username": "",
424     "password": "",
425     "host": "example.org",
426     "hostname": "example.org",
427     "port": "",
428     "pathname": "/foo/bar",
429     "search": "",
430     "hash": ""
431   },
432   {
433     "input": "#/",
434     "base": "http://example.org/foo/bar",
435     "href": "http://example.org/foo/bar#/",
436     "origin": "http://example.org",
437     "protocol": "http:",
438     "username": "",
439     "password": "",
440     "host": "example.org",
441     "hostname": "example.org",
442     "port": "",
443     "pathname": "/foo/bar",
444     "search": "",
445     "hash": "#/"
446   },
447   {
448     "input": "#\\",
449     "base": "http://example.org/foo/bar",
450     "href": "http://example.org/foo/bar#\\",
451     "origin": "http://example.org",
452     "protocol": "http:",
453     "username": "",
454     "password": "",
455     "host": "example.org",
456     "hostname": "example.org",
457     "port": "",
458     "pathname": "/foo/bar",
459     "search": "",
460     "hash": "#\\"
461   },
462   {
463     "input": "#;?",
464     "base": "http://example.org/foo/bar",
465     "href": "http://example.org/foo/bar#;?",
466     "origin": "http://example.org",
467     "protocol": "http:",
468     "username": "",
469     "password": "",
470     "host": "example.org",
471     "hostname": "example.org",
472     "port": "",
473     "pathname": "/foo/bar",
474     "search": "",
475     "hash": "#;?"
476   },
477   {
478     "input": "?",
479     "base": "http://example.org/foo/bar",
480     "href": "http://example.org/foo/bar?",
481     "origin": "http://example.org",
482     "protocol": "http:",
483     "username": "",
484     "password": "",
485     "host": "example.org",
486     "hostname": "example.org",
487     "port": "",
488     "pathname": "/foo/bar",
489     "search": "",
490     "hash": ""
491   },
492   {
493     "input": "/",
494     "base": "http://example.org/foo/bar",
495     "href": "http://example.org/",
496     "origin": "http://example.org",
497     "protocol": "http:",
498     "username": "",
499     "password": "",
500     "host": "example.org",
501     "hostname": "example.org",
502     "port": "",
503     "pathname": "/",
504     "search": "",
505     "hash": ""
506   },
507   {
508     "input": ":23",
509     "base": "http://example.org/foo/bar",
510     "href": "http://example.org/foo/:23",
511     "origin": "http://example.org",
512     "protocol": "http:",
513     "username": "",
514     "password": "",
515     "host": "example.org",
516     "hostname": "example.org",
517     "port": "",
518     "pathname": "/foo/:23",
519     "search": "",
520     "hash": ""
521   },
522   {
523     "input": "/:23",
524     "base": "http://example.org/foo/bar",
525     "href": "http://example.org/:23",
526     "origin": "http://example.org",
527     "protocol": "http:",
528     "username": "",
529     "password": "",
530     "host": "example.org",
531     "hostname": "example.org",
532     "port": "",
533     "pathname": "/:23",
534     "search": "",
535     "hash": ""
536   },
537   {
538     "input": "::",
539     "base": "http://example.org/foo/bar",
540     "href": "http://example.org/foo/::",
541     "origin": "http://example.org",
542     "protocol": "http:",
543     "username": "",
544     "password": "",
545     "host": "example.org",
546     "hostname": "example.org",
547     "port": "",
548     "pathname": "/foo/::",
549     "search": "",
550     "hash": ""
551   },
552   {
553     "input": "::23",
554     "base": "http://example.org/foo/bar",
555     "href": "http://example.org/foo/::23",
556     "origin": "http://example.org",
557     "protocol": "http:",
558     "username": "",
559     "password": "",
560     "host": "example.org",
561     "hostname": "example.org",
562     "port": "",
563     "pathname": "/foo/::23",
564     "search": "",
565     "hash": ""
566   },
567   {
568     "input": "foo://",
569     "base": "http://example.org/foo/bar",
570     "href": "foo://",
571     "origin": "null",
572     "protocol": "foo:",
573     "username": "",
574     "password": "",
575     "host": "",
576     "hostname": "",
577     "port": "",
578     "pathname": "",
579     "search": "",
580     "hash": ""
581   },
582   {
583     "input": "http://a:b@c:29/d",
584     "base": "http://example.org/foo/bar",
585     "href": "http://a:b@c:29/d",
586     "origin": "http://c:29",
587     "protocol": "http:",
588     "username": "a",
589     "password": "b",
590     "host": "c:29",
591     "hostname": "c",
592     "port": "29",
593     "pathname": "/d",
594     "search": "",
595     "hash": ""
596   },
597   {
598     "input": "http::@c:29",
599     "base": "http://example.org/foo/bar",
600     "href": "http://example.org/foo/:@c:29",
601     "origin": "http://example.org",
602     "protocol": "http:",
603     "username": "",
604     "password": "",
605     "host": "example.org",
606     "hostname": "example.org",
607     "port": "",
608     "pathname": "/foo/:@c:29",
609     "search": "",
610     "hash": ""
611   },
612   {
613     "input": "http://&a:foo(b]c@d:2/",
614     "base": "http://example.org/foo/bar",
615     "href": "http://&a:foo(b%5Dc@d:2/",
616     "origin": "http://d:2",
617     "protocol": "http:",
618     "username": "&a",
619     "password": "foo(b%5Dc",
620     "host": "d:2",
621     "hostname": "d",
622     "port": "2",
623     "pathname": "/",
624     "search": "",
625     "hash": ""
626   },
627   {
628     "input": "http://::@c@d:2",
629     "base": "http://example.org/foo/bar",
630     "href": "http://:%3A%40c@d:2/",
631     "origin": "http://d:2",
632     "protocol": "http:",
633     "username": "",
634     "password": "%3A%40c",
635     "host": "d:2",
636     "hostname": "d",
637     "port": "2",
638     "pathname": "/",
639     "search": "",
640     "hash": ""
641   },
642   {
643     "input": "http://foo.com:b@d/",
644     "base": "http://example.org/foo/bar",
645     "href": "http://foo.com:b@d/",
646     "origin": "http://d",
647     "protocol": "http:",
648     "username": "foo.com",
649     "password": "b",
650     "host": "d",
651     "hostname": "d",
652     "port": "",
653     "pathname": "/",
654     "search": "",
655     "hash": ""
656   },
657   {
658     "input": "http://foo.com/\\@",
659     "base": "http://example.org/foo/bar",
660     "href": "http://foo.com//@",
661     "origin": "http://foo.com",
662     "protocol": "http:",
663     "username": "",
664     "password": "",
665     "host": "foo.com",
666     "hostname": "foo.com",
667     "port": "",
668     "pathname": "//@",
669     "search": "",
670     "hash": ""
671   },
672   {
673     "input": "http:\\\\foo.com\\",
674     "base": "http://example.org/foo/bar",
675     "href": "http://foo.com/",
676     "origin": "http://foo.com",
677     "protocol": "http:",
678     "username": "",
679     "password": "",
680     "host": "foo.com",
681     "hostname": "foo.com",
682     "port": "",
683     "pathname": "/",
684     "search": "",
685     "hash": ""
686   },
687   {
688     "input": "http:\\\\a\\b:c\\d@foo.com\\",
689     "base": "http://example.org/foo/bar",
690     "href": "http://a/b:c/d@foo.com/",
691     "origin": "http://a",
692     "protocol": "http:",
693     "username": "",
694     "password": "",
695     "host": "a",
696     "hostname": "a",
697     "port": "",
698     "pathname": "/b:c/d@foo.com/",
699     "search": "",
700     "hash": ""
701   },
702   {
703     "input": "foo:/",
704     "base": "http://example.org/foo/bar",
705     "href": "foo:/",
706     "origin": "null",
707     "protocol": "foo:",
708     "username": "",
709     "password": "",
710     "host": "",
711     "hostname": "",
712     "port": "",
713     "pathname": "/",
714     "search": "",
715     "hash": ""
716   },
717   {
718     "input": "foo:/bar.com/",
719     "base": "http://example.org/foo/bar",
720     "href": "foo:/bar.com/",
721     "origin": "null",
722     "protocol": "foo:",
723     "username": "",
724     "password": "",
725     "host": "",
726     "hostname": "",
727     "port": "",
728     "pathname": "/bar.com/",
729     "search": "",
730     "hash": ""
731   },
732   {
733     "input": "foo://///////",
734     "base": "http://example.org/foo/bar",
735     "href": "foo://///////",
736     "origin": "null",
737     "protocol": "foo:",
738     "username": "",
739     "password": "",
740     "host": "",
741     "hostname": "",
742     "port": "",
743     "pathname": "///////",
744     "search": "",
745     "hash": ""
746   },
747   {
748     "input": "foo://///////bar.com/",
749     "base": "http://example.org/foo/bar",
750     "href": "foo://///////bar.com/",
751     "origin": "null",
752     "protocol": "foo:",
753     "username": "",
754     "password": "",
755     "host": "",
756     "hostname": "",
757     "port": "",
758     "pathname": "///////bar.com/",
759     "search": "",
760     "hash": ""
761   },
762   {
763     "input": "foo:////://///",
764     "base": "http://example.org/foo/bar",
765     "href": "foo:////://///",
766     "origin": "null",
767     "protocol": "foo:",
768     "username": "",
769     "password": "",
770     "host": "",
771     "hostname": "",
772     "port": "",
773     "pathname": "//://///",
774     "search": "",
775     "hash": ""
776   },
777   {
778     "input": "c:/foo",
779     "base": "http://example.org/foo/bar",
780     "href": "c:/foo",
781     "origin": "null",
782     "protocol": "c:",
783     "username": "",
784     "password": "",
785     "host": "",
786     "hostname": "",
787     "port": "",
788     "pathname": "/foo",
789     "search": "",
790     "hash": ""
791   },
792   {
793     "input": "//foo/bar",
794     "base": "http://example.org/foo/bar",
795     "href": "http://foo/bar",
796     "origin": "http://foo",
797     "protocol": "http:",
798     "username": "",
799     "password": "",
800     "host": "foo",
801     "hostname": "foo",
802     "port": "",
803     "pathname": "/bar",
804     "search": "",
805     "hash": ""
806   },
807   {
808     "input": "http://foo/path;a??e#f#g",
809     "base": "http://example.org/foo/bar",
810     "href": "http://foo/path;a??e#f#g",
811     "origin": "http://foo",
812     "protocol": "http:",
813     "username": "",
814     "password": "",
815     "host": "foo",
816     "hostname": "foo",
817     "port": "",
818     "pathname": "/path;a",
819     "search": "??e",
820     "hash": "#f#g"
821   },
822   {
823     "input": "http://foo/abcd?efgh?ijkl",
824     "base": "http://example.org/foo/bar",
825     "href": "http://foo/abcd?efgh?ijkl",
826     "origin": "http://foo",
827     "protocol": "http:",
828     "username": "",
829     "password": "",
830     "host": "foo",
831     "hostname": "foo",
832     "port": "",
833     "pathname": "/abcd",
834     "search": "?efgh?ijkl",
835     "hash": ""
836   },
837   {
838     "input": "http://foo/abcd#foo?bar",
839     "base": "http://example.org/foo/bar",
840     "href": "http://foo/abcd#foo?bar",
841     "origin": "http://foo",
842     "protocol": "http:",
843     "username": "",
844     "password": "",
845     "host": "foo",
846     "hostname": "foo",
847     "port": "",
848     "pathname": "/abcd",
849     "search": "",
850     "hash": "#foo?bar"
851   },
852   {
853     "input": "[61:24:74]:98",
854     "base": "http://example.org/foo/bar",
855     "href": "http://example.org/foo/[61:24:74]:98",
856     "origin": "http://example.org",
857     "protocol": "http:",
858     "username": "",
859     "password": "",
860     "host": "example.org",
861     "hostname": "example.org",
862     "port": "",
863     "pathname": "/foo/[61:24:74]:98",
864     "search": "",
865     "hash": ""
866   },
867   {
868     "input": "http:[61:27]/:foo",
869     "base": "http://example.org/foo/bar",
870     "href": "http://example.org/foo/[61:27]/:foo",
871     "origin": "http://example.org",
872     "protocol": "http:",
873     "username": "",
874     "password": "",
875     "host": "example.org",
876     "hostname": "example.org",
877     "port": "",
878     "pathname": "/foo/[61:27]/:foo",
879     "search": "",
880     "hash": ""
881   },
882   {
883     "input": "http://[1::2]:3:4",
884     "base": "http://example.org/foo/bar",
885     "failure": true
886   },
887   {
888     "input": "http://2001::1",
889     "base": "http://example.org/foo/bar",
890     "failure": true
891   },
892   {
893     "input": "http://2001::1]",
894     "base": "http://example.org/foo/bar",
895     "failure": true
896   },
897   {
898     "input": "http://2001::1]:80",
899     "base": "http://example.org/foo/bar",
900     "failure": true
901   },
902   {
903     "input": "http://[2001::1]",
904     "base": "http://example.org/foo/bar",
905     "href": "http://[2001::1]/",
906     "origin": "http://[2001::1]",
907     "protocol": "http:",
908     "username": "",
909     "password": "",
910     "host": "[2001::1]",
911     "hostname": "[2001::1]",
912     "port": "",
913     "pathname": "/",
914     "search": "",
915     "hash": ""
916   },
917   {
918     "input": "http://[::127.0.0.1]",
919     "base": "http://example.org/foo/bar",
920     "href": "http://[::7f00:1]/",
921     "origin": "http://[::7f00:1]",
922     "protocol": "http:",
923     "username": "",
924     "password": "",
925     "host": "[::7f00:1]",
926     "hostname": "[::7f00:1]",
927     "port": "",
928     "pathname": "/",
929     "search": "",
930     "hash": ""
931   },
932   {
933     "input": "http://[0:0:0:0:0:0:13.1.68.3]",
934     "base": "http://example.org/foo/bar",
935     "href": "http://[::d01:4403]/",
936     "origin": "http://[::d01:4403]",
937     "protocol": "http:",
938     "username": "",
939     "password": "",
940     "host": "[::d01:4403]",
941     "hostname": "[::d01:4403]",
942     "port": "",
943     "pathname": "/",
944     "search": "",
945     "hash": ""
946   },
947   {
948     "input": "http://[2001::1]:80",
949     "base": "http://example.org/foo/bar",
950     "href": "http://[2001::1]/",
951     "origin": "http://[2001::1]",
952     "protocol": "http:",
953     "username": "",
954     "password": "",
955     "host": "[2001::1]",
956     "hostname": "[2001::1]",
957     "port": "",
958     "pathname": "/",
959     "search": "",
960     "hash": ""
961   },
962   {
963     "input": "http:/example.com/",
964     "base": "http://example.org/foo/bar",
965     "href": "http://example.org/example.com/",
966     "origin": "http://example.org",
967     "protocol": "http:",
968     "username": "",
969     "password": "",
970     "host": "example.org",
971     "hostname": "example.org",
972     "port": "",
973     "pathname": "/example.com/",
974     "search": "",
975     "hash": ""
976   },
977   {
978     "input": "ftp:/example.com/",
979     "base": "http://example.org/foo/bar",
980     "href": "ftp://example.com/",
981     "origin": "ftp://example.com",
982     "protocol": "ftp:",
983     "username": "",
984     "password": "",
985     "host": "example.com",
986     "hostname": "example.com",
987     "port": "",
988     "pathname": "/",
989     "search": "",
990     "hash": ""
991   },
992   {
993     "input": "https:/example.com/",
994     "base": "http://example.org/foo/bar",
995     "href": "https://example.com/",
996     "origin": "https://example.com",
997     "protocol": "https:",
998     "username": "",
999     "password": "",
1000     "host": "example.com",
1001     "hostname": "example.com",
1002     "port": "",
1003     "pathname": "/",
1004     "search": "",
1005     "hash": ""
1006   },
1007   {
1008     "input": "madeupscheme:/example.com/",
1009     "base": "http://example.org/foo/bar",
1010     "href": "madeupscheme:/example.com/",
1011     "origin": "null",
1012     "protocol": "madeupscheme:",
1013     "username": "",
1014     "password": "",
1015     "host": "",
1016     "hostname": "",
1017     "port": "",
1018     "pathname": "/example.com/",
1019     "search": "",
1020     "hash": ""
1021   },
1022   {
1023     "input": "file:/example.com/",
1024     "base": "http://example.org/foo/bar",
1025     "href": "file:///example.com/",
1026     "protocol": "file:",
1027     "username": "",
1028     "password": "",
1029     "host": "",
1030     "hostname": "",
1031     "port": "",
1032     "pathname": "/example.com/",
1033     "search": "",
1034     "hash": ""
1035   },
1036   {
1037     "input": "file://example:1/",
1038     "base": "about:blank",
1039     "failure": true
1040   },
1041   {
1042     "input": "file://example:test/",
1043     "base": "about:blank",
1044     "failure": true
1045   },
1046   {
1047     "input": "file://example%/",
1048     "base": "about:blank",
1049     "failure": true
1050   },
1051   {
1052     "input": "file://[example]/",
1053     "base": "about:blank",
1054     "failure": true
1055   },
1056   {
1057     "input": "ftps:/example.com/",
1058     "base": "http://example.org/foo/bar",
1059     "href": "ftps:/example.com/",
1060     "origin": "null",
1061     "protocol": "ftps:",
1062     "username": "",
1063     "password": "",
1064     "host": "",
1065     "hostname": "",
1066     "port": "",
1067     "pathname": "/example.com/",
1068     "search": "",
1069     "hash": ""
1070   },
1071   {
1072     "input": "gopher:/example.com/",
1073     "base": "http://example.org/foo/bar",
1074     "href": "gopher://example.com/",
1075     "origin": "gopher://example.com",
1076     "protocol": "gopher:",
1077     "username": "",
1078     "password": "",
1079     "host": "example.com",
1080     "hostname": "example.com",
1081     "port": "",
1082     "pathname": "/",
1083     "search": "",
1084     "hash": ""
1085   },
1086   {
1087     "input": "ws:/example.com/",
1088     "base": "http://example.org/foo/bar",
1089     "href": "ws://example.com/",
1090     "origin": "ws://example.com",
1091     "protocol": "ws:",
1092     "username": "",
1093     "password": "",
1094     "host": "example.com",
1095     "hostname": "example.com",
1096     "port": "",
1097     "pathname": "/",
1098     "search": "",
1099     "hash": ""
1100   },
1101   {
1102     "input": "wss:/example.com/",
1103     "base": "http://example.org/foo/bar",
1104     "href": "wss://example.com/",
1105     "origin": "wss://example.com",
1106     "protocol": "wss:",
1107     "username": "",
1108     "password": "",
1109     "host": "example.com",
1110     "hostname": "example.com",
1111     "port": "",
1112     "pathname": "/",
1113     "search": "",
1114     "hash": ""
1115   },
1116   {
1117     "input": "data:/example.com/",
1118     "base": "http://example.org/foo/bar",
1119     "href": "data:/example.com/",
1120     "origin": "null",
1121     "protocol": "data:",
1122     "username": "",
1123     "password": "",
1124     "host": "",
1125     "hostname": "",
1126     "port": "",
1127     "pathname": "/example.com/",
1128     "search": "",
1129     "hash": ""
1130   },
1131   {
1132     "input": "javascript:/example.com/",
1133     "base": "http://example.org/foo/bar",
1134     "href": "javascript:/example.com/",
1135     "origin": "null",
1136     "protocol": "javascript:",
1137     "username": "",
1138     "password": "",
1139     "host": "",
1140     "hostname": "",
1141     "port": "",
1142     "pathname": "/example.com/",
1143     "search": "",
1144     "hash": ""
1145   },
1146   {
1147     "input": "mailto:/example.com/",
1148     "base": "http://example.org/foo/bar",
1149     "href": "mailto:/example.com/",
1150     "origin": "null",
1151     "protocol": "mailto:",
1152     "username": "",
1153     "password": "",
1154     "host": "",
1155     "hostname": "",
1156     "port": "",
1157     "pathname": "/example.com/",
1158     "search": "",
1159     "hash": ""
1160   },
1161   {
1162     "input": "http:example.com/",
1163     "base": "http://example.org/foo/bar",
1164     "href": "http://example.org/foo/example.com/",
1165     "origin": "http://example.org",
1166     "protocol": "http:",
1167     "username": "",
1168     "password": "",
1169     "host": "example.org",
1170     "hostname": "example.org",
1171     "port": "",
1172     "pathname": "/foo/example.com/",
1173     "search": "",
1174     "hash": ""
1175   },
1176   {
1177     "input": "ftp:example.com/",
1178     "base": "http://example.org/foo/bar",
1179     "href": "ftp://example.com/",
1180     "origin": "ftp://example.com",
1181     "protocol": "ftp:",
1182     "username": "",
1183     "password": "",
1184     "host": "example.com",
1185     "hostname": "example.com",
1186     "port": "",
1187     "pathname": "/",
1188     "search": "",
1189     "hash": ""
1190   },
1191   {
1192     "input": "https:example.com/",
1193     "base": "http://example.org/foo/bar",
1194     "href": "https://example.com/",
1195     "origin": "https://example.com",
1196     "protocol": "https:",
1197     "username": "",
1198     "password": "",
1199     "host": "example.com",
1200     "hostname": "example.com",
1201     "port": "",
1202     "pathname": "/",
1203     "search": "",
1204     "hash": ""
1205   },
1206   {
1207     "input": "madeupscheme:example.com/",
1208     "base": "http://example.org/foo/bar",
1209     "href": "madeupscheme:example.com/",
1210     "origin": "null",
1211     "protocol": "madeupscheme:",
1212     "username": "",
1213     "password": "",
1214     "host": "",
1215     "hostname": "",
1216     "port": "",
1217     "pathname": "example.com/",
1218     "search": "",
1219     "hash": ""
1220   },
1221   {
1222     "input": "ftps:example.com/",
1223     "base": "http://example.org/foo/bar",
1224     "href": "ftps:example.com/",
1225     "origin": "null",
1226     "protocol": "ftps:",
1227     "username": "",
1228     "password": "",
1229     "host": "",
1230     "hostname": "",
1231     "port": "",
1232     "pathname": "example.com/",
1233     "search": "",
1234     "hash": ""
1235   },
1236   {
1237     "input": "gopher:example.com/",
1238     "base": "http://example.org/foo/bar",
1239     "href": "gopher://example.com/",
1240     "origin": "gopher://example.com",
1241     "protocol": "gopher:",
1242     "username": "",
1243     "password": "",
1244     "host": "example.com",
1245     "hostname": "example.com",
1246     "port": "",
1247     "pathname": "/",
1248     "search": "",
1249     "hash": ""
1250   },
1251   {
1252     "input": "ws:example.com/",
1253     "base": "http://example.org/foo/bar",
1254     "href": "ws://example.com/",
1255     "origin": "ws://example.com",
1256     "protocol": "ws:",
1257     "username": "",
1258     "password": "",
1259     "host": "example.com",
1260     "hostname": "example.com",
1261     "port": "",
1262     "pathname": "/",
1263     "search": "",
1264     "hash": ""
1265   },
1266   {
1267     "input": "wss:example.com/",
1268     "base": "http://example.org/foo/bar",
1269     "href": "wss://example.com/",
1270     "origin": "wss://example.com",
1271     "protocol": "wss:",
1272     "username": "",
1273     "password": "",
1274     "host": "example.com",
1275     "hostname": "example.com",
1276     "port": "",
1277     "pathname": "/",
1278     "search": "",
1279     "hash": ""
1280   },
1281   {
1282     "input": "data:example.com/",
1283     "base": "http://example.org/foo/bar",
1284     "href": "data:example.com/",
1285     "origin": "null",
1286     "protocol": "data:",
1287     "username": "",
1288     "password": "",
1289     "host": "",
1290     "hostname": "",
1291     "port": "",
1292     "pathname": "example.com/",
1293     "search": "",
1294     "hash": ""
1295   },
1296   {
1297     "input": "javascript:example.com/",
1298     "base": "http://example.org/foo/bar",
1299     "href": "javascript:example.com/",
1300     "origin": "null",
1301     "protocol": "javascript:",
1302     "username": "",
1303     "password": "",
1304     "host": "",
1305     "hostname": "",
1306     "port": "",
1307     "pathname": "example.com/",
1308     "search": "",
1309     "hash": ""
1310   },
1311   {
1312     "input": "mailto:example.com/",
1313     "base": "http://example.org/foo/bar",
1314     "href": "mailto:example.com/",
1315     "origin": "null",
1316     "protocol": "mailto:",
1317     "username": "",
1318     "password": "",
1319     "host": "",
1320     "hostname": "",
1321     "port": "",
1322     "pathname": "example.com/",
1323     "search": "",
1324     "hash": ""
1325   },
1326   {
1327     "input": "/a/b/c",
1328     "base": "http://example.org/foo/bar",
1329     "href": "http://example.org/a/b/c",
1330     "origin": "http://example.org",
1331     "protocol": "http:",
1332     "username": "",
1333     "password": "",
1334     "host": "example.org",
1335     "hostname": "example.org",
1336     "port": "",
1337     "pathname": "/a/b/c",
1338     "search": "",
1339     "hash": ""
1340   },
1341   {
1342     "input": "/a/ /c",
1343     "base": "http://example.org/foo/bar",
1344     "href": "http://example.org/a/%20/c",
1345     "origin": "http://example.org",
1346     "protocol": "http:",
1347     "username": "",
1348     "password": "",
1349     "host": "example.org",
1350     "hostname": "example.org",
1351     "port": "",
1352     "pathname": "/a/%20/c",
1353     "search": "",
1354     "hash": ""
1355   },
1356   {
1357     "input": "/a%2fc",
1358     "base": "http://example.org/foo/bar",
1359     "href": "http://example.org/a%2fc",
1360     "origin": "http://example.org",
1361     "protocol": "http:",
1362     "username": "",
1363     "password": "",
1364     "host": "example.org",
1365     "hostname": "example.org",
1366     "port": "",
1367     "pathname": "/a%2fc",
1368     "search": "",
1369     "hash": ""
1370   },
1371   {
1372     "input": "/a/%2f/c",
1373     "base": "http://example.org/foo/bar",
1374     "href": "http://example.org/a/%2f/c",
1375     "origin": "http://example.org",
1376     "protocol": "http:",
1377     "username": "",
1378     "password": "",
1379     "host": "example.org",
1380     "hostname": "example.org",
1381     "port": "",
1382     "pathname": "/a/%2f/c",
1383     "search": "",
1384     "hash": ""
1385   },
1386   {
1387     "input": "#β",
1388     "base": "http://example.org/foo/bar",
1389     "href": "http://example.org/foo/bar#%CE%B2",
1390     "origin": "http://example.org",
1391     "protocol": "http:",
1392     "username": "",
1393     "password": "",
1394     "host": "example.org",
1395     "hostname": "example.org",
1396     "port": "",
1397     "pathname": "/foo/bar",
1398     "search": "",
1399     "hash": "#%CE%B2"
1400   },
1401   {
1402     "input": "data:text/html,test#test",
1403     "base": "http://example.org/foo/bar",
1404     "href": "data:text/html,test#test",
1405     "origin": "null",
1406     "protocol": "data:",
1407     "username": "",
1408     "password": "",
1409     "host": "",
1410     "hostname": "",
1411     "port": "",
1412     "pathname": "text/html,test",
1413     "search": "",
1414     "hash": "#test"
1415   },
1416   {
1417     "input": "tel:1234567890",
1418     "base": "http://example.org/foo/bar",
1419     "href": "tel:1234567890",
1420     "origin": "null",
1421     "protocol": "tel:",
1422     "username": "",
1423     "password": "",
1424     "host": "",
1425     "hostname": "",
1426     "port": "",
1427     "pathname": "1234567890",
1428     "search": "",
1429     "hash": ""
1430   },
1431   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/file.html",
1432   {
1433     "input": "file:c:\\foo\\bar.html",
1434     "base": "file:///tmp/mock/path",
1435     "href": "file:///c:/foo/bar.html",
1436     "protocol": "file:",
1437     "username": "",
1438     "password": "",
1439     "host": "",
1440     "hostname": "",
1441     "port": "",
1442     "pathname": "/c:/foo/bar.html",
1443     "search": "",
1444     "hash": ""
1445   },
1446   {
1447     "input": "  File:c|////foo\\bar.html",
1448     "base": "file:///tmp/mock/path",
1449     "href": "file:///c:////foo/bar.html",
1450     "protocol": "file:",
1451     "username": "",
1452     "password": "",
1453     "host": "",
1454     "hostname": "",
1455     "port": "",
1456     "pathname": "/c:////foo/bar.html",
1457     "search": "",
1458     "hash": ""
1459   },
1460   {
1461     "input": "C|/foo/bar",
1462     "base": "file:///tmp/mock/path",
1463     "href": "file:///C:/foo/bar",
1464     "protocol": "file:",
1465     "username": "",
1466     "password": "",
1467     "host": "",
1468     "hostname": "",
1469     "port": "",
1470     "pathname": "/C:/foo/bar",
1471     "search": "",
1472     "hash": ""
1473   },
1474   {
1475     "input": "/C|\\foo\\bar",
1476     "base": "file:///tmp/mock/path",
1477     "href": "file:///C:/foo/bar",
1478     "protocol": "file:",
1479     "username": "",
1480     "password": "",
1481     "host": "",
1482     "hostname": "",
1483     "port": "",
1484     "pathname": "/C:/foo/bar",
1485     "search": "",
1486     "hash": ""
1487   },
1488   {
1489     "input": "//C|/foo/bar",
1490     "base": "file:///tmp/mock/path",
1491     "href": "file:///C:/foo/bar",
1492     "protocol": "file:",
1493     "username": "",
1494     "password": "",
1495     "host": "",
1496     "hostname": "",
1497     "port": "",
1498     "pathname": "/C:/foo/bar",
1499     "search": "",
1500     "hash": ""
1501   },
1502   {
1503     "input": "//server/file",
1504     "base": "file:///tmp/mock/path",
1505     "href": "file://server/file",
1506     "protocol": "file:",
1507     "username": "",
1508     "password": "",
1509     "host": "server",
1510     "hostname": "server",
1511     "port": "",
1512     "pathname": "/file",
1513     "search": "",
1514     "hash": ""
1515   },
1516   {
1517     "input": "\\\\server\\file",
1518     "base": "file:///tmp/mock/path",
1519     "href": "file://server/file",
1520     "protocol": "file:",
1521     "username": "",
1522     "password": "",
1523     "host": "server",
1524     "hostname": "server",
1525     "port": "",
1526     "pathname": "/file",
1527     "search": "",
1528     "hash": ""
1529   },
1530   {
1531     "input": "/\\server/file",
1532     "base": "file:///tmp/mock/path",
1533     "href": "file://server/file",
1534     "protocol": "file:",
1535     "username": "",
1536     "password": "",
1537     "host": "server",
1538     "hostname": "server",
1539     "port": "",
1540     "pathname": "/file",
1541     "search": "",
1542     "hash": ""
1543   },
1544   {
1545     "input": "file:///foo/bar.txt",
1546     "base": "file:///tmp/mock/path",
1547     "href": "file:///foo/bar.txt",
1548     "protocol": "file:",
1549     "username": "",
1550     "password": "",
1551     "host": "",
1552     "hostname": "",
1553     "port": "",
1554     "pathname": "/foo/bar.txt",
1555     "search": "",
1556     "hash": ""
1557   },
1558   {
1559     "input": "file:///home/me",
1560     "base": "file:///tmp/mock/path",
1561     "href": "file:///home/me",
1562     "protocol": "file:",
1563     "username": "",
1564     "password": "",
1565     "host": "",
1566     "hostname": "",
1567     "port": "",
1568     "pathname": "/home/me",
1569     "search": "",
1570     "hash": ""
1571   },
1572   {
1573     "input": "//",
1574     "base": "file:///tmp/mock/path",
1575     "href": "file:///",
1576     "protocol": "file:",
1577     "username": "",
1578     "password": "",
1579     "host": "",
1580     "hostname": "",
1581     "port": "",
1582     "pathname": "/",
1583     "search": "",
1584     "hash": ""
1585   },
1586   {
1587     "input": "///",
1588     "base": "file:///tmp/mock/path",
1589     "href": "file:///",
1590     "protocol": "file:",
1591     "username": "",
1592     "password": "",
1593     "host": "",
1594     "hostname": "",
1595     "port": "",
1596     "pathname": "/",
1597     "search": "",
1598     "hash": ""
1599   },
1600   {
1601     "input": "///test",
1602     "base": "file:///tmp/mock/path",
1603     "href": "file:///test",
1604     "protocol": "file:",
1605     "username": "",
1606     "password": "",
1607     "host": "",
1608     "hostname": "",
1609     "port": "",
1610     "pathname": "/test",
1611     "search": "",
1612     "hash": ""
1613   },
1614   {
1615     "input": "file://test",
1616     "base": "file:///tmp/mock/path",
1617     "href": "file://test/",
1618     "protocol": "file:",
1619     "username": "",
1620     "password": "",
1621     "host": "test",
1622     "hostname": "test",
1623     "port": "",
1624     "pathname": "/",
1625     "search": "",
1626     "hash": ""
1627   },
1628   {
1629     "input": "file://localhost",
1630     "base": "file:///tmp/mock/path",
1631     "href": "file:///",
1632     "protocol": "file:",
1633     "username": "",
1634     "password": "",
1635     "host": "",
1636     "hostname": "",
1637     "port": "",
1638     "pathname": "/",
1639     "search": "",
1640     "hash": ""
1641   },
1642   {
1643     "input": "file://localhost/",
1644     "base": "file:///tmp/mock/path",
1645     "href": "file:///",
1646     "protocol": "file:",
1647     "username": "",
1648     "password": "",
1649     "host": "",
1650     "hostname": "",
1651     "port": "",
1652     "pathname": "/",
1653     "search": "",
1654     "hash": ""
1655   },
1656   {
1657     "input": "file://localhost/test",
1658     "base": "file:///tmp/mock/path",
1659     "href": "file:///test",
1660     "protocol": "file:",
1661     "username": "",
1662     "password": "",
1663     "host": "",
1664     "hostname": "",
1665     "port": "",
1666     "pathname": "/test",
1667     "search": "",
1668     "hash": ""
1669   },
1670   {
1671     "input": "test",
1672     "base": "file:///tmp/mock/path",
1673     "href": "file:///tmp/mock/test",
1674     "protocol": "file:",
1675     "username": "",
1676     "password": "",
1677     "host": "",
1678     "hostname": "",
1679     "port": "",
1680     "pathname": "/tmp/mock/test",
1681     "search": "",
1682     "hash": ""
1683   },
1684   {
1685     "input": "file:test",
1686     "base": "file:///tmp/mock/path",
1687     "href": "file:///tmp/mock/test",
1688     "protocol": "file:",
1689     "username": "",
1690     "password": "",
1691     "host": "",
1692     "hostname": "",
1693     "port": "",
1694     "pathname": "/tmp/mock/test",
1695     "search": "",
1696     "hash": ""
1697   },
1698   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/path.js",
1699   {
1700     "input": "http://example.com/././foo",
1701     "base": "about:blank",
1702     "href": "http://example.com/foo",
1703     "origin": "http://example.com",
1704     "protocol": "http:",
1705     "username": "",
1706     "password": "",
1707     "host": "example.com",
1708     "hostname": "example.com",
1709     "port": "",
1710     "pathname": "/foo",
1711     "search": "",
1712     "hash": ""
1713   },
1714   {
1715     "input": "http://example.com/./.foo",
1716     "base": "about:blank",
1717     "href": "http://example.com/.foo",
1718     "origin": "http://example.com",
1719     "protocol": "http:",
1720     "username": "",
1721     "password": "",
1722     "host": "example.com",
1723     "hostname": "example.com",
1724     "port": "",
1725     "pathname": "/.foo",
1726     "search": "",
1727     "hash": ""
1728   },
1729   {
1730     "input": "http://example.com/foo/.",
1731     "base": "about:blank",
1732     "href": "http://example.com/foo/",
1733     "origin": "http://example.com",
1734     "protocol": "http:",
1735     "username": "",
1736     "password": "",
1737     "host": "example.com",
1738     "hostname": "example.com",
1739     "port": "",
1740     "pathname": "/foo/",
1741     "search": "",
1742     "hash": ""
1743   },
1744   {
1745     "input": "http://example.com/foo/./",
1746     "base": "about:blank",
1747     "href": "http://example.com/foo/",
1748     "origin": "http://example.com",
1749     "protocol": "http:",
1750     "username": "",
1751     "password": "",
1752     "host": "example.com",
1753     "hostname": "example.com",
1754     "port": "",
1755     "pathname": "/foo/",
1756     "search": "",
1757     "hash": ""
1758   },
1759   {
1760     "input": "http://example.com/foo/bar/..",
1761     "base": "about:blank",
1762     "href": "http://example.com/foo/",
1763     "origin": "http://example.com",
1764     "protocol": "http:",
1765     "username": "",
1766     "password": "",
1767     "host": "example.com",
1768     "hostname": "example.com",
1769     "port": "",
1770     "pathname": "/foo/",
1771     "search": "",
1772     "hash": ""
1773   },
1774   {
1775     "input": "http://example.com/foo/bar/../",
1776     "base": "about:blank",
1777     "href": "http://example.com/foo/",
1778     "origin": "http://example.com",
1779     "protocol": "http:",
1780     "username": "",
1781     "password": "",
1782     "host": "example.com",
1783     "hostname": "example.com",
1784     "port": "",
1785     "pathname": "/foo/",
1786     "search": "",
1787     "hash": ""
1788   },
1789   {
1790     "input": "http://example.com/foo/..bar",
1791     "base": "about:blank",
1792     "href": "http://example.com/foo/..bar",
1793     "origin": "http://example.com",
1794     "protocol": "http:",
1795     "username": "",
1796     "password": "",
1797     "host": "example.com",
1798     "hostname": "example.com",
1799     "port": "",
1800     "pathname": "/foo/..bar",
1801     "search": "",
1802     "hash": ""
1803   },
1804   {
1805     "input": "http://example.com/foo/bar/../ton",
1806     "base": "about:blank",
1807     "href": "http://example.com/foo/ton",
1808     "origin": "http://example.com",
1809     "protocol": "http:",
1810     "username": "",
1811     "password": "",
1812     "host": "example.com",
1813     "hostname": "example.com",
1814     "port": "",
1815     "pathname": "/foo/ton",
1816     "search": "",
1817     "hash": ""
1818   },
1819   {
1820     "input": "http://example.com/foo/bar/../ton/../../a",
1821     "base": "about:blank",
1822     "href": "http://example.com/a",
1823     "origin": "http://example.com",
1824     "protocol": "http:",
1825     "username": "",
1826     "password": "",
1827     "host": "example.com",
1828     "hostname": "example.com",
1829     "port": "",
1830     "pathname": "/a",
1831     "search": "",
1832     "hash": ""
1833   },
1834   {
1835     "input": "http://example.com/foo/../../..",
1836     "base": "about:blank",
1837     "href": "http://example.com/",
1838     "origin": "http://example.com",
1839     "protocol": "http:",
1840     "username": "",
1841     "password": "",
1842     "host": "example.com",
1843     "hostname": "example.com",
1844     "port": "",
1845     "pathname": "/",
1846     "search": "",
1847     "hash": ""
1848   },
1849   {
1850     "input": "http://example.com/foo/../../../ton",
1851     "base": "about:blank",
1852     "href": "http://example.com/ton",
1853     "origin": "http://example.com",
1854     "protocol": "http:",
1855     "username": "",
1856     "password": "",
1857     "host": "example.com",
1858     "hostname": "example.com",
1859     "port": "",
1860     "pathname": "/ton",
1861     "search": "",
1862     "hash": ""
1863   },
1864   {
1865     "input": "http://example.com/foo/%2e",
1866     "base": "about:blank",
1867     "href": "http://example.com/foo/",
1868     "origin": "http://example.com",
1869     "protocol": "http:",
1870     "username": "",
1871     "password": "",
1872     "host": "example.com",
1873     "hostname": "example.com",
1874     "port": "",
1875     "pathname": "/foo/",
1876     "search": "",
1877     "hash": ""
1878   },
1879   {
1880     "input": "http://example.com/foo/%2e%2",
1881     "base": "about:blank",
1882     "href": "http://example.com/foo/%2e%2",
1883     "origin": "http://example.com",
1884     "protocol": "http:",
1885     "username": "",
1886     "password": "",
1887     "host": "example.com",
1888     "hostname": "example.com",
1889     "port": "",
1890     "pathname": "/foo/%2e%2",
1891     "search": "",
1892     "hash": ""
1893   },
1894   {
1895     "input": "http://example.com/foo/%2e./%2e%2e/.%2e/%2e.bar",
1896     "base": "about:blank",
1897     "href": "http://example.com/%2e.bar",
1898     "origin": "http://example.com",
1899     "protocol": "http:",
1900     "username": "",
1901     "password": "",
1902     "host": "example.com",
1903     "hostname": "example.com",
1904     "port": "",
1905     "pathname": "/%2e.bar",
1906     "search": "",
1907     "hash": ""
1908   },
1909   {
1910     "input": "http://example.com////../..",
1911     "base": "about:blank",
1912     "href": "http://example.com//",
1913     "origin": "http://example.com",
1914     "protocol": "http:",
1915     "username": "",
1916     "password": "",
1917     "host": "example.com",
1918     "hostname": "example.com",
1919     "port": "",
1920     "pathname": "//",
1921     "search": "",
1922     "hash": ""
1923   },
1924   {
1925     "input": "http://example.com/foo/bar//../..",
1926     "base": "about:blank",
1927     "href": "http://example.com/foo/",
1928     "origin": "http://example.com",
1929     "protocol": "http:",
1930     "username": "",
1931     "password": "",
1932     "host": "example.com",
1933     "hostname": "example.com",
1934     "port": "",
1935     "pathname": "/foo/",
1936     "search": "",
1937     "hash": ""
1938   },
1939   {
1940     "input": "http://example.com/foo/bar//..",
1941     "base": "about:blank",
1942     "href": "http://example.com/foo/bar/",
1943     "origin": "http://example.com",
1944     "protocol": "http:",
1945     "username": "",
1946     "password": "",
1947     "host": "example.com",
1948     "hostname": "example.com",
1949     "port": "",
1950     "pathname": "/foo/bar/",
1951     "search": "",
1952     "hash": ""
1953   },
1954   {
1955     "input": "http://example.com/foo",
1956     "base": "about:blank",
1957     "href": "http://example.com/foo",
1958     "origin": "http://example.com",
1959     "protocol": "http:",
1960     "username": "",
1961     "password": "",
1962     "host": "example.com",
1963     "hostname": "example.com",
1964     "port": "",
1965     "pathname": "/foo",
1966     "search": "",
1967     "hash": ""
1968   },
1969   {
1970     "input": "http://example.com/%20foo",
1971     "base": "about:blank",
1972     "href": "http://example.com/%20foo",
1973     "origin": "http://example.com",
1974     "protocol": "http:",
1975     "username": "",
1976     "password": "",
1977     "host": "example.com",
1978     "hostname": "example.com",
1979     "port": "",
1980     "pathname": "/%20foo",
1981     "search": "",
1982     "hash": ""
1983   },
1984   {
1985     "input": "http://example.com/foo%",
1986     "base": "about:blank",
1987     "href": "http://example.com/foo%",
1988     "origin": "http://example.com",
1989     "protocol": "http:",
1990     "username": "",
1991     "password": "",
1992     "host": "example.com",
1993     "hostname": "example.com",
1994     "port": "",
1995     "pathname": "/foo%",
1996     "search": "",
1997     "hash": ""
1998   },
1999   {
2000     "input": "http://example.com/foo%2",
2001     "base": "about:blank",
2002     "href": "http://example.com/foo%2",
2003     "origin": "http://example.com",
2004     "protocol": "http:",
2005     "username": "",
2006     "password": "",
2007     "host": "example.com",
2008     "hostname": "example.com",
2009     "port": "",
2010     "pathname": "/foo%2",
2011     "search": "",
2012     "hash": ""
2013   },
2014   {
2015     "input": "http://example.com/foo%2zbar",
2016     "base": "about:blank",
2017     "href": "http://example.com/foo%2zbar",
2018     "origin": "http://example.com",
2019     "protocol": "http:",
2020     "username": "",
2021     "password": "",
2022     "host": "example.com",
2023     "hostname": "example.com",
2024     "port": "",
2025     "pathname": "/foo%2zbar",
2026     "search": "",
2027     "hash": ""
2028   },
2029   {
2030     "input": "http://example.com/foo%2©zbar",
2031     "base": "about:blank",
2032     "href": "http://example.com/foo%2%C3%82%C2%A9zbar",
2033     "origin": "http://example.com",
2034     "protocol": "http:",
2035     "username": "",
2036     "password": "",
2037     "host": "example.com",
2038     "hostname": "example.com",
2039     "port": "",
2040     "pathname": "/foo%2%C3%82%C2%A9zbar",
2041     "search": "",
2042     "hash": ""
2043   },
2044   {
2045     "input": "http://example.com/foo%41%7a",
2046     "base": "about:blank",
2047     "href": "http://example.com/foo%41%7a",
2048     "origin": "http://example.com",
2049     "protocol": "http:",
2050     "username": "",
2051     "password": "",
2052     "host": "example.com",
2053     "hostname": "example.com",
2054     "port": "",
2055     "pathname": "/foo%41%7a",
2056     "search": "",
2057     "hash": ""
2058   },
2059   {
2060     "input": "http://example.com/foo\t\u0091%91",
2061     "base": "about:blank",
2062     "href": "http://example.com/foo%C2%91%91",
2063     "origin": "http://example.com",
2064     "protocol": "http:",
2065     "username": "",
2066     "password": "",
2067     "host": "example.com",
2068     "hostname": "example.com",
2069     "port": "",
2070     "pathname": "/foo%C2%91%91",
2071     "search": "",
2072     "hash": ""
2073   },
2074   {
2075     "input": "http://example.com/foo%00%51",
2076     "base": "about:blank",
2077     "href": "http://example.com/foo%00%51",
2078     "origin": "http://example.com",
2079     "protocol": "http:",
2080     "username": "",
2081     "password": "",
2082     "host": "example.com",
2083     "hostname": "example.com",
2084     "port": "",
2085     "pathname": "/foo%00%51",
2086     "search": "",
2087     "hash": ""
2088   },
2089   {
2090     "input": "http://example.com/(%28:%3A%29)",
2091     "base": "about:blank",
2092     "href": "http://example.com/(%28:%3A%29)",
2093     "origin": "http://example.com",
2094     "protocol": "http:",
2095     "username": "",
2096     "password": "",
2097     "host": "example.com",
2098     "hostname": "example.com",
2099     "port": "",
2100     "pathname": "/(%28:%3A%29)",
2101     "search": "",
2102     "hash": ""
2103   },
2104   {
2105     "input": "http://example.com/%3A%3a%3C%3c",
2106     "base": "about:blank",
2107     "href": "http://example.com/%3A%3a%3C%3c",
2108     "origin": "http://example.com",
2109     "protocol": "http:",
2110     "username": "",
2111     "password": "",
2112     "host": "example.com",
2113     "hostname": "example.com",
2114     "port": "",
2115     "pathname": "/%3A%3a%3C%3c",
2116     "search": "",
2117     "hash": ""
2118   },
2119   {
2120     "input": "http://example.com/foo\tbar",
2121     "base": "about:blank",
2122     "href": "http://example.com/foobar",
2123     "origin": "http://example.com",
2124     "protocol": "http:",
2125     "username": "",
2126     "password": "",
2127     "host": "example.com",
2128     "hostname": "example.com",
2129     "port": "",
2130     "pathname": "/foobar",
2131     "search": "",
2132     "hash": ""
2133   },
2134   {
2135     "input": "http://example.com\\\\foo\\\\bar",
2136     "base": "about:blank",
2137     "href": "http://example.com//foo//bar",
2138     "origin": "http://example.com",
2139     "protocol": "http:",
2140     "username": "",
2141     "password": "",
2142     "host": "example.com",
2143     "hostname": "example.com",
2144     "port": "",
2145     "pathname": "//foo//bar",
2146     "search": "",
2147     "hash": ""
2148   },
2149   {
2150     "input": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2151     "base": "about:blank",
2152     "href": "http://example.com/%7Ffp3%3Eju%3Dduvgw%3Dd",
2153     "origin": "http://example.com",
2154     "protocol": "http:",
2155     "username": "",
2156     "password": "",
2157     "host": "example.com",
2158     "hostname": "example.com",
2159     "port": "",
2160     "pathname": "/%7Ffp3%3Eju%3Dduvgw%3Dd",
2161     "search": "",
2162     "hash": ""
2163   },
2164   {
2165     "input": "http://example.com/@asdf%40",
2166     "base": "about:blank",
2167     "href": "http://example.com/@asdf%40",
2168     "origin": "http://example.com",
2169     "protocol": "http:",
2170     "username": "",
2171     "password": "",
2172     "host": "example.com",
2173     "hostname": "example.com",
2174     "port": "",
2175     "pathname": "/@asdf%40",
2176     "search": "",
2177     "hash": ""
2178   },
2179   {
2180     "input": "http://example.com/你好你好",
2181     "base": "about:blank",
2182     "href": "http://example.com/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2183     "origin": "http://example.com",
2184     "protocol": "http:",
2185     "username": "",
2186     "password": "",
2187     "host": "example.com",
2188     "hostname": "example.com",
2189     "port": "",
2190     "pathname": "/%E4%BD%A0%E5%A5%BD%E4%BD%A0%E5%A5%BD",
2191     "search": "",
2192     "hash": ""
2193   },
2194   {
2195     "input": "http://example.com/‥/foo",
2196     "base": "about:blank",
2197     "href": "http://example.com/%E2%80%A5/foo",
2198     "origin": "http://example.com",
2199     "protocol": "http:",
2200     "username": "",
2201     "password": "",
2202     "host": "example.com",
2203     "hostname": "example.com",
2204     "port": "",
2205     "pathname": "/%E2%80%A5/foo",
2206     "search": "",
2207     "hash": ""
2208   },
2209   {
2210     "input": "http://example.com//foo",
2211     "base": "about:blank",
2212     "href": "http://example.com/%EF%BB%BF/foo",
2213     "origin": "http://example.com",
2214     "protocol": "http:",
2215     "username": "",
2216     "password": "",
2217     "host": "example.com",
2218     "hostname": "example.com",
2219     "port": "",
2220     "pathname": "/%EF%BB%BF/foo",
2221     "search": "",
2222     "hash": ""
2223   },
2224   {
2225     "input": "http://example.com/‮/foo/‭/bar",
2226     "base": "about:blank",
2227     "href": "http://example.com/%E2%80%AE/foo/%E2%80%AD/bar",
2228     "origin": "http://example.com",
2229     "protocol": "http:",
2230     "username": "",
2231     "password": "",
2232     "host": "example.com",
2233     "hostname": "example.com",
2234     "port": "",
2235     "pathname": "/%E2%80%AE/foo/%E2%80%AD/bar",
2236     "search": "",
2237     "hash": ""
2238   },
2239   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/script-tests/relative.js",
2240   {
2241     "input": "http://www.google.com/foo?bar=baz#",
2242     "base": "about:blank",
2243     "href": "http://www.google.com/foo?bar=baz#",
2244     "origin": "http://www.google.com",
2245     "protocol": "http:",
2246     "username": "",
2247     "password": "",
2248     "host": "www.google.com",
2249     "hostname": "www.google.com",
2250     "port": "",
2251     "pathname": "/foo",
2252     "search": "?bar=baz",
2253     "hash": ""
2254   },
2255   {
2256     "input": "http://www.google.com/foo?bar=baz# »",
2257     "base": "about:blank",
2258     "href": "http://www.google.com/foo?bar=baz# %C2%BB",
2259     "origin": "http://www.google.com",
2260     "protocol": "http:",
2261     "username": "",
2262     "password": "",
2263     "host": "www.google.com",
2264     "hostname": "www.google.com",
2265     "port": "",
2266     "pathname": "/foo",
2267     "search": "?bar=baz",
2268     "hash": "# %C2%BB"
2269   },
2270   {
2271     "input": "data:test# »",
2272     "base": "about:blank",
2273     "href": "data:test# %C2%BB",
2274     "origin": "null",
2275     "protocol": "data:",
2276     "username": "",
2277     "password": "",
2278     "host": "",
2279     "hostname": "",
2280     "port": "",
2281     "pathname": "test",
2282     "search": "",
2283     "hash": "# %C2%BB"
2284   },
2285   {
2286     "input": "http://www.google.com",
2287     "base": "about:blank",
2288     "href": "http://www.google.com/",
2289     "origin": "http://www.google.com",
2290     "protocol": "http:",
2291     "username": "",
2292     "password": "",
2293     "host": "www.google.com",
2294     "hostname": "www.google.com",
2295     "port": "",
2296     "pathname": "/",
2297     "search": "",
2298     "hash": ""
2299   },
2300   {
2301     "input": "http://192.0x00A80001",
2302     "base": "about:blank",
2303     "href": "http://192.168.0.1/",
2304     "origin": "http://192.168.0.1",
2305     "protocol": "http:",
2306     "username": "",
2307     "password": "",
2308     "host": "192.168.0.1",
2309     "hostname": "192.168.0.1",
2310     "port": "",
2311     "pathname": "/",
2312     "search": "",
2313     "hash": ""
2314   },
2315   {
2316     "input": "http://www/foo%2Ehtml",
2317     "base": "about:blank",
2318     "href": "http://www/foo%2Ehtml",
2319     "origin": "http://www",
2320     "protocol": "http:",
2321     "username": "",
2322     "password": "",
2323     "host": "www",
2324     "hostname": "www",
2325     "port": "",
2326     "pathname": "/foo%2Ehtml",
2327     "search": "",
2328     "hash": ""
2329   },
2330   {
2331     "input": "http://www/foo/%2E/html",
2332     "base": "about:blank",
2333     "href": "http://www/foo/html",
2334     "origin": "http://www",
2335     "protocol": "http:",
2336     "username": "",
2337     "password": "",
2338     "host": "www",
2339     "hostname": "www",
2340     "port": "",
2341     "pathname": "/foo/html",
2342     "search": "",
2343     "hash": ""
2344   },
2345   {
2346     "input": "http://user:pass@/",
2347     "base": "about:blank",
2348     "failure": true
2349   },
2350   {
2351     "input": "http://%25DOMAIN:foobar@foodomain.com/",
2352     "base": "about:blank",
2353     "href": "http://%25DOMAIN:foobar@foodomain.com/",
2354     "origin": "http://foodomain.com",
2355     "protocol": "http:",
2356     "username": "%25DOMAIN",
2357     "password": "foobar",
2358     "host": "foodomain.com",
2359     "hostname": "foodomain.com",
2360     "port": "",
2361     "pathname": "/",
2362     "search": "",
2363     "hash": ""
2364   },
2365   {
2366     "input": "http:\\\\www.google.com\\foo",
2367     "base": "about:blank",
2368     "href": "http://www.google.com/foo",
2369     "origin": "http://www.google.com",
2370     "protocol": "http:",
2371     "username": "",
2372     "password": "",
2373     "host": "www.google.com",
2374     "hostname": "www.google.com",
2375     "port": "",
2376     "pathname": "/foo",
2377     "search": "",
2378     "hash": ""
2379   },
2380   {
2381     "input": "http://foo:80/",
2382     "base": "about:blank",
2383     "href": "http://foo/",
2384     "origin": "http://foo",
2385     "protocol": "http:",
2386     "username": "",
2387     "password": "",
2388     "host": "foo",
2389     "hostname": "foo",
2390     "port": "",
2391     "pathname": "/",
2392     "search": "",
2393     "hash": ""
2394   },
2395   {
2396     "input": "http://foo:81/",
2397     "base": "about:blank",
2398     "href": "http://foo:81/",
2399     "origin": "http://foo:81",
2400     "protocol": "http:",
2401     "username": "",
2402     "password": "",
2403     "host": "foo:81",
2404     "hostname": "foo",
2405     "port": "81",
2406     "pathname": "/",
2407     "search": "",
2408     "hash": ""
2409   },
2410   {
2411     "input": "httpa://foo:80/",
2412     "base": "about:blank",
2413     "href": "httpa://foo:80/",
2414     "origin": "null",
2415     "protocol": "httpa:",
2416     "username": "",
2417     "password": "",
2418     "host": "foo:80",
2419     "hostname": "foo",
2420     "port": "80",
2421     "pathname": "/",
2422     "search": "",
2423     "hash": ""
2424   },
2425   {
2426     "input": "http://foo:-80/",
2427     "base": "about:blank",
2428     "failure": true
2429   },
2430   {
2431     "input": "https://foo:443/",
2432     "base": "about:blank",
2433     "href": "https://foo/",
2434     "origin": "https://foo",
2435     "protocol": "https:",
2436     "username": "",
2437     "password": "",
2438     "host": "foo",
2439     "hostname": "foo",
2440     "port": "",
2441     "pathname": "/",
2442     "search": "",
2443     "hash": ""
2444   },
2445   {
2446     "input": "https://foo:80/",
2447     "base": "about:blank",
2448     "href": "https://foo:80/",
2449     "origin": "https://foo:80",
2450     "protocol": "https:",
2451     "username": "",
2452     "password": "",
2453     "host": "foo:80",
2454     "hostname": "foo",
2455     "port": "80",
2456     "pathname": "/",
2457     "search": "",
2458     "hash": ""
2459   },
2460   {
2461     "input": "ftp://foo:21/",
2462     "base": "about:blank",
2463     "href": "ftp://foo/",
2464     "origin": "ftp://foo",
2465     "protocol": "ftp:",
2466     "username": "",
2467     "password": "",
2468     "host": "foo",
2469     "hostname": "foo",
2470     "port": "",
2471     "pathname": "/",
2472     "search": "",
2473     "hash": ""
2474   },
2475   {
2476     "input": "ftp://foo:80/",
2477     "base": "about:blank",
2478     "href": "ftp://foo:80/",
2479     "origin": "ftp://foo:80",
2480     "protocol": "ftp:",
2481     "username": "",
2482     "password": "",
2483     "host": "foo:80",
2484     "hostname": "foo",
2485     "port": "80",
2486     "pathname": "/",
2487     "search": "",
2488     "hash": ""
2489   },
2490   {
2491     "input": "gopher://foo:70/",
2492     "base": "about:blank",
2493     "href": "gopher://foo/",
2494     "origin": "gopher://foo",
2495     "protocol": "gopher:",
2496     "username": "",
2497     "password": "",
2498     "host": "foo",
2499     "hostname": "foo",
2500     "port": "",
2501     "pathname": "/",
2502     "search": "",
2503     "hash": ""
2504   },
2505   {
2506     "input": "gopher://foo:443/",
2507     "base": "about:blank",
2508     "href": "gopher://foo:443/",
2509     "origin": "gopher://foo:443",
2510     "protocol": "gopher:",
2511     "username": "",
2512     "password": "",
2513     "host": "foo:443",
2514     "hostname": "foo",
2515     "port": "443",
2516     "pathname": "/",
2517     "search": "",
2518     "hash": ""
2519   },
2520   {
2521     "input": "ws://foo:80/",
2522     "base": "about:blank",
2523     "href": "ws://foo/",
2524     "origin": "ws://foo",
2525     "protocol": "ws:",
2526     "username": "",
2527     "password": "",
2528     "host": "foo",
2529     "hostname": "foo",
2530     "port": "",
2531     "pathname": "/",
2532     "search": "",
2533     "hash": ""
2534   },
2535   {
2536     "input": "ws://foo:81/",
2537     "base": "about:blank",
2538     "href": "ws://foo:81/",
2539     "origin": "ws://foo:81",
2540     "protocol": "ws:",
2541     "username": "",
2542     "password": "",
2543     "host": "foo:81",
2544     "hostname": "foo",
2545     "port": "81",
2546     "pathname": "/",
2547     "search": "",
2548     "hash": ""
2549   },
2550   {
2551     "input": "ws://foo:443/",
2552     "base": "about:blank",
2553     "href": "ws://foo:443/",
2554     "origin": "ws://foo:443",
2555     "protocol": "ws:",
2556     "username": "",
2557     "password": "",
2558     "host": "foo:443",
2559     "hostname": "foo",
2560     "port": "443",
2561     "pathname": "/",
2562     "search": "",
2563     "hash": ""
2564   },
2565   {
2566     "input": "ws://foo:815/",
2567     "base": "about:blank",
2568     "href": "ws://foo:815/",
2569     "origin": "ws://foo:815",
2570     "protocol": "ws:",
2571     "username": "",
2572     "password": "",
2573     "host": "foo:815",
2574     "hostname": "foo",
2575     "port": "815",
2576     "pathname": "/",
2577     "search": "",
2578     "hash": ""
2579   },
2580   {
2581     "input": "wss://foo:80/",
2582     "base": "about:blank",
2583     "href": "wss://foo:80/",
2584     "origin": "wss://foo:80",
2585     "protocol": "wss:",
2586     "username": "",
2587     "password": "",
2588     "host": "foo:80",
2589     "hostname": "foo",
2590     "port": "80",
2591     "pathname": "/",
2592     "search": "",
2593     "hash": ""
2594   },
2595   {
2596     "input": "wss://foo:81/",
2597     "base": "about:blank",
2598     "href": "wss://foo:81/",
2599     "origin": "wss://foo:81",
2600     "protocol": "wss:",
2601     "username": "",
2602     "password": "",
2603     "host": "foo:81",
2604     "hostname": "foo",
2605     "port": "81",
2606     "pathname": "/",
2607     "search": "",
2608     "hash": ""
2609   },
2610   {
2611     "input": "wss://foo:443/",
2612     "base": "about:blank",
2613     "href": "wss://foo/",
2614     "origin": "wss://foo",
2615     "protocol": "wss:",
2616     "username": "",
2617     "password": "",
2618     "host": "foo",
2619     "hostname": "foo",
2620     "port": "",
2621     "pathname": "/",
2622     "search": "",
2623     "hash": ""
2624   },
2625   {
2626     "input": "wss://foo:815/",
2627     "base": "about:blank",
2628     "href": "wss://foo:815/",
2629     "origin": "wss://foo:815",
2630     "protocol": "wss:",
2631     "username": "",
2632     "password": "",
2633     "host": "foo:815",
2634     "hostname": "foo",
2635     "port": "815",
2636     "pathname": "/",
2637     "search": "",
2638     "hash": ""
2639   },
2640   {
2641     "input": "http:/example.com/",
2642     "base": "about:blank",
2643     "href": "http://example.com/",
2644     "origin": "http://example.com",
2645     "protocol": "http:",
2646     "username": "",
2647     "password": "",
2648     "host": "example.com",
2649     "hostname": "example.com",
2650     "port": "",
2651     "pathname": "/",
2652     "search": "",
2653     "hash": ""
2654   },
2655   {
2656     "input": "ftp:/example.com/",
2657     "base": "about:blank",
2658     "href": "ftp://example.com/",
2659     "origin": "ftp://example.com",
2660     "protocol": "ftp:",
2661     "username": "",
2662     "password": "",
2663     "host": "example.com",
2664     "hostname": "example.com",
2665     "port": "",
2666     "pathname": "/",
2667     "search": "",
2668     "hash": ""
2669   },
2670   {
2671     "input": "https:/example.com/",
2672     "base": "about:blank",
2673     "href": "https://example.com/",
2674     "origin": "https://example.com",
2675     "protocol": "https:",
2676     "username": "",
2677     "password": "",
2678     "host": "example.com",
2679     "hostname": "example.com",
2680     "port": "",
2681     "pathname": "/",
2682     "search": "",
2683     "hash": ""
2684   },
2685   {
2686     "input": "madeupscheme:/example.com/",
2687     "base": "about:blank",
2688     "href": "madeupscheme:/example.com/",
2689     "origin": "null",
2690     "protocol": "madeupscheme:",
2691     "username": "",
2692     "password": "",
2693     "host": "",
2694     "hostname": "",
2695     "port": "",
2696     "pathname": "/example.com/",
2697     "search": "",
2698     "hash": ""
2699   },
2700   {
2701     "input": "file:/example.com/",
2702     "base": "about:blank",
2703     "href": "file:///example.com/",
2704     "protocol": "file:",
2705     "username": "",
2706     "password": "",
2707     "host": "",
2708     "hostname": "",
2709     "port": "",
2710     "pathname": "/example.com/",
2711     "search": "",
2712     "hash": ""
2713   },
2714   {
2715     "input": "ftps:/example.com/",
2716     "base": "about:blank",
2717     "href": "ftps:/example.com/",
2718     "origin": "null",
2719     "protocol": "ftps:",
2720     "username": "",
2721     "password": "",
2722     "host": "",
2723     "hostname": "",
2724     "port": "",
2725     "pathname": "/example.com/",
2726     "search": "",
2727     "hash": ""
2728   },
2729   {
2730     "input": "gopher:/example.com/",
2731     "base": "about:blank",
2732     "href": "gopher://example.com/",
2733     "origin": "gopher://example.com",
2734     "protocol": "gopher:",
2735     "username": "",
2736     "password": "",
2737     "host": "example.com",
2738     "hostname": "example.com",
2739     "port": "",
2740     "pathname": "/",
2741     "search": "",
2742     "hash": ""
2743   },
2744   {
2745     "input": "ws:/example.com/",
2746     "base": "about:blank",
2747     "href": "ws://example.com/",
2748     "origin": "ws://example.com",
2749     "protocol": "ws:",
2750     "username": "",
2751     "password": "",
2752     "host": "example.com",
2753     "hostname": "example.com",
2754     "port": "",
2755     "pathname": "/",
2756     "search": "",
2757     "hash": ""
2758   },
2759   {
2760     "input": "wss:/example.com/",
2761     "base": "about:blank",
2762     "href": "wss://example.com/",
2763     "origin": "wss://example.com",
2764     "protocol": "wss:",
2765     "username": "",
2766     "password": "",
2767     "host": "example.com",
2768     "hostname": "example.com",
2769     "port": "",
2770     "pathname": "/",
2771     "search": "",
2772     "hash": ""
2773   },
2774   {
2775     "input": "data:/example.com/",
2776     "base": "about:blank",
2777     "href": "data:/example.com/",
2778     "origin": "null",
2779     "protocol": "data:",
2780     "username": "",
2781     "password": "",
2782     "host": "",
2783     "hostname": "",
2784     "port": "",
2785     "pathname": "/example.com/",
2786     "search": "",
2787     "hash": ""
2788   },
2789   {
2790     "input": "javascript:/example.com/",
2791     "base": "about:blank",
2792     "href": "javascript:/example.com/",
2793     "origin": "null",
2794     "protocol": "javascript:",
2795     "username": "",
2796     "password": "",
2797     "host": "",
2798     "hostname": "",
2799     "port": "",
2800     "pathname": "/example.com/",
2801     "search": "",
2802     "hash": ""
2803   },
2804   {
2805     "input": "mailto:/example.com/",
2806     "base": "about:blank",
2807     "href": "mailto:/example.com/",
2808     "origin": "null",
2809     "protocol": "mailto:",
2810     "username": "",
2811     "password": "",
2812     "host": "",
2813     "hostname": "",
2814     "port": "",
2815     "pathname": "/example.com/",
2816     "search": "",
2817     "hash": ""
2818   },
2819   {
2820     "input": "http:example.com/",
2821     "base": "about:blank",
2822     "href": "http://example.com/",
2823     "origin": "http://example.com",
2824     "protocol": "http:",
2825     "username": "",
2826     "password": "",
2827     "host": "example.com",
2828     "hostname": "example.com",
2829     "port": "",
2830     "pathname": "/",
2831     "search": "",
2832     "hash": ""
2833   },
2834   {
2835     "input": "ftp:example.com/",
2836     "base": "about:blank",
2837     "href": "ftp://example.com/",
2838     "origin": "ftp://example.com",
2839     "protocol": "ftp:",
2840     "username": "",
2841     "password": "",
2842     "host": "example.com",
2843     "hostname": "example.com",
2844     "port": "",
2845     "pathname": "/",
2846     "search": "",
2847     "hash": ""
2848   },
2849   {
2850     "input": "https:example.com/",
2851     "base": "about:blank",
2852     "href": "https://example.com/",
2853     "origin": "https://example.com",
2854     "protocol": "https:",
2855     "username": "",
2856     "password": "",
2857     "host": "example.com",
2858     "hostname": "example.com",
2859     "port": "",
2860     "pathname": "/",
2861     "search": "",
2862     "hash": ""
2863   },
2864   {
2865     "input": "madeupscheme:example.com/",
2866     "base": "about:blank",
2867     "href": "madeupscheme:example.com/",
2868     "origin": "null",
2869     "protocol": "madeupscheme:",
2870     "username": "",
2871     "password": "",
2872     "host": "",
2873     "hostname": "",
2874     "port": "",
2875     "pathname": "example.com/",
2876     "search": "",
2877     "hash": ""
2878   },
2879   {
2880     "input": "ftps:example.com/",
2881     "base": "about:blank",
2882     "href": "ftps:example.com/",
2883     "origin": "null",
2884     "protocol": "ftps:",
2885     "username": "",
2886     "password": "",
2887     "host": "",
2888     "hostname": "",
2889     "port": "",
2890     "pathname": "example.com/",
2891     "search": "",
2892     "hash": ""
2893   },
2894   {
2895     "input": "gopher:example.com/",
2896     "base": "about:blank",
2897     "href": "gopher://example.com/",
2898     "origin": "gopher://example.com",
2899     "protocol": "gopher:",
2900     "username": "",
2901     "password": "",
2902     "host": "example.com",
2903     "hostname": "example.com",
2904     "port": "",
2905     "pathname": "/",
2906     "search": "",
2907     "hash": ""
2908   },
2909   {
2910     "input": "ws:example.com/",
2911     "base": "about:blank",
2912     "href": "ws://example.com/",
2913     "origin": "ws://example.com",
2914     "protocol": "ws:",
2915     "username": "",
2916     "password": "",
2917     "host": "example.com",
2918     "hostname": "example.com",
2919     "port": "",
2920     "pathname": "/",
2921     "search": "",
2922     "hash": ""
2923   },
2924   {
2925     "input": "wss:example.com/",
2926     "base": "about:blank",
2927     "href": "wss://example.com/",
2928     "origin": "wss://example.com",
2929     "protocol": "wss:",
2930     "username": "",
2931     "password": "",
2932     "host": "example.com",
2933     "hostname": "example.com",
2934     "port": "",
2935     "pathname": "/",
2936     "search": "",
2937     "hash": ""
2938   },
2939   {
2940     "input": "data:example.com/",
2941     "base": "about:blank",
2942     "href": "data:example.com/",
2943     "origin": "null",
2944     "protocol": "data:",
2945     "username": "",
2946     "password": "",
2947     "host": "",
2948     "hostname": "",
2949     "port": "",
2950     "pathname": "example.com/",
2951     "search": "",
2952     "hash": ""
2953   },
2954   {
2955     "input": "javascript:example.com/",
2956     "base": "about:blank",
2957     "href": "javascript:example.com/",
2958     "origin": "null",
2959     "protocol": "javascript:",
2960     "username": "",
2961     "password": "",
2962     "host": "",
2963     "hostname": "",
2964     "port": "",
2965     "pathname": "example.com/",
2966     "search": "",
2967     "hash": ""
2968   },
2969   {
2970     "input": "mailto:example.com/",
2971     "base": "about:blank",
2972     "href": "mailto:example.com/",
2973     "origin": "null",
2974     "protocol": "mailto:",
2975     "username": "",
2976     "password": "",
2977     "host": "",
2978     "hostname": "",
2979     "port": "",
2980     "pathname": "example.com/",
2981     "search": "",
2982     "hash": ""
2983   },
2984   "# Based on http://trac.webkit.org/browser/trunk/LayoutTests/fast/url/segments-userinfo-vs-host.html",
2985   {
2986     "input": "http:@www.example.com",
2987     "base": "about:blank",
2988     "href": "http://www.example.com/",
2989     "origin": "http://www.example.com",
2990     "protocol": "http:",
2991     "username": "",
2992     "password": "",
2993     "host": "www.example.com",
2994     "hostname": "www.example.com",
2995     "port": "",
2996     "pathname": "/",
2997     "search": "",
2998     "hash": ""
2999   },
3000   {
3001     "input": "http:/@www.example.com",
3002     "base": "about:blank",
3003     "href": "http://www.example.com/",
3004     "origin": "http://www.example.com",
3005     "protocol": "http:",
3006     "username": "",
3007     "password": "",
3008     "host": "www.example.com",
3009     "hostname": "www.example.com",
3010     "port": "",
3011     "pathname": "/",
3012     "search": "",
3013     "hash": ""
3014   },
3015   {
3016     "input": "http://@www.example.com",
3017     "base": "about:blank",
3018     "href": "http://www.example.com/",
3019     "origin": "http://www.example.com",
3020     "protocol": "http:",
3021     "username": "",
3022     "password": "",
3023     "host": "www.example.com",
3024     "hostname": "www.example.com",
3025     "port": "",
3026     "pathname": "/",
3027     "search": "",
3028     "hash": ""
3029   },
3030   {
3031     "input": "http:a:b@www.example.com",
3032     "base": "about:blank",
3033     "href": "http://a:b@www.example.com/",
3034     "origin": "http://www.example.com",
3035     "protocol": "http:",
3036     "username": "a",
3037     "password": "b",
3038     "host": "www.example.com",
3039     "hostname": "www.example.com",
3040     "port": "",
3041     "pathname": "/",
3042     "search": "",
3043     "hash": ""
3044   },
3045   {
3046     "input": "http:/a:b@www.example.com",
3047     "base": "about:blank",
3048     "href": "http://a:b@www.example.com/",
3049     "origin": "http://www.example.com",
3050     "protocol": "http:",
3051     "username": "a",
3052     "password": "b",
3053     "host": "www.example.com",
3054     "hostname": "www.example.com",
3055     "port": "",
3056     "pathname": "/",
3057     "search": "",
3058     "hash": ""
3059   },
3060   {
3061     "input": "http://a:b@www.example.com",
3062     "base": "about:blank",
3063     "href": "http://a:b@www.example.com/",
3064     "origin": "http://www.example.com",
3065     "protocol": "http:",
3066     "username": "a",
3067     "password": "b",
3068     "host": "www.example.com",
3069     "hostname": "www.example.com",
3070     "port": "",
3071     "pathname": "/",
3072     "search": "",
3073     "hash": ""
3074   },
3075   {
3076     "input": "http://@pple.com",
3077     "base": "about:blank",
3078     "href": "http://pple.com/",
3079     "origin": "http://pple.com",
3080     "protocol": "http:",
3081     "username": "",
3082     "password": "",
3083     "host": "pple.com",
3084     "hostname": "pple.com",
3085     "port": "",
3086     "pathname": "/",
3087     "search": "",
3088     "hash": ""
3089   },
3090   {
3091     "input": "http::b@www.example.com",
3092     "base": "about:blank",
3093     "href": "http://:b@www.example.com/",
3094     "origin": "http://www.example.com",
3095     "protocol": "http:",
3096     "username": "",
3097     "password": "b",
3098     "host": "www.example.com",
3099     "hostname": "www.example.com",
3100     "port": "",
3101     "pathname": "/",
3102     "search": "",
3103     "hash": ""
3104   },
3105   {
3106     "input": "http:/:b@www.example.com",
3107     "base": "about:blank",
3108     "href": "http://:b@www.example.com/",
3109     "origin": "http://www.example.com",
3110     "protocol": "http:",
3111     "username": "",
3112     "password": "b",
3113     "host": "www.example.com",
3114     "hostname": "www.example.com",
3115     "port": "",
3116     "pathname": "/",
3117     "search": "",
3118     "hash": ""
3119   },
3120   {
3121     "input": "http://:b@www.example.com",
3122     "base": "about:blank",
3123     "href": "http://:b@www.example.com/",
3124     "origin": "http://www.example.com",
3125     "protocol": "http:",
3126     "username": "",
3127     "password": "b",
3128     "host": "www.example.com",
3129     "hostname": "www.example.com",
3130     "port": "",
3131     "pathname": "/",
3132     "search": "",
3133     "hash": ""
3134   },
3135   {
3136     "input": "http:/:@/www.example.com",
3137     "base": "about:blank",
3138     "failure": true
3139   },
3140   {
3141     "input": "http://user@/www.example.com",
3142     "base": "about:blank",
3143     "failure": true
3144   },
3145   {
3146     "input": "http:@/www.example.com",
3147     "base": "about:blank",
3148     "failure": true
3149   },
3150   {
3151     "input": "http:/@/www.example.com",
3152     "base": "about:blank",
3153     "failure": true
3154   },
3155   {
3156     "input": "http://@/www.example.com",
3157     "base": "about:blank",
3158     "failure": true
3159   },
3160   {
3161     "input": "https:@/www.example.com",
3162     "base": "about:blank",
3163     "failure": true
3164   },
3165   {
3166     "input": "http:a:b@/www.example.com",
3167     "base": "about:blank",
3168     "failure": true
3169   },
3170   {
3171     "input": "http:/a:b@/www.example.com",
3172     "base": "about:blank",
3173     "failure": true
3174   },
3175   {
3176     "input": "http://a:b@/www.example.com",
3177     "base": "about:blank",
3178     "failure": true
3179   },
3180   {
3181     "input": "http::@/www.example.com",
3182     "base": "about:blank",
3183     "failure": true
3184   },
3185   {
3186     "input": "http:a:@www.example.com",
3187     "base": "about:blank",
3188     "href": "http://a@www.example.com/",
3189     "origin": "http://www.example.com",
3190     "protocol": "http:",
3191     "username": "a",
3192     "password": "",
3193     "host": "www.example.com",
3194     "hostname": "www.example.com",
3195     "port": "",
3196     "pathname": "/",
3197     "search": "",
3198     "hash": ""
3199   },
3200   {
3201     "input": "http:/a:@www.example.com",
3202     "base": "about:blank",
3203     "href": "http://a@www.example.com/",
3204     "origin": "http://www.example.com",
3205     "protocol": "http:",
3206     "username": "a",
3207     "password": "",
3208     "host": "www.example.com",
3209     "hostname": "www.example.com",
3210     "port": "",
3211     "pathname": "/",
3212     "search": "",
3213     "hash": ""
3214   },
3215   {
3216     "input": "http://a:@www.example.com",
3217     "base": "about:blank",
3218     "href": "http://a@www.example.com/",
3219     "origin": "http://www.example.com",
3220     "protocol": "http:",
3221     "username": "a",
3222     "password": "",
3223     "host": "www.example.com",
3224     "hostname": "www.example.com",
3225     "port": "",
3226     "pathname": "/",
3227     "search": "",
3228     "hash": ""
3229   },
3230   {
3231     "input": "http://www.@pple.com",
3232     "base": "about:blank",
3233     "href": "http://www.@pple.com/",
3234     "origin": "http://pple.com",
3235     "protocol": "http:",
3236     "username": "www.",
3237     "password": "",
3238     "host": "pple.com",
3239     "hostname": "pple.com",
3240     "port": "",
3241     "pathname": "/",
3242     "search": "",
3243     "hash": ""
3244   },
3245   {
3246     "input": "http:@:www.example.com",
3247     "base": "about:blank",
3248     "failure": true
3249   },
3250   {
3251     "input": "http:/@:www.example.com",
3252     "base": "about:blank",
3253     "failure": true
3254   },
3255   {
3256     "input": "http://@:www.example.com",
3257     "base": "about:blank",
3258     "failure": true
3259   },
3260   {
3261     "input": "http://:@www.example.com",
3262     "base": "about:blank",
3263     "href": "http://www.example.com/",
3264     "origin": "http://www.example.com",
3265     "protocol": "http:",
3266     "username": "",
3267     "password": "",
3268     "host": "www.example.com",
3269     "hostname": "www.example.com",
3270     "port": "",
3271     "pathname": "/",
3272     "search": "",
3273     "hash": ""
3274   },
3275   "# Others",
3276   {
3277     "input": "/",
3278     "base": "http://www.example.com/test",
3279     "href": "http://www.example.com/",
3280     "origin": "http://www.example.com",
3281     "protocol": "http:",
3282     "username": "",