11cb0ef41Sopenharmony_ci{
21cb0ef41Sopenharmony_ci    "comment": [
31cb0ef41Sopenharmony_ci        "## Tests for setters of https://url.spec.whatwg.org/#urlutils-members",
41cb0ef41Sopenharmony_ci        "",
51cb0ef41Sopenharmony_ci        "This file contains a JSON object.",
61cb0ef41Sopenharmony_ci        "Other than 'comment', each key is an attribute of the `URL` interface",
71cb0ef41Sopenharmony_ci        "defined in WHATWG’s URL Standard.",
81cb0ef41Sopenharmony_ci        "The values are arrays of test case objects for that attribute.",
91cb0ef41Sopenharmony_ci        "",
101cb0ef41Sopenharmony_ci        "To run a test case for the attribute `attr`:",
111cb0ef41Sopenharmony_ci        "",
121cb0ef41Sopenharmony_ci        "* Create a new `URL` object with the value for the 'href' key",
131cb0ef41Sopenharmony_ci        "  the constructor single parameter. (Without a base URL.)",
141cb0ef41Sopenharmony_ci        "  This must not throw.",
151cb0ef41Sopenharmony_ci        "* Set the attribute `attr` to (invoke its setter with)",
161cb0ef41Sopenharmony_ci        "  with the value of for 'new_value' key.",
171cb0ef41Sopenharmony_ci        "* The value for the 'expected' key is another object.",
181cb0ef41Sopenharmony_ci        "  For each `key` / `value` pair of that object,",
191cb0ef41Sopenharmony_ci        "  get the attribute `key` (invoke its getter).",
201cb0ef41Sopenharmony_ci        "  The returned string must be equal to `value`.",
211cb0ef41Sopenharmony_ci        "",
221cb0ef41Sopenharmony_ci        "Note: the 'href' setter is already covered by urltestdata.json."
231cb0ef41Sopenharmony_ci    ],
241cb0ef41Sopenharmony_ci    "protocol": [
251cb0ef41Sopenharmony_ci        {
261cb0ef41Sopenharmony_ci            "comment": "The empty string is not a valid scheme. Setter leaves the URL unchanged.",
271cb0ef41Sopenharmony_ci            "href": "a://example.net",
281cb0ef41Sopenharmony_ci            "new_value": "",
291cb0ef41Sopenharmony_ci            "expected": {
301cb0ef41Sopenharmony_ci                "href": "a://example.net",
311cb0ef41Sopenharmony_ci                "protocol": "a:"
321cb0ef41Sopenharmony_ci            }
331cb0ef41Sopenharmony_ci        },
341cb0ef41Sopenharmony_ci        {
351cb0ef41Sopenharmony_ci            "href": "a://example.net",
361cb0ef41Sopenharmony_ci            "new_value": "b",
371cb0ef41Sopenharmony_ci            "expected": {
381cb0ef41Sopenharmony_ci                "href": "b://example.net",
391cb0ef41Sopenharmony_ci                "protocol": "b:"
401cb0ef41Sopenharmony_ci            }
411cb0ef41Sopenharmony_ci        },
421cb0ef41Sopenharmony_ci        {
431cb0ef41Sopenharmony_ci            "href": "javascript:alert(1)",
441cb0ef41Sopenharmony_ci            "new_value": "defuse",
451cb0ef41Sopenharmony_ci            "expected": {
461cb0ef41Sopenharmony_ci                "href": "defuse:alert(1)",
471cb0ef41Sopenharmony_ci                "protocol": "defuse:"
481cb0ef41Sopenharmony_ci            }
491cb0ef41Sopenharmony_ci        },
501cb0ef41Sopenharmony_ci        {
511cb0ef41Sopenharmony_ci            "comment": "Upper-case ASCII is lower-cased",
521cb0ef41Sopenharmony_ci            "href": "a://example.net",
531cb0ef41Sopenharmony_ci            "new_value": "B",
541cb0ef41Sopenharmony_ci            "expected": {
551cb0ef41Sopenharmony_ci                "href": "b://example.net",
561cb0ef41Sopenharmony_ci                "protocol": "b:"
571cb0ef41Sopenharmony_ci            }
581cb0ef41Sopenharmony_ci        },
591cb0ef41Sopenharmony_ci        {
601cb0ef41Sopenharmony_ci            "comment": "Non-ASCII is rejected",
611cb0ef41Sopenharmony_ci            "href": "a://example.net",
621cb0ef41Sopenharmony_ci            "new_value": "é",
631cb0ef41Sopenharmony_ci            "expected": {
641cb0ef41Sopenharmony_ci                "href": "a://example.net",
651cb0ef41Sopenharmony_ci                "protocol": "a:"
661cb0ef41Sopenharmony_ci            }
671cb0ef41Sopenharmony_ci        },
681cb0ef41Sopenharmony_ci        {
691cb0ef41Sopenharmony_ci            "comment": "No leading digit",
701cb0ef41Sopenharmony_ci            "href": "a://example.net",
711cb0ef41Sopenharmony_ci            "new_value": "0b",
721cb0ef41Sopenharmony_ci            "expected": {
731cb0ef41Sopenharmony_ci                "href": "a://example.net",
741cb0ef41Sopenharmony_ci                "protocol": "a:"
751cb0ef41Sopenharmony_ci            }
761cb0ef41Sopenharmony_ci        },
771cb0ef41Sopenharmony_ci        {
781cb0ef41Sopenharmony_ci            "comment": "No leading punctuation",
791cb0ef41Sopenharmony_ci            "href": "a://example.net",
801cb0ef41Sopenharmony_ci            "new_value": "+b",
811cb0ef41Sopenharmony_ci            "expected": {
821cb0ef41Sopenharmony_ci                "href": "a://example.net",
831cb0ef41Sopenharmony_ci                "protocol": "a:"
841cb0ef41Sopenharmony_ci            }
851cb0ef41Sopenharmony_ci        },
861cb0ef41Sopenharmony_ci        {
871cb0ef41Sopenharmony_ci            "href": "a://example.net",
881cb0ef41Sopenharmony_ci            "new_value": "bC0+-.",
891cb0ef41Sopenharmony_ci            "expected": {
901cb0ef41Sopenharmony_ci                "href": "bc0+-.://example.net",
911cb0ef41Sopenharmony_ci                "protocol": "bc0+-.:"
921cb0ef41Sopenharmony_ci            }
931cb0ef41Sopenharmony_ci        },
941cb0ef41Sopenharmony_ci        {
951cb0ef41Sopenharmony_ci            "comment": "Only some punctuation is acceptable",
961cb0ef41Sopenharmony_ci            "href": "a://example.net",
971cb0ef41Sopenharmony_ci            "new_value": "b,c",
981cb0ef41Sopenharmony_ci            "expected": {
991cb0ef41Sopenharmony_ci                "href": "a://example.net",
1001cb0ef41Sopenharmony_ci                "protocol": "a:"
1011cb0ef41Sopenharmony_ci            }
1021cb0ef41Sopenharmony_ci        },
1031cb0ef41Sopenharmony_ci        {
1041cb0ef41Sopenharmony_ci            "comment": "Non-ASCII is rejected",
1051cb0ef41Sopenharmony_ci            "href": "a://example.net",
1061cb0ef41Sopenharmony_ci            "new_value": "bé",
1071cb0ef41Sopenharmony_ci            "expected": {
1081cb0ef41Sopenharmony_ci                "href": "a://example.net",
1091cb0ef41Sopenharmony_ci                "protocol": "a:"
1101cb0ef41Sopenharmony_ci            }
1111cb0ef41Sopenharmony_ci        },
1121cb0ef41Sopenharmony_ci        {
1131cb0ef41Sopenharmony_ci            "comment": "Can’t switch from URL containing username/password/port to file",
1141cb0ef41Sopenharmony_ci            "href": "http://test@example.net",
1151cb0ef41Sopenharmony_ci            "new_value": "file",
1161cb0ef41Sopenharmony_ci            "expected": {
1171cb0ef41Sopenharmony_ci                "href": "http://test@example.net/",
1181cb0ef41Sopenharmony_ci                "protocol": "http:"
1191cb0ef41Sopenharmony_ci            }
1201cb0ef41Sopenharmony_ci        },
1211cb0ef41Sopenharmony_ci        {
1221cb0ef41Sopenharmony_ci            "href": "https://example.net:1234",
1231cb0ef41Sopenharmony_ci            "new_value": "file",
1241cb0ef41Sopenharmony_ci            "expected": {
1251cb0ef41Sopenharmony_ci                "href": "https://example.net:1234/",
1261cb0ef41Sopenharmony_ci                "protocol": "https:"
1271cb0ef41Sopenharmony_ci            }
1281cb0ef41Sopenharmony_ci        },
1291cb0ef41Sopenharmony_ci        {
1301cb0ef41Sopenharmony_ci            "href": "wss://x:x@example.net:1234",
1311cb0ef41Sopenharmony_ci            "new_value": "file",
1321cb0ef41Sopenharmony_ci            "expected": {
1331cb0ef41Sopenharmony_ci                "href": "wss://x:x@example.net:1234/",
1341cb0ef41Sopenharmony_ci                "protocol": "wss:"
1351cb0ef41Sopenharmony_ci            }
1361cb0ef41Sopenharmony_ci        },
1371cb0ef41Sopenharmony_ci        {
1381cb0ef41Sopenharmony_ci            "comment": "Can’t switch from file URL with no host",
1391cb0ef41Sopenharmony_ci            "href": "file://localhost/",
1401cb0ef41Sopenharmony_ci            "new_value": "http",
1411cb0ef41Sopenharmony_ci            "expected": {
1421cb0ef41Sopenharmony_ci                "href": "file:///",
1431cb0ef41Sopenharmony_ci                "protocol": "file:"
1441cb0ef41Sopenharmony_ci            }
1451cb0ef41Sopenharmony_ci        },
1461cb0ef41Sopenharmony_ci        {
1471cb0ef41Sopenharmony_ci            "href": "file:///test",
1481cb0ef41Sopenharmony_ci            "new_value": "https",
1491cb0ef41Sopenharmony_ci            "expected": {
1501cb0ef41Sopenharmony_ci                "href": "file:///test",
1511cb0ef41Sopenharmony_ci                "protocol": "file:"
1521cb0ef41Sopenharmony_ci            }
1531cb0ef41Sopenharmony_ci        },
1541cb0ef41Sopenharmony_ci        {
1551cb0ef41Sopenharmony_ci            "href": "file:",
1561cb0ef41Sopenharmony_ci            "new_value": "wss",
1571cb0ef41Sopenharmony_ci            "expected": {
1581cb0ef41Sopenharmony_ci                "href": "file:///",
1591cb0ef41Sopenharmony_ci                "protocol": "file:"
1601cb0ef41Sopenharmony_ci            }
1611cb0ef41Sopenharmony_ci        },
1621cb0ef41Sopenharmony_ci        {
1631cb0ef41Sopenharmony_ci            "comment": "Can’t switch from special scheme to non-special",
1641cb0ef41Sopenharmony_ci            "href": "http://example.net",
1651cb0ef41Sopenharmony_ci            "new_value": "b",
1661cb0ef41Sopenharmony_ci            "expected": {
1671cb0ef41Sopenharmony_ci                "href": "http://example.net/",
1681cb0ef41Sopenharmony_ci                "protocol": "http:"
1691cb0ef41Sopenharmony_ci            }
1701cb0ef41Sopenharmony_ci        },
1711cb0ef41Sopenharmony_ci        {
1721cb0ef41Sopenharmony_ci            "href": "file://hi/path",
1731cb0ef41Sopenharmony_ci            "new_value": "s",
1741cb0ef41Sopenharmony_ci            "expected": {
1751cb0ef41Sopenharmony_ci                "href": "file://hi/path",
1761cb0ef41Sopenharmony_ci                "protocol": "file:"
1771cb0ef41Sopenharmony_ci            }
1781cb0ef41Sopenharmony_ci        },
1791cb0ef41Sopenharmony_ci        {
1801cb0ef41Sopenharmony_ci            "href": "https://example.net",
1811cb0ef41Sopenharmony_ci            "new_value": "s",
1821cb0ef41Sopenharmony_ci            "expected": {
1831cb0ef41Sopenharmony_ci                "href": "https://example.net/",
1841cb0ef41Sopenharmony_ci                "protocol": "https:"
1851cb0ef41Sopenharmony_ci            }
1861cb0ef41Sopenharmony_ci        },
1871cb0ef41Sopenharmony_ci        {
1881cb0ef41Sopenharmony_ci            "href": "ftp://example.net",
1891cb0ef41Sopenharmony_ci            "new_value": "test",
1901cb0ef41Sopenharmony_ci            "expected": {
1911cb0ef41Sopenharmony_ci                "href": "ftp://example.net/",
1921cb0ef41Sopenharmony_ci                "protocol": "ftp:"
1931cb0ef41Sopenharmony_ci            }
1941cb0ef41Sopenharmony_ci        },
1951cb0ef41Sopenharmony_ci        {
1961cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base URL doesn’t have a host, but URL in a special scheme must.",
1971cb0ef41Sopenharmony_ci            "href": "mailto:me@example.net",
1981cb0ef41Sopenharmony_ci            "new_value": "http",
1991cb0ef41Sopenharmony_ci            "expected": {
2001cb0ef41Sopenharmony_ci                "href": "mailto:me@example.net",
2011cb0ef41Sopenharmony_ci                "protocol": "mailto:"
2021cb0ef41Sopenharmony_ci            }
2031cb0ef41Sopenharmony_ci        },
2041cb0ef41Sopenharmony_ci        {
2051cb0ef41Sopenharmony_ci            "comment": "Can’t switch from non-special scheme to special",
2061cb0ef41Sopenharmony_ci            "href": "ssh://me@example.net",
2071cb0ef41Sopenharmony_ci            "new_value": "http",
2081cb0ef41Sopenharmony_ci            "expected": {
2091cb0ef41Sopenharmony_ci                "href": "ssh://me@example.net",
2101cb0ef41Sopenharmony_ci                "protocol": "ssh:"
2111cb0ef41Sopenharmony_ci            }
2121cb0ef41Sopenharmony_ci        },
2131cb0ef41Sopenharmony_ci        {
2141cb0ef41Sopenharmony_ci            "href": "ssh://me@example.net",
2151cb0ef41Sopenharmony_ci            "new_value": "https",
2161cb0ef41Sopenharmony_ci            "expected": {
2171cb0ef41Sopenharmony_ci                "href": "ssh://me@example.net",
2181cb0ef41Sopenharmony_ci                "protocol": "ssh:"
2191cb0ef41Sopenharmony_ci            }
2201cb0ef41Sopenharmony_ci        },
2211cb0ef41Sopenharmony_ci        {
2221cb0ef41Sopenharmony_ci            "href": "ssh://me@example.net",
2231cb0ef41Sopenharmony_ci            "new_value": "file",
2241cb0ef41Sopenharmony_ci            "expected": {
2251cb0ef41Sopenharmony_ci                "href": "ssh://me@example.net",
2261cb0ef41Sopenharmony_ci                "protocol": "ssh:"
2271cb0ef41Sopenharmony_ci            }
2281cb0ef41Sopenharmony_ci        },
2291cb0ef41Sopenharmony_ci        {
2301cb0ef41Sopenharmony_ci            "href": "ssh://example.net",
2311cb0ef41Sopenharmony_ci            "new_value": "file",
2321cb0ef41Sopenharmony_ci            "expected": {
2331cb0ef41Sopenharmony_ci                "href": "ssh://example.net",
2341cb0ef41Sopenharmony_ci                "protocol": "ssh:"
2351cb0ef41Sopenharmony_ci            }
2361cb0ef41Sopenharmony_ci        },
2371cb0ef41Sopenharmony_ci        {
2381cb0ef41Sopenharmony_ci            "href": "nonsense:///test",
2391cb0ef41Sopenharmony_ci            "new_value": "https",
2401cb0ef41Sopenharmony_ci            "expected": {
2411cb0ef41Sopenharmony_ci                "href": "nonsense:///test",
2421cb0ef41Sopenharmony_ci                "protocol": "nonsense:"
2431cb0ef41Sopenharmony_ci            }
2441cb0ef41Sopenharmony_ci        },
2451cb0ef41Sopenharmony_ci        {
2461cb0ef41Sopenharmony_ci            "comment": "Stuff after the first ':' is ignored",
2471cb0ef41Sopenharmony_ci            "href": "http://example.net",
2481cb0ef41Sopenharmony_ci            "new_value": "https:foo : bar",
2491cb0ef41Sopenharmony_ci            "expected": {
2501cb0ef41Sopenharmony_ci                "href": "https://example.net/",
2511cb0ef41Sopenharmony_ci                "protocol": "https:"
2521cb0ef41Sopenharmony_ci            }
2531cb0ef41Sopenharmony_ci        },
2541cb0ef41Sopenharmony_ci        {
2551cb0ef41Sopenharmony_ci            "comment": "Stuff after the first ':' is ignored",
2561cb0ef41Sopenharmony_ci            "href": "data:text/html,<p>Test",
2571cb0ef41Sopenharmony_ci            "new_value": "view-source+data:foo : bar",
2581cb0ef41Sopenharmony_ci            "expected": {
2591cb0ef41Sopenharmony_ci                "href": "view-source+data:text/html,<p>Test",
2601cb0ef41Sopenharmony_ci                "protocol": "view-source+data:"
2611cb0ef41Sopenharmony_ci            }
2621cb0ef41Sopenharmony_ci        },
2631cb0ef41Sopenharmony_ci        {
2641cb0ef41Sopenharmony_ci            "comment": "Port is set to null if it is the default for new scheme.",
2651cb0ef41Sopenharmony_ci            "href": "http://foo.com:443/",
2661cb0ef41Sopenharmony_ci            "new_value": "https",
2671cb0ef41Sopenharmony_ci            "expected": {
2681cb0ef41Sopenharmony_ci                "href": "https://foo.com/",
2691cb0ef41Sopenharmony_ci                "protocol": "https:",
2701cb0ef41Sopenharmony_ci                "port": ""
2711cb0ef41Sopenharmony_ci            }
2721cb0ef41Sopenharmony_ci        },
2731cb0ef41Sopenharmony_ci        {
2741cb0ef41Sopenharmony_ci            "comment": "Tab and newline are stripped",
2751cb0ef41Sopenharmony_ci            "href": "http://test/",
2761cb0ef41Sopenharmony_ci            "new_value": "h\u000D\u000Att\u0009ps",
2771cb0ef41Sopenharmony_ci            "expected": {
2781cb0ef41Sopenharmony_ci              "href": "https://test/",
2791cb0ef41Sopenharmony_ci              "protocol": "https:",
2801cb0ef41Sopenharmony_ci              "port": ""
2811cb0ef41Sopenharmony_ci            }
2821cb0ef41Sopenharmony_ci        },
2831cb0ef41Sopenharmony_ci        {
2841cb0ef41Sopenharmony_ci            "href": "http://test/",
2851cb0ef41Sopenharmony_ci            "new_value": "https\u000D",
2861cb0ef41Sopenharmony_ci            "expected": {
2871cb0ef41Sopenharmony_ci              "href": "https://test/",
2881cb0ef41Sopenharmony_ci              "protocol": "https:"
2891cb0ef41Sopenharmony_ci            }
2901cb0ef41Sopenharmony_ci        },
2911cb0ef41Sopenharmony_ci        {
2921cb0ef41Sopenharmony_ci            "comment": "Non-tab/newline C0 controls result in no-op",
2931cb0ef41Sopenharmony_ci            "href": "http://test/",
2941cb0ef41Sopenharmony_ci            "new_value": "https\u0000",
2951cb0ef41Sopenharmony_ci            "expected": {
2961cb0ef41Sopenharmony_ci              "href": "http://test/",
2971cb0ef41Sopenharmony_ci              "protocol": "http:"
2981cb0ef41Sopenharmony_ci            }
2991cb0ef41Sopenharmony_ci        },
3001cb0ef41Sopenharmony_ci        {
3011cb0ef41Sopenharmony_ci            "href": "http://test/",
3021cb0ef41Sopenharmony_ci            "new_value": "https\u000C",
3031cb0ef41Sopenharmony_ci            "expected": {
3041cb0ef41Sopenharmony_ci              "href": "http://test/",
3051cb0ef41Sopenharmony_ci              "protocol": "http:"
3061cb0ef41Sopenharmony_ci            }
3071cb0ef41Sopenharmony_ci        },
3081cb0ef41Sopenharmony_ci        {
3091cb0ef41Sopenharmony_ci            "href": "http://test/",
3101cb0ef41Sopenharmony_ci            "new_value": "https\u000E",
3111cb0ef41Sopenharmony_ci            "expected": {
3121cb0ef41Sopenharmony_ci              "href": "http://test/",
3131cb0ef41Sopenharmony_ci              "protocol": "http:"
3141cb0ef41Sopenharmony_ci            }
3151cb0ef41Sopenharmony_ci        },
3161cb0ef41Sopenharmony_ci        {
3171cb0ef41Sopenharmony_ci            "href": "http://test/",
3181cb0ef41Sopenharmony_ci            "new_value": "https\u0020",
3191cb0ef41Sopenharmony_ci            "expected": {
3201cb0ef41Sopenharmony_ci              "href": "http://test/",
3211cb0ef41Sopenharmony_ci              "protocol": "http:"
3221cb0ef41Sopenharmony_ci            }
3231cb0ef41Sopenharmony_ci        }
3241cb0ef41Sopenharmony_ci    ],
3251cb0ef41Sopenharmony_ci    "username": [
3261cb0ef41Sopenharmony_ci        {
3271cb0ef41Sopenharmony_ci            "comment": "No host means no username",
3281cb0ef41Sopenharmony_ci            "href": "file:///home/you/index.html",
3291cb0ef41Sopenharmony_ci            "new_value": "me",
3301cb0ef41Sopenharmony_ci            "expected": {
3311cb0ef41Sopenharmony_ci                "href": "file:///home/you/index.html",
3321cb0ef41Sopenharmony_ci                "username": ""
3331cb0ef41Sopenharmony_ci            }
3341cb0ef41Sopenharmony_ci        },
3351cb0ef41Sopenharmony_ci        {
3361cb0ef41Sopenharmony_ci            "comment": "No host means no username",
3371cb0ef41Sopenharmony_ci            "href": "unix:/run/foo.socket",
3381cb0ef41Sopenharmony_ci            "new_value": "me",
3391cb0ef41Sopenharmony_ci            "expected": {
3401cb0ef41Sopenharmony_ci                "href": "unix:/run/foo.socket",
3411cb0ef41Sopenharmony_ci                "username": ""
3421cb0ef41Sopenharmony_ci            }
3431cb0ef41Sopenharmony_ci        },
3441cb0ef41Sopenharmony_ci        {
3451cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no username",
3461cb0ef41Sopenharmony_ci            "href": "mailto:you@example.net",
3471cb0ef41Sopenharmony_ci            "new_value": "me",
3481cb0ef41Sopenharmony_ci            "expected": {
3491cb0ef41Sopenharmony_ci                "href": "mailto:you@example.net",
3501cb0ef41Sopenharmony_ci                "username": ""
3511cb0ef41Sopenharmony_ci            }
3521cb0ef41Sopenharmony_ci        },
3531cb0ef41Sopenharmony_ci        {
3541cb0ef41Sopenharmony_ci            "href": "javascript:alert(1)",
3551cb0ef41Sopenharmony_ci            "new_value": "wario",
3561cb0ef41Sopenharmony_ci            "expected": {
3571cb0ef41Sopenharmony_ci                "href": "javascript:alert(1)",
3581cb0ef41Sopenharmony_ci                "username": ""
3591cb0ef41Sopenharmony_ci            }
3601cb0ef41Sopenharmony_ci        },
3611cb0ef41Sopenharmony_ci        {
3621cb0ef41Sopenharmony_ci            "href": "http://example.net",
3631cb0ef41Sopenharmony_ci            "new_value": "me",
3641cb0ef41Sopenharmony_ci            "expected": {
3651cb0ef41Sopenharmony_ci                "href": "http://me@example.net/",
3661cb0ef41Sopenharmony_ci                "username": "me"
3671cb0ef41Sopenharmony_ci            }
3681cb0ef41Sopenharmony_ci        },
3691cb0ef41Sopenharmony_ci        {
3701cb0ef41Sopenharmony_ci            "href": "http://:secret@example.net",
3711cb0ef41Sopenharmony_ci            "new_value": "me",
3721cb0ef41Sopenharmony_ci            "expected": {
3731cb0ef41Sopenharmony_ci                "href": "http://me:secret@example.net/",
3741cb0ef41Sopenharmony_ci                "username": "me"
3751cb0ef41Sopenharmony_ci            }
3761cb0ef41Sopenharmony_ci        },
3771cb0ef41Sopenharmony_ci        {
3781cb0ef41Sopenharmony_ci            "href": "http://me@example.net",
3791cb0ef41Sopenharmony_ci            "new_value": "",
3801cb0ef41Sopenharmony_ci            "expected": {
3811cb0ef41Sopenharmony_ci                "href": "http://example.net/",
3821cb0ef41Sopenharmony_ci                "username": ""
3831cb0ef41Sopenharmony_ci            }
3841cb0ef41Sopenharmony_ci        },
3851cb0ef41Sopenharmony_ci        {
3861cb0ef41Sopenharmony_ci            "href": "http://me:secret@example.net",
3871cb0ef41Sopenharmony_ci            "new_value": "",
3881cb0ef41Sopenharmony_ci            "expected": {
3891cb0ef41Sopenharmony_ci                "href": "http://:secret@example.net/",
3901cb0ef41Sopenharmony_ci                "username": ""
3911cb0ef41Sopenharmony_ci            }
3921cb0ef41Sopenharmony_ci        },
3931cb0ef41Sopenharmony_ci        {
3941cb0ef41Sopenharmony_ci            "comment": "UTF-8 percent encoding with the userinfo encode set.",
3951cb0ef41Sopenharmony_ci            "href": "http://example.net",
3961cb0ef41Sopenharmony_ci            "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
3971cb0ef41Sopenharmony_ci            "expected": {
3981cb0ef41Sopenharmony_ci                "href": "http://%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9@example.net/",
3991cb0ef41Sopenharmony_ci                "username": "%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
4001cb0ef41Sopenharmony_ci            }
4011cb0ef41Sopenharmony_ci        },
4021cb0ef41Sopenharmony_ci        {
4031cb0ef41Sopenharmony_ci            "comment": "Bytes already percent-encoded are left as-is.",
4041cb0ef41Sopenharmony_ci            "href": "http://example.net",
4051cb0ef41Sopenharmony_ci            "new_value": "%c3%89té",
4061cb0ef41Sopenharmony_ci            "expected": {
4071cb0ef41Sopenharmony_ci                "href": "http://%c3%89t%C3%A9@example.net/",
4081cb0ef41Sopenharmony_ci                "username": "%c3%89t%C3%A9"
4091cb0ef41Sopenharmony_ci            }
4101cb0ef41Sopenharmony_ci        },
4111cb0ef41Sopenharmony_ci        {
4121cb0ef41Sopenharmony_ci            "href": "sc:///",
4131cb0ef41Sopenharmony_ci            "new_value": "x",
4141cb0ef41Sopenharmony_ci            "expected": {
4151cb0ef41Sopenharmony_ci                "href": "sc:///",
4161cb0ef41Sopenharmony_ci                "username": ""
4171cb0ef41Sopenharmony_ci            }
4181cb0ef41Sopenharmony_ci        },
4191cb0ef41Sopenharmony_ci        {
4201cb0ef41Sopenharmony_ci            "href": "javascript://x/",
4211cb0ef41Sopenharmony_ci            "new_value": "wario",
4221cb0ef41Sopenharmony_ci            "expected": {
4231cb0ef41Sopenharmony_ci                "href": "javascript://wario@x/",
4241cb0ef41Sopenharmony_ci                "username": "wario"
4251cb0ef41Sopenharmony_ci            }
4261cb0ef41Sopenharmony_ci        },
4271cb0ef41Sopenharmony_ci        {
4281cb0ef41Sopenharmony_ci            "href": "file://test/",
4291cb0ef41Sopenharmony_ci            "new_value": "test",
4301cb0ef41Sopenharmony_ci            "expected": {
4311cb0ef41Sopenharmony_ci                "href": "file://test/",
4321cb0ef41Sopenharmony_ci                "username": ""
4331cb0ef41Sopenharmony_ci            }
4341cb0ef41Sopenharmony_ci        }
4351cb0ef41Sopenharmony_ci    ],
4361cb0ef41Sopenharmony_ci    "password": [
4371cb0ef41Sopenharmony_ci        {
4381cb0ef41Sopenharmony_ci            "comment": "No host means no password",
4391cb0ef41Sopenharmony_ci            "href": "file:///home/me/index.html",
4401cb0ef41Sopenharmony_ci            "new_value": "secret",
4411cb0ef41Sopenharmony_ci            "expected": {
4421cb0ef41Sopenharmony_ci                "href": "file:///home/me/index.html",
4431cb0ef41Sopenharmony_ci                "password": ""
4441cb0ef41Sopenharmony_ci            }
4451cb0ef41Sopenharmony_ci        },
4461cb0ef41Sopenharmony_ci        {
4471cb0ef41Sopenharmony_ci            "comment": "No host means no password",
4481cb0ef41Sopenharmony_ci            "href": "unix:/run/foo.socket",
4491cb0ef41Sopenharmony_ci            "new_value": "secret",
4501cb0ef41Sopenharmony_ci            "expected": {
4511cb0ef41Sopenharmony_ci                "href": "unix:/run/foo.socket",
4521cb0ef41Sopenharmony_ci                "password": ""
4531cb0ef41Sopenharmony_ci            }
4541cb0ef41Sopenharmony_ci        },
4551cb0ef41Sopenharmony_ci        {
4561cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no password",
4571cb0ef41Sopenharmony_ci            "href": "mailto:me@example.net",
4581cb0ef41Sopenharmony_ci            "new_value": "secret",
4591cb0ef41Sopenharmony_ci            "expected": {
4601cb0ef41Sopenharmony_ci                "href": "mailto:me@example.net",
4611cb0ef41Sopenharmony_ci                "password": ""
4621cb0ef41Sopenharmony_ci            }
4631cb0ef41Sopenharmony_ci        },
4641cb0ef41Sopenharmony_ci        {
4651cb0ef41Sopenharmony_ci            "href": "http://example.net",
4661cb0ef41Sopenharmony_ci            "new_value": "secret",
4671cb0ef41Sopenharmony_ci            "expected": {
4681cb0ef41Sopenharmony_ci                "href": "http://:secret@example.net/",
4691cb0ef41Sopenharmony_ci                "password": "secret"
4701cb0ef41Sopenharmony_ci            }
4711cb0ef41Sopenharmony_ci        },
4721cb0ef41Sopenharmony_ci        {
4731cb0ef41Sopenharmony_ci            "href": "http://me@example.net",
4741cb0ef41Sopenharmony_ci            "new_value": "secret",
4751cb0ef41Sopenharmony_ci            "expected": {
4761cb0ef41Sopenharmony_ci                "href": "http://me:secret@example.net/",
4771cb0ef41Sopenharmony_ci                "password": "secret"
4781cb0ef41Sopenharmony_ci            }
4791cb0ef41Sopenharmony_ci        },
4801cb0ef41Sopenharmony_ci        {
4811cb0ef41Sopenharmony_ci            "href": "http://:secret@example.net",
4821cb0ef41Sopenharmony_ci            "new_value": "",
4831cb0ef41Sopenharmony_ci            "expected": {
4841cb0ef41Sopenharmony_ci                "href": "http://example.net/",
4851cb0ef41Sopenharmony_ci                "password": ""
4861cb0ef41Sopenharmony_ci            }
4871cb0ef41Sopenharmony_ci        },
4881cb0ef41Sopenharmony_ci        {
4891cb0ef41Sopenharmony_ci            "href": "http://me:secret@example.net",
4901cb0ef41Sopenharmony_ci            "new_value": "",
4911cb0ef41Sopenharmony_ci            "expected": {
4921cb0ef41Sopenharmony_ci                "href": "http://me@example.net/",
4931cb0ef41Sopenharmony_ci                "password": ""
4941cb0ef41Sopenharmony_ci            }
4951cb0ef41Sopenharmony_ci        },
4961cb0ef41Sopenharmony_ci        {
4971cb0ef41Sopenharmony_ci            "comment": "UTF-8 percent encoding with the userinfo encode set.",
4981cb0ef41Sopenharmony_ci            "href": "http://example.net",
4991cb0ef41Sopenharmony_ci            "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
5001cb0ef41Sopenharmony_ci            "expected": {
5011cb0ef41Sopenharmony_ci                "href": "http://:%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9@example.net/",
5021cb0ef41Sopenharmony_ci                "password": "%00%01%09%0A%0D%1F%20!%22%23$%&'()*+,-.%2F09%3A%3B%3C%3D%3E%3F%40AZ%5B%5C%5D%5E_%60az%7B%7C%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
5031cb0ef41Sopenharmony_ci            }
5041cb0ef41Sopenharmony_ci        },
5051cb0ef41Sopenharmony_ci        {
5061cb0ef41Sopenharmony_ci            "comment": "Bytes already percent-encoded are left as-is.",
5071cb0ef41Sopenharmony_ci            "href": "http://example.net",
5081cb0ef41Sopenharmony_ci            "new_value": "%c3%89té",
5091cb0ef41Sopenharmony_ci            "expected": {
5101cb0ef41Sopenharmony_ci                "href": "http://:%c3%89t%C3%A9@example.net/",
5111cb0ef41Sopenharmony_ci                "password": "%c3%89t%C3%A9"
5121cb0ef41Sopenharmony_ci            }
5131cb0ef41Sopenharmony_ci        },
5141cb0ef41Sopenharmony_ci        {
5151cb0ef41Sopenharmony_ci            "href": "sc:///",
5161cb0ef41Sopenharmony_ci            "new_value": "x",
5171cb0ef41Sopenharmony_ci            "expected": {
5181cb0ef41Sopenharmony_ci                "href": "sc:///",
5191cb0ef41Sopenharmony_ci                "password": ""
5201cb0ef41Sopenharmony_ci            }
5211cb0ef41Sopenharmony_ci        },
5221cb0ef41Sopenharmony_ci        {
5231cb0ef41Sopenharmony_ci            "href": "javascript://x/",
5241cb0ef41Sopenharmony_ci            "new_value": "bowser",
5251cb0ef41Sopenharmony_ci            "expected": {
5261cb0ef41Sopenharmony_ci                "href": "javascript://:bowser@x/",
5271cb0ef41Sopenharmony_ci                "password": "bowser"
5281cb0ef41Sopenharmony_ci            }
5291cb0ef41Sopenharmony_ci        },
5301cb0ef41Sopenharmony_ci        {
5311cb0ef41Sopenharmony_ci            "href": "file://test/",
5321cb0ef41Sopenharmony_ci            "new_value": "test",
5331cb0ef41Sopenharmony_ci            "expected": {
5341cb0ef41Sopenharmony_ci                "href": "file://test/",
5351cb0ef41Sopenharmony_ci                "password": ""
5361cb0ef41Sopenharmony_ci            }
5371cb0ef41Sopenharmony_ci        }
5381cb0ef41Sopenharmony_ci    ],
5391cb0ef41Sopenharmony_ci    "host": [
5401cb0ef41Sopenharmony_ci        {
5411cb0ef41Sopenharmony_ci            "comment": "Non-special scheme",
5421cb0ef41Sopenharmony_ci            "href": "sc://x/",
5431cb0ef41Sopenharmony_ci            "new_value": "\u0000",
5441cb0ef41Sopenharmony_ci            "expected": {
5451cb0ef41Sopenharmony_ci                "href": "sc://x/",
5461cb0ef41Sopenharmony_ci                "host": "x",
5471cb0ef41Sopenharmony_ci                "hostname": "x"
5481cb0ef41Sopenharmony_ci            }
5491cb0ef41Sopenharmony_ci        },
5501cb0ef41Sopenharmony_ci        {
5511cb0ef41Sopenharmony_ci            "href": "sc://x/",
5521cb0ef41Sopenharmony_ci            "new_value": "\u0009",
5531cb0ef41Sopenharmony_ci            "expected": {
5541cb0ef41Sopenharmony_ci                "href": "sc:///",
5551cb0ef41Sopenharmony_ci                "host": "",
5561cb0ef41Sopenharmony_ci                "hostname": ""
5571cb0ef41Sopenharmony_ci            }
5581cb0ef41Sopenharmony_ci        },
5591cb0ef41Sopenharmony_ci        {
5601cb0ef41Sopenharmony_ci            "href": "sc://x/",
5611cb0ef41Sopenharmony_ci            "new_value": "\u000A",
5621cb0ef41Sopenharmony_ci            "expected": {
5631cb0ef41Sopenharmony_ci                "href": "sc:///",
5641cb0ef41Sopenharmony_ci                "host": "",
5651cb0ef41Sopenharmony_ci                "hostname": ""
5661cb0ef41Sopenharmony_ci            }
5671cb0ef41Sopenharmony_ci        },
5681cb0ef41Sopenharmony_ci        {
5691cb0ef41Sopenharmony_ci            "href": "sc://x/",
5701cb0ef41Sopenharmony_ci            "new_value": "\u000D",
5711cb0ef41Sopenharmony_ci            "expected": {
5721cb0ef41Sopenharmony_ci                "href": "sc:///",
5731cb0ef41Sopenharmony_ci                "host": "",
5741cb0ef41Sopenharmony_ci                "hostname": ""
5751cb0ef41Sopenharmony_ci            }
5761cb0ef41Sopenharmony_ci        },
5771cb0ef41Sopenharmony_ci        {
5781cb0ef41Sopenharmony_ci            "href": "sc://x/",
5791cb0ef41Sopenharmony_ci            "new_value": " ",
5801cb0ef41Sopenharmony_ci            "expected": {
5811cb0ef41Sopenharmony_ci                "href": "sc://x/",
5821cb0ef41Sopenharmony_ci                "host": "x",
5831cb0ef41Sopenharmony_ci                "hostname": "x"
5841cb0ef41Sopenharmony_ci            }
5851cb0ef41Sopenharmony_ci        },
5861cb0ef41Sopenharmony_ci        {
5871cb0ef41Sopenharmony_ci            "href": "sc://x/",
5881cb0ef41Sopenharmony_ci            "new_value": "#",
5891cb0ef41Sopenharmony_ci            "expected": {
5901cb0ef41Sopenharmony_ci                "href": "sc:///",
5911cb0ef41Sopenharmony_ci                "host": "",
5921cb0ef41Sopenharmony_ci                "hostname": ""
5931cb0ef41Sopenharmony_ci            }
5941cb0ef41Sopenharmony_ci        },
5951cb0ef41Sopenharmony_ci        {
5961cb0ef41Sopenharmony_ci            "href": "sc://x/",
5971cb0ef41Sopenharmony_ci            "new_value": "/",
5981cb0ef41Sopenharmony_ci            "expected": {
5991cb0ef41Sopenharmony_ci                "href": "sc:///",
6001cb0ef41Sopenharmony_ci                "host": "",
6011cb0ef41Sopenharmony_ci                "hostname": ""
6021cb0ef41Sopenharmony_ci            }
6031cb0ef41Sopenharmony_ci        },
6041cb0ef41Sopenharmony_ci        {
6051cb0ef41Sopenharmony_ci            "href": "sc://x/",
6061cb0ef41Sopenharmony_ci            "new_value": "?",
6071cb0ef41Sopenharmony_ci            "expected": {
6081cb0ef41Sopenharmony_ci                "href": "sc:///",
6091cb0ef41Sopenharmony_ci                "host": "",
6101cb0ef41Sopenharmony_ci                "hostname": ""
6111cb0ef41Sopenharmony_ci            }
6121cb0ef41Sopenharmony_ci        },
6131cb0ef41Sopenharmony_ci        {
6141cb0ef41Sopenharmony_ci            "href": "sc://x/",
6151cb0ef41Sopenharmony_ci            "new_value": "@",
6161cb0ef41Sopenharmony_ci            "expected": {
6171cb0ef41Sopenharmony_ci                "href": "sc://x/",
6181cb0ef41Sopenharmony_ci                "host": "x",
6191cb0ef41Sopenharmony_ci                "hostname": "x"
6201cb0ef41Sopenharmony_ci            }
6211cb0ef41Sopenharmony_ci        },
6221cb0ef41Sopenharmony_ci        {
6231cb0ef41Sopenharmony_ci            "href": "sc://x/",
6241cb0ef41Sopenharmony_ci            "new_value": "ß",
6251cb0ef41Sopenharmony_ci            "expected": {
6261cb0ef41Sopenharmony_ci                "href": "sc://%C3%9F/",
6271cb0ef41Sopenharmony_ci                "host": "%C3%9F",
6281cb0ef41Sopenharmony_ci                "hostname": "%C3%9F"
6291cb0ef41Sopenharmony_ci            }
6301cb0ef41Sopenharmony_ci        },
6311cb0ef41Sopenharmony_ci        {
6321cb0ef41Sopenharmony_ci            "comment": "IDNA Nontransitional_Processing",
6331cb0ef41Sopenharmony_ci            "href": "https://x/",
6341cb0ef41Sopenharmony_ci            "new_value": "ß",
6351cb0ef41Sopenharmony_ci            "expected": {
6361cb0ef41Sopenharmony_ci                "href": "https://xn--zca/",
6371cb0ef41Sopenharmony_ci                "host": "xn--zca",
6381cb0ef41Sopenharmony_ci                "hostname": "xn--zca"
6391cb0ef41Sopenharmony_ci            }
6401cb0ef41Sopenharmony_ci        },
6411cb0ef41Sopenharmony_ci        {
6421cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no host",
6431cb0ef41Sopenharmony_ci            "href": "mailto:me@example.net",
6441cb0ef41Sopenharmony_ci            "new_value": "example.com",
6451cb0ef41Sopenharmony_ci            "expected": {
6461cb0ef41Sopenharmony_ci                "href": "mailto:me@example.net",
6471cb0ef41Sopenharmony_ci                "host": ""
6481cb0ef41Sopenharmony_ci            }
6491cb0ef41Sopenharmony_ci        },
6501cb0ef41Sopenharmony_ci        {
6511cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no host",
6521cb0ef41Sopenharmony_ci            "href": "data:text/plain,Stuff",
6531cb0ef41Sopenharmony_ci            "new_value": "example.net",
6541cb0ef41Sopenharmony_ci            "expected": {
6551cb0ef41Sopenharmony_ci                "href": "data:text/plain,Stuff",
6561cb0ef41Sopenharmony_ci                "host": ""
6571cb0ef41Sopenharmony_ci            }
6581cb0ef41Sopenharmony_ci        },
6591cb0ef41Sopenharmony_ci        {
6601cb0ef41Sopenharmony_ci            "href": "http://example.net",
6611cb0ef41Sopenharmony_ci            "new_value": "example.com:8080",
6621cb0ef41Sopenharmony_ci            "expected": {
6631cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/",
6641cb0ef41Sopenharmony_ci                "host": "example.com:8080",
6651cb0ef41Sopenharmony_ci                "hostname": "example.com",
6661cb0ef41Sopenharmony_ci                "port": "8080"
6671cb0ef41Sopenharmony_ci            }
6681cb0ef41Sopenharmony_ci        },
6691cb0ef41Sopenharmony_ci        {
6701cb0ef41Sopenharmony_ci            "comment": "Port number is unchanged if not specified in the new value",
6711cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
6721cb0ef41Sopenharmony_ci            "new_value": "example.com",
6731cb0ef41Sopenharmony_ci            "expected": {
6741cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/",
6751cb0ef41Sopenharmony_ci                "host": "example.com:8080",
6761cb0ef41Sopenharmony_ci                "hostname": "example.com",
6771cb0ef41Sopenharmony_ci                "port": "8080"
6781cb0ef41Sopenharmony_ci            }
6791cb0ef41Sopenharmony_ci        },
6801cb0ef41Sopenharmony_ci        {
6811cb0ef41Sopenharmony_ci            "comment": "Port number is unchanged if not specified",
6821cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
6831cb0ef41Sopenharmony_ci            "new_value": "example.com:",
6841cb0ef41Sopenharmony_ci            "expected": {
6851cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/",
6861cb0ef41Sopenharmony_ci                "host": "example.com:8080",
6871cb0ef41Sopenharmony_ci                "hostname": "example.com",
6881cb0ef41Sopenharmony_ci                "port": "8080"
6891cb0ef41Sopenharmony_ci            }
6901cb0ef41Sopenharmony_ci        },
6911cb0ef41Sopenharmony_ci        {
6921cb0ef41Sopenharmony_ci            "comment": "The empty host is not valid for special schemes",
6931cb0ef41Sopenharmony_ci            "href": "http://example.net",
6941cb0ef41Sopenharmony_ci            "new_value": "",
6951cb0ef41Sopenharmony_ci            "expected": {
6961cb0ef41Sopenharmony_ci                "href": "http://example.net/",
6971cb0ef41Sopenharmony_ci                "host": "example.net"
6981cb0ef41Sopenharmony_ci            }
6991cb0ef41Sopenharmony_ci        },
7001cb0ef41Sopenharmony_ci        {
7011cb0ef41Sopenharmony_ci            "comment": "The empty host is OK for non-special schemes",
7021cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/foo",
7031cb0ef41Sopenharmony_ci            "new_value": "",
7041cb0ef41Sopenharmony_ci            "expected": {
7051cb0ef41Sopenharmony_ci                "href": "view-source+http:///foo",
7061cb0ef41Sopenharmony_ci                "host": ""
7071cb0ef41Sopenharmony_ci            }
7081cb0ef41Sopenharmony_ci        },
7091cb0ef41Sopenharmony_ci        {
7101cb0ef41Sopenharmony_ci            "comment": "Path-only URLs can gain a host",
7111cb0ef41Sopenharmony_ci            "href": "a:/foo",
7121cb0ef41Sopenharmony_ci            "new_value": "example.net",
7131cb0ef41Sopenharmony_ci            "expected": {
7141cb0ef41Sopenharmony_ci                "href": "a://example.net/foo",
7151cb0ef41Sopenharmony_ci                "host": "example.net"
7161cb0ef41Sopenharmony_ci            }
7171cb0ef41Sopenharmony_ci        },
7181cb0ef41Sopenharmony_ci        {
7191cb0ef41Sopenharmony_ci            "comment": "IPv4 address syntax is normalized",
7201cb0ef41Sopenharmony_ci            "href": "http://example.net",
7211cb0ef41Sopenharmony_ci            "new_value": "0x7F000001:8080",
7221cb0ef41Sopenharmony_ci            "expected": {
7231cb0ef41Sopenharmony_ci                "href": "http://127.0.0.1:8080/",
7241cb0ef41Sopenharmony_ci                "host": "127.0.0.1:8080",
7251cb0ef41Sopenharmony_ci                "hostname": "127.0.0.1",
7261cb0ef41Sopenharmony_ci                "port": "8080"
7271cb0ef41Sopenharmony_ci            }
7281cb0ef41Sopenharmony_ci        },
7291cb0ef41Sopenharmony_ci        {
7301cb0ef41Sopenharmony_ci            "comment": "IPv6 address syntax is normalized",
7311cb0ef41Sopenharmony_ci            "href": "http://example.net",
7321cb0ef41Sopenharmony_ci            "new_value": "[::0:01]:2",
7331cb0ef41Sopenharmony_ci            "expected": {
7341cb0ef41Sopenharmony_ci                "href": "http://[::1]:2/",
7351cb0ef41Sopenharmony_ci                "host": "[::1]:2",
7361cb0ef41Sopenharmony_ci                "hostname": "[::1]",
7371cb0ef41Sopenharmony_ci                "port": "2"
7381cb0ef41Sopenharmony_ci            }
7391cb0ef41Sopenharmony_ci        },
7401cb0ef41Sopenharmony_ci        {
7411cb0ef41Sopenharmony_ci            "comment": "IPv6 literal address with port, crbug.com/1012416",
7421cb0ef41Sopenharmony_ci            "href": "http://example.net",
7431cb0ef41Sopenharmony_ci            "new_value": "[2001:db8::2]:4002",
7441cb0ef41Sopenharmony_ci            "expected": {
7451cb0ef41Sopenharmony_ci                "href": "http://[2001:db8::2]:4002/",
7461cb0ef41Sopenharmony_ci                "host": "[2001:db8::2]:4002",
7471cb0ef41Sopenharmony_ci                "hostname": "[2001:db8::2]",
7481cb0ef41Sopenharmony_ci                "port": "4002"
7491cb0ef41Sopenharmony_ci             }
7501cb0ef41Sopenharmony_ci        },
7511cb0ef41Sopenharmony_ci        {
7521cb0ef41Sopenharmony_ci            "comment": "Default port number is removed",
7531cb0ef41Sopenharmony_ci            "href": "http://example.net",
7541cb0ef41Sopenharmony_ci            "new_value": "example.com:80",
7551cb0ef41Sopenharmony_ci            "expected": {
7561cb0ef41Sopenharmony_ci                "href": "http://example.com/",
7571cb0ef41Sopenharmony_ci                "host": "example.com",
7581cb0ef41Sopenharmony_ci                "hostname": "example.com",
7591cb0ef41Sopenharmony_ci                "port": ""
7601cb0ef41Sopenharmony_ci            }
7611cb0ef41Sopenharmony_ci        },
7621cb0ef41Sopenharmony_ci        {
7631cb0ef41Sopenharmony_ci            "comment": "Default port number is removed",
7641cb0ef41Sopenharmony_ci            "href": "https://example.net",
7651cb0ef41Sopenharmony_ci            "new_value": "example.com:443",
7661cb0ef41Sopenharmony_ci            "expected": {
7671cb0ef41Sopenharmony_ci                "href": "https://example.com/",
7681cb0ef41Sopenharmony_ci                "host": "example.com",
7691cb0ef41Sopenharmony_ci                "hostname": "example.com",
7701cb0ef41Sopenharmony_ci                "port": ""
7711cb0ef41Sopenharmony_ci            }
7721cb0ef41Sopenharmony_ci        },
7731cb0ef41Sopenharmony_ci        {
7741cb0ef41Sopenharmony_ci            "comment": "Default port number is only removed for the relevant scheme",
7751cb0ef41Sopenharmony_ci            "href": "https://example.net",
7761cb0ef41Sopenharmony_ci            "new_value": "example.com:80",
7771cb0ef41Sopenharmony_ci            "expected": {
7781cb0ef41Sopenharmony_ci                "href": "https://example.com:80/",
7791cb0ef41Sopenharmony_ci                "host": "example.com:80",
7801cb0ef41Sopenharmony_ci                "hostname": "example.com",
7811cb0ef41Sopenharmony_ci                "port": "80"
7821cb0ef41Sopenharmony_ci            }
7831cb0ef41Sopenharmony_ci        },
7841cb0ef41Sopenharmony_ci        {
7851cb0ef41Sopenharmony_ci            "comment": "Port number is removed if new port is scheme default and existing URL has a non-default port",
7861cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
7871cb0ef41Sopenharmony_ci            "new_value": "example.com:80",
7881cb0ef41Sopenharmony_ci            "expected": {
7891cb0ef41Sopenharmony_ci                "href": "http://example.com/",
7901cb0ef41Sopenharmony_ci                "host": "example.com",
7911cb0ef41Sopenharmony_ci                "hostname": "example.com",
7921cb0ef41Sopenharmony_ci                "port": ""
7931cb0ef41Sopenharmony_ci            }
7941cb0ef41Sopenharmony_ci        },
7951cb0ef41Sopenharmony_ci        {
7961cb0ef41Sopenharmony_ci            "comment": "Stuff after a / delimiter is ignored",
7971cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
7981cb0ef41Sopenharmony_ci            "new_value": "example.com/stuff",
7991cb0ef41Sopenharmony_ci            "expected": {
8001cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
8011cb0ef41Sopenharmony_ci                "host": "example.com",
8021cb0ef41Sopenharmony_ci                "hostname": "example.com",
8031cb0ef41Sopenharmony_ci                "port": ""
8041cb0ef41Sopenharmony_ci            }
8051cb0ef41Sopenharmony_ci        },
8061cb0ef41Sopenharmony_ci        {
8071cb0ef41Sopenharmony_ci            "comment": "Stuff after a / delimiter is ignored",
8081cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8091cb0ef41Sopenharmony_ci            "new_value": "example.com:8080/stuff",
8101cb0ef41Sopenharmony_ci            "expected": {
8111cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
8121cb0ef41Sopenharmony_ci                "host": "example.com:8080",
8131cb0ef41Sopenharmony_ci                "hostname": "example.com",
8141cb0ef41Sopenharmony_ci                "port": "8080"
8151cb0ef41Sopenharmony_ci            }
8161cb0ef41Sopenharmony_ci        },
8171cb0ef41Sopenharmony_ci        {
8181cb0ef41Sopenharmony_ci            "comment": "Stuff after a ? delimiter is ignored",
8191cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8201cb0ef41Sopenharmony_ci            "new_value": "example.com?stuff",
8211cb0ef41Sopenharmony_ci            "expected": {
8221cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
8231cb0ef41Sopenharmony_ci                "host": "example.com",
8241cb0ef41Sopenharmony_ci                "hostname": "example.com",
8251cb0ef41Sopenharmony_ci                "port": ""
8261cb0ef41Sopenharmony_ci            }
8271cb0ef41Sopenharmony_ci        },
8281cb0ef41Sopenharmony_ci        {
8291cb0ef41Sopenharmony_ci            "comment": "Stuff after a ? delimiter is ignored",
8301cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8311cb0ef41Sopenharmony_ci            "new_value": "example.com:8080?stuff",
8321cb0ef41Sopenharmony_ci            "expected": {
8331cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
8341cb0ef41Sopenharmony_ci                "host": "example.com:8080",
8351cb0ef41Sopenharmony_ci                "hostname": "example.com",
8361cb0ef41Sopenharmony_ci                "port": "8080"
8371cb0ef41Sopenharmony_ci            }
8381cb0ef41Sopenharmony_ci        },
8391cb0ef41Sopenharmony_ci        {
8401cb0ef41Sopenharmony_ci            "comment": "Stuff after a # delimiter is ignored",
8411cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8421cb0ef41Sopenharmony_ci            "new_value": "example.com#stuff",
8431cb0ef41Sopenharmony_ci            "expected": {
8441cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
8451cb0ef41Sopenharmony_ci                "host": "example.com",
8461cb0ef41Sopenharmony_ci                "hostname": "example.com",
8471cb0ef41Sopenharmony_ci                "port": ""
8481cb0ef41Sopenharmony_ci            }
8491cb0ef41Sopenharmony_ci        },
8501cb0ef41Sopenharmony_ci        {
8511cb0ef41Sopenharmony_ci            "comment": "Stuff after a # delimiter is ignored",
8521cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8531cb0ef41Sopenharmony_ci            "new_value": "example.com:8080#stuff",
8541cb0ef41Sopenharmony_ci            "expected": {
8551cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
8561cb0ef41Sopenharmony_ci                "host": "example.com:8080",
8571cb0ef41Sopenharmony_ci                "hostname": "example.com",
8581cb0ef41Sopenharmony_ci                "port": "8080"
8591cb0ef41Sopenharmony_ci            }
8601cb0ef41Sopenharmony_ci        },
8611cb0ef41Sopenharmony_ci        {
8621cb0ef41Sopenharmony_ci            "comment": "Stuff after a \\ delimiter is ignored for special schemes",
8631cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8641cb0ef41Sopenharmony_ci            "new_value": "example.com\\stuff",
8651cb0ef41Sopenharmony_ci            "expected": {
8661cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
8671cb0ef41Sopenharmony_ci                "host": "example.com",
8681cb0ef41Sopenharmony_ci                "hostname": "example.com",
8691cb0ef41Sopenharmony_ci                "port": ""
8701cb0ef41Sopenharmony_ci            }
8711cb0ef41Sopenharmony_ci        },
8721cb0ef41Sopenharmony_ci        {
8731cb0ef41Sopenharmony_ci            "comment": "Stuff after a \\ delimiter is ignored for special schemes",
8741cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
8751cb0ef41Sopenharmony_ci            "new_value": "example.com:8080\\stuff",
8761cb0ef41Sopenharmony_ci            "expected": {
8771cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
8781cb0ef41Sopenharmony_ci                "host": "example.com:8080",
8791cb0ef41Sopenharmony_ci                "hostname": "example.com",
8801cb0ef41Sopenharmony_ci                "port": "8080"
8811cb0ef41Sopenharmony_ci            }
8821cb0ef41Sopenharmony_ci        },
8831cb0ef41Sopenharmony_ci        {
8841cb0ef41Sopenharmony_ci            "comment": "\\ is not a delimiter for non-special schemes, but still forbidden in hosts",
8851cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/path",
8861cb0ef41Sopenharmony_ci            "new_value": "example.com\\stuff",
8871cb0ef41Sopenharmony_ci            "expected": {
8881cb0ef41Sopenharmony_ci                "href": "view-source+http://example.net/path",
8891cb0ef41Sopenharmony_ci                "host": "example.net",
8901cb0ef41Sopenharmony_ci                "hostname": "example.net",
8911cb0ef41Sopenharmony_ci                "port": ""
8921cb0ef41Sopenharmony_ci            }
8931cb0ef41Sopenharmony_ci        },
8941cb0ef41Sopenharmony_ci        {
8951cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
8961cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/path",
8971cb0ef41Sopenharmony_ci            "new_value": "example.com:8080stuff2",
8981cb0ef41Sopenharmony_ci            "expected": {
8991cb0ef41Sopenharmony_ci                "href": "view-source+http://example.com:8080/path",
9001cb0ef41Sopenharmony_ci                "host": "example.com:8080",
9011cb0ef41Sopenharmony_ci                "hostname": "example.com",
9021cb0ef41Sopenharmony_ci                "port": "8080"
9031cb0ef41Sopenharmony_ci            }
9041cb0ef41Sopenharmony_ci        },
9051cb0ef41Sopenharmony_ci        {
9061cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
9071cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
9081cb0ef41Sopenharmony_ci            "new_value": "example.com:8080stuff2",
9091cb0ef41Sopenharmony_ci            "expected": {
9101cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
9111cb0ef41Sopenharmony_ci                "host": "example.com:8080",
9121cb0ef41Sopenharmony_ci                "hostname": "example.com",
9131cb0ef41Sopenharmony_ci                "port": "8080"
9141cb0ef41Sopenharmony_ci            }
9151cb0ef41Sopenharmony_ci        },
9161cb0ef41Sopenharmony_ci        {
9171cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
9181cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
9191cb0ef41Sopenharmony_ci            "new_value": "example.com:8080+2",
9201cb0ef41Sopenharmony_ci            "expected": {
9211cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/path",
9221cb0ef41Sopenharmony_ci                "host": "example.com:8080",
9231cb0ef41Sopenharmony_ci                "hostname": "example.com",
9241cb0ef41Sopenharmony_ci                "port": "8080"
9251cb0ef41Sopenharmony_ci            }
9261cb0ef41Sopenharmony_ci        },
9271cb0ef41Sopenharmony_ci        {
9281cb0ef41Sopenharmony_ci            "comment": "Port numbers are 16 bit integers",
9291cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
9301cb0ef41Sopenharmony_ci            "new_value": "example.com:65535",
9311cb0ef41Sopenharmony_ci            "expected": {
9321cb0ef41Sopenharmony_ci                "href": "http://example.com:65535/path",
9331cb0ef41Sopenharmony_ci                "host": "example.com:65535",
9341cb0ef41Sopenharmony_ci                "hostname": "example.com",
9351cb0ef41Sopenharmony_ci                "port": "65535"
9361cb0ef41Sopenharmony_ci            }
9371cb0ef41Sopenharmony_ci        },
9381cb0ef41Sopenharmony_ci        {
9391cb0ef41Sopenharmony_ci            "comment": "Port numbers are 16 bit integers, overflowing is an error. Hostname is still set, though.",
9401cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
9411cb0ef41Sopenharmony_ci            "new_value": "example.com:65536",
9421cb0ef41Sopenharmony_ci            "expected": {
9431cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
9441cb0ef41Sopenharmony_ci                "host": "example.com",
9451cb0ef41Sopenharmony_ci                "hostname": "example.com",
9461cb0ef41Sopenharmony_ci                "port": ""
9471cb0ef41Sopenharmony_ci            }
9481cb0ef41Sopenharmony_ci        },
9491cb0ef41Sopenharmony_ci        {
9501cb0ef41Sopenharmony_ci            "comment": "Broken IPv6",
9511cb0ef41Sopenharmony_ci            "href": "http://example.net/",
9521cb0ef41Sopenharmony_ci            "new_value": "[google.com]",
9531cb0ef41Sopenharmony_ci            "expected": {
9541cb0ef41Sopenharmony_ci                "href": "http://example.net/",
9551cb0ef41Sopenharmony_ci                "host": "example.net",
9561cb0ef41Sopenharmony_ci                "hostname": "example.net"
9571cb0ef41Sopenharmony_ci            }
9581cb0ef41Sopenharmony_ci        },
9591cb0ef41Sopenharmony_ci        {
9601cb0ef41Sopenharmony_ci            "href": "http://example.net/",
9611cb0ef41Sopenharmony_ci            "new_value": "[::1.2.3.4x]",
9621cb0ef41Sopenharmony_ci            "expected": {
9631cb0ef41Sopenharmony_ci                "href": "http://example.net/",
9641cb0ef41Sopenharmony_ci                "host": "example.net",
9651cb0ef41Sopenharmony_ci                "hostname": "example.net"
9661cb0ef41Sopenharmony_ci            }
9671cb0ef41Sopenharmony_ci        },
9681cb0ef41Sopenharmony_ci        {
9691cb0ef41Sopenharmony_ci            "href": "http://example.net/",
9701cb0ef41Sopenharmony_ci            "new_value": "[::1.2.3.]",
9711cb0ef41Sopenharmony_ci            "expected": {
9721cb0ef41Sopenharmony_ci                "href": "http://example.net/",
9731cb0ef41Sopenharmony_ci                "host": "example.net",
9741cb0ef41Sopenharmony_ci                "hostname": "example.net"
9751cb0ef41Sopenharmony_ci            }
9761cb0ef41Sopenharmony_ci        },
9771cb0ef41Sopenharmony_ci        {
9781cb0ef41Sopenharmony_ci            "href": "http://example.net/",
9791cb0ef41Sopenharmony_ci            "new_value": "[::1.2.]",
9801cb0ef41Sopenharmony_ci            "expected": {
9811cb0ef41Sopenharmony_ci                "href": "http://example.net/",
9821cb0ef41Sopenharmony_ci                "host": "example.net",
9831cb0ef41Sopenharmony_ci                "hostname": "example.net"
9841cb0ef41Sopenharmony_ci            }
9851cb0ef41Sopenharmony_ci        },
9861cb0ef41Sopenharmony_ci        {
9871cb0ef41Sopenharmony_ci            "href": "http://example.net/",
9881cb0ef41Sopenharmony_ci            "new_value": "[::1.]",
9891cb0ef41Sopenharmony_ci            "expected": {
9901cb0ef41Sopenharmony_ci                "href": "http://example.net/",
9911cb0ef41Sopenharmony_ci                "host": "example.net",
9921cb0ef41Sopenharmony_ci                "hostname": "example.net"
9931cb0ef41Sopenharmony_ci            }
9941cb0ef41Sopenharmony_ci        },
9951cb0ef41Sopenharmony_ci        {
9961cb0ef41Sopenharmony_ci            "href": "file://y/",
9971cb0ef41Sopenharmony_ci            "new_value": "x:123",
9981cb0ef41Sopenharmony_ci            "expected": {
9991cb0ef41Sopenharmony_ci                "href": "file://y/",
10001cb0ef41Sopenharmony_ci                "host": "y",
10011cb0ef41Sopenharmony_ci                "hostname": "y",
10021cb0ef41Sopenharmony_ci                "port": ""
10031cb0ef41Sopenharmony_ci            }
10041cb0ef41Sopenharmony_ci        },
10051cb0ef41Sopenharmony_ci        {
10061cb0ef41Sopenharmony_ci            "href": "file://y/",
10071cb0ef41Sopenharmony_ci            "new_value": "loc%41lhost",
10081cb0ef41Sopenharmony_ci            "expected": {
10091cb0ef41Sopenharmony_ci                "href": "file:///",
10101cb0ef41Sopenharmony_ci                "host": "",
10111cb0ef41Sopenharmony_ci                "hostname": "",
10121cb0ef41Sopenharmony_ci                "port": ""
10131cb0ef41Sopenharmony_ci            }
10141cb0ef41Sopenharmony_ci        },
10151cb0ef41Sopenharmony_ci        {
10161cb0ef41Sopenharmony_ci            "href": "file://hi/x",
10171cb0ef41Sopenharmony_ci            "new_value": "",
10181cb0ef41Sopenharmony_ci            "expected": {
10191cb0ef41Sopenharmony_ci                "href": "file:///x",
10201cb0ef41Sopenharmony_ci                "host": "",
10211cb0ef41Sopenharmony_ci                "hostname": "",
10221cb0ef41Sopenharmony_ci                "port": ""
10231cb0ef41Sopenharmony_ci            }
10241cb0ef41Sopenharmony_ci        },
10251cb0ef41Sopenharmony_ci        {
10261cb0ef41Sopenharmony_ci            "href": "sc://test@test/",
10271cb0ef41Sopenharmony_ci            "new_value": "",
10281cb0ef41Sopenharmony_ci            "expected": {
10291cb0ef41Sopenharmony_ci                "href": "sc://test@test/",
10301cb0ef41Sopenharmony_ci                "host": "test",
10311cb0ef41Sopenharmony_ci                "hostname": "test",
10321cb0ef41Sopenharmony_ci                "username": "test"
10331cb0ef41Sopenharmony_ci            }
10341cb0ef41Sopenharmony_ci        },
10351cb0ef41Sopenharmony_ci        {
10361cb0ef41Sopenharmony_ci            "href": "sc://test:12/",
10371cb0ef41Sopenharmony_ci            "new_value": "",
10381cb0ef41Sopenharmony_ci            "expected": {
10391cb0ef41Sopenharmony_ci                "href": "sc://test:12/",
10401cb0ef41Sopenharmony_ci                "host": "test:12",
10411cb0ef41Sopenharmony_ci                "hostname": "test",
10421cb0ef41Sopenharmony_ci                "port": "12"
10431cb0ef41Sopenharmony_ci            }
10441cb0ef41Sopenharmony_ci        },
10451cb0ef41Sopenharmony_ci        {
10461cb0ef41Sopenharmony_ci            "comment": "Leading / is not stripped",
10471cb0ef41Sopenharmony_ci            "href": "http://example.com/",
10481cb0ef41Sopenharmony_ci            "new_value": "///bad.com",
10491cb0ef41Sopenharmony_ci            "expected": {
10501cb0ef41Sopenharmony_ci                "href": "http://example.com/",
10511cb0ef41Sopenharmony_ci                "host": "example.com",
10521cb0ef41Sopenharmony_ci                "hostname": "example.com"
10531cb0ef41Sopenharmony_ci            }
10541cb0ef41Sopenharmony_ci        },
10551cb0ef41Sopenharmony_ci        {
10561cb0ef41Sopenharmony_ci            "comment": "Leading / is not stripped",
10571cb0ef41Sopenharmony_ci            "href": "sc://example.com/",
10581cb0ef41Sopenharmony_ci            "new_value": "///bad.com",
10591cb0ef41Sopenharmony_ci            "expected": {
10601cb0ef41Sopenharmony_ci                "href": "sc:///",
10611cb0ef41Sopenharmony_ci                "host": "",
10621cb0ef41Sopenharmony_ci                "hostname": ""
10631cb0ef41Sopenharmony_ci            }
10641cb0ef41Sopenharmony_ci        },
10651cb0ef41Sopenharmony_ci        {
10661cb0ef41Sopenharmony_ci            "href": "https://example.com/",
10671cb0ef41Sopenharmony_ci            "new_value": "a%C2%ADb",
10681cb0ef41Sopenharmony_ci            "expected": {
10691cb0ef41Sopenharmony_ci                "href": "https://ab/",
10701cb0ef41Sopenharmony_ci                "host": "ab",
10711cb0ef41Sopenharmony_ci                "hostname": "ab"
10721cb0ef41Sopenharmony_ci            }
10731cb0ef41Sopenharmony_ci        },
10741cb0ef41Sopenharmony_ci        {
10751cb0ef41Sopenharmony_ci            "href": "https://example.com/",
10761cb0ef41Sopenharmony_ci            "new_value": "\u00AD",
10771cb0ef41Sopenharmony_ci            "expected": {
10781cb0ef41Sopenharmony_ci                "href": "https://example.com/",
10791cb0ef41Sopenharmony_ci                "host": "example.com",
10801cb0ef41Sopenharmony_ci                "hostname": "example.com"
10811cb0ef41Sopenharmony_ci            }
10821cb0ef41Sopenharmony_ci        },
10831cb0ef41Sopenharmony_ci        {
10841cb0ef41Sopenharmony_ci            "href": "https://example.com/",
10851cb0ef41Sopenharmony_ci            "new_value": "%C2%AD",
10861cb0ef41Sopenharmony_ci            "expected": {
10871cb0ef41Sopenharmony_ci                "href": "https://example.com/",
10881cb0ef41Sopenharmony_ci                "host": "example.com",
10891cb0ef41Sopenharmony_ci                "hostname": "example.com"
10901cb0ef41Sopenharmony_ci            }
10911cb0ef41Sopenharmony_ci        },
10921cb0ef41Sopenharmony_ci        {
10931cb0ef41Sopenharmony_ci            "href": "https://example.com/",
10941cb0ef41Sopenharmony_ci            "new_value": "xn--",
10951cb0ef41Sopenharmony_ci            "expected": {
10961cb0ef41Sopenharmony_ci                "href": "https://example.com/",
10971cb0ef41Sopenharmony_ci                "host": "example.com",
10981cb0ef41Sopenharmony_ci                "hostname": "example.com"
10991cb0ef41Sopenharmony_ci            }
11001cb0ef41Sopenharmony_ci        }
11011cb0ef41Sopenharmony_ci    ],
11021cb0ef41Sopenharmony_ci    "hostname": [
11031cb0ef41Sopenharmony_ci        {
11041cb0ef41Sopenharmony_ci            "comment": "Non-special scheme",
11051cb0ef41Sopenharmony_ci            "href": "sc://x/",
11061cb0ef41Sopenharmony_ci            "new_value": "\u0000",
11071cb0ef41Sopenharmony_ci            "expected": {
11081cb0ef41Sopenharmony_ci                "href": "sc://x/",
11091cb0ef41Sopenharmony_ci                "host": "x",
11101cb0ef41Sopenharmony_ci                "hostname": "x"
11111cb0ef41Sopenharmony_ci            }
11121cb0ef41Sopenharmony_ci        },
11131cb0ef41Sopenharmony_ci        {
11141cb0ef41Sopenharmony_ci            "href": "sc://x/",
11151cb0ef41Sopenharmony_ci            "new_value": "\u0009",
11161cb0ef41Sopenharmony_ci            "expected": {
11171cb0ef41Sopenharmony_ci                "href": "sc:///",
11181cb0ef41Sopenharmony_ci                "host": "",
11191cb0ef41Sopenharmony_ci                "hostname": ""
11201cb0ef41Sopenharmony_ci            }
11211cb0ef41Sopenharmony_ci        },
11221cb0ef41Sopenharmony_ci        {
11231cb0ef41Sopenharmony_ci            "href": "sc://x/",
11241cb0ef41Sopenharmony_ci            "new_value": "\u000A",
11251cb0ef41Sopenharmony_ci            "expected": {
11261cb0ef41Sopenharmony_ci                "href": "sc:///",
11271cb0ef41Sopenharmony_ci                "host": "",
11281cb0ef41Sopenharmony_ci                "hostname": ""
11291cb0ef41Sopenharmony_ci            }
11301cb0ef41Sopenharmony_ci        },
11311cb0ef41Sopenharmony_ci        {
11321cb0ef41Sopenharmony_ci            "href": "sc://x/",
11331cb0ef41Sopenharmony_ci            "new_value": "\u000D",
11341cb0ef41Sopenharmony_ci            "expected": {
11351cb0ef41Sopenharmony_ci                "href": "sc:///",
11361cb0ef41Sopenharmony_ci                "host": "",
11371cb0ef41Sopenharmony_ci                "hostname": ""
11381cb0ef41Sopenharmony_ci            }
11391cb0ef41Sopenharmony_ci        },
11401cb0ef41Sopenharmony_ci        {
11411cb0ef41Sopenharmony_ci            "href": "sc://x/",
11421cb0ef41Sopenharmony_ci            "new_value": " ",
11431cb0ef41Sopenharmony_ci            "expected": {
11441cb0ef41Sopenharmony_ci                "href": "sc://x/",
11451cb0ef41Sopenharmony_ci                "host": "x",
11461cb0ef41Sopenharmony_ci                "hostname": "x"
11471cb0ef41Sopenharmony_ci            }
11481cb0ef41Sopenharmony_ci        },
11491cb0ef41Sopenharmony_ci        {
11501cb0ef41Sopenharmony_ci            "href": "sc://x/",
11511cb0ef41Sopenharmony_ci            "new_value": "#",
11521cb0ef41Sopenharmony_ci            "expected": {
11531cb0ef41Sopenharmony_ci                "href": "sc:///",
11541cb0ef41Sopenharmony_ci                "host": "",
11551cb0ef41Sopenharmony_ci                "hostname": ""
11561cb0ef41Sopenharmony_ci            }
11571cb0ef41Sopenharmony_ci        },
11581cb0ef41Sopenharmony_ci        {
11591cb0ef41Sopenharmony_ci            "href": "sc://x/",
11601cb0ef41Sopenharmony_ci            "new_value": "/",
11611cb0ef41Sopenharmony_ci            "expected": {
11621cb0ef41Sopenharmony_ci                "href": "sc:///",
11631cb0ef41Sopenharmony_ci                "host": "",
11641cb0ef41Sopenharmony_ci                "hostname": ""
11651cb0ef41Sopenharmony_ci            }
11661cb0ef41Sopenharmony_ci        },
11671cb0ef41Sopenharmony_ci        {
11681cb0ef41Sopenharmony_ci            "href": "sc://x/",
11691cb0ef41Sopenharmony_ci            "new_value": "?",
11701cb0ef41Sopenharmony_ci            "expected": {
11711cb0ef41Sopenharmony_ci                "href": "sc:///",
11721cb0ef41Sopenharmony_ci                "host": "",
11731cb0ef41Sopenharmony_ci                "hostname": ""
11741cb0ef41Sopenharmony_ci            }
11751cb0ef41Sopenharmony_ci        },
11761cb0ef41Sopenharmony_ci        {
11771cb0ef41Sopenharmony_ci            "href": "sc://x/",
11781cb0ef41Sopenharmony_ci            "new_value": "@",
11791cb0ef41Sopenharmony_ci            "expected": {
11801cb0ef41Sopenharmony_ci                "href": "sc://x/",
11811cb0ef41Sopenharmony_ci                "host": "x",
11821cb0ef41Sopenharmony_ci                "hostname": "x"
11831cb0ef41Sopenharmony_ci            }
11841cb0ef41Sopenharmony_ci        },
11851cb0ef41Sopenharmony_ci        {
11861cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no host",
11871cb0ef41Sopenharmony_ci            "href": "mailto:me@example.net",
11881cb0ef41Sopenharmony_ci            "new_value": "example.com",
11891cb0ef41Sopenharmony_ci            "expected": {
11901cb0ef41Sopenharmony_ci                "href": "mailto:me@example.net",
11911cb0ef41Sopenharmony_ci                "host": ""
11921cb0ef41Sopenharmony_ci            }
11931cb0ef41Sopenharmony_ci        },
11941cb0ef41Sopenharmony_ci        {
11951cb0ef41Sopenharmony_ci            "comment": "Cannot-be-a-base means no host",
11961cb0ef41Sopenharmony_ci            "href": "data:text/plain,Stuff",
11971cb0ef41Sopenharmony_ci            "new_value": "example.net",
11981cb0ef41Sopenharmony_ci            "expected": {
11991cb0ef41Sopenharmony_ci                "href": "data:text/plain,Stuff",
12001cb0ef41Sopenharmony_ci                "host": ""
12011cb0ef41Sopenharmony_ci            }
12021cb0ef41Sopenharmony_ci        },
12031cb0ef41Sopenharmony_ci        {
12041cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
12051cb0ef41Sopenharmony_ci            "new_value": "example.com",
12061cb0ef41Sopenharmony_ci            "expected": {
12071cb0ef41Sopenharmony_ci                "href": "http://example.com:8080/",
12081cb0ef41Sopenharmony_ci                "host": "example.com:8080",
12091cb0ef41Sopenharmony_ci                "hostname": "example.com",
12101cb0ef41Sopenharmony_ci                "port": "8080"
12111cb0ef41Sopenharmony_ci            }
12121cb0ef41Sopenharmony_ci        },
12131cb0ef41Sopenharmony_ci        {
12141cb0ef41Sopenharmony_ci            "comment": "The empty host is not valid for special schemes",
12151cb0ef41Sopenharmony_ci            "href": "http://example.net",
12161cb0ef41Sopenharmony_ci            "new_value": "",
12171cb0ef41Sopenharmony_ci            "expected": {
12181cb0ef41Sopenharmony_ci                "href": "http://example.net/",
12191cb0ef41Sopenharmony_ci                "host": "example.net"
12201cb0ef41Sopenharmony_ci            }
12211cb0ef41Sopenharmony_ci        },
12221cb0ef41Sopenharmony_ci        {
12231cb0ef41Sopenharmony_ci            "comment": "The empty host is OK for non-special schemes",
12241cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/foo",
12251cb0ef41Sopenharmony_ci            "new_value": "",
12261cb0ef41Sopenharmony_ci            "expected": {
12271cb0ef41Sopenharmony_ci                "href": "view-source+http:///foo",
12281cb0ef41Sopenharmony_ci                "host": ""
12291cb0ef41Sopenharmony_ci            }
12301cb0ef41Sopenharmony_ci        },
12311cb0ef41Sopenharmony_ci        {
12321cb0ef41Sopenharmony_ci            "comment": "Path-only URLs can gain a host",
12331cb0ef41Sopenharmony_ci            "href": "a:/foo",
12341cb0ef41Sopenharmony_ci            "new_value": "example.net",
12351cb0ef41Sopenharmony_ci            "expected": {
12361cb0ef41Sopenharmony_ci                "href": "a://example.net/foo",
12371cb0ef41Sopenharmony_ci                "host": "example.net"
12381cb0ef41Sopenharmony_ci            }
12391cb0ef41Sopenharmony_ci        },
12401cb0ef41Sopenharmony_ci        {
12411cb0ef41Sopenharmony_ci            "comment": "IPv4 address syntax is normalized",
12421cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
12431cb0ef41Sopenharmony_ci            "new_value": "0x7F000001",
12441cb0ef41Sopenharmony_ci            "expected": {
12451cb0ef41Sopenharmony_ci                "href": "http://127.0.0.1:8080/",
12461cb0ef41Sopenharmony_ci                "host": "127.0.0.1:8080",
12471cb0ef41Sopenharmony_ci                "hostname": "127.0.0.1",
12481cb0ef41Sopenharmony_ci                "port": "8080"
12491cb0ef41Sopenharmony_ci            }
12501cb0ef41Sopenharmony_ci        },
12511cb0ef41Sopenharmony_ci        {
12521cb0ef41Sopenharmony_ci            "comment": "IPv6 address syntax is normalized",
12531cb0ef41Sopenharmony_ci            "href": "http://example.net",
12541cb0ef41Sopenharmony_ci            "new_value": "[::0:01]",
12551cb0ef41Sopenharmony_ci            "expected": {
12561cb0ef41Sopenharmony_ci                "href": "http://[::1]/",
12571cb0ef41Sopenharmony_ci                "host": "[::1]",
12581cb0ef41Sopenharmony_ci                "hostname": "[::1]",
12591cb0ef41Sopenharmony_ci                "port": ""
12601cb0ef41Sopenharmony_ci            }
12611cb0ef41Sopenharmony_ci        },
12621cb0ef41Sopenharmony_ci        {
12631cb0ef41Sopenharmony_ci            "comment": ": delimiter invalidates entire value",
12641cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
12651cb0ef41Sopenharmony_ci            "new_value": "example.com:8080",
12661cb0ef41Sopenharmony_ci            "expected": {
12671cb0ef41Sopenharmony_ci                "href": "http://example.net/path",
12681cb0ef41Sopenharmony_ci                "host": "example.net",
12691cb0ef41Sopenharmony_ci                "hostname": "example.net",
12701cb0ef41Sopenharmony_ci                "port": ""
12711cb0ef41Sopenharmony_ci            }
12721cb0ef41Sopenharmony_ci        },
12731cb0ef41Sopenharmony_ci        {
12741cb0ef41Sopenharmony_ci            "comment": ": delimiter invalidates entire value",
12751cb0ef41Sopenharmony_ci            "href": "http://example.net:8080/path",
12761cb0ef41Sopenharmony_ci            "new_value": "example.com:",
12771cb0ef41Sopenharmony_ci            "expected": {
12781cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
12791cb0ef41Sopenharmony_ci                "host": "example.net:8080",
12801cb0ef41Sopenharmony_ci                "hostname": "example.net",
12811cb0ef41Sopenharmony_ci                "port": "8080"
12821cb0ef41Sopenharmony_ci            }
12831cb0ef41Sopenharmony_ci        },
12841cb0ef41Sopenharmony_ci        {
12851cb0ef41Sopenharmony_ci            "comment": "Stuff after a / delimiter is ignored",
12861cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
12871cb0ef41Sopenharmony_ci            "new_value": "example.com/stuff",
12881cb0ef41Sopenharmony_ci            "expected": {
12891cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
12901cb0ef41Sopenharmony_ci                "host": "example.com",
12911cb0ef41Sopenharmony_ci                "hostname": "example.com",
12921cb0ef41Sopenharmony_ci                "port": ""
12931cb0ef41Sopenharmony_ci            }
12941cb0ef41Sopenharmony_ci        },
12951cb0ef41Sopenharmony_ci        {
12961cb0ef41Sopenharmony_ci            "comment": "Stuff after a ? delimiter is ignored",
12971cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
12981cb0ef41Sopenharmony_ci            "new_value": "example.com?stuff",
12991cb0ef41Sopenharmony_ci            "expected": {
13001cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
13011cb0ef41Sopenharmony_ci                "host": "example.com",
13021cb0ef41Sopenharmony_ci                "hostname": "example.com",
13031cb0ef41Sopenharmony_ci                "port": ""
13041cb0ef41Sopenharmony_ci            }
13051cb0ef41Sopenharmony_ci        },
13061cb0ef41Sopenharmony_ci        {
13071cb0ef41Sopenharmony_ci            "comment": "Stuff after a # delimiter is ignored",
13081cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
13091cb0ef41Sopenharmony_ci            "new_value": "example.com#stuff",
13101cb0ef41Sopenharmony_ci            "expected": {
13111cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
13121cb0ef41Sopenharmony_ci                "host": "example.com",
13131cb0ef41Sopenharmony_ci                "hostname": "example.com",
13141cb0ef41Sopenharmony_ci                "port": ""
13151cb0ef41Sopenharmony_ci            }
13161cb0ef41Sopenharmony_ci        },
13171cb0ef41Sopenharmony_ci        {
13181cb0ef41Sopenharmony_ci            "comment": "Stuff after a \\ delimiter is ignored for special schemes",
13191cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
13201cb0ef41Sopenharmony_ci            "new_value": "example.com\\stuff",
13211cb0ef41Sopenharmony_ci            "expected": {
13221cb0ef41Sopenharmony_ci                "href": "http://example.com/path",
13231cb0ef41Sopenharmony_ci                "host": "example.com",
13241cb0ef41Sopenharmony_ci                "hostname": "example.com",
13251cb0ef41Sopenharmony_ci                "port": ""
13261cb0ef41Sopenharmony_ci            }
13271cb0ef41Sopenharmony_ci        },
13281cb0ef41Sopenharmony_ci        {
13291cb0ef41Sopenharmony_ci            "comment": "\\ is not a delimiter for non-special schemes, but still forbidden in hosts",
13301cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/path",
13311cb0ef41Sopenharmony_ci            "new_value": "example.com\\stuff",
13321cb0ef41Sopenharmony_ci            "expected": {
13331cb0ef41Sopenharmony_ci                "href": "view-source+http://example.net/path",
13341cb0ef41Sopenharmony_ci                "host": "example.net",
13351cb0ef41Sopenharmony_ci                "hostname": "example.net",
13361cb0ef41Sopenharmony_ci                "port": ""
13371cb0ef41Sopenharmony_ci            }
13381cb0ef41Sopenharmony_ci        },
13391cb0ef41Sopenharmony_ci        {
13401cb0ef41Sopenharmony_ci            "comment": "Broken IPv6",
13411cb0ef41Sopenharmony_ci            "href": "http://example.net/",
13421cb0ef41Sopenharmony_ci            "new_value": "[google.com]",
13431cb0ef41Sopenharmony_ci            "expected": {
13441cb0ef41Sopenharmony_ci                "href": "http://example.net/",
13451cb0ef41Sopenharmony_ci                "host": "example.net",
13461cb0ef41Sopenharmony_ci                "hostname": "example.net"
13471cb0ef41Sopenharmony_ci            }
13481cb0ef41Sopenharmony_ci        },
13491cb0ef41Sopenharmony_ci        {
13501cb0ef41Sopenharmony_ci            "href": "http://example.net/",
13511cb0ef41Sopenharmony_ci            "new_value": "[::1.2.3.4x]",
13521cb0ef41Sopenharmony_ci            "expected": {
13531cb0ef41Sopenharmony_ci                "href": "http://example.net/",
13541cb0ef41Sopenharmony_ci                "host": "example.net",
13551cb0ef41Sopenharmony_ci                "hostname": "example.net"
13561cb0ef41Sopenharmony_ci            }
13571cb0ef41Sopenharmony_ci        },
13581cb0ef41Sopenharmony_ci        {
13591cb0ef41Sopenharmony_ci            "href": "http://example.net/",
13601cb0ef41Sopenharmony_ci            "new_value": "[::1.2.3.]",
13611cb0ef41Sopenharmony_ci            "expected": {
13621cb0ef41Sopenharmony_ci                "href": "http://example.net/",
13631cb0ef41Sopenharmony_ci                "host": "example.net",
13641cb0ef41Sopenharmony_ci                "hostname": "example.net"
13651cb0ef41Sopenharmony_ci            }
13661cb0ef41Sopenharmony_ci        },
13671cb0ef41Sopenharmony_ci        {
13681cb0ef41Sopenharmony_ci            "href": "http://example.net/",
13691cb0ef41Sopenharmony_ci            "new_value": "[::1.2.]",
13701cb0ef41Sopenharmony_ci            "expected": {
13711cb0ef41Sopenharmony_ci                "href": "http://example.net/",
13721cb0ef41Sopenharmony_ci                "host": "example.net",
13731cb0ef41Sopenharmony_ci                "hostname": "example.net"
13741cb0ef41Sopenharmony_ci            }
13751cb0ef41Sopenharmony_ci        },
13761cb0ef41Sopenharmony_ci        {
13771cb0ef41Sopenharmony_ci            "href": "http://example.net/",
13781cb0ef41Sopenharmony_ci            "new_value": "[::1.]",
13791cb0ef41Sopenharmony_ci            "expected": {
13801cb0ef41Sopenharmony_ci                "href": "http://example.net/",
13811cb0ef41Sopenharmony_ci                "host": "example.net",
13821cb0ef41Sopenharmony_ci                "hostname": "example.net"
13831cb0ef41Sopenharmony_ci            }
13841cb0ef41Sopenharmony_ci        },
13851cb0ef41Sopenharmony_ci        {
13861cb0ef41Sopenharmony_ci            "href": "file://y/",
13871cb0ef41Sopenharmony_ci            "new_value": "x:123",
13881cb0ef41Sopenharmony_ci            "expected": {
13891cb0ef41Sopenharmony_ci                "href": "file://y/",
13901cb0ef41Sopenharmony_ci                "host": "y",
13911cb0ef41Sopenharmony_ci                "hostname": "y",
13921cb0ef41Sopenharmony_ci                "port": ""
13931cb0ef41Sopenharmony_ci            }
13941cb0ef41Sopenharmony_ci        },
13951cb0ef41Sopenharmony_ci        {
13961cb0ef41Sopenharmony_ci            "href": "file://y/",
13971cb0ef41Sopenharmony_ci            "new_value": "loc%41lhost",
13981cb0ef41Sopenharmony_ci            "expected": {
13991cb0ef41Sopenharmony_ci                "href": "file:///",
14001cb0ef41Sopenharmony_ci                "host": "",
14011cb0ef41Sopenharmony_ci                "hostname": "",
14021cb0ef41Sopenharmony_ci                "port": ""
14031cb0ef41Sopenharmony_ci            }
14041cb0ef41Sopenharmony_ci        },
14051cb0ef41Sopenharmony_ci        {
14061cb0ef41Sopenharmony_ci            "href": "file://hi/x",
14071cb0ef41Sopenharmony_ci            "new_value": "",
14081cb0ef41Sopenharmony_ci            "expected": {
14091cb0ef41Sopenharmony_ci                "href": "file:///x",
14101cb0ef41Sopenharmony_ci                "host": "",
14111cb0ef41Sopenharmony_ci                "hostname": "",
14121cb0ef41Sopenharmony_ci                "port": ""
14131cb0ef41Sopenharmony_ci            }
14141cb0ef41Sopenharmony_ci        },
14151cb0ef41Sopenharmony_ci        {
14161cb0ef41Sopenharmony_ci            "href": "sc://test@test/",
14171cb0ef41Sopenharmony_ci            "new_value": "",
14181cb0ef41Sopenharmony_ci            "expected": {
14191cb0ef41Sopenharmony_ci                "href": "sc://test@test/",
14201cb0ef41Sopenharmony_ci                "host": "test",
14211cb0ef41Sopenharmony_ci                "hostname": "test",
14221cb0ef41Sopenharmony_ci                "username": "test"
14231cb0ef41Sopenharmony_ci            }
14241cb0ef41Sopenharmony_ci        },
14251cb0ef41Sopenharmony_ci        {
14261cb0ef41Sopenharmony_ci            "href": "sc://test:12/",
14271cb0ef41Sopenharmony_ci            "new_value": "",
14281cb0ef41Sopenharmony_ci            "expected": {
14291cb0ef41Sopenharmony_ci                "href": "sc://test:12/",
14301cb0ef41Sopenharmony_ci                "host": "test:12",
14311cb0ef41Sopenharmony_ci                "hostname": "test",
14321cb0ef41Sopenharmony_ci                "port": "12"
14331cb0ef41Sopenharmony_ci            }
14341cb0ef41Sopenharmony_ci        },
14351cb0ef41Sopenharmony_ci        {
14361cb0ef41Sopenharmony_ci            "comment": "Drop /. from path",
14371cb0ef41Sopenharmony_ci            "href": "non-spec:/.//p",
14381cb0ef41Sopenharmony_ci            "new_value": "h",
14391cb0ef41Sopenharmony_ci            "expected": {
14401cb0ef41Sopenharmony_ci                "href": "non-spec://h//p",
14411cb0ef41Sopenharmony_ci                "host": "h",
14421cb0ef41Sopenharmony_ci                "hostname": "h",
14431cb0ef41Sopenharmony_ci                "pathname": "//p"
14441cb0ef41Sopenharmony_ci            }
14451cb0ef41Sopenharmony_ci        },
14461cb0ef41Sopenharmony_ci        {
14471cb0ef41Sopenharmony_ci            "href": "non-spec:/.//p",
14481cb0ef41Sopenharmony_ci            "new_value": "",
14491cb0ef41Sopenharmony_ci            "expected": {
14501cb0ef41Sopenharmony_ci                "href": "non-spec:////p",
14511cb0ef41Sopenharmony_ci                "host": "",
14521cb0ef41Sopenharmony_ci                "hostname": "",
14531cb0ef41Sopenharmony_ci                "pathname": "//p"
14541cb0ef41Sopenharmony_ci            }
14551cb0ef41Sopenharmony_ci        },
14561cb0ef41Sopenharmony_ci        {
14571cb0ef41Sopenharmony_ci            "comment": "Leading / is not stripped",
14581cb0ef41Sopenharmony_ci            "href": "http://example.com/",
14591cb0ef41Sopenharmony_ci            "new_value": "///bad.com",
14601cb0ef41Sopenharmony_ci            "expected": {
14611cb0ef41Sopenharmony_ci                "href": "http://example.com/",
14621cb0ef41Sopenharmony_ci                "host": "example.com",
14631cb0ef41Sopenharmony_ci                "hostname": "example.com"
14641cb0ef41Sopenharmony_ci            }
14651cb0ef41Sopenharmony_ci        },
14661cb0ef41Sopenharmony_ci        {
14671cb0ef41Sopenharmony_ci            "comment": "Leading / is not stripped",
14681cb0ef41Sopenharmony_ci            "href": "sc://example.com/",
14691cb0ef41Sopenharmony_ci            "new_value": "///bad.com",
14701cb0ef41Sopenharmony_ci            "expected": {
14711cb0ef41Sopenharmony_ci                "href": "sc:///",
14721cb0ef41Sopenharmony_ci                "host": "",
14731cb0ef41Sopenharmony_ci                "hostname": ""
14741cb0ef41Sopenharmony_ci            }
14751cb0ef41Sopenharmony_ci        },
14761cb0ef41Sopenharmony_ci        {
14771cb0ef41Sopenharmony_ci            "href": "https://example.com/",
14781cb0ef41Sopenharmony_ci            "new_value": "a%C2%ADb",
14791cb0ef41Sopenharmony_ci            "expected": {
14801cb0ef41Sopenharmony_ci                "href": "https://ab/",
14811cb0ef41Sopenharmony_ci                "host": "ab",
14821cb0ef41Sopenharmony_ci                "hostname": "ab"
14831cb0ef41Sopenharmony_ci            }
14841cb0ef41Sopenharmony_ci        },
14851cb0ef41Sopenharmony_ci        {
14861cb0ef41Sopenharmony_ci            "href": "https://example.com/",
14871cb0ef41Sopenharmony_ci            "new_value": "\u00AD",
14881cb0ef41Sopenharmony_ci            "expected": {
14891cb0ef41Sopenharmony_ci                "href": "https://example.com/",
14901cb0ef41Sopenharmony_ci                "host": "example.com",
14911cb0ef41Sopenharmony_ci                "hostname": "example.com"
14921cb0ef41Sopenharmony_ci            }
14931cb0ef41Sopenharmony_ci        },
14941cb0ef41Sopenharmony_ci        {
14951cb0ef41Sopenharmony_ci            "href": "https://example.com/",
14961cb0ef41Sopenharmony_ci            "new_value": "%C2%AD",
14971cb0ef41Sopenharmony_ci            "expected": {
14981cb0ef41Sopenharmony_ci                "href": "https://example.com/",
14991cb0ef41Sopenharmony_ci                "host": "example.com",
15001cb0ef41Sopenharmony_ci                "hostname": "example.com"
15011cb0ef41Sopenharmony_ci            }
15021cb0ef41Sopenharmony_ci        },
15031cb0ef41Sopenharmony_ci        {
15041cb0ef41Sopenharmony_ci            "href": "https://example.com/",
15051cb0ef41Sopenharmony_ci            "new_value": "xn--",
15061cb0ef41Sopenharmony_ci            "expected": {
15071cb0ef41Sopenharmony_ci                "href": "https://example.com/",
15081cb0ef41Sopenharmony_ci                "host": "example.com",
15091cb0ef41Sopenharmony_ci                "hostname": "example.com"
15101cb0ef41Sopenharmony_ci            }
15111cb0ef41Sopenharmony_ci        }
15121cb0ef41Sopenharmony_ci    ],
15131cb0ef41Sopenharmony_ci    "port": [
15141cb0ef41Sopenharmony_ci        {
15151cb0ef41Sopenharmony_ci            "href": "http://example.net",
15161cb0ef41Sopenharmony_ci            "new_value": "8080",
15171cb0ef41Sopenharmony_ci            "expected": {
15181cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/",
15191cb0ef41Sopenharmony_ci                "host": "example.net:8080",
15201cb0ef41Sopenharmony_ci                "hostname": "example.net",
15211cb0ef41Sopenharmony_ci                "port": "8080"
15221cb0ef41Sopenharmony_ci            }
15231cb0ef41Sopenharmony_ci        },
15241cb0ef41Sopenharmony_ci        {
15251cb0ef41Sopenharmony_ci            "comment": "Port number is removed if empty is the new value",
15261cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
15271cb0ef41Sopenharmony_ci            "new_value": "",
15281cb0ef41Sopenharmony_ci            "expected": {
15291cb0ef41Sopenharmony_ci                "href": "http://example.net/",
15301cb0ef41Sopenharmony_ci                "host": "example.net",
15311cb0ef41Sopenharmony_ci                "hostname": "example.net",
15321cb0ef41Sopenharmony_ci                "port": ""
15331cb0ef41Sopenharmony_ci            }
15341cb0ef41Sopenharmony_ci        },
15351cb0ef41Sopenharmony_ci        {
15361cb0ef41Sopenharmony_ci            "comment": "Default port number is removed",
15371cb0ef41Sopenharmony_ci            "href": "http://example.net:8080",
15381cb0ef41Sopenharmony_ci            "new_value": "80",
15391cb0ef41Sopenharmony_ci            "expected": {
15401cb0ef41Sopenharmony_ci                "href": "http://example.net/",
15411cb0ef41Sopenharmony_ci                "host": "example.net",
15421cb0ef41Sopenharmony_ci                "hostname": "example.net",
15431cb0ef41Sopenharmony_ci                "port": ""
15441cb0ef41Sopenharmony_ci            }
15451cb0ef41Sopenharmony_ci        },
15461cb0ef41Sopenharmony_ci        {
15471cb0ef41Sopenharmony_ci            "comment": "Default port number is removed",
15481cb0ef41Sopenharmony_ci            "href": "https://example.net:4433",
15491cb0ef41Sopenharmony_ci            "new_value": "443",
15501cb0ef41Sopenharmony_ci            "expected": {
15511cb0ef41Sopenharmony_ci                "href": "https://example.net/",
15521cb0ef41Sopenharmony_ci                "host": "example.net",
15531cb0ef41Sopenharmony_ci                "hostname": "example.net",
15541cb0ef41Sopenharmony_ci                "port": ""
15551cb0ef41Sopenharmony_ci            }
15561cb0ef41Sopenharmony_ci        },
15571cb0ef41Sopenharmony_ci        {
15581cb0ef41Sopenharmony_ci            "comment": "Default port number is only removed for the relevant scheme",
15591cb0ef41Sopenharmony_ci            "href": "https://example.net",
15601cb0ef41Sopenharmony_ci            "new_value": "80",
15611cb0ef41Sopenharmony_ci            "expected": {
15621cb0ef41Sopenharmony_ci                "href": "https://example.net:80/",
15631cb0ef41Sopenharmony_ci                "host": "example.net:80",
15641cb0ef41Sopenharmony_ci                "hostname": "example.net",
15651cb0ef41Sopenharmony_ci                "port": "80"
15661cb0ef41Sopenharmony_ci            }
15671cb0ef41Sopenharmony_ci        },
15681cb0ef41Sopenharmony_ci        {
15691cb0ef41Sopenharmony_ci            "comment": "Stuff after a / delimiter is ignored",
15701cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
15711cb0ef41Sopenharmony_ci            "new_value": "8080/stuff",
15721cb0ef41Sopenharmony_ci            "expected": {
15731cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
15741cb0ef41Sopenharmony_ci                "host": "example.net:8080",
15751cb0ef41Sopenharmony_ci                "hostname": "example.net",
15761cb0ef41Sopenharmony_ci                "port": "8080"
15771cb0ef41Sopenharmony_ci            }
15781cb0ef41Sopenharmony_ci        },
15791cb0ef41Sopenharmony_ci        {
15801cb0ef41Sopenharmony_ci            "comment": "Stuff after a ? delimiter is ignored",
15811cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
15821cb0ef41Sopenharmony_ci            "new_value": "8080?stuff",
15831cb0ef41Sopenharmony_ci            "expected": {
15841cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
15851cb0ef41Sopenharmony_ci                "host": "example.net:8080",
15861cb0ef41Sopenharmony_ci                "hostname": "example.net",
15871cb0ef41Sopenharmony_ci                "port": "8080"
15881cb0ef41Sopenharmony_ci            }
15891cb0ef41Sopenharmony_ci        },
15901cb0ef41Sopenharmony_ci        {
15911cb0ef41Sopenharmony_ci            "comment": "Stuff after a # delimiter is ignored",
15921cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
15931cb0ef41Sopenharmony_ci            "new_value": "8080#stuff",
15941cb0ef41Sopenharmony_ci            "expected": {
15951cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
15961cb0ef41Sopenharmony_ci                "host": "example.net:8080",
15971cb0ef41Sopenharmony_ci                "hostname": "example.net",
15981cb0ef41Sopenharmony_ci                "port": "8080"
15991cb0ef41Sopenharmony_ci            }
16001cb0ef41Sopenharmony_ci        },
16011cb0ef41Sopenharmony_ci        {
16021cb0ef41Sopenharmony_ci            "comment": "Stuff after a \\ delimiter is ignored for special schemes",
16031cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
16041cb0ef41Sopenharmony_ci            "new_value": "8080\\stuff",
16051cb0ef41Sopenharmony_ci            "expected": {
16061cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
16071cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16081cb0ef41Sopenharmony_ci                "hostname": "example.net",
16091cb0ef41Sopenharmony_ci                "port": "8080"
16101cb0ef41Sopenharmony_ci            }
16111cb0ef41Sopenharmony_ci        },
16121cb0ef41Sopenharmony_ci        {
16131cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
16141cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/path",
16151cb0ef41Sopenharmony_ci            "new_value": "8080stuff2",
16161cb0ef41Sopenharmony_ci            "expected": {
16171cb0ef41Sopenharmony_ci                "href": "view-source+http://example.net:8080/path",
16181cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16191cb0ef41Sopenharmony_ci                "hostname": "example.net",
16201cb0ef41Sopenharmony_ci                "port": "8080"
16211cb0ef41Sopenharmony_ci            }
16221cb0ef41Sopenharmony_ci        },
16231cb0ef41Sopenharmony_ci        {
16241cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
16251cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
16261cb0ef41Sopenharmony_ci            "new_value": "8080stuff2",
16271cb0ef41Sopenharmony_ci            "expected": {
16281cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
16291cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16301cb0ef41Sopenharmony_ci                "hostname": "example.net",
16311cb0ef41Sopenharmony_ci                "port": "8080"
16321cb0ef41Sopenharmony_ci            }
16331cb0ef41Sopenharmony_ci        },
16341cb0ef41Sopenharmony_ci        {
16351cb0ef41Sopenharmony_ci            "comment": "Anything other than ASCII digit stops the port parser in a setter but is not an error",
16361cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
16371cb0ef41Sopenharmony_ci            "new_value": "8080+2",
16381cb0ef41Sopenharmony_ci            "expected": {
16391cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
16401cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16411cb0ef41Sopenharmony_ci                "hostname": "example.net",
16421cb0ef41Sopenharmony_ci                "port": "8080"
16431cb0ef41Sopenharmony_ci            }
16441cb0ef41Sopenharmony_ci        },
16451cb0ef41Sopenharmony_ci        {
16461cb0ef41Sopenharmony_ci            "comment": "Port numbers are 16 bit integers",
16471cb0ef41Sopenharmony_ci            "href": "http://example.net/path",
16481cb0ef41Sopenharmony_ci            "new_value": "65535",
16491cb0ef41Sopenharmony_ci            "expected": {
16501cb0ef41Sopenharmony_ci                "href": "http://example.net:65535/path",
16511cb0ef41Sopenharmony_ci                "host": "example.net:65535",
16521cb0ef41Sopenharmony_ci                "hostname": "example.net",
16531cb0ef41Sopenharmony_ci                "port": "65535"
16541cb0ef41Sopenharmony_ci            }
16551cb0ef41Sopenharmony_ci        },
16561cb0ef41Sopenharmony_ci        {
16571cb0ef41Sopenharmony_ci            "comment": "Port numbers are 16 bit integers, overflowing is an error",
16581cb0ef41Sopenharmony_ci            "href": "http://example.net:8080/path",
16591cb0ef41Sopenharmony_ci            "new_value": "65536",
16601cb0ef41Sopenharmony_ci            "expected": {
16611cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
16621cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16631cb0ef41Sopenharmony_ci                "hostname": "example.net",
16641cb0ef41Sopenharmony_ci                "port": "8080"
16651cb0ef41Sopenharmony_ci            }
16661cb0ef41Sopenharmony_ci        },
16671cb0ef41Sopenharmony_ci        {
16681cb0ef41Sopenharmony_ci            "comment": "Setting port to a string that doesn't parse as a number",
16691cb0ef41Sopenharmony_ci            "href": "http://example.net:8080/path",
16701cb0ef41Sopenharmony_ci            "new_value": "randomstring",
16711cb0ef41Sopenharmony_ci            "expected": {
16721cb0ef41Sopenharmony_ci                "href": "http://example.net:8080/path",
16731cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16741cb0ef41Sopenharmony_ci                "hostname": "example.net",
16751cb0ef41Sopenharmony_ci                "port": "8080"
16761cb0ef41Sopenharmony_ci            }
16771cb0ef41Sopenharmony_ci        },
16781cb0ef41Sopenharmony_ci        {
16791cb0ef41Sopenharmony_ci            "comment": "Port numbers are 16 bit integers, overflowing is an error",
16801cb0ef41Sopenharmony_ci            "href": "non-special://example.net:8080/path",
16811cb0ef41Sopenharmony_ci            "new_value": "65536",
16821cb0ef41Sopenharmony_ci            "expected": {
16831cb0ef41Sopenharmony_ci                "href": "non-special://example.net:8080/path",
16841cb0ef41Sopenharmony_ci                "host": "example.net:8080",
16851cb0ef41Sopenharmony_ci                "hostname": "example.net",
16861cb0ef41Sopenharmony_ci                "port": "8080"
16871cb0ef41Sopenharmony_ci            }
16881cb0ef41Sopenharmony_ci        },
16891cb0ef41Sopenharmony_ci        {
16901cb0ef41Sopenharmony_ci            "href": "file://test/",
16911cb0ef41Sopenharmony_ci            "new_value": "12",
16921cb0ef41Sopenharmony_ci            "expected": {
16931cb0ef41Sopenharmony_ci                "href": "file://test/",
16941cb0ef41Sopenharmony_ci                "port": ""
16951cb0ef41Sopenharmony_ci            }
16961cb0ef41Sopenharmony_ci        },
16971cb0ef41Sopenharmony_ci        {
16981cb0ef41Sopenharmony_ci            "href": "file://localhost/",
16991cb0ef41Sopenharmony_ci            "new_value": "12",
17001cb0ef41Sopenharmony_ci            "expected": {
17011cb0ef41Sopenharmony_ci                "href": "file:///",
17021cb0ef41Sopenharmony_ci                "port": ""
17031cb0ef41Sopenharmony_ci            }
17041cb0ef41Sopenharmony_ci        },
17051cb0ef41Sopenharmony_ci        {
17061cb0ef41Sopenharmony_ci            "href": "non-base:value",
17071cb0ef41Sopenharmony_ci            "new_value": "12",
17081cb0ef41Sopenharmony_ci            "expected": {
17091cb0ef41Sopenharmony_ci                "href": "non-base:value",
17101cb0ef41Sopenharmony_ci                "port": ""
17111cb0ef41Sopenharmony_ci            }
17121cb0ef41Sopenharmony_ci        },
17131cb0ef41Sopenharmony_ci        {
17141cb0ef41Sopenharmony_ci            "href": "sc:///",
17151cb0ef41Sopenharmony_ci            "new_value": "12",
17161cb0ef41Sopenharmony_ci            "expected": {
17171cb0ef41Sopenharmony_ci                "href": "sc:///",
17181cb0ef41Sopenharmony_ci                "port": ""
17191cb0ef41Sopenharmony_ci            }
17201cb0ef41Sopenharmony_ci        },
17211cb0ef41Sopenharmony_ci        {
17221cb0ef41Sopenharmony_ci            "href": "sc://x/",
17231cb0ef41Sopenharmony_ci            "new_value": "12",
17241cb0ef41Sopenharmony_ci            "expected": {
17251cb0ef41Sopenharmony_ci                "href": "sc://x:12/",
17261cb0ef41Sopenharmony_ci                "port": "12"
17271cb0ef41Sopenharmony_ci            }
17281cb0ef41Sopenharmony_ci        },
17291cb0ef41Sopenharmony_ci        {
17301cb0ef41Sopenharmony_ci            "href": "javascript://x/",
17311cb0ef41Sopenharmony_ci            "new_value": "12",
17321cb0ef41Sopenharmony_ci            "expected": {
17331cb0ef41Sopenharmony_ci                "href": "javascript://x:12/",
17341cb0ef41Sopenharmony_ci                "port": "12"
17351cb0ef41Sopenharmony_ci            }
17361cb0ef41Sopenharmony_ci        },
17371cb0ef41Sopenharmony_ci        {
17381cb0ef41Sopenharmony_ci            "comment": "Leading u0009 on special scheme",
17391cb0ef41Sopenharmony_ci            "href": "https://domain.com:443",
17401cb0ef41Sopenharmony_ci            "new_value": "\u00098080",
17411cb0ef41Sopenharmony_ci            "expected": {
17421cb0ef41Sopenharmony_ci                "port": "8080"
17431cb0ef41Sopenharmony_ci            }
17441cb0ef41Sopenharmony_ci        },
17451cb0ef41Sopenharmony_ci        {
17461cb0ef41Sopenharmony_ci            "comment": "Leading u0009 on non-special scheme",
17471cb0ef41Sopenharmony_ci            "href": "wpt++://domain.com:443",
17481cb0ef41Sopenharmony_ci            "new_value": "\u00098080",
17491cb0ef41Sopenharmony_ci            "expected": {
17501cb0ef41Sopenharmony_ci                "port": "8080"
17511cb0ef41Sopenharmony_ci            }
17521cb0ef41Sopenharmony_ci        },
17531cb0ef41Sopenharmony_ci        {
17541cb0ef41Sopenharmony_ci            "comment": "Should use all ascii prefixed characters as port",
17551cb0ef41Sopenharmony_ci            "href": "https://www.google.com:4343",
17561cb0ef41Sopenharmony_ci            "new_value": "4wpt",
17571cb0ef41Sopenharmony_ci            "expected": {
17581cb0ef41Sopenharmony_ci                "port": "4"
17591cb0ef41Sopenharmony_ci            }
17601cb0ef41Sopenharmony_ci        }
17611cb0ef41Sopenharmony_ci    ],
17621cb0ef41Sopenharmony_ci    "pathname": [
17631cb0ef41Sopenharmony_ci        {
17641cb0ef41Sopenharmony_ci            "comment": "Opaque paths cannot be set",
17651cb0ef41Sopenharmony_ci            "href": "mailto:me@example.net",
17661cb0ef41Sopenharmony_ci            "new_value": "/foo",
17671cb0ef41Sopenharmony_ci            "expected": {
17681cb0ef41Sopenharmony_ci                "href": "mailto:me@example.net",
17691cb0ef41Sopenharmony_ci                "pathname": "me@example.net"
17701cb0ef41Sopenharmony_ci            }
17711cb0ef41Sopenharmony_ci        },
17721cb0ef41Sopenharmony_ci        {
17731cb0ef41Sopenharmony_ci            "href": "data:original",
17741cb0ef41Sopenharmony_ci            "new_value": "new value",
17751cb0ef41Sopenharmony_ci            "expected": {
17761cb0ef41Sopenharmony_ci                "href": "data:original",
17771cb0ef41Sopenharmony_ci                "pathname": "original"
17781cb0ef41Sopenharmony_ci            }
17791cb0ef41Sopenharmony_ci        },
17801cb0ef41Sopenharmony_ci        {
17811cb0ef41Sopenharmony_ci            "href": "sc:original",
17821cb0ef41Sopenharmony_ci            "new_value": "new value",
17831cb0ef41Sopenharmony_ci            "expected": {
17841cb0ef41Sopenharmony_ci                "href": "sc:original",
17851cb0ef41Sopenharmony_ci                "pathname": "original"
17861cb0ef41Sopenharmony_ci            }
17871cb0ef41Sopenharmony_ci        },
17881cb0ef41Sopenharmony_ci        {
17891cb0ef41Sopenharmony_ci            "comment": "Special URLs cannot have their paths erased",
17901cb0ef41Sopenharmony_ci            "href": "file:///some/path",
17911cb0ef41Sopenharmony_ci            "new_value": "",
17921cb0ef41Sopenharmony_ci            "expected": {
17931cb0ef41Sopenharmony_ci                "href": "file:///",
17941cb0ef41Sopenharmony_ci                "pathname": "/"
17951cb0ef41Sopenharmony_ci            }
17961cb0ef41Sopenharmony_ci        },
17971cb0ef41Sopenharmony_ci        {
17981cb0ef41Sopenharmony_ci            "comment": "Non-special URLs can have their paths erased",
17991cb0ef41Sopenharmony_ci            "href": "foo://somehost/some/path",
18001cb0ef41Sopenharmony_ci            "new_value": "",
18011cb0ef41Sopenharmony_ci            "expected": {
18021cb0ef41Sopenharmony_ci                "href": "foo://somehost",
18031cb0ef41Sopenharmony_ci                "pathname": ""
18041cb0ef41Sopenharmony_ci            }
18051cb0ef41Sopenharmony_ci        },
18061cb0ef41Sopenharmony_ci        {
18071cb0ef41Sopenharmony_ci            "comment": "Non-special URLs with an empty host can have their paths erased",
18081cb0ef41Sopenharmony_ci            "href": "foo:///some/path",
18091cb0ef41Sopenharmony_ci            "new_value": "",
18101cb0ef41Sopenharmony_ci            "expected": {
18111cb0ef41Sopenharmony_ci                "href": "foo://",
18121cb0ef41Sopenharmony_ci                "pathname": ""
18131cb0ef41Sopenharmony_ci            }
18141cb0ef41Sopenharmony_ci        },
18151cb0ef41Sopenharmony_ci        {
18161cb0ef41Sopenharmony_ci            "comment": "Path-only URLs cannot have their paths erased",
18171cb0ef41Sopenharmony_ci            "href": "foo:/some/path",
18181cb0ef41Sopenharmony_ci            "new_value": "",
18191cb0ef41Sopenharmony_ci            "expected": {
18201cb0ef41Sopenharmony_ci                "href": "foo:/",
18211cb0ef41Sopenharmony_ci                "pathname": "/"
18221cb0ef41Sopenharmony_ci            }
18231cb0ef41Sopenharmony_ci        },
18241cb0ef41Sopenharmony_ci        {
18251cb0ef41Sopenharmony_ci            "comment": "Path-only URLs always have an initial slash",
18261cb0ef41Sopenharmony_ci            "href": "foo:/some/path",
18271cb0ef41Sopenharmony_ci            "new_value": "test",
18281cb0ef41Sopenharmony_ci            "expected": {
18291cb0ef41Sopenharmony_ci                "href": "foo:/test",
18301cb0ef41Sopenharmony_ci                "pathname": "/test"
18311cb0ef41Sopenharmony_ci            }
18321cb0ef41Sopenharmony_ci        },
18331cb0ef41Sopenharmony_ci        {
18341cb0ef41Sopenharmony_ci            "href": "unix:/run/foo.socket?timeout=10",
18351cb0ef41Sopenharmony_ci            "new_value": "/var/log/../run/bar.socket",
18361cb0ef41Sopenharmony_ci            "expected": {
18371cb0ef41Sopenharmony_ci                "href": "unix:/var/run/bar.socket?timeout=10",
18381cb0ef41Sopenharmony_ci                "pathname": "/var/run/bar.socket"
18391cb0ef41Sopenharmony_ci            }
18401cb0ef41Sopenharmony_ci        },
18411cb0ef41Sopenharmony_ci        {
18421cb0ef41Sopenharmony_ci            "href": "https://example.net#nav",
18431cb0ef41Sopenharmony_ci            "new_value": "home",
18441cb0ef41Sopenharmony_ci            "expected": {
18451cb0ef41Sopenharmony_ci                "href": "https://example.net/home#nav",
18461cb0ef41Sopenharmony_ci                "pathname": "/home"
18471cb0ef41Sopenharmony_ci            }
18481cb0ef41Sopenharmony_ci        },
18491cb0ef41Sopenharmony_ci        {
18501cb0ef41Sopenharmony_ci            "href": "https://example.net#nav",
18511cb0ef41Sopenharmony_ci            "new_value": "../home",
18521cb0ef41Sopenharmony_ci            "expected": {
18531cb0ef41Sopenharmony_ci                "href": "https://example.net/home#nav",
18541cb0ef41Sopenharmony_ci                "pathname": "/home"
18551cb0ef41Sopenharmony_ci            }
18561cb0ef41Sopenharmony_ci        },
18571cb0ef41Sopenharmony_ci        {
18581cb0ef41Sopenharmony_ci            "comment": "\\ is a segment delimiter for 'special' URLs",
18591cb0ef41Sopenharmony_ci            "href": "http://example.net/home?lang=fr#nav",
18601cb0ef41Sopenharmony_ci            "new_value": "\\a\\%2E\\b\\%2e.\\c",
18611cb0ef41Sopenharmony_ci            "expected": {
18621cb0ef41Sopenharmony_ci                "href": "http://example.net/a/c?lang=fr#nav",
18631cb0ef41Sopenharmony_ci                "pathname": "/a/c"
18641cb0ef41Sopenharmony_ci            }
18651cb0ef41Sopenharmony_ci        },
18661cb0ef41Sopenharmony_ci        {
18671cb0ef41Sopenharmony_ci            "comment": "\\ is *not* a segment delimiter for non-'special' URLs",
18681cb0ef41Sopenharmony_ci            "href": "view-source+http://example.net/home?lang=fr#nav",
18691cb0ef41Sopenharmony_ci            "new_value": "\\a\\%2E\\b\\%2e.\\c",
18701cb0ef41Sopenharmony_ci            "expected": {
18711cb0ef41Sopenharmony_ci                "href": "view-source+http://example.net/\\a\\%2E\\b\\%2e.\\c?lang=fr#nav",
18721cb0ef41Sopenharmony_ci                "pathname": "/\\a\\%2E\\b\\%2e.\\c"
18731cb0ef41Sopenharmony_ci            }
18741cb0ef41Sopenharmony_ci        },
18751cb0ef41Sopenharmony_ci        {
18761cb0ef41Sopenharmony_ci            "comment": "UTF-8 percent encoding with the default encode set. Tabs and newlines are removed.",
18771cb0ef41Sopenharmony_ci            "href": "a:/",
18781cb0ef41Sopenharmony_ci            "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
18791cb0ef41Sopenharmony_ci            "expected": {
18801cb0ef41Sopenharmony_ci                "href": "a:/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9",
18811cb0ef41Sopenharmony_ci                "pathname": "/%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E%3F@AZ[\\]^_%60az%7B|%7D~%7F%C2%80%C2%81%C3%89%C3%A9"
18821cb0ef41Sopenharmony_ci            }
18831cb0ef41Sopenharmony_ci        },
18841cb0ef41Sopenharmony_ci        {
18851cb0ef41Sopenharmony_ci            "comment": "Bytes already percent-encoded are left as-is, including %2E outside dotted segments.",
18861cb0ef41Sopenharmony_ci            "href": "http://example.net",
18871cb0ef41Sopenharmony_ci            "new_value": "%2e%2E%c3%89té",
18881cb0ef41Sopenharmony_ci            "expected": {
18891cb0ef41Sopenharmony_ci                "href": "http://example.net/%2e%2E%c3%89t%C3%A9",
18901cb0ef41Sopenharmony_ci                "pathname": "/%2e%2E%c3%89t%C3%A9"
18911cb0ef41Sopenharmony_ci            }
18921cb0ef41Sopenharmony_ci        },
18931cb0ef41Sopenharmony_ci        {
18941cb0ef41Sopenharmony_ci            "comment": "? needs to be encoded",
18951cb0ef41Sopenharmony_ci            "href": "http://example.net",
18961cb0ef41Sopenharmony_ci            "new_value": "?",
18971cb0ef41Sopenharmony_ci            "expected": {
18981cb0ef41Sopenharmony_ci                "href": "http://example.net/%3F",
18991cb0ef41Sopenharmony_ci                "pathname": "/%3F"
19001cb0ef41Sopenharmony_ci            }
19011cb0ef41Sopenharmony_ci        },
19021cb0ef41Sopenharmony_ci        {
19031cb0ef41Sopenharmony_ci            "comment": "# needs to be encoded",
19041cb0ef41Sopenharmony_ci            "href": "http://example.net",
19051cb0ef41Sopenharmony_ci            "new_value": "#",
19061cb0ef41Sopenharmony_ci            "expected": {
19071cb0ef41Sopenharmony_ci                "href": "http://example.net/%23",
19081cb0ef41Sopenharmony_ci                "pathname": "/%23"
19091cb0ef41Sopenharmony_ci            }
19101cb0ef41Sopenharmony_ci        },
19111cb0ef41Sopenharmony_ci        {
19121cb0ef41Sopenharmony_ci            "comment": "? needs to be encoded, non-special scheme",
19131cb0ef41Sopenharmony_ci            "href": "sc://example.net",
19141cb0ef41Sopenharmony_ci            "new_value": "?",
19151cb0ef41Sopenharmony_ci            "expected": {
19161cb0ef41Sopenharmony_ci                "href": "sc://example.net/%3F",
19171cb0ef41Sopenharmony_ci                "pathname": "/%3F"
19181cb0ef41Sopenharmony_ci            }
19191cb0ef41Sopenharmony_ci        },
19201cb0ef41Sopenharmony_ci        {
19211cb0ef41Sopenharmony_ci            "comment": "# needs to be encoded, non-special scheme",
19221cb0ef41Sopenharmony_ci            "href": "sc://example.net",
19231cb0ef41Sopenharmony_ci            "new_value": "#",
19241cb0ef41Sopenharmony_ci            "expected": {
19251cb0ef41Sopenharmony_ci                "href": "sc://example.net/%23",
19261cb0ef41Sopenharmony_ci                "pathname": "/%23"
19271cb0ef41Sopenharmony_ci            }
19281cb0ef41Sopenharmony_ci        },
19291cb0ef41Sopenharmony_ci        {
19301cb0ef41Sopenharmony_ci            "comment": "? doesn't mess up encoding",
19311cb0ef41Sopenharmony_ci            "href": "http://example.net",
19321cb0ef41Sopenharmony_ci            "new_value": "/?é",
19331cb0ef41Sopenharmony_ci            "expected": {
19341cb0ef41Sopenharmony_ci                "href": "http://example.net/%3F%C3%A9",
19351cb0ef41Sopenharmony_ci                "pathname": "/%3F%C3%A9"
19361cb0ef41Sopenharmony_ci            }
19371cb0ef41Sopenharmony_ci        },
19381cb0ef41Sopenharmony_ci        {
19391cb0ef41Sopenharmony_ci            "comment": "# doesn't mess up encoding",
19401cb0ef41Sopenharmony_ci            "href": "http://example.net",
19411cb0ef41Sopenharmony_ci            "new_value": "/#é",
19421cb0ef41Sopenharmony_ci            "expected": {
19431cb0ef41Sopenharmony_ci                "href": "http://example.net/%23%C3%A9",
19441cb0ef41Sopenharmony_ci                "pathname": "/%23%C3%A9"
19451cb0ef41Sopenharmony_ci            }
19461cb0ef41Sopenharmony_ci        },
19471cb0ef41Sopenharmony_ci        {
19481cb0ef41Sopenharmony_ci            "comment": "File URLs and (back)slashes",
19491cb0ef41Sopenharmony_ci            "href": "file://monkey/",
19501cb0ef41Sopenharmony_ci            "new_value": "\\\\",
19511cb0ef41Sopenharmony_ci            "expected": {
19521cb0ef41Sopenharmony_ci                "href": "file://monkey//",
19531cb0ef41Sopenharmony_ci                "pathname": "//"
19541cb0ef41Sopenharmony_ci            }
19551cb0ef41Sopenharmony_ci        },
19561cb0ef41Sopenharmony_ci        {
19571cb0ef41Sopenharmony_ci            "comment": "File URLs and (back)slashes",
19581cb0ef41Sopenharmony_ci            "href": "file:///unicorn",
19591cb0ef41Sopenharmony_ci            "new_value": "//\\/",
19601cb0ef41Sopenharmony_ci            "expected": {
19611cb0ef41Sopenharmony_ci                "href": "file://////",
19621cb0ef41Sopenharmony_ci                "pathname": "////"
19631cb0ef41Sopenharmony_ci            }
19641cb0ef41Sopenharmony_ci        },
19651cb0ef41Sopenharmony_ci        {
19661cb0ef41Sopenharmony_ci            "comment": "File URLs and (back)slashes",
19671cb0ef41Sopenharmony_ci            "href": "file:///unicorn",
19681cb0ef41Sopenharmony_ci            "new_value": "//monkey/..//",
19691cb0ef41Sopenharmony_ci            "expected": {
19701cb0ef41Sopenharmony_ci                "href": "file://///",
19711cb0ef41Sopenharmony_ci                "pathname": "///"
19721cb0ef41Sopenharmony_ci            }
19731cb0ef41Sopenharmony_ci        },
19741cb0ef41Sopenharmony_ci        {
19751cb0ef41Sopenharmony_ci            "comment": "Serialize /. in path",
19761cb0ef41Sopenharmony_ci            "href": "non-spec:/",
19771cb0ef41Sopenharmony_ci            "new_value": "/.//p",
19781cb0ef41Sopenharmony_ci            "expected": {
19791cb0ef41Sopenharmony_ci                "href": "non-spec:/.//p",
19801cb0ef41Sopenharmony_ci                "pathname": "//p"
19811cb0ef41Sopenharmony_ci            }
19821cb0ef41Sopenharmony_ci        },
19831cb0ef41Sopenharmony_ci        {
19841cb0ef41Sopenharmony_ci            "href": "non-spec:/",
19851cb0ef41Sopenharmony_ci            "new_value": "/..//p",
19861cb0ef41Sopenharmony_ci            "expected": {
19871cb0ef41Sopenharmony_ci                "href": "non-spec:/.//p",
19881cb0ef41Sopenharmony_ci                "pathname": "//p"
19891cb0ef41Sopenharmony_ci            }
19901cb0ef41Sopenharmony_ci        },
19911cb0ef41Sopenharmony_ci        {
19921cb0ef41Sopenharmony_ci            "href": "non-spec:/",
19931cb0ef41Sopenharmony_ci            "new_value": "//p",
19941cb0ef41Sopenharmony_ci            "expected": {
19951cb0ef41Sopenharmony_ci                "href": "non-spec:/.//p",
19961cb0ef41Sopenharmony_ci                "pathname": "//p"
19971cb0ef41Sopenharmony_ci            }
19981cb0ef41Sopenharmony_ci        },
19991cb0ef41Sopenharmony_ci        {
20001cb0ef41Sopenharmony_ci            "comment": "Drop /. from path",
20011cb0ef41Sopenharmony_ci            "href": "non-spec:/.//",
20021cb0ef41Sopenharmony_ci            "new_value": "p",
20031cb0ef41Sopenharmony_ci            "expected": {
20041cb0ef41Sopenharmony_ci                "href": "non-spec:/p",
20051cb0ef41Sopenharmony_ci                "pathname": "/p"
20061cb0ef41Sopenharmony_ci            }
20071cb0ef41Sopenharmony_ci        },
20081cb0ef41Sopenharmony_ci        {
20091cb0ef41Sopenharmony_ci            "comment": "Non-special URLs with non-opaque paths percent-encode U+0020",
20101cb0ef41Sopenharmony_ci            "href": "data:/nospace",
20111cb0ef41Sopenharmony_ci            "new_value": "space ",
20121cb0ef41Sopenharmony_ci            "expected": {
20131cb0ef41Sopenharmony_ci                "href": "data:/space%20",
20141cb0ef41Sopenharmony_ci                "pathname": "/space%20"
20151cb0ef41Sopenharmony_ci            }
20161cb0ef41Sopenharmony_ci        },
20171cb0ef41Sopenharmony_ci        {
20181cb0ef41Sopenharmony_ci            "href": "sc:/nospace",
20191cb0ef41Sopenharmony_ci            "new_value": "space ",
20201cb0ef41Sopenharmony_ci            "expected": {
20211cb0ef41Sopenharmony_ci                "href": "sc:/space%20",
20221cb0ef41Sopenharmony_ci                "pathname": "/space%20"
20231cb0ef41Sopenharmony_ci            }
20241cb0ef41Sopenharmony_ci        }
20251cb0ef41Sopenharmony_ci    ],
20261cb0ef41Sopenharmony_ci    "search": [
20271cb0ef41Sopenharmony_ci        {
20281cb0ef41Sopenharmony_ci            "href": "https://example.net#nav",
20291cb0ef41Sopenharmony_ci            "new_value": "lang=fr",
20301cb0ef41Sopenharmony_ci            "expected": {
20311cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=fr#nav",
20321cb0ef41Sopenharmony_ci                "search": "?lang=fr"
20331cb0ef41Sopenharmony_ci            }
20341cb0ef41Sopenharmony_ci        },
20351cb0ef41Sopenharmony_ci        {
20361cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
20371cb0ef41Sopenharmony_ci            "new_value": "lang=fr",
20381cb0ef41Sopenharmony_ci            "expected": {
20391cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=fr#nav",
20401cb0ef41Sopenharmony_ci                "search": "?lang=fr"
20411cb0ef41Sopenharmony_ci            }
20421cb0ef41Sopenharmony_ci        },
20431cb0ef41Sopenharmony_ci        {
20441cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
20451cb0ef41Sopenharmony_ci            "new_value": "?lang=fr",
20461cb0ef41Sopenharmony_ci            "expected": {
20471cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=fr#nav",
20481cb0ef41Sopenharmony_ci                "search": "?lang=fr"
20491cb0ef41Sopenharmony_ci            }
20501cb0ef41Sopenharmony_ci        },
20511cb0ef41Sopenharmony_ci        {
20521cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
20531cb0ef41Sopenharmony_ci            "new_value": "??lang=fr",
20541cb0ef41Sopenharmony_ci            "expected": {
20551cb0ef41Sopenharmony_ci                "href": "https://example.net/??lang=fr#nav",
20561cb0ef41Sopenharmony_ci                "search": "??lang=fr"
20571cb0ef41Sopenharmony_ci            }
20581cb0ef41Sopenharmony_ci        },
20591cb0ef41Sopenharmony_ci        {
20601cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
20611cb0ef41Sopenharmony_ci            "new_value": "?",
20621cb0ef41Sopenharmony_ci            "expected": {
20631cb0ef41Sopenharmony_ci                "href": "https://example.net/?#nav",
20641cb0ef41Sopenharmony_ci                "search": ""
20651cb0ef41Sopenharmony_ci            }
20661cb0ef41Sopenharmony_ci        },
20671cb0ef41Sopenharmony_ci        {
20681cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
20691cb0ef41Sopenharmony_ci            "new_value": "",
20701cb0ef41Sopenharmony_ci            "expected": {
20711cb0ef41Sopenharmony_ci                "href": "https://example.net/#nav",
20721cb0ef41Sopenharmony_ci                "search": ""
20731cb0ef41Sopenharmony_ci            }
20741cb0ef41Sopenharmony_ci        },
20751cb0ef41Sopenharmony_ci        {
20761cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US",
20771cb0ef41Sopenharmony_ci            "new_value": "",
20781cb0ef41Sopenharmony_ci            "expected": {
20791cb0ef41Sopenharmony_ci                "href": "https://example.net/",
20801cb0ef41Sopenharmony_ci                "search": ""
20811cb0ef41Sopenharmony_ci            }
20821cb0ef41Sopenharmony_ci        },
20831cb0ef41Sopenharmony_ci        {
20841cb0ef41Sopenharmony_ci            "href": "https://example.net",
20851cb0ef41Sopenharmony_ci            "new_value": "",
20861cb0ef41Sopenharmony_ci            "expected": {
20871cb0ef41Sopenharmony_ci                "href": "https://example.net/",
20881cb0ef41Sopenharmony_ci                "search": ""
20891cb0ef41Sopenharmony_ci            }
20901cb0ef41Sopenharmony_ci        },
20911cb0ef41Sopenharmony_ci        {
20921cb0ef41Sopenharmony_ci            "comment": "UTF-8 percent encoding with the query encode set. Tabs and newlines are removed.",
20931cb0ef41Sopenharmony_ci            "href": "a:/",
20941cb0ef41Sopenharmony_ci            "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
20951cb0ef41Sopenharmony_ci            "expected": {
20961cb0ef41Sopenharmony_ci                "href": "a:/?%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
20971cb0ef41Sopenharmony_ci                "search": "?%00%01%1F%20!%22%23$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_`az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
20981cb0ef41Sopenharmony_ci            }
20991cb0ef41Sopenharmony_ci        },
21001cb0ef41Sopenharmony_ci        {
21011cb0ef41Sopenharmony_ci            "comment": "Bytes already percent-encoded are left as-is",
21021cb0ef41Sopenharmony_ci            "href": "http://example.net",
21031cb0ef41Sopenharmony_ci            "new_value": "%c3%89té",
21041cb0ef41Sopenharmony_ci            "expected": {
21051cb0ef41Sopenharmony_ci                "href": "http://example.net/?%c3%89t%C3%A9",
21061cb0ef41Sopenharmony_ci                "search": "?%c3%89t%C3%A9"
21071cb0ef41Sopenharmony_ci            }
21081cb0ef41Sopenharmony_ci        },
21091cb0ef41Sopenharmony_ci        {
21101cb0ef41Sopenharmony_ci            "comment": "Drop trailing spaces from trailing opaque paths",
21111cb0ef41Sopenharmony_ci            "href": "data:space ?query",
21121cb0ef41Sopenharmony_ci            "new_value": "",
21131cb0ef41Sopenharmony_ci            "expected": {
21141cb0ef41Sopenharmony_ci                "href": "data:space",
21151cb0ef41Sopenharmony_ci                "pathname": "space",
21161cb0ef41Sopenharmony_ci                "search": ""
21171cb0ef41Sopenharmony_ci            }
21181cb0ef41Sopenharmony_ci        },
21191cb0ef41Sopenharmony_ci        {
21201cb0ef41Sopenharmony_ci            "href": "sc:space ?query",
21211cb0ef41Sopenharmony_ci            "new_value": "",
21221cb0ef41Sopenharmony_ci            "expected": {
21231cb0ef41Sopenharmony_ci                "href": "sc:space",
21241cb0ef41Sopenharmony_ci                "pathname": "space",
21251cb0ef41Sopenharmony_ci                "search": ""
21261cb0ef41Sopenharmony_ci            }
21271cb0ef41Sopenharmony_ci        },
21281cb0ef41Sopenharmony_ci        {
21291cb0ef41Sopenharmony_ci            "comment": "Do not drop trailing spaces from non-trailing opaque paths",
21301cb0ef41Sopenharmony_ci            "href": "data:space  ?query#fragment",
21311cb0ef41Sopenharmony_ci            "new_value": "",
21321cb0ef41Sopenharmony_ci            "expected": {
21331cb0ef41Sopenharmony_ci                "href": "data:space  #fragment",
21341cb0ef41Sopenharmony_ci                "search": ""
21351cb0ef41Sopenharmony_ci            }
21361cb0ef41Sopenharmony_ci        },
21371cb0ef41Sopenharmony_ci        {
21381cb0ef41Sopenharmony_ci            "href": "sc:space  ?query#fragment",
21391cb0ef41Sopenharmony_ci            "new_value": "",
21401cb0ef41Sopenharmony_ci            "expected": {
21411cb0ef41Sopenharmony_ci                "href": "sc:space  #fragment",
21421cb0ef41Sopenharmony_ci                "search": ""
21431cb0ef41Sopenharmony_ci            }
21441cb0ef41Sopenharmony_ci        }
21451cb0ef41Sopenharmony_ci    ],
21461cb0ef41Sopenharmony_ci    "hash": [
21471cb0ef41Sopenharmony_ci        {
21481cb0ef41Sopenharmony_ci            "href": "https://example.net",
21491cb0ef41Sopenharmony_ci            "new_value": "main",
21501cb0ef41Sopenharmony_ci            "expected": {
21511cb0ef41Sopenharmony_ci                "href": "https://example.net/#main",
21521cb0ef41Sopenharmony_ci                "hash": "#main"
21531cb0ef41Sopenharmony_ci            }
21541cb0ef41Sopenharmony_ci        },
21551cb0ef41Sopenharmony_ci        {
21561cb0ef41Sopenharmony_ci            "href": "https://example.net#nav",
21571cb0ef41Sopenharmony_ci            "new_value": "main",
21581cb0ef41Sopenharmony_ci            "expected": {
21591cb0ef41Sopenharmony_ci                "href": "https://example.net/#main",
21601cb0ef41Sopenharmony_ci                "hash": "#main"
21611cb0ef41Sopenharmony_ci            }
21621cb0ef41Sopenharmony_ci        },
21631cb0ef41Sopenharmony_ci        {
21641cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US",
21651cb0ef41Sopenharmony_ci            "new_value": "##nav",
21661cb0ef41Sopenharmony_ci            "expected": {
21671cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=en-US##nav",
21681cb0ef41Sopenharmony_ci                "hash": "##nav"
21691cb0ef41Sopenharmony_ci            }
21701cb0ef41Sopenharmony_ci        },
21711cb0ef41Sopenharmony_ci        {
21721cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
21731cb0ef41Sopenharmony_ci            "new_value": "#main",
21741cb0ef41Sopenharmony_ci            "expected": {
21751cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=en-US#main",
21761cb0ef41Sopenharmony_ci                "hash": "#main"
21771cb0ef41Sopenharmony_ci            }
21781cb0ef41Sopenharmony_ci        },
21791cb0ef41Sopenharmony_ci        {
21801cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
21811cb0ef41Sopenharmony_ci            "new_value": "#",
21821cb0ef41Sopenharmony_ci            "expected": {
21831cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=en-US#",
21841cb0ef41Sopenharmony_ci                "hash": ""
21851cb0ef41Sopenharmony_ci            }
21861cb0ef41Sopenharmony_ci        },
21871cb0ef41Sopenharmony_ci        {
21881cb0ef41Sopenharmony_ci            "href": "https://example.net?lang=en-US#nav",
21891cb0ef41Sopenharmony_ci            "new_value": "",
21901cb0ef41Sopenharmony_ci            "expected": {
21911cb0ef41Sopenharmony_ci                "href": "https://example.net/?lang=en-US",
21921cb0ef41Sopenharmony_ci                "hash": ""
21931cb0ef41Sopenharmony_ci            }
21941cb0ef41Sopenharmony_ci        },
21951cb0ef41Sopenharmony_ci        {
21961cb0ef41Sopenharmony_ci            "href": "http://example.net",
21971cb0ef41Sopenharmony_ci            "new_value": "#foo bar",
21981cb0ef41Sopenharmony_ci            "expected": {
21991cb0ef41Sopenharmony_ci                "href": "http://example.net/#foo%20bar",
22001cb0ef41Sopenharmony_ci                "hash": "#foo%20bar"
22011cb0ef41Sopenharmony_ci            }
22021cb0ef41Sopenharmony_ci        },
22031cb0ef41Sopenharmony_ci        {
22041cb0ef41Sopenharmony_ci            "href": "http://example.net",
22051cb0ef41Sopenharmony_ci            "new_value": "#foo\"bar",
22061cb0ef41Sopenharmony_ci            "expected": {
22071cb0ef41Sopenharmony_ci                "href": "http://example.net/#foo%22bar",
22081cb0ef41Sopenharmony_ci                "hash": "#foo%22bar"
22091cb0ef41Sopenharmony_ci            }
22101cb0ef41Sopenharmony_ci        },
22111cb0ef41Sopenharmony_ci        {
22121cb0ef41Sopenharmony_ci            "href": "http://example.net",
22131cb0ef41Sopenharmony_ci            "new_value": "#foo<bar",
22141cb0ef41Sopenharmony_ci            "expected": {
22151cb0ef41Sopenharmony_ci                "href": "http://example.net/#foo%3Cbar",
22161cb0ef41Sopenharmony_ci                "hash": "#foo%3Cbar"
22171cb0ef41Sopenharmony_ci            }
22181cb0ef41Sopenharmony_ci        },
22191cb0ef41Sopenharmony_ci        {
22201cb0ef41Sopenharmony_ci            "href": "http://example.net",
22211cb0ef41Sopenharmony_ci            "new_value": "#foo>bar",
22221cb0ef41Sopenharmony_ci            "expected": {
22231cb0ef41Sopenharmony_ci                "href": "http://example.net/#foo%3Ebar",
22241cb0ef41Sopenharmony_ci                "hash": "#foo%3Ebar"
22251cb0ef41Sopenharmony_ci            }
22261cb0ef41Sopenharmony_ci        },
22271cb0ef41Sopenharmony_ci        {
22281cb0ef41Sopenharmony_ci            "href": "http://example.net",
22291cb0ef41Sopenharmony_ci            "new_value": "#foo`bar",
22301cb0ef41Sopenharmony_ci            "expected": {
22311cb0ef41Sopenharmony_ci                "href": "http://example.net/#foo%60bar",
22321cb0ef41Sopenharmony_ci                "hash": "#foo%60bar"
22331cb0ef41Sopenharmony_ci            }
22341cb0ef41Sopenharmony_ci        },
22351cb0ef41Sopenharmony_ci        {
22361cb0ef41Sopenharmony_ci            "comment": "Simple percent-encoding; tabs and newlines are removed",
22371cb0ef41Sopenharmony_ci            "href": "a:/",
22381cb0ef41Sopenharmony_ci            "new_value": "\u0000\u0001\t\n\r\u001f !\"#$%&'()*+,-./09:;<=>?@AZ[\\]^_`az{|}~\u007f\u0080\u0081Éé",
22391cb0ef41Sopenharmony_ci            "expected": {
22401cb0ef41Sopenharmony_ci                "href": "a:/#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9",
22411cb0ef41Sopenharmony_ci                "hash": "#%00%01%1F%20!%22#$%&'()*+,-./09:;%3C=%3E?@AZ[\\]^_%60az{|}~%7F%C2%80%C2%81%C3%89%C3%A9"
22421cb0ef41Sopenharmony_ci            }
22431cb0ef41Sopenharmony_ci        },
22441cb0ef41Sopenharmony_ci        {
22451cb0ef41Sopenharmony_ci            "comment": "Percent-encode NULLs in fragment",
22461cb0ef41Sopenharmony_ci            "href": "http://example.net",
22471cb0ef41Sopenharmony_ci            "new_value": "a\u0000b",
22481cb0ef41Sopenharmony_ci            "expected": {
22491cb0ef41Sopenharmony_ci                "href": "http://example.net/#a%00b",
22501cb0ef41Sopenharmony_ci                "hash": "#a%00b"
22511cb0ef41Sopenharmony_ci            }
22521cb0ef41Sopenharmony_ci        },
22531cb0ef41Sopenharmony_ci        {
22541cb0ef41Sopenharmony_ci            "comment": "Percent-encode NULLs in fragment",
22551cb0ef41Sopenharmony_ci            "href": "non-spec:/",
22561cb0ef41Sopenharmony_ci            "new_value": "a\u0000b",
22571cb0ef41Sopenharmony_ci            "expected": {
22581cb0ef41Sopenharmony_ci                "href": "non-spec:/#a%00b",
22591cb0ef41Sopenharmony_ci                "hash": "#a%00b"
22601cb0ef41Sopenharmony_ci            }
22611cb0ef41Sopenharmony_ci        },
22621cb0ef41Sopenharmony_ci        {
22631cb0ef41Sopenharmony_ci            "comment": "Bytes already percent-encoded are left as-is",
22641cb0ef41Sopenharmony_ci            "href": "http://example.net",
22651cb0ef41Sopenharmony_ci            "new_value": "%c3%89té",
22661cb0ef41Sopenharmony_ci            "expected": {
22671cb0ef41Sopenharmony_ci                "href": "http://example.net/#%c3%89t%C3%A9",
22681cb0ef41Sopenharmony_ci                "hash": "#%c3%89t%C3%A9"
22691cb0ef41Sopenharmony_ci            }
22701cb0ef41Sopenharmony_ci        },
22711cb0ef41Sopenharmony_ci        {
22721cb0ef41Sopenharmony_ci            "href": "javascript:alert(1)",
22731cb0ef41Sopenharmony_ci            "new_value": "castle",
22741cb0ef41Sopenharmony_ci            "expected": {
22751cb0ef41Sopenharmony_ci                "href": "javascript:alert(1)#castle",
22761cb0ef41Sopenharmony_ci                "hash": "#castle"
22771cb0ef41Sopenharmony_ci            }
22781cb0ef41Sopenharmony_ci        },
22791cb0ef41Sopenharmony_ci        {
22801cb0ef41Sopenharmony_ci            "comment": "Drop trailing spaces from trailing opaque paths",
22811cb0ef41Sopenharmony_ci            "href": "data:space                                                                                                                                  #fragment",
22821cb0ef41Sopenharmony_ci            "new_value": "",
22831cb0ef41Sopenharmony_ci            "expected": {
22841cb0ef41Sopenharmony_ci                "href": "data:space",
22851cb0ef41Sopenharmony_ci                "pathname": "space",
22861cb0ef41Sopenharmony_ci                "hash": ""
22871cb0ef41Sopenharmony_ci            }
22881cb0ef41Sopenharmony_ci        },
22891cb0ef41Sopenharmony_ci        {
22901cb0ef41Sopenharmony_ci            "href": "sc:space    #fragment",
22911cb0ef41Sopenharmony_ci            "new_value": "",
22921cb0ef41Sopenharmony_ci            "expected": {
22931cb0ef41Sopenharmony_ci                "href": "sc:space",
22941cb0ef41Sopenharmony_ci                "pathname": "space",
22951cb0ef41Sopenharmony_ci                "hash": ""
22961cb0ef41Sopenharmony_ci            }
22971cb0ef41Sopenharmony_ci        },
22981cb0ef41Sopenharmony_ci        {
22991cb0ef41Sopenharmony_ci            "comment": "Do not drop trailing spaces from non-trailing opaque paths",
23001cb0ef41Sopenharmony_ci            "href": "data:space  ?query#fragment",
23011cb0ef41Sopenharmony_ci            "new_value": "",
23021cb0ef41Sopenharmony_ci            "expected": {
23031cb0ef41Sopenharmony_ci                "href": "data:space  ?query",
23041cb0ef41Sopenharmony_ci                "hash": ""
23051cb0ef41Sopenharmony_ci            }
23061cb0ef41Sopenharmony_ci        },
23071cb0ef41Sopenharmony_ci        {
23081cb0ef41Sopenharmony_ci            "href": "sc:space  ?query#fragment",
23091cb0ef41Sopenharmony_ci            "new_value": "",
23101cb0ef41Sopenharmony_ci            "expected": {
23111cb0ef41Sopenharmony_ci                "href": "sc:space  ?query",
23121cb0ef41Sopenharmony_ci                "hash": ""
23131cb0ef41Sopenharmony_ci            }
23141cb0ef41Sopenharmony_ci        }
23151cb0ef41Sopenharmony_ci    ],
23161cb0ef41Sopenharmony_ci    "href": [
23171cb0ef41Sopenharmony_ci        {
23181cb0ef41Sopenharmony_ci            "href": "file:///var/log/system.log",
23191cb0ef41Sopenharmony_ci            "new_value": "http://0300.168.0xF0",
23201cb0ef41Sopenharmony_ci            "expected": {
23211cb0ef41Sopenharmony_ci                "href": "http://192.168.0.240/",
23221cb0ef41Sopenharmony_ci                "protocol": "http:"
23231cb0ef41Sopenharmony_ci            }
23241cb0ef41Sopenharmony_ci        }
23251cb0ef41Sopenharmony_ci    ]
23261cb0ef41Sopenharmony_ci}
2327