CINXE.COM

URL Standard

<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <meta content="width=device-width, initial-scale=1, shrink-to-fit=no" name="viewport"> <meta content="#3c790a" name="theme-color"> <meta content="light dark" name="color-scheme"> <title>URL Standard</title> <link crossorigin href="https://resources.whatwg.org/standard-shared-with-dev.css" rel="stylesheet"> <link crossorigin href="https://resources.whatwg.org/standard.css" rel="stylesheet"> <link crossorigin href="https://resources.whatwg.org/spec.css" rel="stylesheet"> <link crossorigin href="https://resources.whatwg.org/logo-url.svg" rel="icon"> <script crossorigin defer src="https://resources.whatwg.org/commit-snapshot-shortcut-key.js"></script> <meta content="Bikeshed version 742f3d674, updated Mon Nov 4 14:56:54 2024 -0800" name="generator"> <meta content="7ff8de0a1445abcabbbc4d33b292a5eddc8bd22d" name="revision"> <style> .yesno .yes { background: papayawhip; } .yesno .yes, .yesno .no { text-align: center; } </style> <style>/* Boilerplate: style-dfn-panel */ :root { --dfnpanel-bg: #ddd; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #ffc; --dfnpanel-target-outline: orange; } @media (prefers-color-scheme: dark) { :root { --dfnpanel-bg: #222; --dfnpanel-text: var(--text); --dfnpanel-target-bg: #333; --dfnpanel-target-outline: silver; } } .dfn-panel { position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.75em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--dfnpanel-bg); color: var(--dfnpanel-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .dfn-panel:not(.on) { display: none; } .dfn-panel * { margin: 0; padding: 0; text-indent: 0; } .dfn-panel > b { display: block; } .dfn-panel a { color: var(--dfnpanel-text); } .dfn-panel a:not(:hover) { text-decoration: none !important; border-bottom: none !important; } .dfn-panel a:focus { outline: 5px auto Highlight; outline: 5px auto -webkit-focus-ring-color; } .dfn-panel > b + b { margin-top: 0.25em; } .dfn-panel ul { padding: 0 0 0 1em; list-style: none; } .dfn-panel li a { max-width: calc(300px - 1.5em - 1em); overflow: hidden; text-overflow: ellipsis; } .dfn-panel.activated { display: inline-block; position: fixed; left: 8px; bottom: 2em; margin: 0 auto; max-width: calc(100vw - 1.5em - .4em - .5em); max-height: 30vh; transition: left 1s ease-out, bottom 1s ease-out; } .dfn-panel .link-item:hover { text-decoration: underline; } .dfn-panel .link-item .copy-icon { opacity: 0; } .dfn-panel .link-item:hover .copy-icon, .dfn-panel .link-item .copy-icon:focus { opacity: 1; } .dfn-panel .copy-icon { display: inline-block; margin-right: 0.5em; width: 0.85em; height: 1em; border-radius: 3px; background-color: #ccc; cursor: pointer; } .dfn-panel .copy-icon .icon { width: 100%; height: 100%; background-color: #fff; display: flex; justify-content: center; align-items: center; position: relative; } .dfn-panel .copy-icon .icon::before { content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 1px solid black; background-color: #ccc; opacity: 0.25; transform: translate(3px, -3px); } .dfn-panel .copy-icon:active .icon::before { opacity: 1; } .dfn-paneled[role="button"] { cursor: help; } .highlighted { animation: target-fade 3s; } @keyframes target-fade { from { background-color: var(--dfnpanel-target-bg); outline: 5px solid var(--dfnpanel-target-outline); } to { color: var(--a-normal-text); background-color: transparent; outline: transparent; } } </style> <style>/* Boilerplate: style-mdn-anno */ :root { --mdn-bg: #EEE; --mdn-shadow: #999; --mdn-nosupport-text: #ccc; --mdn-pass: green; --mdn-fail: red; } @media (prefers-color-scheme: dark) { :root { --mdn-bg: #222; --mdn-shadow: #444; --mdn-nosupport-text: #666; --mdn-pass: #690; --mdn-fail: #d22; } } .mdn-anno { background: var(--mdn-bg, #EEE); border-radius: .25em; box-shadow: 0 0 3px var(--mdn-shadow, #999); color: var(--text, black); font: 1em sans-serif; hyphens: none; max-width: min-content; overflow: hidden; padding: 0.2em; position: absolute; right: 0.3em; top: auto; white-space: nowrap; word-wrap: normal; z-index: 8; } .mdn-anno.unpositioned { display: none; } .mdn-anno.overlapping-main { opacity: .2; transition: opacity .1s; } .mdn-anno[open] { opacity: 1; z-index: 9; min-width: 9em; } .mdn-anno:hover { opacity: 1; outline: var(--text, black) 1px solid; } .mdn-anno > summary { font-weight: normal; text-align: right; cursor: pointer; display: block; } .mdn-anno > summary > .less-than-two-engines-flag { color: var(--mdn-fail); padding-right: 2px; } .mdn-anno > summary > .all-engines-flag { color: var(--mdn-pass); padding-right: 2px; } .mdn-anno > summary > span { color: #fff; background-color: #000; font-weight: normal; font-family: zillaslab, Palatino, "Palatino Linotype", serif; padding: 2px 3px 0px 3px; line-height: 1.3em; vertical-align: top; } .mdn-anno > .feature { margin-top: 20px; } .mdn-anno > .feature:not(:first-of-type) { border-top: 1px solid #999; margin-top: 6px; padding-top: 2px; } .mdn-anno > .feature > .less-than-two-engines-text { color: var(--mdn-fail); } .mdn-anno > .feature > .all-engines-text { color: var(--mdn-pass); } .mdn-anno > .feature > p { font-size: .75em; margin-top: 6px; margin-bottom: 0; } .mdn-anno > .feature > p + p { margin-top: 3px; } .mdn-anno > .feature > .support { display: block; font-size: 0.6em; margin: 0; padding: 0; margin-top: 2px; } .mdn-anno > .feature > .support + div { padding-top: 0.5em; } .mdn-anno > .feature > .support > hr { display: block; border: none; border-top: 1px dotted #999; padding: 3px 0px 0px 0px; margin: 2px 3px 0px 3px; } .mdn-anno > .feature > .support > hr::before { content: ""; } .mdn-anno > .feature > .support > span { padding: 0.2em 0; display: block; display: table; } .mdn-anno > .feature > .support > span.no { color: var(--mdn-nosupport-text); filter: grayscale(100%); } .mdn-anno > .feature > .support > span.no::before { opacity: 0.5; } .mdn-anno > .feature > .support > span:first-of-type { padding-top: 0.5em; } .mdn-anno > .feature > .support > span > span { padding: 0 0.5em; display: table-cell; } .mdn-anno > .feature > .support > span > span:first-child { width: 100%; } .mdn-anno > .feature > .support > span > span:last-child { width: 100%; white-space: pre; padding: 0; } .mdn-anno > .feature > .support > span::before { content: ' '; display: table-cell; min-width: 1.5em; height: 1.5em; background: no-repeat center center; background-size: contain; text-align: right; font-size: 0.75em; font-weight: bold; } .mdn-anno > .feature > .support > .chrome_android::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .firefox_android::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .chrome::before { background-image: url(https://resources.whatwg.org/browser-logos/chrome.svg); } .mdn-anno > .feature > .support > .edge_blink::before { background-image: url(https://resources.whatwg.org/browser-logos/edge.svg); } .mdn-anno > .feature > .support > .edge::before { background-image: url(https://resources.whatwg.org/browser-logos/edge_legacy.svg); } .mdn-anno > .feature > .support > .firefox::before { background-image: url(https://resources.whatwg.org/browser-logos/firefox.png); } .mdn-anno > .feature > .support > .ie::before { background-image: url(https://resources.whatwg.org/browser-logos/ie.png); } .mdn-anno > .feature > .support > .safari_ios::before { background-image: url(https://resources.whatwg.org/browser-logos/safari-ios.svg); } .mdn-anno > .feature > .support > .nodejs::before { background-image: url(https://nodejs.org/static/images/favicons/favicon.ico); } .mdn-anno > .feature > .support > .opera_android::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .opera::before { background-image: url(https://resources.whatwg.org/browser-logos/opera.svg); } .mdn-anno > .feature > .support > .safari::before { background-image: url(https://resources.whatwg.org/browser-logos/safari.png); } .mdn-anno > .feature > .support > .samsunginternet_android::before { background-image: url(https://resources.whatwg.org/browser-logos/samsung.svg); } .mdn-anno > .feature > .support > .webview_android::before { background-image: url(https://resources.whatwg.org/browser-logos/android-webview.png); } .name-slug-mismatch { color: red; } .caniuse-status:hover { z-index: 9; } /* dt, li, .issue, .note, and .example are "position: relative", so to put annotation at right margin, must move to right of containing block */; .h-entry:not(.status-LS) dt > .mdn-anno, .h-entry:not(.status-LS) li > .mdn-anno, .h-entry:not(.status-LS) .issue > .mdn-anno, .h-entry:not(.status-LS) .note > .mdn-anno, .h-entry:not(.status-LS) .example > .mdn-anno { right: -6.7em; } .h-entry p + .mdn-anno { margin-top: 0; } h2 + .mdn-anno.after { margin: -48px 0 0 0; } h3 + .mdn-anno.after { margin: -46px 0 0 0; } h4 + .mdn-anno.after { margin: -42px 0 0 0; } h5 + .mdn-anno.after { margin: -40px 0 0 0; } h6 + .mdn-anno.after { margin: -40px 0 0 0; } </style> <style>/* Boilerplate: style-ref-hints */ :root { --ref-hint-bg: #ddd; --ref-hint-text: var(--text); } @media (prefers-color-scheme: dark) { :root { --ref-hint-bg: #222; --ref-hint-text: var(--text); } } .ref-hint { display: inline-block; position: absolute; z-index: 35; width: 20em; width: 300px; height: auto; max-height: 500px; overflow: auto; padding: 0.5em 0.5em; font: small Helvetica Neue, sans-serif, Droid Sans Fallback; background: var(--ref-hint-bg); color: var(--ref-hint-text); border: outset 0.2em; white-space: normal; /* in case it's moved into a pre */ } .ref-hint * { margin: 0; padding: 0; text-indent: 0; } .ref-hint ul { padding: 0 0 0 1em; list-style: none; } </style> <style>/* Boilerplate: style-var-click-highlighting */ /* Colors were chosen in Lab using https://nixsensor.com/free-color-converter/ D50 2deg illuminant, L in [0,100], a and b in [-128, 128] 0 = lab(85,0,85) 1 = lab(85,80,30) 2 = lab(85,-40,40) 3 = lab(85,-50,0) 4 = lab(85,5,15) 5 = lab(85,-10,-50) 6 = lab(85,35,-15) For darkmode: 0 = oklab(50% 0% 108%) 1 = oklab(50% -51% 51%) 2 = oklab(50% -64% -20%) 3 = oklab(50% 6% 19%) 4 = oklab(50% -12% -64%) 5 = oklab(50% 44% -19%) 6 = oklab(50% 102% 38%) */ [data-algorithm] var { cursor: pointer; } var[data-var-color] { background-color: var(--var-bg); box-shadow: 0 0 0 2px var(--var-bg); } var[data-var-color] { --var-bg: #F4D200; } var[data-var-color="1"] { --var-bg: #FF87A2; } var[data-var-color="2"] { --var-bg: #96E885; } var[data-var-color="3"] { --var-bg: #3EEED2; } var[data-var-color="4"] { --var-bg: #EACFB6; } var[data-var-color="5"] { --var-bg: #82DDFF; } var[data-var-color="6"] { --var-vg: #FFBCF2; } @media (prefers-color-scheme: dark) { var[data-var-color] { --var-bg: #bc1a00; } var[data-var-color="1"] { --var-bg: #007f00; } var[data-var-color="2"] { --var-bg: #008698; } var[data-var-color="3"] { --var-bg: #7f5b2b; } var[data-var-color="4"] { --var-bg: #004df3; } var[data-var-color="5"] { --var-bg: #a1248a; } var[data-var-color="6"] { --var-vg: #ff0000; } } </style> <body class="h-entry status-LS"> <div class="head"> <a class="logo" href="https://whatwg.org/"> <img alt="WHATWG" class="darkmode-aware" crossorigin height="100" src="https://resources.whatwg.org/logo-url.svg"> </a> <hgroup> <h1 class="p-name no-ref allcaps" id="title">URL</h1> <p id="subtitle">Living Standard — Last Updated <time class="dt-updated" datetime="2024-11-26">26 November 2024</time> </p> </hgroup> <div data-fill-with="spec-metadata"> <dl> <dt>Participate: <dd><a href="https://github.com/whatwg/url">GitHub whatwg/url</a> (<a href="https://github.com/whatwg/url/issues/new/choose">new issue</a>, <a href="https://github.com/whatwg/url/issues">open issues</a>) <dd><a href="https://whatwg.org/chat">Chat on Matrix</a> <dt>Commits: <dd><a href="https://github.com/whatwg/url/commits">GitHub whatwg/url/commits</a> <dd><a href="/commit-snapshots/7ff8de0a1445abcabbbc4d33b292a5eddc8bd22d/" id="commit-snapshot-link">Snapshot as of this commit</a> <dd><a href="https://twitter.com/urlstandard">@urlstandard</a> <dt>Tests: <dd><a href="https://github.com/web-platform-tests/wpt/tree/master/url">web-platform-tests url/</a> (<a href="https://github.com/web-platform-tests/wpt/labels/url">ongoing work</a>) <dt>Translations <small>(non-normative)</small>: <dd><span title="Japanese"><a href="https://triple-underscore.github.io/URL-ja.html" hreflang="ja" lang="ja" rel="alternate">日本語</a></span> <dd><span title="Simplified Chinese"><a href="https://htmlspecs.com/url/" hreflang="zh-hans" lang="zh-hans" rel="alternate">简体中文</a></span> </dl> </div> <div data-fill-with="warning"></div> </div> <div class="p-summary" data-fill-with="abstract"> <h2 class="no-num no-toc no-ref heading settled" id="abstract"><span class="content">Abstract</span></h2> <p>The URL Standard defines URLs, domains, IP addresses, the <code>application/x-www-form-urlencoded</code> format, and their API.</p> </div> <nav data-fill-with="table-of-contents" id="toc"> <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2> <ol class="toc" role="directory"> <li><a href="#goals"><span class="secno"></span> <span class="content">Goals</span></a> <li> <a href="#infrastructure"><span class="secno">1</span> <span class="content">Infrastructure</span></a> <ol class="toc"> <li><a href="#writing"><span class="secno">1.1</span> <span class="content">Writing</span></a> <li><a href="#parsers"><span class="secno">1.2</span> <span class="content">Parsers</span></a> <li><a href="#percent-encoded-bytes"><span class="secno">1.3</span> <span class="content">Percent-encoded bytes</span></a> </ol> <li><a href="#security-considerations"><span class="secno">2</span> <span class="content">Security considerations</span></a> <li> <a href="#hosts-(domains-and-ip-addresses)"><span class="secno">3</span> <span class="content">Hosts (domains and IP addresses)</span></a> <ol class="toc"> <li><a href="#host-representation"><span class="secno">3.1</span> <span class="content">Host representation</span></a> <li><a href="#host-miscellaneous"><span class="secno">3.2</span> <span class="content">Host miscellaneous</span></a> <li><a href="#idna"><span class="secno">3.3</span> <span class="content">IDNA</span></a> <li><a href="#host-writing"><span class="secno">3.4</span> <span class="content">Host writing</span></a> <li><a href="#host-parsing"><span class="secno">3.5</span> <span class="content">Host parsing</span></a> <li><a href="#host-serializing"><span class="secno">3.6</span> <span class="content">Host serializing</span></a> <li><a href="#host-equivalence"><span class="secno">3.7</span> <span class="content">Host equivalence</span></a> </ol> <li> <a href="#urls"><span class="secno">4</span> <span class="content">URLs</span></a> <ol class="toc"> <li><a href="#url-representation"><span class="secno">4.1</span> <span class="content">URL representation</span></a> <li><a href="#url-miscellaneous"><span class="secno">4.2</span> <span class="content">URL miscellaneous</span></a> <li><a href="#url-writing"><span class="secno">4.3</span> <span class="content">URL writing</span></a> <li><a href="#url-parsing"><span class="secno">4.4</span> <span class="content">URL parsing</span></a> <li><a href="#url-serializing"><span class="secno">4.5</span> <span class="content">URL serializing</span></a> <li><a href="#url-equivalence"><span class="secno">4.6</span> <span class="content">URL equivalence</span></a> <li><a href="#origin"><span class="secno">4.7</span> <span class="content">Origin</span></a> <li> <a href="#url-rendering"><span class="secno">4.8</span> <span class="content">URL rendering</span></a> <ol class="toc"> <li><a href="#url-rendering-simplification"><span class="secno">4.8.1</span> <span class="content">Simplify non-human-readable or irrelevant components</span></a> <li><a href="#url-rendering-elision"><span class="secno">4.8.2</span> <span class="content">Elision</span></a> <li><a href="#url-rendering-i18n"><span class="secno">4.8.3</span> <span class="content">Internationalization and special characters</span></a> </ol> </ol> <li> <a href="#application/x-www-form-urlencoded"><span class="secno">5</span> <span class="content"><code>application/x-www-form-urlencoded</code></span></a> <ol class="toc"> <li><a href="#urlencoded-parsing"><span class="secno">5.1</span> <span class="content"><code>application/x-www-form-urlencoded</code> parsing</span></a> <li><a href="#urlencoded-serializing"><span class="secno">5.2</span> <span class="content"><code>application/x-www-form-urlencoded</code> serializing</span></a> <li><a href="#urlencoded-hooks"><span class="secno">5.3</span> <span class="content">Hooks</span></a> </ol> <li> <a href="#api"><span class="secno">6</span> <span class="content">API</span></a> <ol class="toc"> <li><a href="#url-class"><span class="secno">6.1</span> <span class="content">URL class</span></a> <li><a href="#interface-urlsearchparams"><span class="secno">6.2</span> <span class="content">URLSearchParams class</span></a> <li><a href="#url-apis-elsewhere"><span class="secno">6.3</span> <span class="content">URL APIs elsewhere</span></a> </ol> <li><a href="#acknowledgments"><span class="secno"></span> <span class="content">Acknowledgments</span></a> <li><a href="#ipr"><span class="secno"></span> <span class="content">Intellectual property rights</span></a> <li> <a href="#index"><span class="secno"></span> <span class="content">Index</span></a> <ol class="toc"> <li><a href="#index-defined-here"><span class="secno"></span> <span class="content">Terms defined by this specification</span></a> <li><a href="#index-defined-elsewhere"><span class="secno"></span> <span class="content">Terms defined by reference</span></a> </ol> <li> <a href="#references"><span class="secno"></span> <span class="content">References</span></a> <ol class="toc"> <li><a href="#normative"><span class="secno"></span> <span class="content">Normative References</span></a> <li><a href="#informative"><span class="secno"></span> <span class="content">Informative References</span></a> </ol> <li><a href="#idl-index"><span class="secno"></span> <span class="content">IDL Index</span></a> </ol> </nav> <main> <h2 class="no-num heading settled" id="goals"><span class="content">Goals</span></h2> <p>The URL standard takes the following approach towards making URLs fully interoperable: </p> <ul> <li> <p>Align RFC 3986 and RFC 3987 with contemporary implementations and obsolete the RFCs in the process. (E.g., spaces, other "illegal" code points, query encoding, equality, canonicalization, are all concepts not entirely shared, or defined.) URL parsing needs to become as solid as HTML parsing. <a data-link-type="biblio" href="#biblio-rfc3986" title="Uniform Resource Identifier (URI): Generic Syntax">[RFC3986]</a> <a data-link-type="biblio" href="#biblio-rfc3987" title="Internationalized Resource Identifiers (IRIs)">[RFC3987]</a> </p> <li> <p>Standardize on the term URL. URI and IRI are just confusing. In practice a single algorithm is used for both so keeping them distinct is not helping anyone. URL also easily wins the <a href="https://trends.google.com/trends/explore?q=url,uri">search result popularity contest</a>. </p> <li> <p>Supplanting <a href="https://tools.ietf.org/html/rfc6454#section-4">Origin of a URI [sic]</a>. <a data-link-type="biblio" href="#biblio-rfc6454" title="The Web Origin Concept">[RFC6454]</a> </p> <li> <p>Define URL’s existing JavaScript API in full detail and add enhancements to make it easier to work with. Add a new <code><a class="idl-code" data-link-type="interface" href="#url" id="ref-for-url">URL</a></code> object as well for URL manipulation without usage of HTML elements. (Useful for JavaScript worker environments.) </p> <li> <p>Ensure the combination of parser, serializer, and API guarantee idempotence. For example, a non-failure result of a parse-then-serialize operation will not change with any further parse-then-serialize operations applied to it. Similarly, manipulating a non-failure result through the API will not change from applying any number of serialize-then-parse operations to it. </p> </ul> <p class="note" role="note">As the editors learn more about the subject matter the goals might increase in scope somewhat. </p> <h2 class="heading settled" data-level="1" id="infrastructure"><span class="secno">1. </span><span class="content">Infrastructure</span><a class="self-link" href="#infrastructure"></a></h2> <p>This specification depends on <cite>Infra</cite>. <a data-link-type="biblio" href="#biblio-infra" title="Infra Standard">[INFRA]</a> </p> <p>Some terms used in this specification are defined in the following standards and specifications: </p> <ul class="brief"> <li><cite>Encoding</cite> <a data-link-type="biblio" href="#biblio-encoding" title="Encoding Standard">[ENCODING]</a> <li><cite>File API</cite> <a data-link-type="biblio" href="#biblio-fileapi" title="File API">[FILEAPI]</a> <li><cite>HTML</cite> <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> <li><cite>Unicode IDNA Compatibility Processing</cite> <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> <li><cite>Web IDL</cite> <a data-link-type="biblio" href="#biblio-webidl" title="Web IDL Standard">[WEBIDL]</a> </ul> <hr> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="serialize-an-integer">serialize an integer</dfn>, represent it as the shortest possible decimal number. </p> <h3 class="heading settled" data-level="1.1" id="writing"><span class="secno">1.1. </span><span class="content">Writing</span><a class="self-link" href="#writing"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="validation-error">validation error<span id="syntax-violation"></span></dfn> indicates a mismatch between input and valid input. User agents, especially conformance checkers, are encouraged to report them somewhere. </p> <div class="note" role="note"> <p>A <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error">validation error</a> does not mean that the parser terminates. Termination of a parser is always stated explicitly, e.g., through a return statement. </p> <p>It is useful to signal <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①">validation errors</a> as error-handling can be non-intuitive, legacy user agents might not implement correct error-handling, and the intent of what is written might be unclear to other developers. </p> </div> <table class="yesno"> <thead> <tr> <th>Error type <th>Error description <th>Failure <tbody> <tr> <th colspan="3" scope="rowgroup"><a href="#idna">IDNA</a> <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="validation-error-domain-to-ascii">domain-to-ASCII</dfn> <td> <p><a data-link-type="abstract-op" href="https://www.unicode.org/reports/tr46/#ToASCII" id="ref-for-ToASCII">Unicode ToASCII</a> records an error or returns the empty string. <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> </p> <p class="note" role="note">If details about <a data-link-type="abstract-op" href="https://www.unicode.org/reports/tr46/#ToASCII" id="ref-for-ToASCII①">Unicode ToASCII</a> errors are recorded, user agents are encouraged to pass those along. </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="domain-to-unicode">domain-to-Unicode</dfn> <td> <p><a data-link-type="abstract-op" href="https://www.unicode.org/reports/tr46/#ToUnicode" id="ref-for-ToUnicode">Unicode ToUnicode</a> records an error. <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> </p> <p class="note" role="note">The same considerations as with <a data-link-type="dfn" href="#validation-error-domain-to-ascii" id="ref-for-validation-error-domain-to-ascii">domain-to-ASCII</a> apply. </p> <td class="no">· <tbody> <tr> <th colspan="3" scope="rowgroup"><a href="#host-parsing">Host parsing</a> <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="domain-invalid-code-point">domain-invalid-code-point</dfn> <td> <p>The input’s <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host">host</a> contains a <a data-link-type="dfn" href="#forbidden-domain-code-point" id="ref-for-forbidden-domain-code-point">forbidden domain code point</a>. </p> <div class="example" id="example-domain-invalid-code-point"> <a class="self-link" href="#example-domain-invalid-code-point"></a> <p>Hosts are <a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode">percent-decoded</a> before being processed when the URL <a data-link-type="dfn" href="#is-special" id="ref-for-is-special">is special</a>, which would result in the following host portion becoming "<code>exa#mple.org</code>" and thus triggering this error. </p> <p>"<code>https://exa%23mple.org</code>" </p> </div> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="host-invalid-code-point">host-invalid-code-point</dfn> <td> <p>An <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host">opaque host</a> (in a URL that <a data-link-type="dfn" href="#is-not-special" id="ref-for-is-not-special">is not special</a>) contains a <a data-link-type="dfn" href="#forbidden-host-code-point" id="ref-for-forbidden-host-code-point">forbidden host code point</a>. </p> <p class="example" id="example-host-invalid-code-point"><a class="self-link" href="#example-host-invalid-code-point"></a>"<code>foo://exa[mple.org</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-empty-part">IPv4-empty-part</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4">IPv4 address</a> ends with a U+002E (.). </p> <p class="example" id="example-ipv4-empty-part"><a class="self-link" href="#example-ipv4-empty-part"></a>"<code>https://127.0.0.1./</code>" </p> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-too-many-parts">IPv4-too-many-parts</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①">IPv4 address</a> does not consist of exactly 4 parts. </p> <p class="example" id="example-ipv4-too-many-parts"><a class="self-link" href="#example-ipv4-too-many-parts"></a>"<code>https://1.2.3.4.5/</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-non-numeric-part">IPv4-non-numeric-part</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4②">IPv4 address</a> part is not numeric. </p> <p class="example" id="example-ipv4-non-numeric-part"><a class="self-link" href="#example-ipv4-non-numeric-part"></a>"<code>https://test.42</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-non-decimal-part">IPv4-non-decimal-part</dfn> <td> <p>The <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4③">IPv4 address</a> contains numbers expressed using hexadecimal or octal digits. </p> <p class="example" id="example-ipv4-non-decimal-part"><a class="self-link" href="#example-ipv4-non-decimal-part"></a>"<code>https://127.0.0x0.1</code>" </p> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-out-of-range-part">IPv4-out-of-range-part</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4④">IPv4 address</a> part exceeds 255. </p> <p class="example" id="example-ipv4-out-of-range-part"><a class="self-link" href="#example-ipv4-out-of-range-part"></a>"<code>https://255.255.4000.1</code>" </p> <td class="yes">Yes<br>(only if applicable to the last part) <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-unclosed">IPv6-unclosed</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6">IPv6 address</a> is missing the closing U+005D (]). </p> <p class="example" id="example-ipv6-unclosed"><a class="self-link" href="#example-ipv6-unclosed"></a>"<code>https://[::1</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-invalid-compression">IPv6-invalid-compression</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①">IPv6 address</a> begins with improper compression. </p> <p class="example" id="example-ipv6-invalid-compression"><a class="self-link" href="#example-ipv6-invalid-compression"></a>"<code>https://[:1]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-too-many-pieces">IPv6-too-many-pieces</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6②">IPv6 address</a> contains more than 8 pieces. </p> <p class="example" id="example-ipv6-too-many-pieces"><a class="self-link" href="#example-ipv6-too-many-pieces"></a>"<code>https://[1:2:3:4:5:6:7:8:9]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-multiple-compression">IPv6-multiple-compression</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6③">IPv6 address</a> is compressed in more than one spot. </p> <p class="example" id="example-ipv6-multiple-compression"><a class="self-link" href="#example-ipv6-multiple-compression"></a>"<code>https://[1::1::1]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-invalid-code-point">IPv6-invalid-code-point</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6④">IPv6 address</a> contains a code point that is neither an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit">ASCII hex digit</a> nor a U+003A (:). Or it unexpectedly ends. </p> <div class="example" id="example-ipv6-invalid-code-point"> <a class="self-link" href="#example-ipv6-invalid-code-point"></a> <p>"<code>https://[1:2:3!:4]</code>" </p> <p>"<code>https://[1:2:3:]</code>" </p> </div> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv6-too-few-pieces">IPv6-too-few-pieces</dfn> <td> <p>An uncompressed <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6⑤">IPv6 address</a> contains fewer than 8 pieces. </p> <p class="example" id="example-ipv6-too-few-pieces"><a class="self-link" href="#example-ipv6-too-few-pieces"></a>"<code>https://[1:2:3]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-in-ipv6-too-many-pieces">IPv4-in-IPv6-too-many-pieces</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6⑥">IPv6 address</a> with <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4⑤">IPv4 address</a> syntax: the IPv6 address has more than 6 pieces. </p> <p class="example" id="example-ipv4-in-ipv6-too-many-pieces"><a class="self-link" href="#example-ipv4-in-ipv6-too-many-pieces"></a>"<code>https://[1:1:1:1:1:1:1:127.0.0.1]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-in-ipv6-invalid-code-point">IPv4-in-IPv6-invalid-code-point</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6⑦">IPv6 address</a> with <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4⑥">IPv4 address</a> syntax: </p> <ul> <li>An IPv4 part is empty or contains a non-<a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit">ASCII digit</a>. <li>An IPv4 part contains a leading 0. <li>There are too many IPv4 parts. </ul> <div class="example" id="example-ipv4-in-ipv6-invalid-code-point"> <a class="self-link" href="#example-ipv4-in-ipv6-invalid-code-point"></a> <p>"<code>https://[ffff::.0.0.1]</code>" </p> <p>"<code>https://[ffff::127.0.xyz.1]</code>" </p> <p>"<code>https://[ffff::127.0xyz]</code>" </p> <p>"<code>https://[ffff::127.00.0.1]</code>" </p> <p>"<code>https://[ffff::127.0.0.1.2]</code>" </p> </div> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-in-ipv6-out-of-range-part">IPv4-in-IPv6-out-of-range-part</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6⑧">IPv6 address</a> with <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4⑦">IPv4 address</a> syntax: an IPv4 part exceeds 255. </p> <p class="example" id="example-ipv4-in-ipv6-out-of-range-part"><a class="self-link" href="#example-ipv4-in-ipv6-out-of-range-part"></a>"<code>https://[ffff::127.0.0.4000]</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-in-ipv6-too-few-parts">IPv4-in-IPv6-too-few-parts</dfn> <td> <p>An <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6⑨">IPv6 address</a> with <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4⑧">IPv4 address</a> syntax: an IPv4 address contains too few parts. </p> <p class="example" id="example-ipv4-in-ipv6-too-few-parts"><a class="self-link" href="#example-ipv4-in-ipv6-too-few-parts"></a>"<code>https://[ffff::127.0.0]</code>" </p> <td class="yes">Yes <tbody> <tr> <th colspan="3" scope="rowgroup"><a href="#url-parsing">URL parsing</a> <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="invalid-url-unit">invalid-URL-unit</dfn> <td> <p>A code point is found that is not a <a data-link-type="dfn" href="#url-units" id="ref-for-url-units">URL unit</a>. </p> <div class="example" id="example-invalid-url-unit"> <a class="self-link" href="#example-invalid-url-unit"></a> <p>"<code>https://example.org/></code>" </p> <p>"<code> https://example.org </code>" </p> <p>"<code>ht<br>tps://example.org</code>" </p> <p>"<code>https://example.org/%s</code>" </p> </div> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="special-scheme-missing-following-solidus">special-scheme-missing-following-solidus</dfn> <td> <p>The input’s scheme is not followed by "<code>//</code>". </p> <div class="example" id="example-special-scheme-missing-following-solidus"> <a class="self-link" href="#example-special-scheme-missing-following-solidus"></a> <p>"<code>file:c:/my-secret-folder</code>" </p> <p>"<code>https:example.org</code>" </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"https:foo.html"</c-><c- p>,</c-> <c- u>"https://example.org/"</c-><c- p>);</c-></code></pre> </div> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="missing-scheme-non-relative-url">missing-scheme-non-relative-URL</dfn> <td> <p>The input is missing a <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme">scheme</a>, because it does not begin with an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alpha" id="ref-for-ascii-alpha">ASCII alpha</a>, and either no <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url">base URL</a> was provided or the <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①">base URL</a> cannot be used as a <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url②">base URL</a> because it has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path">opaque path</a>. </p> <div class="example" id="example-missing-scheme-non-relative-url"> <a class="self-link" href="#example-missing-scheme-non-relative-url"></a> <p>Input’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①">scheme</a> is missing and no <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url③">base URL</a> is given: </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"💩"</c-><c- p>);</c-></code></pre> <p>Input’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②">scheme</a> is missing, but the <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url④">base URL</a> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path①">opaque path</a>. </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"💩"</c-><c- p>,</c-> <c- u>"mailto:user@example.org"</c-><c- p>);</c-></code></pre> </div> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="invalid-reverse-solidus">invalid-reverse-solidus</dfn> <td> <p>The URL has a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme">special scheme</a> and it uses U+005C (\) instead of U+002F (/). </p> <p class="example" id="example-invalid-reverse-solidus"><a class="self-link" href="#example-invalid-reverse-solidus"></a>"<code>https://example.org\path\to\file</code>" </p> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="invalid-credentials">invalid-credentials</dfn> <td> <p>The input <a data-link-type="dfn" href="#include-credentials" id="ref-for-include-credentials">includes credentials</a>. </p> <div class="example" id="example-invalid-credentials"> <a class="self-link" href="#example-invalid-credentials"></a> <p>"<code>https://user@example.org</code>" </p> <p>"<code>ssh://user@example.org</code>" </p> </div> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="host-missing">host-missing</dfn> <td> <p>The input has a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme①">special scheme</a>, but does not contain a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①">host</a>. </p> <div class="example" id="example-host-missing"> <a class="self-link" href="#example-host-missing"></a> <p>"<code>https://#fragment</code>" </p> <p>"<code>https://:443</code>" </p> <p>"<code>https://user:pass@</code>" </p> </div> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="port-out-of-range">port-out-of-range</dfn> <td> <p>The input’s port is too big. </p> <p class="example" id="example-port-out-of-range"><a class="self-link" href="#example-port-out-of-range"></a>"<code>https://example.org:70000</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="port-invalid">port-invalid</dfn> <td> <p>The input’s port is invalid. </p> <p class="example" id="example-port-invalid"><a class="self-link" href="#example-port-invalid"></a>"<code>https://example.org:7z</code>" </p> <td class="yes">Yes <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="file-invalid-windows-drive-letter">file-invalid-Windows-drive-letter</dfn> <td> <p>The input is a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string">relative-URL string</a> that <a data-link-type="dfn" href="#start-with-a-windows-drive-letter" id="ref-for-start-with-a-windows-drive-letter">starts with a Windows drive letter</a> and the <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url⑤">base URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③">scheme</a> is "<code>file</code>". </p> <pre class="example" id="example-file-invalid-windows-drive-letter"><a class="self-link" href="#example-file-invalid-windows-drive-letter"></a><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"/c:/path/to/file"</c-><c- p>,</c-> <c- u>"file:///c:/"</c-><c- p>);</c-></code></pre> <td class="no">· <tr> <td><dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="file-invalid-windows-drive-letter-host">file-invalid-Windows-drive-letter-host</dfn> <td> <p>A <code>file:</code> URL’s host is a Windows drive letter. </p> <p class="example" id="example-file-invalid-windows-drive-letter-host"><a class="self-link" href="#example-file-invalid-windows-drive-letter-host"></a>"<code>file://c:</code>" </p> <td class="no">· </table> <h3 class="heading settled" data-level="1.2" id="parsers"><span class="secno">1.2. </span><span class="content">Parsers</span><a class="self-link" href="#parsers"></a></h3> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="eof-code-point">EOF code point</dfn> is a conceptual code point that signifies the end of a string or code point stream. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="pointer">pointer</dfn> for a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string">string</a> <var>input</var> is an integer that points to a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point">code point</a> within <var>input</var>. Initially it points to the start of <var>input</var>. If it is −1 it points nowhere. If it is greater than or equal to <var>input</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-code-point-length" id="ref-for-string-code-point-length">code point length</a>, it points to the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point">EOF code point</a>. </p> <p>When a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer">pointer</a> is used, <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="c">c</dfn> references the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point①">code point</a> the <a data-link-type="dfn" href="#pointer" id="ref-for-pointer①">pointer</a> points to as long as it does not point nowhere. When the <a data-link-type="dfn" href="#pointer" id="ref-for-pointer②">pointer</a> points to nowhere <a data-link-type="dfn" href="#c" id="ref-for-c">c</a> cannot be used. </p> <p>When a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer③">pointer</a> is used, <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="remaining">remaining</dfn> references the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string" id="ref-for-code-point-substring-to-the-end-of-the-string">code point substring</a> from the <a data-link-type="dfn" href="#pointer" id="ref-for-pointer④">pointer</a> + 1 to the end of the string, as long as <a data-link-type="dfn" href="#c" id="ref-for-c①">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①">EOF code point</a>. When <a data-link-type="dfn" href="#c" id="ref-for-c②">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point②">EOF code point</a> <a data-link-type="dfn" href="#remaining" id="ref-for-remaining">remaining</a> cannot be used. </p> <p class="example" id="example-12672b6a"><a class="self-link" href="#example-12672b6a"></a>If "<code>mailto:username@example</code>" is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string①">string</a> being processed and a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer⑤">pointer</a> points to @, <a data-link-type="dfn" href="#c" id="ref-for-c③">c</a> is U+0040 (@) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining①">remaining</a> is "<code>example</code>". </p> <p class="example" id="example-empty-string"><a class="self-link" href="#example-empty-string"></a>If the empty string is being processed and a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer⑥">pointer</a> points to the start and is then decreased by 1, using <a data-link-type="dfn" href="#c" id="ref-for-c④">c</a> or <a data-link-type="dfn" href="#remaining" id="ref-for-remaining②">remaining</a> would be an error. </p> <h3 class="heading settled" data-level="1.3" id="percent-encoded-bytes"><span class="secno">1.3. </span><span class="content">Percent-encoded bytes</span><a class="self-link" href="#percent-encoded-bytes"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="percent-encoded-byte">percent-encoded byte</dfn> is U+0025 (%), followed by two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit①">ASCII hex digits</a>. </p> <p class="note" role="note">It is generally a good idea for sequences of <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte">percent-encoded bytes</a> to be such that, when <a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode①">percent-decoded</a> and then passed to <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail" id="ref-for-utf-8-decode-without-bom-or-fail">UTF-8 decode without BOM or fail</a>, they do not end up as failure. How important this is depends on where the <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte①">percent-encoded bytes</a> are used. E.g., for the <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser">host parser</a> not following this advice is fatal, whereas for <a href="#url-rendering-i18n">URL rendering</a> the <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte②">percent-encoded bytes</a> would not be rendered <a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode②">percent-decoded</a>. </p> <div class="algorithm" data-algorithm="percent-encode" data-algorithm-for="byte"> <p>To <dfn class="dfn-paneled" data-dfn-for="byte" data-dfn-type="dfn" data-noexport id="percent-encode">percent-encode</dfn> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte" id="ref-for-byte">byte</a> <var>byte</var>, return a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string②">string</a> consisting of U+0025 (%), followed by two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-upper-hex-digit" id="ref-for-ascii-upper-hex-digit">ASCII upper hex digits</a> representing <var>byte</var>. </p> </div> <div class="algorithm" data-algorithm="percent-decode" data-algorithm-for="byte sequence"> <p>To <dfn class="dfn-paneled" data-dfn-for="byte sequence" data-dfn-type="dfn" data-export id="percent-decode">percent-decode</dfn> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence">byte sequence</a> <var>input</var>, run these steps: </p> <p class="warning">Using anything but <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom">UTF-8 decode without BOM</a> when <var>input</var> contains bytes that are not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-byte" id="ref-for-ascii-byte">ASCII bytes</a> might be insecure and is not recommended. </p> <ol> <li> <p>Let <var>output</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-sequence" id="ref-for-byte-sequence①">byte sequence</a>. </p> <li> <p>For each byte <var>byte</var> in <var>input</var>: </p> <ol> <li> <p>If <var>byte</var> is not 0x25 (%), then append <var>byte</var> to <var>output</var>. </p> <li> <p>Otherwise, if <var>byte</var> is 0x25 (%) and the next two bytes after <var>byte</var> in <var>input</var> are not in the ranges 0x30 (0) to 0x39 (9), 0x41 (A) to 0x46 (F), and 0x61 (a) to 0x66 (f), all inclusive, append <var>byte</var> to <var>output</var>. </p> <li> <p>Otherwise: </p> <ol> <li> <p>Let <var>bytePoint</var> be the two bytes after <var>byte</var> in <var>input</var>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#isomorphic-decode" id="ref-for-isomorphic-decode">decoded</a>, and then interpreted as hexadecimal number. </p> <li> <p>Append a byte whose value is <var>bytePoint</var> to <var>output</var>. </p> <li> <p>Skip the next two bytes in <var>input</var>. </p> </ol> </ol> <li> <p>Return <var>output</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="percent-decode" data-algorithm-for="string"> <p>To <dfn class="dfn-paneled" data-dfn-for="string" data-dfn-type="dfn" data-export id="string-percent-decode">percent-decode</dfn> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string">scalar value string</a> <var>input</var>: </p> <ol> <li> <p>Let <var>bytes</var> be the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode">UTF-8 encoding</a> of <var>input</var>. </p> <li> <p>Return the <a data-link-type="dfn" href="#percent-decode" id="ref-for-percent-decode">percent-decoding</a> of <var>bytes</var>. </p> </ol> <p class="note" role="note">In general, percent-encoding results in a string with more U+0025 (%) code points than the input, and percent-decoding results in a byte sequence with less 0x25 (%) bytes than the input. </p> </div> <hr> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="c0-control-percent-encode-set">C0 control percent-encode set<span id="simple-encode-set"></span></dfn> are the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#c0-control" id="ref-for-c0-control">C0 controls</a> and all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point②">code points</a> greater than U+007E (~). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="fragment-percent-encode-set">fragment percent-encode set</dfn> is the <a data-link-type="dfn" href="#c0-control-percent-encode-set" id="ref-for-c0-control-percent-encode-set">C0 control percent-encode set</a> and U+0020 SPACE, U+0022 ("), U+003C (&lt;), U+003E (>), and U+0060 (`). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="query-percent-encode-set">query percent-encode set</dfn> is the <a data-link-type="dfn" href="#c0-control-percent-encode-set" id="ref-for-c0-control-percent-encode-set①">C0 control percent-encode set</a> and U+0020 SPACE, U+0022 ("), U+0023 (#), U+003C (&lt;), and U+003E (>). </p> <p class="note" role="note">The <a data-link-type="dfn" href="#query-percent-encode-set" id="ref-for-query-percent-encode-set">query percent-encode set</a> cannot be defined in terms of the <a data-link-type="dfn" href="#fragment-percent-encode-set" id="ref-for-fragment-percent-encode-set">fragment percent-encode set</a> due to the omission of U+0060 (`). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="special-query-percent-encode-set">special-query percent-encode set</dfn> is the <a data-link-type="dfn" href="#query-percent-encode-set" id="ref-for-query-percent-encode-set①">query percent-encode set</a> and U+0027 ('). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="path-percent-encode-set">path percent-encode set<span id="default-encode-set"></span></dfn> is the <a data-link-type="dfn" href="#query-percent-encode-set" id="ref-for-query-percent-encode-set②">query percent-encode set</a> and U+003F (?), U+0060 (`), U+007B ({), and U+007D (}). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="userinfo-percent-encode-set">userinfo percent-encode set<span id="userinfo-encode-set"></span></dfn> is the <a data-link-type="dfn" href="#path-percent-encode-set" id="ref-for-path-percent-encode-set">path percent-encode set</a> and U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+0040 (@), U+005B ([) to U+005E (^), inclusive, and U+007C (|). </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="component-percent-encode-set">component percent-encode set</dfn> is the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set">userinfo percent-encode set</a> and U+0024 ($) to U+0026 (&amp;), inclusive, U+002B (+), and U+002C (,). </p> <p class="note" role="note">This is used by <cite>HTML</cite> for <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-registerprotocolhandler" id="ref-for-dom-navigator-registerprotocolhandler">registerProtocolHandler()</a></code>, and could also be used by other standards to percent-encode data that can then be embedded in a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path">path</a>, <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query">query</a>, or <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment">fragment</a>; or in an <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①">opaque host</a>. Using it with <a data-link-type="dfn" href="#string-utf-8-percent-encode" id="ref-for-string-utf-8-percent-encode">UTF-8 percent-encode</a> gives identical results to JavaScript’s <a class="idl-code" data-link-type="method" href="https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent" id="ref-for-sec-encodeuricomponent-uricomponent"><code>encodeURIComponent()</code> [sic]</a>. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> <a data-link-type="biblio" href="#biblio-ecma-262" title="ECMAScript Language Specification">[ECMA-262]</a> </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="application-x-www-form-urlencoded-percent-encode-set"><code>application/x-www-form-urlencoded</code> percent-encode set</dfn> is the <a data-link-type="dfn" href="#component-percent-encode-set" id="ref-for-component-percent-encode-set">component percent-encode set</a> and U+0021 (!), U+0027 (') to U+0029 RIGHT PARENTHESIS, inclusive, and U+007E (~). </p> <p class="note" role="note">The <a data-link-type="dfn" href="#application-x-www-form-urlencoded-percent-encode-set" id="ref-for-application-x-www-form-urlencoded-percent-encode-set"><code>application/x-www-form-urlencoded</code> percent-encode set</a> contains all code points, except the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alphanumeric" id="ref-for-ascii-alphanumeric">ASCII alphanumeric</a>, U+002A (*), U+002D (-), U+002E (.), and U+005F (_). </p> <div class="algorithm" data-algorithm="percent-encode after encoding" data-algorithm-for="string"> <p>To <dfn class="dfn-paneled" data-dfn-for="string" data-dfn-type="dfn" data-noexport id="string-percent-encode-after-encoding">percent-encode after encoding</dfn>, given an <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encoding" id="ref-for-encoding">encoding</a> <var>encoding</var>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string①">scalar value string</a> <var>input</var>, a <var>percentEncodeSet</var>, and an optional boolean <var>spaceAsPlus</var> (default false): </p> <ol> <li> <p>Let <var>encoder</var> be the result of <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#get-an-encoder" id="ref-for-get-an-encoder">getting an encoder</a> from <var>encoding</var>. </p> <li> <p>Let <var>inputQueue</var> be <var>input</var> converted to an <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#concept-stream" id="ref-for-concept-stream">I/O queue</a>. </p> <li> <p>Let <var>output</var> be the empty string. </p> <li> <p>Let <var>potentialError</var> be 0. </p> <p class="note" role="note">This needs to be a non-null value to initiate the subsequent while loop. </p> <li> <p>While <var>potentialError</var> is non-null: </p> <ol> <li> <p>Let <var>encodeOutput</var> be an empty <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#concept-stream" id="ref-for-concept-stream①">I/O queue</a>. </p> <li> <p>Set <var>potentialError</var> to the result of running <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encode-or-fail" id="ref-for-encode-or-fail">encode or fail</a> with <var>inputQueue</var>, <var>encoder</var>, and <var>encodeOutput</var>. </p> <li> <p>For each <var>byte</var> of <var>encodeOutput</var> converted to a byte sequence: </p> <ol> <li> <p>If <var>spaceAsPlus</var> is true and <var>byte</var> is 0x20 (SP), then append U+002B (+) to <var>output</var> and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue">continue</a>. </p> <li> <p>Let <var>isomorph</var> be a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point③">code point</a> whose <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point-value" id="ref-for-code-point-value">value</a> is <var>byte</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#byte-value" id="ref-for-byte-value">value</a>. </p> <li> <p>Assert: <var>percentEncodeSet</var> includes all non-<a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-code-point" id="ref-for-ascii-code-point">ASCII code points</a>. </p> <li> <p>If <var>isomorph</var> is not in <var>percentEncodeSet</var>, then append <var>isomorph</var> to <var>output</var>. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="#percent-encode" id="ref-for-percent-encode">percent-encode</a> <var>byte</var> and append the result to <var>output</var>. </p> </ol> <li> <p>If <var>potentialError</var> is non-null, then append "<code>%26%23</code>", followed by the shortest sequence of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit①">ASCII digits</a> representing <var>potentialError</var> in base ten, followed by "<code>%3B</code>", to <var>output</var>. </p> <p class="note" role="note">This can happen when <var>encoding</var> is not <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8">UTF-8</a>. </p> </ol> <li> <p>Return <var>output</var>. </p> </ol> <p class="note" role="note">Of the possible values for the <var>percentEncodeSet</var> argument only two end up encoding U+0025 (%) and thus give “roundtripable data”: <a data-link-type="dfn" href="#component-percent-encode-set" id="ref-for-component-percent-encode-set①">component percent-encode set</a> and <a data-link-type="dfn" href="#application-x-www-form-urlencoded-percent-encode-set" id="ref-for-application-x-www-form-urlencoded-percent-encode-set①"><code>application/x-www-form-urlencoded</code> percent-encode set</a>. The other values for the <var>percentEncodeSet</var> argument — which happen to be used by the <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser">URL parser</a> — leave U+0025 (%) untouched and as such it needs to be <a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode">percent-encoded</a> first in order to be properly represented. </p> </div> <div class="algorithm" data-algorithm="UTF-8 percent-encode" data-algorithm-for="code point"> <p>To <dfn class="dfn-paneled" data-dfn-for="code point" data-dfn-type="dfn" data-noexport id="utf-8-percent-encode">UTF-8 percent-encode</dfn> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value" id="ref-for-scalar-value">scalar value</a> <var>scalarValue</var> using a <var>percentEncodeSet</var>, return the result of running <a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding">percent-encode after encoding</a> with <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8①">UTF-8</a>, <var>scalarValue</var> as a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string③">string</a>, and <var>percentEncodeSet</var>. </p> </div> <div class="algorithm" data-algorithm="UTF-8 percent-encode" data-algorithm-for="string"> <p>To <dfn class="dfn-paneled" data-dfn-for="string" data-dfn-type="dfn" data-export id="string-utf-8-percent-encode">UTF-8 percent-encode</dfn> a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string②">scalar value string</a> <var>input</var> using a <var>percentEncodeSet</var>, return the result of running <a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding①">percent-encode after encoding</a> with <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8②">UTF-8</a>, <var>input</var>, and <var>percentEncodeSet</var>. </p> </div> <hr> <div class="example" id="example-percent-encode-operations"> <a class="self-link" href="#example-percent-encode-operations"></a> <p>Here is a summary, by way of example, of the operations defined above: </p> <table> <tbody> <tr> <th>Operation <th>Input <th>Output <tr> <td rowspan="2"><a data-link-type="dfn" href="#percent-encode" id="ref-for-percent-encode①">Percent-encode</a> <var>input</var> <td>0x23 <td>"<code>%23</code>" <tr> <td>0x7F <td>"<code>%7F</code>" <tr> <td><a data-link-type="dfn" href="#percent-decode" id="ref-for-percent-decode①">Percent-decode</a> <var>input</var> <td>`<code>%25%s%1G</code>` <td>`<code>%%s%1G</code>` <tr> <td><a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode③">Percent-decode</a> <var>input</var> <td>"<code>‽%25%2E</code>" <td>0xE2 0x80 0xBD 0x25 0x2E <tr> <td rowspan="3"><a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding②">Percent-encode after encoding</a> with <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#shift_jis" id="ref-for-shift_jis">Shift_JIS</a>, <var>input</var>, and the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set①">userinfo percent-encode set</a> <td>"<code> </code>" <td>"<code>%20</code>" <tr> <td>"<code>≡</code>" <td>"<code>%81%DF</code>" <tr> <td>"<code>‽</code>" <td>"<code>%26%238253%3B</code>" <tr> <td><a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding③">Percent-encode after encoding</a> with <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#iso-2022-jp" id="ref-for-iso-2022-jp">ISO-2022-JP</a>, <var>input</var>, and the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set②">userinfo percent-encode set</a> <td>"<code>¥</code>" <td>"<code>%1B(J\%1B(B</code>" <tr> <td><a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding④">Percent-encode after encoding</a> with <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#shift_jis" id="ref-for-shift_jis①">Shift_JIS</a>, <var>input</var>, the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set③">userinfo percent-encode set</a>, and true <td>"<code>1+1 ≡ 2%20‽</code>" <td>"<code>1+1+%81%DF+2%20%26%238253%3B</code>" <tr> <td rowspan="2"><a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode①">UTF-8 percent-encode</a> <var>input</var> using the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set④">userinfo percent-encode set</a> <td>U+2261 (≡) <td>"<code>%E2%89%A1</code>" <tr> <td>U+203D (‽) <td>"<code>%E2%80%BD</code>" <tr> <td><a data-link-type="dfn" href="#string-utf-8-percent-encode" id="ref-for-string-utf-8-percent-encode①">UTF-8 percent-encode</a> <var>input</var> using the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set⑤">userinfo percent-encode set</a> <td>"<code>Say what‽</code>" <td>"<code>Say%20what%E2%80%BD</code>" </table> </div> <h2 class="heading settled" data-level="2" id="security-considerations"><span class="secno">2. </span><span class="content">Security considerations</span><a class="self-link" href="#security-considerations"></a></h2> <p>The security of a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①">URL</a> is a function of its environment. Care is to be taken when rendering, interpreting, and passing <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②">URLs</a> around. </p> <p>When rendering and allocating new <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③">URLs</a> "spoofing" needs to be considered. An attack whereby one <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host②">host</a> or <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④">URL</a> can be confused for another. For instance, consider how 1/l/I, m/rn/rri, 0/O, and а/a can all appear eerily similar. Or worse, consider how U+202A LEFT-TO-RIGHT EMBEDDING and similar <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point④">code points</a> are invisible. <a data-link-type="biblio" href="#biblio-utr36" title="Unicode Security Considerations">[UTR36]</a> </p> <p>When passing a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤">URL</a> from party <var>A</var> to <var>B</var>, both need to carefully consider what is happening. <var>A</var> might end up leaking data it does not want to leak. <var>B</var> might receive input it did not expect and take an action that harms the user. In particular, <var>B</var> should never trust <var>A</var>, as at some point <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥">URLs</a> from <var>A</var> can come from untrusted sources. </p> <h2 class="heading settled" data-level="3" id="hosts-(domains-and-ip-addresses)"><span class="secno">3. </span><span class="content">Hosts (domains and IP addresses)</span><a class="self-link" href="#hosts-(domains-and-ip-addresses)"></a></h2> <p>At a high level, a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host③">host</a>, <a data-link-type="dfn" href="#valid-host-string" id="ref-for-valid-host-string">valid host string</a>, <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser①">host parser</a>, and <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer">host serializer</a> relate as follows: </p> <ul> <li> <p>The <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser②">host parser</a> takes an arbitrary <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string③">scalar value string</a> and returns either failure or a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host④">host</a>. </p> <li> <p>A <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host⑤">host</a> can be seen as the in-memory representation. </p> <li> <p>A <a data-link-type="dfn" href="#valid-host-string" id="ref-for-valid-host-string①">valid host string</a> defines what input would not trigger a <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②">validation error</a> or failure when given to the <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser③">host parser</a>. I.e., input that would be considered conforming or valid. </p> <li> <p>The <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer①">host serializer</a> takes a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host⑥">host</a> and returns an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string">ASCII string</a>. (If that string is then <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser④">parsed</a>, the result will <a data-link-type="dfn" href="#concept-host-equals" id="ref-for-concept-host-equals">equal</a> the <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host⑦">host</a> that was <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer②">serialized</a>.) </p> </ul> <div class="example" id="example-host-parsing"> <a class="self-link" href="#example-host-parsing"></a> <p>A <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser⑤">parse</a>-<a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer③">serialize</a> roundtrip gives the following results, depending on the <var>isOpaque</var> argument to the <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser⑥">host parser</a>: </p> <table> <tbody> <tr> <th>Input <th>Output (<var>isOpaque</var> = false) <th>Output (<var>isOpaque</var> = true) <tr> <td><code>EXAMPLE.COM</code> <td rowspan="2"><code>example.com</code> (<a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain">domain</a>) <td><code>EXAMPLE.COM</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host②">opaque host</a>) <tr> <td><code>example%2Ecom</code> <td><code>example%2Ecom</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host③">opaque host</a>) <tr> <td><code>faß.example</code> <td><code>xn--fa-hia.example</code> (<a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain①">domain</a>) <td><code>fa%C3%9F.example</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host④">opaque host</a>) <tr> <td><code>0</code> <td rowspan="3"><code>0.0.0.0</code> (<a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4⑨">IPv4</a>) <td><code>0</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host⑤">opaque host</a>) <tr> <td><code>%30</code> <td><code>%30</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host⑥">opaque host</a>) <tr> <td><code>0x</code> <td><code>0x</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host⑦">opaque host</a>) <tr> <td><code>0xffffffff</code> <td><code>255.255.255.255</code> (<a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①⓪">IPv4</a>) <td><code>0xffffffff</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host⑧">opaque host</a>) <tr> <td><code>[0:0::1]</code> <td colspan="2"><code>[::1]</code> (<a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①⓪">IPv6</a>) <tr> <td><code>[0:0::1%5D</code> <td colspan="2" rowspan="2">Failure <tr> <td><code>[0:0::%31]</code> <tr> <td><code>09</code> <td rowspan="3">Failure <td><code>09</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host⑨">opaque host</a>) <tr> <td><code>example.255</code> <td><code>example.255</code> (<a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①⓪">opaque host</a>) <tr> <td><code>example^example</code> <td>Failure </table> </div> <h3 class="heading settled" data-level="3.1" id="host-representation"><span class="secno">3.1. </span><span class="content">Host representation</span><a class="self-link" href="#host-representation"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-host">host</dfn> is a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain②">domain</a>, an <a data-link-type="dfn" href="#ip-address" id="ref-for-ip-address">IP address</a>, an <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①①">opaque host</a>, or an <a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host">empty host</a>. Typically a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host⑧">host</a> serves as a network address, but it is sometimes used as opaque identifier in <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑦">URLs</a> where a network address is not necessary. </p> <p class="example" id="example-opaque-host-url"><a class="self-link" href="#example-opaque-host-url"></a>A typical <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑧">URL</a> whose <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host">host</a> is an <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①②">opaque host</a> is <code>git://github.com/whatwg/url.git</code>. </p> <p class="note" role="note">The RFCs referenced in the paragraphs below are for informative purposes only. They have no influence on <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host⑨">host</a> writing, parsing, and serialization. Unless stated otherwise in the sections that follow. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-domain">domain</dfn> is a non-empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①">ASCII string</a> that identifies a realm within a network. <a data-link-type="biblio" href="#biblio-rfc1034" title="Domain names - concepts and facilities">[RFC1034]</a> </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="domain label" id="domain-label">domain labels</dfn> of a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain③">domain</a> <var>domain</var> are the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split">strictly splitting</a> <var>domain</var> on U+002E (.). </p> <p class="note" role="note">The <code>example.com</code> and <code>example.com.</code> <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain④">domains</a> are not equivalent and typically treated as distinct. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="ip-address">IP address</dfn> is an <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①①">IPv4 address</a> or an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①①">IPv6 address</a>. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-ipv4">IPv4 address</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#32-bit-unsigned-integer" id="ref-for-32-bit-unsigned-integer">32-bit unsigned integer</a> that identifies a network address. <a data-link-type="biblio" href="#biblio-rfc791" title="Internet Protocol">[RFC791]</a> </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-ipv6">IPv6 address</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#128-bit-unsigned-integer" id="ref-for-128-bit-unsigned-integer">128-bit unsigned integer</a> that identifies a network address. This integer is composed of a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list">list</a> of 8 <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#16-bit-unsigned-integer" id="ref-for-16-bit-unsigned-integer">16-bit unsigned integers</a>, also known as an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①②">IPv6 address</a>’s <dfn class="dfn-paneled" data-dfn-for="IPv6 address" data-dfn-type="dfn" data-export id="concept-ipv6-piece">pieces</dfn>. <a data-link-type="biblio" href="#biblio-rfc4291" title="IP Version 6 Addressing Architecture">[RFC4291]</a> </p> <p class="note" role="note">Support for <code>&lt;zone_id></code> is <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27234#c2">intentionally omitted</a>. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="opaque-host">opaque host</dfn> is a non-empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string②">ASCII string</a> that can be used for further processing. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="empty-host">empty host</dfn> is the empty string. </p> <h3 class="heading settled" data-level="3.2" id="host-miscellaneous"><span class="secno">3.2. </span><span class="content">Host miscellaneous</span><a class="self-link" href="#host-miscellaneous"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="forbidden-host-code-point">forbidden host code point</dfn> is U+0000 NULL, U+0009 TAB, U+000A LF, U+000D CR, U+0020 SPACE, U+0023 (#), U+002F (/), U+003A (:), U+003C (&lt;), U+003E (>), U+003F (?), U+0040 (@), U+005B ([), U+005C (\), U+005D (]), U+005E (^), or U+007C (|). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="forbidden-domain-code-point">forbidden domain code point</dfn> is a <a data-link-type="dfn" href="#forbidden-host-code-point" id="ref-for-forbidden-host-code-point①">forbidden host code point</a>, a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#c0-control" id="ref-for-c0-control①">C0 control</a>, U+0025 (%), or U+007F DELETE. </p> <div class="algorithm" data-algorithm="public suffix" data-algorithm-for="host"> <p>To obtain the <dfn class="dfn-paneled" data-dfn-for="host" data-dfn-type="dfn" data-export id="host-public-suffix">public suffix</dfn> of a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①⓪">host</a> <var>host</var>, run these steps. They return null or a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain⑤">domain</a> representing a portion of <var>host</var> that is included on the <cite>Public Suffix List</cite>. <a data-link-type="biblio" href="#biblio-psl" title="Public Suffix List">[PSL]</a> </p> <ol> <li> <p>If <var>host</var> is not a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain⑥">domain</a>, then return null. </p> <li> <p>Let <var>trailingDot</var> be "<code>.</code>" if <var>host</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-ends-with" id="ref-for-string-ends-with">ends with</a> "<code>.</code>"; otherwise the empty string. </p> <li> <p>Let <var>publicSuffix</var> be the public suffix determined by running the <a href="https://github.com/publicsuffix/list/wiki/Format#formal-algorithm">Public Suffix List algorithm</a> with <var>host</var> as domain. <a data-link-type="biblio" href="#biblio-psl" title="Public Suffix List">[PSL]</a> </p> <li> <p>Assert: <var>publicSuffix</var> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string③">ASCII string</a> that does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-ends-with" id="ref-for-string-ends-with①">end with</a> "<code>.</code>". </p> <li> <p>Return <var>publicSuffix</var> and <var>trailingDot</var> concatenated. </p> </ol> </div> <div class="algorithm" data-algorithm="registrable domain" data-algorithm-for="host"> <p>To obtain the <dfn class="dfn-paneled" data-dfn-for="host" data-dfn-type="dfn" data-export id="host-registrable-domain">registrable domain</dfn> of a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①①">host</a> <var>host</var>, run these steps. They return null or a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain⑦">domain</a> formed by <var>host</var>’s <a data-link-type="dfn" href="#host-public-suffix" id="ref-for-host-public-suffix">public suffix</a> and the <a data-link-type="dfn" href="#domain-label" id="ref-for-domain-label">domain label</a> preceding it, if any. </p> <ol> <li> <p>If <var>host</var>’s <a data-link-type="dfn" href="#host-public-suffix" id="ref-for-host-public-suffix①">public suffix</a> is null or <var>host</var>’s <a data-link-type="dfn" href="#host-public-suffix" id="ref-for-host-public-suffix②">public suffix</a> <a data-link-type="dfn" href="#concept-host-equals" id="ref-for-concept-host-equals①">equals</a> <var>host</var>, then return null. </p> <li> <p>Let <var>trailingDot</var> be "<code>.</code>" if <var>host</var> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-ends-with" id="ref-for-string-ends-with②">ends with</a> "<code>.</code>"; otherwise the empty string. </p> <li> <p>Let <var>registrableDomain</var> be the registrable domain determined by running the <a href="https://github.com/publicsuffix/list/wiki/Format#formal-algorithm">Public Suffix List algorithm</a> with <var>host</var> as domain. <a data-link-type="biblio" href="#biblio-psl" title="Public Suffix List">[PSL]</a> </p> <li> <p>Assert: <var>registrableDomain</var> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string④">ASCII string</a> that does not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-ends-with" id="ref-for-string-ends-with③">end with</a> "<code>.</code>". </p> <li> <p>Return <var>registrableDomain</var> and <var>trailingDot</var> concatenated. </p> </ol> </div> <div class="example" id="example-host-psl"> <a class="self-link" href="#example-host-psl"></a> <table> <tbody> <tr> <th>Host input <th>Public suffix <th>Registrable domain <tr> <td><code>com</code> <td><code>com</code> <td>null <tr> <td><code>example.com</code> <td><code>com</code> <td><code>example.com</code> <tr> <td><code>www.example.com</code> <td><code>com</code> <td><code>example.com</code> <tr> <td><code>sub.www.example.com</code> <td><code>com</code> <td><code>example.com</code> <tr> <td><code>EXAMPLE.COM</code> <td><code>com</code> <td><code>example.com</code> <tr> <td><code>example.com.</code> <td><code>com.</code> <td><code>example.com.</code> <tr> <td><code>github.io</code> <td><code>github.io</code> <td>null <tr> <td><code>whatwg.github.io</code> <td><code>github.io</code> <td><code>whatwg.github.io</code> <tr> <td><code>إختبار</code> <td><code>xn--kgbechtv</code> <td>null <tr> <td><code>example.إختبار</code> <td><code>xn--kgbechtv</code> <td><code>example.xn--kgbechtv</code> <tr> <td><code>sub.example.إختبار</code> <td><code>xn--kgbechtv</code> <td><code>example.xn--kgbechtv</code> <tr> <td><code>[2001:0db8:85a3:0000:0000:8a2e:0370:7334]</code> <td>null <td>null </table> </div> <p class="warning" id="warning-avoid-psl">Specifications should prefer the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin" id="ref-for-concept-origin">origin</a> concept for security decisions. The notion of "<a data-link-type="dfn" href="#host-public-suffix" id="ref-for-host-public-suffix③">public suffix</a>" and "<a data-link-type="dfn" href="#host-registrable-domain" id="ref-for-host-registrable-domain">registrable domain</a>" cannot be relied-upon to provide a hard security boundary, as the public suffix list will diverge from client to client. Specifications which ignore this advice are encouraged to carefully consider whether URLs' schemes ought to be incorporated into any decisions made, i.e. whether to use the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#same-site" id="ref-for-same-site">same site</a> or <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site" id="ref-for-schemelessly-same-site">schemelessly same site</a> concepts. </p> <h3 class="heading settled" data-level="3.3" id="idna"><span class="secno">3.3. </span><span class="content">IDNA</span><a class="self-link" href="#idna"></a></h3> <div class="algorithm" data-algorithm="domain to ASCII"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-domain-to-ascii">domain to ASCII</dfn> algorithm, given a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string" id="ref-for-string④">string</a> <var>domain</var> and a boolean <var>beStrict</var>, runs these steps: </p> <ol> <li> <p>Let <var>result</var> be the result of running <a data-link-type="abstract-op" href="https://www.unicode.org/reports/tr46/#ToASCII" id="ref-for-ToASCII②">Unicode ToASCII</a> with <i>domain_name</i> set to <var>domain</var>, <i>UseSTD3ASCIIRules</i> set to <var>beStrict</var>, <i>CheckHyphens</i> set to false, <i>CheckBidi</i> set to true, <i>CheckJoiners</i> set to true, <i>Transitional_Processing</i> set to false, and <i>VerifyDnsLength</i> set to <var>beStrict</var>. <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> </p> <p class="note" role="note">If <var>beStrict</var> is false, <var>domain</var> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string⑤">ASCII string</a>, and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split①">strictly splitting</a> <var>domain</var> on U+002E (.) does not produce any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item">item</a> that <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-starts-with" id="ref-for-string-starts-with">starts with</a> an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive">ASCII case-insensitive</a> match for "<code>xn--</code>", this step is equivalent to <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-lowercase" id="ref-for-ascii-lowercase">ASCII lowercasing</a> <var>domain</var>. </p> <li> <p>If <var>result</var> is a failure value, <a data-link-type="dfn" href="#validation-error-domain-to-ascii" id="ref-for-validation-error-domain-to-ascii①">domain-to-ASCII</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③">validation error</a>, return failure. </p> <li> <p>If <var>result</var> is the empty string, <a data-link-type="dfn" href="#validation-error-domain-to-ascii" id="ref-for-validation-error-domain-to-ascii②">domain-to-ASCII</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④">validation error</a>, return failure. </p> <li> <p>Return <var>result</var>. </p> </ol> <p class="note" role="note">This document and the web platform at large use <cite>Unicode IDNA Compatibility Processing</cite> and not IDNA2008. For instance, <code>☕.example</code> becomes <code>xn--53h.example</code> and not failure. <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> <a data-link-type="biblio" href="#biblio-rfc5890" title="Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework">[RFC5890]</a> </p> </div> <div class="algorithm" data-algorithm="domain to Unicode"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-domain-to-unicode">domain to Unicode</dfn> algorithm, given a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain⑧">domain</a> <var>domain</var> and a boolean <var>beStrict</var>, runs these steps: </p> <ol> <li> <p>Let <var>result</var> be the result of running <a data-link-type="abstract-op" href="https://www.unicode.org/reports/tr46/#ToUnicode" id="ref-for-ToUnicode①">Unicode ToUnicode</a> with <i>domain_name</i> set to <var>domain</var>, <i>CheckHyphens</i> set to false, <i>CheckBidi</i> set to true, <i>CheckJoiners</i> set to true, <i>UseSTD3ASCIIRules</i> set to <var>beStrict</var>, and <i>Transitional_Processing</i> set to false. <a data-link-type="biblio" href="#biblio-uts46" title="Unicode IDNA Compatibility Processing">[UTS46]</a> </p> <li> <p>Signify <a data-link-type="dfn" href="#domain-to-unicode" id="ref-for-domain-to-unicode">domain-to-Unicode</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤">validation errors</a> for any returned errors, and then, return <var>result</var>. </p> </ol> </div> <h3 class="heading settled" data-level="3.4" id="host-writing"><span class="secno">3.4. </span><span class="content">Host writing</span><span id="host-syntax"></span><a class="self-link" href="#host-writing"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-host-string">valid host string<span id="syntax-host"></span></dfn> must be a <a data-link-type="dfn" href="#valid-domain-string" id="ref-for-valid-domain-string">valid domain string</a>, a <a data-link-type="dfn" href="#valid-ipv4-address-string" id="ref-for-valid-ipv4-address-string">valid IPv4-address string</a>, or: U+005B ([), followed by a <a data-link-type="dfn" href="#valid-ipv6-address-string" id="ref-for-valid-ipv6-address-string">valid IPv6-address string</a>, followed by U+005D (]). </p> <p>A <var>domain</var> is a <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="valid-domain">valid domain</dfn> if these steps return success: </p> <ol> <li> <p>Let <var>result</var> be the result of running <a data-link-type="dfn" href="#concept-domain-to-ascii" id="ref-for-concept-domain-to-ascii">domain to ASCII</a> with <var>domain</var> and true. </p> <li> <p>If <var>result</var> is failure, then return failure. </p> <li> <p>Set <var>result</var> to the result of running <a data-link-type="dfn" href="#concept-domain-to-unicode" id="ref-for-concept-domain-to-unicode">domain to Unicode</a> with <var>result</var> and true. </p> <li> <p>If <var>result</var> contains any errors, return failure. </p> <li> <p>Return success. </p> </ol> <p class="XXX">Ideally we define this in terms of a sequence of code points that make up a <a data-link-type="dfn" href="#valid-domain" id="ref-for-valid-domain">valid domain</a> rather than through a whack-a-mole: <a href="https://github.com/whatwg/url/issues/245">issue 245</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-domain-string">valid domain string<span id="syntax-host-domain"></span></dfn> must be a string that is a <a data-link-type="dfn" href="#valid-domain" id="ref-for-valid-domain①">valid domain</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-ipv4-address-string">valid IPv4-address string<span id="syntax-host-ipv4"></span></dfn> must be four shortest possible strings of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit②">ASCII digits</a>, representing a decimal number in the range 0 to 255, inclusive, separated from each other by U+002E (.). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-ipv6-address-string">valid IPv6-address string<span id="syntax-host-ipv6"></span></dfn> is defined in the <a href="https://tools.ietf.org/html/rfc4291#section-2.2">"Text Representation of Addresses" chapter of IP Version 6 Addressing Architecture</a>. <a data-link-type="biblio" href="#biblio-rfc4291" title="IP Version 6 Addressing Architecture">[RFC4291]</a> </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-opaque-host-string">valid opaque-host string</dfn> must be one of the following: </p> <ul class="brief"> <li> <p>one or more <a data-link-type="dfn" href="#url-units" id="ref-for-url-units①">URL units</a> excluding <a data-link-type="dfn" href="#forbidden-host-code-point" id="ref-for-forbidden-host-code-point②">forbidden host code points</a> </p> <li> <p>U+005B ([), followed by a <a data-link-type="dfn" href="#valid-ipv6-address-string" id="ref-for-valid-ipv6-address-string①">valid IPv6-address string</a>, followed by U+005D (]). </p> </ul> <p class="note" role="note">This is not part of the definition of <a data-link-type="dfn" href="#valid-host-string" id="ref-for-valid-host-string②">valid host string</a> as it requires context to be distinguished. </p> <h3 class="heading settled" data-level="3.5" id="host-parsing"><span class="secno">3.5. </span><span class="content">Host parsing</span><a class="self-link" href="#host-parsing"></a></h3> <div class="algorithm" data-algorithm="host parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="host parser|host parsing" id="concept-host-parser">host parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string④">scalar value string</a> <var>input</var> with an optional boolean <var>isOpaque</var> (default false), and then runs these steps. They return failure or a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①②">host</a>. </p> <ol> <li> <p>If <var>input</var> starts with U+005B ([), then: </p> <ol> <li> <p>If <var>input</var> does not end with U+005D (]), <a data-link-type="dfn" href="#ipv6-unclosed" id="ref-for-ipv6-unclosed">IPv6-unclosed</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑥">validation error</a>, return failure. </p> <li> <p>Return the result of <a data-link-type="dfn" href="#concept-ipv6-parser" id="ref-for-concept-ipv6-parser">IPv6 parsing</a> <var>input</var> with its leading U+005B ([) and trailing U+005D (]) removed. </p> </ol> <li> <p>If <var>isOpaque</var> is true, then return the result of <a data-link-type="dfn" href="#concept-opaque-host-parser" id="ref-for-concept-opaque-host-parser">opaque-host parsing</a> <var>input</var>. </p> <li> <p>Assert: <var>input</var> is not the empty string. </p> <li> <p>Let <var>domain</var> be the result of running <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom①">UTF-8 decode without BOM</a> on the <a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode④">percent-decoding</a> of <var>input</var>. </p> <p class="note" role="note">Alternatively <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail" id="ref-for-utf-8-decode-without-bom-or-fail①">UTF-8 decode without BOM or fail</a> can be used, coupled with an early return for failure, as <a data-link-type="dfn" href="#concept-domain-to-ascii" id="ref-for-concept-domain-to-ascii①">domain to ASCII</a> fails on U+FFFD (�). </p> <li> <p>Let <var>asciiDomain</var> be the result of running <a data-link-type="dfn" href="#concept-domain-to-ascii" id="ref-for-concept-domain-to-ascii②">domain to ASCII</a> with <var>domain</var> and false. </p> <li> <p>If <var>asciiDomain</var> is failure, then return failure. </p> <li> <p>If <var>asciiDomain</var> contains a <a data-link-type="dfn" href="#forbidden-domain-code-point" id="ref-for-forbidden-domain-code-point①">forbidden domain code point</a>, <a data-link-type="dfn" href="#domain-invalid-code-point" id="ref-for-domain-invalid-code-point">domain-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑦">validation error</a>, return failure. </p> <li> <p>If <var>asciiDomain</var> <a data-link-type="dfn" href="#ends-in-a-number-checker" id="ref-for-ends-in-a-number-checker">ends in a number</a>, then return the result of <a data-link-type="dfn" href="#concept-ipv4-parser" id="ref-for-concept-ipv4-parser">IPv4 parsing</a> <var>asciiDomain</var>. </p> <li> <p>Return <var>asciiDomain</var>. </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="ends in a number checker"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ends-in-a-number-checker">ends in a number checker</dfn> takes an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string⑥">ASCII string</a> <var>input</var> and then runs these steps. They return a boolean. </p> <ol> <li> <p>Let <var>parts</var> be the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split②">strictly splitting</a> <var>input</var> on U+002E (.). </p> <li> <p>If the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item①">item</a> in <var>parts</var> is the empty string, then: </p> <ol> <li> <p>If <var>parts</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size">size</a> is 1, then return false. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove">Remove</a> the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item②">item</a> from <var>parts</var>. </p> </ol> <li> <p>Let <var>last</var> be the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item③">item</a> in <var>parts</var>. </p> <li> <p>If <var>last</var> is non-empty and contains only <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit③">ASCII digits</a>, then return true. </p> <p class="note" role="note">The erroneous input "<code>09</code>" will be caught by the <a data-link-type="dfn" href="#concept-ipv4-parser" id="ref-for-concept-ipv4-parser①">IPv4 parser</a> at a later stage. </p> <li> <p>If parsing <var>last</var> as an <a data-link-type="dfn" href="#ipv4-number-parser" id="ref-for-ipv4-number-parser">IPv4 number</a> does not return failure, then return true. </p> <p class="note" role="note">This is equivalent to checking that <var>last</var> is "<code>0X</code>" or "<code>0x</code>", followed by zero or more <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit②">ASCII hex digits</a>. </p> <li> <p>Return false. </p> </ol> </div> <div class="algorithm" data-algorithm="IPv4 parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-ipv4-parser">IPv4 parser</dfn> takes an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string⑦">ASCII string</a> <var>input</var> and then runs these steps. They return failure or an <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①②">IPv4 address</a>. </p> <p class="note" role="note">The <a data-link-type="dfn" href="#concept-ipv4-parser" id="ref-for-concept-ipv4-parser②">IPv4 parser</a> is not to be invoked directly. Instead check that the return value of the <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser⑦">host parser</a> is an <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①③">IPv4 address</a>. </p> <ol> <li> <p>Let <var>parts</var> be the result of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#strictly-split" id="ref-for-strictly-split③">strictly splitting</a> <var>input</var> on U+002E (.). </p> <li> <p>If the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item④">item</a> in <var>parts</var> is the empty string, then: </p> <ol> <li> <p><a data-link-type="dfn" href="#ipv4-empty-part" id="ref-for-ipv4-empty-part">IPv4-empty-part</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑧">validation error</a>. </p> <li> <p>If <var>parts</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size①">size</a> is greater than 1, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove①">remove</a> the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑤">item</a> from <var>parts</var>. </p> </ol> <li> <p>If <var>parts</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size②">size</a> is greater than 4, <a data-link-type="dfn" href="#ipv4-too-many-parts" id="ref-for-ipv4-too-many-parts">IPv4-too-many-parts</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑨">validation error</a>, return failure. </p> <li> <p>Let <var>numbers</var> be an empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list①">list</a>. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate">For each</a> <var>part</var> of <var>parts</var>: </p> <ol> <li> <p>Let <var>result</var> be the result of <a data-link-type="dfn" href="#ipv4-number-parser" id="ref-for-ipv4-number-parser①">parsing</a> <var>part</var>. </p> <li> <p>If <var>result</var> is failure, <a data-link-type="dfn" href="#ipv4-non-numeric-part" id="ref-for-ipv4-non-numeric-part">IPv4-non-numeric-part</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⓪">validation error</a>, return failure. </p> <li> <p>If <var>result</var>[1] is true, <a data-link-type="dfn" href="#ipv4-non-decimal-part" id="ref-for-ipv4-non-decimal-part">IPv4-non-decimal-part</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①①">validation error</a>. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append">Append</a> <var>result</var>[0] to <var>numbers</var>. </p> </ol> <li> <p>If any item in <var>numbers</var> is greater than 255, <a data-link-type="dfn" href="#ipv4-out-of-range-part" id="ref-for-ipv4-out-of-range-part">IPv4-out-of-range-part</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①②">validation error</a>. </p> <li> <p>If any but the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑥">item</a> in <var>numbers</var> is greater than 255, then return failure. </p> <li> <p>If the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑦">item</a> in <var>numbers</var> is greater than or equal to 256<sup>(5 − <var>numbers</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size③">size</a>)</sup>, then return failure. </p> <li> <p>Let <var>ipv4</var> be the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑧">item</a> in <var>numbers</var>. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove②">Remove</a> the last <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-item" id="ref-for-list-item⑨">item</a> from <var>numbers</var>. </p> <li> <p>Let <var>counter</var> be 0. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate①">For each</a> <var>n</var> of <var>numbers</var>: </p> <ol> <li> <p>Increment <var>ipv4</var> by <var>n</var> × 256<sup>(3 − <var>counter</var>)</sup>. </p> <li> <p>Increment <var>counter</var> by 1. </p> </ol> <li> <p>Return <var>ipv4</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="IPv4 number parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="ipv4-number-parser">IPv4 number parser</dfn> takes an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string⑧">ASCII string</a> <var>input</var> and then runs these steps. They return failure or a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple">tuple</a> of a number and a boolean. </p> <ol> <li> <p>If <var>input</var> is the empty string, then return failure. </p> <li> <p>Let <var>validationError</var> be false. </p> <li> <p>Let <var>R</var> be 10. </p> <li> <p>If <var>input</var> contains at least two code points and the first two code points are either "<code>0X</code>" or "<code>0x</code>", then: </p> <ol> <li> <p>Set <var>validationError</var> to true. </p> <li> <p>Remove the first two code points from <var>input</var>. </p> <li> <p>Set <var>R</var> to 16. </p> </ol> <li> <p>Otherwise, if <var>input</var> contains at least two code points and the first code point is U+0030 (0), then: </p> <ol> <li> <p>Set <var>validationError</var> to true. </p> <li> <p>Remove the first code point from <var>input</var>. </p> <li> <p>Set <var>R</var> to 8. </p> </ol> <li> <p>If <var>input</var> is the empty string, then return (0, true). </p> <li> <p>If <var>input</var> contains a code point that is not a radix-<var>R</var> digit, then return failure. </p> <li> <p>Let <var>output</var> be the mathematical integer value that is represented by <var>input</var> in radix-<var>R</var> notation, using <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit③">ASCII hex digits</a> for digits with values 0 through 15. </p> <li> <p>Return (<var>output</var>, <var>validationError</var>). </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="IPv6 parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-ipv6-parser">IPv6 parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string⑤">scalar value string</a> <var>input</var> and then runs these steps. They return failure or an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①③">IPv6 address</a>. </p> <p class="note" role="note">The <a data-link-type="dfn" href="#concept-ipv6-parser" id="ref-for-concept-ipv6-parser①">IPv6 parser</a> could in theory be invoked directly, but please discuss actually doing that with the editors of this document first. </p> <ol> <li> <p>Let <var>address</var> be a new <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①④">IPv6 address</a> whose <a data-link-type="dfn" href="#concept-ipv6-piece" id="ref-for-concept-ipv6-piece">pieces</a> are all 0. </p> <li> <p>Let <var>pieceIndex</var> be 0. </p> <li> <p>Let <var>compress</var> be null. </p> <li> <p>Let <var>pointer</var> be a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer⑦">pointer</a> for <var>input</var>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤">c</a> is U+003A (:), then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#remaining" id="ref-for-remaining③">remaining</a> does not start with U+003A (:), <a data-link-type="dfn" href="#ipv6-invalid-compression" id="ref-for-ipv6-invalid-compression">IPv6-invalid-compression</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①③">validation error</a>, return failure. </p> <li> <p>Increase <var>pointer</var> by 2. </p> <li> <p>Increase <var>pieceIndex</var> by 1 and then set <var>compress</var> to <var>pieceIndex</var>. </p> </ol> <li> <p>While <a data-link-type="dfn" href="#c" id="ref-for-c⑥">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point③">EOF code point</a>: </p> <ol> <li> <p>If <var>pieceIndex</var> is 8, <a data-link-type="dfn" href="#ipv6-too-many-pieces" id="ref-for-ipv6-too-many-pieces">IPv6-too-many-pieces</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①④">validation error</a>, return failure. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑦">c</a> is U+003A (:), then: </p> <ol> <li> <p>If <var>compress</var> is non-null, <a data-link-type="dfn" href="#ipv6-multiple-compression" id="ref-for-ipv6-multiple-compression">IPv6-multiple-compression</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⑤">validation error</a>, return failure. </p> <li>Increase <var>pointer</var> and <var>pieceIndex</var> by 1, set <var>compress</var> to <var>pieceIndex</var>, and then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue①">continue</a>. </ol> <li> <p>Let <var>value</var> and <var>length</var> be 0. </p> <li> <p>While <var>length</var> is less than 4 and <a data-link-type="dfn" href="#c" id="ref-for-c⑧">c</a> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit④">ASCII hex digit</a>, set <var>value</var> to <var>value</var> × 0x10 + <a data-link-type="dfn" href="#c" id="ref-for-c⑨">c</a> interpreted as hexadecimal number, and increase <var>pointer</var> and <var>length</var> by 1. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c①⓪">c</a> is U+002E (.), then: </p> <ol> <li> <p>If <var>length</var> is 0, <a data-link-type="dfn" href="#ipv4-in-ipv6-invalid-code-point" id="ref-for-ipv4-in-ipv6-invalid-code-point">IPv4-in-IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⑥">validation error</a>, return failure. </p> <li> <p>Decrease <var>pointer</var> by <var>length</var>. </p> <li> <p>If <var>pieceIndex</var> is greater than 6, <a data-link-type="dfn" href="#ipv4-in-ipv6-too-many-pieces" id="ref-for-ipv4-in-ipv6-too-many-pieces">IPv4-in-IPv6-too-many-pieces</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⑦">validation error</a>, return failure. </p> <li> <p>Let <var>numbersSeen</var> be 0. </p> <li> <p>While <a data-link-type="dfn" href="#c" id="ref-for-c①①">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point④">EOF code point</a>: </p> <ol> <li> <p>Let <var>ipv4Piece</var> be null. </p> <li> <p>If <var>numbersSeen</var> is greater than 0, then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c①②">c</a> is a U+002E (.) and <var>numbersSeen</var> is less than 4, then increase <var>pointer</var> by 1. </p> <li>Otherwise, <a data-link-type="dfn" href="#ipv4-in-ipv6-invalid-code-point" id="ref-for-ipv4-in-ipv6-invalid-code-point①">IPv4-in-IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⑧">validation error</a>, return failure. </ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c①③">c</a> is not an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit④">ASCII digit</a>, <a data-link-type="dfn" href="#ipv4-in-ipv6-invalid-code-point" id="ref-for-ipv4-in-ipv6-invalid-code-point②">IPv4-in-IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error①⑨">validation error</a>, return failure. </p> <li> <p>While <a data-link-type="dfn" href="#c" id="ref-for-c①④">c</a> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit⑤">ASCII digit</a>: </p> <ol> <li> <p>Let <var>number</var> be <a data-link-type="dfn" href="#c" id="ref-for-c①⑤">c</a> interpreted as decimal number. </p> <li> <p>If <var>ipv4Piece</var> is null, then set <var>ipv4Piece</var> to <var>number</var>. </p> <p>Otherwise, if <var>ipv4Piece</var> is 0, <a data-link-type="dfn" href="#ipv4-in-ipv6-invalid-code-point" id="ref-for-ipv4-in-ipv6-invalid-code-point③">IPv4-in-IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⓪">validation error</a>, return failure. </p> <p>Otherwise, set <var>ipv4Piece</var> to <var>ipv4Piece</var> × 10 + <var>number</var>. </p> <li> <p>If <var>ipv4Piece</var> is greater than 255, <a data-link-type="dfn" href="#ipv4-in-ipv6-out-of-range-part" id="ref-for-ipv4-in-ipv6-out-of-range-part">IPv4-in-IPv6-out-of-range-part</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②①">validation error</a>, return failure. </p> <li> <p>Increase <var>pointer</var> by 1. </p> </ol> <li> <p>Set <var>address</var>[<var>pieceIndex</var>] to <var>address</var>[<var>pieceIndex</var>] × 0x100 + <var>ipv4Piece</var>. </p> <li> <p>Increase <var>numbersSeen</var> by 1. </p> <li> <p>If <var>numbersSeen</var> is 2 or 4, then increase <var>pieceIndex</var> by 1. </p> </ol> <li> <p>If <var>numbersSeen</var> is not 4, <a data-link-type="dfn" href="#ipv4-in-ipv6-too-few-parts" id="ref-for-ipv4-in-ipv6-too-few-parts">IPv4-in-IPv6-too-few-parts</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②②">validation error</a>, return failure. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-break" id="ref-for-iteration-break">Break</a>. </p> </ol> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c①⑥">c</a> is U+003A (:): </p> <ol> <li> <p>Increase <var>pointer</var> by 1. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c①⑦">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point⑤">EOF code point</a>, <a data-link-type="dfn" href="#ipv6-invalid-code-point" id="ref-for-ipv6-invalid-code-point">IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②③">validation error</a>, return failure. </p> </ol> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c①⑧">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point⑥">EOF code point</a>, <a data-link-type="dfn" href="#ipv6-invalid-code-point" id="ref-for-ipv6-invalid-code-point①">IPv6-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②④">validation error</a>, return failure. </p> <li> <p>Set <var>address</var>[<var>pieceIndex</var>] to <var>value</var>. </p> <li> <p>Increase <var>pieceIndex</var> by 1. </p> </ol> <li> <p>If <var>compress</var> is non-null, then: </p> <ol> <li> <p>Let <var>swaps</var> be <var>pieceIndex</var> − <var>compress</var>. </p> <li> <p>Set <var>pieceIndex</var> to 7. </p> <li> <p>While <var>pieceIndex</var> is not 0 and <var>swaps</var> is greater than 0, swap <var>address</var>[<var>pieceIndex</var>] with <var>address</var>[<var>compress</var> + <var>swaps</var> − 1], and then decrease both <var>pieceIndex</var> and <var>swaps</var> by 1. </p> </ol> <li> <p>Otherwise, if <var>compress</var> is null and <var>pieceIndex</var> is not 8, <a data-link-type="dfn" href="#ipv6-too-few-pieces" id="ref-for-ipv6-too-few-pieces">IPv6-too-few-pieces</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⑤">validation error</a>, return failure. </p> <li> <p>Return <var>address</var>. </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="opaque-host parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-opaque-host-parser">opaque-host parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string⑥">scalar value string</a> <var>input</var>, and then runs these steps. They return failure or an <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①③">opaque host</a>. </p> <ol> <li> <p>If <var>input</var> contains a <a data-link-type="dfn" href="#forbidden-host-code-point" id="ref-for-forbidden-host-code-point③">forbidden host code point</a>, <a data-link-type="dfn" href="#host-invalid-code-point" id="ref-for-host-invalid-code-point">host-invalid-code-point</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⑥">validation error</a>, return failure. </p> <li> <p>If <var>input</var> contains a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑤">code point</a> that is not a <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points">URL code point</a> and not U+0025 (%), <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⑦">validation error</a>. </p> <li> <p>If <var>input</var> contains a U+0025 (%) and the two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑥">code points</a> following it are not <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit⑤">ASCII hex digits</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit①">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⑧">validation error</a>. </p> <li> <p>Return the result of running <a data-link-type="dfn" href="#string-utf-8-percent-encode" id="ref-for-string-utf-8-percent-encode②">UTF-8 percent-encode</a> on <var>input</var> using the <a data-link-type="dfn" href="#c0-control-percent-encode-set" id="ref-for-c0-control-percent-encode-set②">C0 control percent-encode set</a>. </p> </ol> </div> <h3 class="heading settled" data-level="3.6" id="host-serializing"><span class="secno">3.6. </span><span class="content">Host serializing</span><a class="self-link" href="#host-serializing"></a></h3> <div class="algorithm" data-algorithm="host serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-host-serializer">host serializer</dfn> takes a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①③">host</a> <var>host</var> and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string⑨">ASCII string</a>. </p> <ol> <li> <p>If <var>host</var> is an <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①④">IPv4 address</a>, return the result of running the <a data-link-type="dfn" href="#concept-ipv4-serializer" id="ref-for-concept-ipv4-serializer">IPv4 serializer</a> on <var>host</var>. </p> <li> <p>Otherwise, if <var>host</var> is an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①⑤">IPv6 address</a>, return U+005B ([), followed by the result of running the <a data-link-type="dfn" href="#concept-ipv6-serializer" id="ref-for-concept-ipv6-serializer">IPv6 serializer</a> on <var>host</var>, followed by U+005D (]). </p> <li> <p>Otherwise, <var>host</var> is a <a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain⑨">domain</a>, <a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①④">opaque host</a>, or <a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host①">empty host</a>, return <var>host</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="IPv4 serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-ipv4-serializer">IPv4 serializer</dfn> takes an <a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①⑤">IPv4 address</a> <var>address</var> and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⓪">ASCII string</a>. </p> <ol> <li> <p>Let <var>output</var> be the empty string. </p> <li> <p>Let <var>n</var> be the value of <var>address</var>. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate②">For each</a> <var>i</var> in the range 1 to 4, inclusive: </p> <ol> <li> <p>Prepend <var>n</var> % 256, <a data-link-type="dfn" href="#serialize-an-integer" id="ref-for-serialize-an-integer">serialized</a>, to <var>output</var>. </p> <li> <p>If <var>i</var> is not 4, then prepend U+002E (.) to <var>output</var>. </p> <li> <p>Set <var>n</var> to floor(<var>n</var> / 256). </p> </ol> <li> <p>Return <var>output</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="IPv6 serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-ipv6-serializer">IPv6 serializer</dfn> takes an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①⑥">IPv6 address</a> <var>address</var> and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①①">ASCII string</a>. </p> <ol> <li> <p>Let <var>output</var> be the empty string. </p> <li> <p>Let <var>compress</var> be the result of <a data-link-type="dfn" href="#find-the-ipv6-address-compressed-piece-index" id="ref-for-find-the-ipv6-address-compressed-piece-index">finding the IPv6 address compressed piece index</a> given <var>address</var>. </p> <li> <p>Let <var>ignore0</var> be false. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate③">For each</a> <var>pieceIndex</var> of <var>address</var>’s <a data-link-type="dfn" href="#concept-ipv6-piece" id="ref-for-concept-ipv6-piece①">pieces</a>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-get-the-indices" id="ref-for-list-get-the-indices">indices</a>: </p> <ol> <li> <p>If <var>ignore0</var> is true and <var>address</var>[<var>pieceIndex</var>] is 0, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue②">continue</a>. </p> <li> <p>Otherwise, if <var>ignore0</var> is true, set <var>ignore0</var> to false. </p> <li> <p>If <var>compress</var> is <var>pieceIndex</var>, then: </p> <ol> <li> <p>Let <var>separator</var> be "<code>::</code>" if <var>pieceIndex</var> is 0; otherwise U+003A (:). </p> <li> <p>Append <var>separator</var> to <var>output</var>. </p> <li> <p>Set <var>ignore0</var> to true and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue③">continue</a>. </p> </ol> <li> <p>Append <var>address</var>[<var>pieceIndex</var>], represented as the shortest possible lowercase hexadecimal number, to <var>output</var>. </p> <li> <p>If <var>pieceIndex</var> is not 7, then append U+003A (:) to <var>output</var>. </p> </ol> <li> <p>Return <var>output</var>. </p> </ol> <p class="note" role="note">This algorithm requires the recommendation from A Recommendation for IPv6 Address Text Representation. <a data-link-type="biblio" href="#biblio-rfc5952" title="A Recommendation for IPv6 Address Text Representation">[RFC5952]</a> </p> </div> <div class="algorithm" data-algorithm="find the IPv6 address compressed piece index"> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="find-the-ipv6-address-compressed-piece-index">find the IPv6 address compressed piece index</dfn> given an <a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①⑦">IPv6 address</a> <var>address</var>: </p> <ol> <li> <p>Let <var>longestIndex</var> be null. </p> <li> <p>Let <var>longestSize</var> be 1. </p> <li> <p>Let <var>foundIndex</var> be null. </p> <li> <p>Let <var>foundSize</var> be 0. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate④">For each</a> <var>pieceIndex</var> of <var>address</var>’s <a data-link-type="dfn" href="#concept-ipv6-piece" id="ref-for-concept-ipv6-piece②">pieces</a>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-get-the-indices" id="ref-for-list-get-the-indices①">indices</a>: </p> <ol> <li> <p>If <var>address</var>’s <a data-link-type="dfn" href="#concept-ipv6-piece" id="ref-for-concept-ipv6-piece③">pieces</a>[<var>pieceIndex</var>] is not 0: </p> <ol> <li> <p>If <var>foundSize</var> is greater than <var>longestSize</var>, then set <var>longestIndex</var> to <var>foundIndex</var> and <var>longestSize</var> to <var>foundSize</var>. </p> <li>Set <var>foundIndex</var> to null. <li>Set <var>foundSize</var> to 0. </ol> <li> <p>Otherwise: </p> <ol> <li> <p>If <var>foundIndex</var> is null, then set <var>foundIndex</var> to <var>pieceIndex</var>. </p> <li> <p>Increment <var>foundSize</var> by 1. </p> </ol> </ol> <li> <p>If <var>foundSize</var> is greater than <var>longestSize</var>, then return <var>foundIndex</var>. </p> <li> <p>Return <var>longestIndex</var>. </p> </ol> <p class="example" id="example-e2b3492e"><a class="self-link" href="#example-e2b3492e"></a>In <code>0:f:0:0:f:f:0:0</code> it would point to the second 0. </p> </div> <h3 class="heading settled" data-level="3.7" id="host-equivalence"><span class="secno">3.7. </span><span class="content">Host equivalence</span><a class="self-link" href="#host-equivalence"></a></h3> <div class="algorithm" data-algorithm="equal" data-algorithm-for="host"> <p>To determine whether a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①④">host</a> <var>A</var> <dfn class="dfn-paneled" data-dfn-for="host" data-dfn-type="dfn" data-export data-lt="equal" id="concept-host-equals">equals</dfn> <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①⑤">host</a> <var>B</var>, return true if <var>A</var> is <var>B</var>, and false otherwise. </p> </div> <p class="XXX">Certificate comparison requires a host equivalence check that ignores the trailing dot of a domain (if any). However, those hosts have also various other facets enforced, such as DNS length, that are not enforced here, as URLs do not enforce them. If anyone has a good suggestion for how to bring these two closer together, or what a good unified model would be, please file an issue. </p> <h2 class="heading settled" data-level="4" id="urls"><span class="secno">4. </span><span class="content">URLs</span><a class="self-link" href="#urls"></a></h2> <p>At a high level, a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑨">URL</a>, <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string">valid URL string</a>, <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser①">URL parser</a>, and <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer">URL serializer</a> relate as follows: </p> <ul> <li> <p>The <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser②">URL parser</a> takes an arbitrary <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string⑦">scalar value string</a> and returns either failure or a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⓪">URL</a>. It might also record zero or more <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error②⑨">validation errors</a>. </p> <li> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①①">URL</a> can be seen as the in-memory representation. </p> <li> <p>A <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string①">valid URL string</a> defines what input would not trigger a <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⓪">validation error</a> or failure when given to the <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser③">URL parser</a>. I.e., input that would be considered conforming or valid. </p> <li> <p>The <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer①">URL serializer</a> takes a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①②">URL</a> and returns an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①②">ASCII string</a>. (If that string is then <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser④">parsed</a>, the result will <a data-link-type="dfn" href="#concept-url-equals" id="ref-for-concept-url-equals">equal</a> the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①③">URL</a> that was <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer②">serialized</a>.) The output of the <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer③">URL serializer</a> is not always a <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string②">valid URL string</a>. </p> </ul> <div class="example" id="example-url-parsing"> <a class="self-link" href="#example-url-parsing"></a> <table> <tbody> <tr> <th>Input <th>Base <th>Valid <th>Output <tr> <td><code>https:example.org</code> <td> <td>❌ <td><code>https://example.org/</code> <tr> <td><code>https://////example.com///</code> <td> <td>❌ <td><code>https://example.com///</code> <tr> <td><code>https://example.com/././foo</code> <td> <td>✅ <td><code>https://example.com/foo</code> <tr> <td><code>hello:world</code> <td><code>https://example.com/</code> <td>✅ <td><code>hello:world</code> <tr> <td><code>https:example.org</code> <td><code>https://example.com/</code> <td>❌ <td><code>https://example.com/example.org</code> <tr> <td><code>\example\..\demo/.\</code> <td><code>https://example.com/</code> <td>❌ <td><code>https://example.com/demo/</code> <tr> <td><code>example</code> <td><code>https://example.com/demo</code> <td>✅ <td><code>https://example.com/example</code> <tr> <td><code>file:///C|/demo</code> <td> <td>❌ <td><code>file:///C:/demo</code> <tr> <td><code>..</code> <td><code>file:///C:/demo</code> <td>✅ <td><code>file:///C:/</code> <tr> <td><code>file://loc%61lhost/</code> <td> <td>✅ <td><code>file:///</code> <tr> <td><code>https://user:password@example.org/</code> <td> <td>❌ <td><code>https://user:password@example.org/</code> <tr> <td><code>https://example.org/foo bar</code> <td> <td>❌ <td><code>https://example.org/foo%20bar</code> <tr> <td><code>https://EXAMPLE.com/../x</code> <td> <td>✅ <td><code>https://example.com/x</code> <tr> <td><code>https://ex ample.org/</code> <td> <td>❌ <td>Failure <tr> <td><code>example</code> <td> <td>❌, due to lack of base <td>Failure <tr> <td><code>https://example.com:demo</code> <td> <td>❌ <td>Failure <tr> <td><code>http://[www.example.com]/</code> <td> <td>❌ <td>Failure <tr> <td><code>https://example.org//</code> <td> <td>✅ <td><code>https://example.org//</code> <tr> <td><code>https://example.com/[]?[]#[]</code> <td> <td>❌ <td><code>https://example.com/[]?[]#[]</code> <tr> <td><code>https://example/%?%#%</code> <td> <td>❌ <td><code>https://example/%?%#%</code> <tr> <td><code>https://example/%25?%25#%25</code> <td> <td>✅ <td><code>https://example/%25?%25#%25</code> </table> <p>The base and output <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①④">URL</a> are represented in <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer④">serialized</a> form for brevity. </p> </div> <h3 class="heading settled" data-level="4.1" id="url-representation"><span class="secno">4.1. </span><span class="content">URL representation</span><a class="self-link" href="#url-representation"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="URL|URL record" id="concept-url">URL</dfn> is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#struct" id="ref-for-struct">struct</a> that represents a universal identifier. To disambiguate from a <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string③">valid URL string</a> it can also be referred to as a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⑤">URL record</a>. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⑥">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-scheme">scheme</dfn> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①③">ASCII string</a> that identifies the type of <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⑦">URL</a> and can be used to dispatch a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⑧">URL</a> for further processing after <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser⑤">parsing</a>. It is initially the empty string. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url①⑨">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-username">username</dfn> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①④">ASCII string</a> identifying a username. It is initially the empty string. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⓪">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-password">password</dfn> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⑤">ASCII string</a> identifying a password. It is initially the empty string. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②①">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-host">host</dfn> is null or a <a data-link-type="dfn" href="#concept-host" id="ref-for-concept-host①⑥">host</a>. It is initially null. </p> <div class="note" role="note"> <p>The following table lists allowed <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②②">URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme④">scheme</a> / <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①">host</a> combinations. </p> <table> <tbody> <tr> <th rowspan="2"><a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme⑤">scheme</a> <th colspan="6"><a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②">host</a> <tr> <th><a data-link-type="dfn" href="#concept-domain" id="ref-for-concept-domain①⓪">domain</a> <th><a data-link-type="dfn" href="#concept-ipv4" id="ref-for-concept-ipv4①⑥">IPv4 address</a> <th><a data-link-type="dfn" href="#concept-ipv6" id="ref-for-concept-ipv6①⑧">IPv6 address</a> <th><a data-link-type="dfn" href="#opaque-host" id="ref-for-opaque-host①⑤">opaque host</a> <th><a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host②">empty host</a> <th>null <tr> <td><a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme②">Special schemes</a> excluding "<code>file</code>" <td>✅ <td>✅ <td>✅ <td>❌ <td>❌ <td>❌ <tr> <td>"<code>file</code>" <td>✅ <td>✅ <td>✅ <td>❌ <td>✅ <td>❌ <tr> <td>Others <td>❌ <td>❌ <td>✅ <td>✅ <td>✅ <td>✅ </table> </div> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②③">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-port">port</dfn> is either null or a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#16-bit-unsigned-integer" id="ref-for-16-bit-unsigned-integer①">16-bit unsigned integer</a> that identifies a networking port. It is initially null. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②④">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-path">path<span id="non-relative-flag"></span><span id="url-cannot-be-a-base-url-flag"></span></dfn> is a <a data-link-type="dfn" href="#url-path" id="ref-for-url-path">URL path</a>, usually identifying a location. It is initially « ». </p> <p class="note" role="note">A <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①">special</a> <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⑤">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①">path</a> is always a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list②">list</a>, i.e., it is never <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path②">opaque</a>. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⑥">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-query">query</dfn> is either null or an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⑥">ASCII string</a>. It is initially null. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⑦">URL</a>’s <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-fragment">fragment</dfn> is either null or an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⑦">ASCII string</a> that can be used for further processing on the resource the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⑧">URL</a>’s other components identify. It is initially null. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url②⑨">URL</a> also has an associated <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-blob-entry">blob URL entry</dfn> that is either null or a <a data-link-type="dfn" href="https://w3c.github.io/FileAPI/#blob-url-entry" id="ref-for-blob-url-entry">blob URL entry</a>. It is initially null. </p> <p class="note" role="note">This is used to support caching the object a "<code>blob</code>" URL refers to as well as its origin. It is important that these are cached as the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⓪">URL</a> might be removed from the <a data-link-type="dfn" href="https://w3c.github.io/FileAPI/#BlobURLStore" id="ref-for-BlobURLStore">blob URL store</a> between parsing and fetching, while fetching will still need to succeed. </p> <div class="example" id="example-url-components"> <a class="self-link" href="#example-url-components"></a> <p>The following table lists how <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string④">valid URL strings</a>, when <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser⑥">parsed</a>, map to a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③①">URL</a>’s components. <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username">Username</a>, <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password">password</a>, and <a data-link-type="dfn" href="#concept-url-blob-entry" id="ref-for-concept-url-blob-entry">blob URL entry</a> are omitted; in the examples below they are the empty string, the empty string, and null, respectively. </p> <table> <tbody> <tr> <th>Input <th><a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme⑥">Scheme</a> <th><a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③">Host</a> <th><a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port">Port</a> <th><a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②">Path</a> <th><a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①">Query</a> <th><a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①">Fragment</a> <tr> <td><code>https://example.com/</code> <td>"<code>https</code>" <td>"<code>example.com</code>" <td>null <td>« the empty string » <td>null <td>null <tr> <td><code>https://localhost:8000/search?q=text#hello</code> <td>"<code>https</code>" <td>"<code>localhost</code>" <td>8000 <td>« "<code>search</code>" » <td>"<code>q=text</code>" <td>"<code>hello</code>" <tr> <td><code>urn:isbn:9780307476463</code> <td>"<code>urn</code>" <td>null <td>null <td>"<code>isbn:9780307476463</code>" <td>null <td>null <tr> <td><code>file:///ada/Analytical%20Engine/README.md </code> <td>"<code>file</code>" <td>null <td>null <td>« "<code>ada</code>", "<code>Analytical%20Engine</code>", "<code>README.md</code>" » <td>null <td>null </table> </div> <hr> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-path">URL path</dfn> is either a <a data-link-type="dfn" href="#url-path-segment" id="ref-for-url-path-segment">URL path segment</a> or a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list③">list</a> of zero or more <a data-link-type="dfn" href="#url-path-segment" id="ref-for-url-path-segment①">URL path segments</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-path-segment">URL path segment</dfn> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⑧">ASCII string</a>. It commonly refers to a directory or a file, but has no predefined meaning. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="single-dot-path-segment">single-dot URL path segment<span id="syntax-url-path-segment-dot"></span></dfn> is a <a data-link-type="dfn" href="#url-path-segment" id="ref-for-url-path-segment②">URL path segment</a> that is "<code>.</code>" or an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive①">ASCII case-insensitive</a> match for "<code>%2e</code>". </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="double-dot-path-segment">double-dot URL path segment<span id="syntax-url-path-segment-dotdot"></span></dfn> is a <a data-link-type="dfn" href="#url-path-segment" id="ref-for-url-path-segment③">URL path segment</a> that is "<code>..</code>" or an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive②">ASCII case-insensitive</a> match for "<code>.%2e</code>", "<code>%2e.</code>", or "<code>%2e%2e</code>". </p> <h3 class="heading settled" data-level="4.2" id="url-miscellaneous"><span class="secno">4.2. </span><span class="content">URL miscellaneous</span><a class="self-link" href="#url-miscellaneous"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="special-scheme">special scheme</dfn> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string①⑨">ASCII string</a> that is listed in the first column of the following table. The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="default-port">default port</dfn> for a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme③">special scheme</a> is listed in the second column on the same row. The <a data-link-type="dfn" href="#default-port" id="ref-for-default-port">default port</a> for any other <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string②⓪">ASCII string</a> is null. </p> <table> <tbody> <tr> <th><a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme④">Special scheme</a> <th><a data-link-type="dfn" href="#default-port" id="ref-for-default-port①">Default port</a> <tr> <td>"<code>ftp</code>" <td>21 <tr> <td>"<code>file</code>" <td>null <tr> <td>"<code>http</code>" <td>80 <tr> <td>"<code>https</code>" <td>443 <tr> <td>"<code>ws</code>" <td>80 <tr> <td>"<code>wss</code>" <td>443 </table> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③②">URL</a> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="is-special">is special</dfn> if its <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme⑦">scheme</a> is a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme⑤">special scheme</a>. A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③③">URL</a> <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="is-not-special">is not special</dfn> if its <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme⑧">scheme</a> is not a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme⑥">special scheme</a>. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③④">URL</a> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="include credentials|includes credentials" id="include-credentials">includes credentials</dfn> if its <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username①">username</a> or <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password①">password</a> is not the empty string. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⑤">URL</a> has an <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="url-opaque-path">opaque path</dfn> if its <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③">path</a> is a <a data-link-type="dfn" href="#url-path-segment" id="ref-for-url-path-segment④">URL path segment</a>. </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⑥">URL</a> <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="cannot-have-a-username-password-port">cannot have a username/password/port</dfn> if its <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host④">host</a> is null or the empty string, or its <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme⑨">scheme</a> is "<code>file</code>". </p> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⑦">URL</a> can be designated as <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="concept-base-url">base URL</dfn>. </p> <p class="note" role="note">A <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url⑥">base URL</a> is useful for the <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser⑦">URL parser</a> when the input might be a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string①">relative-URL string</a>. </p> <hr> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="windows-drive-letter">Windows drive letter</dfn> is two code points, of which the first is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alpha" id="ref-for-ascii-alpha①">ASCII alpha</a> and the second is either U+003A (:) or U+007C (|). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="normalized-windows-drive-letter">normalized Windows drive letter</dfn> is a <a data-link-type="dfn" href="#windows-drive-letter" id="ref-for-windows-drive-letter">Windows drive letter</a> of which the second code point is U+003A (:). </p> <p class="note" role="note">As per the <a href="#url-writing">URL writing</a> section, only a <a data-link-type="dfn" href="#normalized-windows-drive-letter" id="ref-for-normalized-windows-drive-letter">normalized Windows drive letter</a> is conforming. </p> <p>A string <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="start with a Windows drive letter|starts with a Windows drive letter" data-noexport id="start-with-a-windows-drive-letter">starts with a Windows drive letter</dfn> if all of the following are true: </p> <ul class="brief"> <li>its <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-length" id="ref-for-string-length">length</a> is greater than or equal to 2 <li>its first two code points are a <a data-link-type="dfn" href="#windows-drive-letter" id="ref-for-windows-drive-letter①">Windows drive letter</a> <li>its <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-length" id="ref-for-string-length①">length</a> is 2 or its third code point is U+002F (/), U+005C (\), U+003F (?), or U+0023 (#). </ul> <div class="example" id="example-start-with-a-widows-drive-letter"> <a class="self-link" href="#example-start-with-a-widows-drive-letter"></a> <table> <tbody> <tr> <th>String <th>Starts with a Windows drive letter <tr> <td>"<code>c:</code>" <td>✅ <tr> <td>"<code>c:/</code>" <td>✅ <tr> <td>"<code>c:a</code>" <td>❌ </table> </div> <div class="algorithm" data-algorithm="shorten a url’s path"> <p id="pop-a-urls-path">To <dfn class="dfn-paneled" data-dfn-type="dfn" data-local-lt="shorten" data-noexport id="shorten-a-urls-path">shorten a <var>url</var>’s path</dfn>: </p> <ol> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#assert" id="ref-for-assert">Assert</a>: <var>url</var> does not have an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path③">opaque path</a>. </p> <li> <p>Let <var>path</var> be <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path④">path</a>. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⓪">scheme</a> is "<code>file</code>", <var>path</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size④">size</a> is 1, and <var>path</var>[0] is a <a data-link-type="dfn" href="#normalized-windows-drive-letter" id="ref-for-normalized-windows-drive-letter①">normalized Windows drive letter</a>, then return. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove③">Remove</a> <var>path</var>’s last item, if any. </p> </ol> </div> <h3 class="heading settled" data-level="4.3" id="url-writing"><span class="secno">4.3. </span><span class="content">URL writing</span><span id="url-syntax"></span><a class="self-link" href="#url-writing"></a></h3> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="valid-url-string">valid URL string<span id="syntax-url"></span></dfn> must be either a <a data-link-type="dfn" href="#relative-url-with-fragment-string" id="ref-for-relative-url-with-fragment-string">relative-URL-with-fragment string</a> or an <a data-link-type="dfn" href="#absolute-url-with-fragment-string" id="ref-for-absolute-url-with-fragment-string">absolute-URL-with-fragment string</a>. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="absolute-url-with-fragment-string">absolute-URL-with-fragment string<span id="syntax-url-absolute-with-fragment"></span></dfn> must be an <a data-link-type="dfn" href="#absolute-url-string" id="ref-for-absolute-url-string">absolute-URL string</a>, optionally followed by U+0023 (#) and a <a data-link-type="dfn" href="#url-fragment-string" id="ref-for-url-fragment-string">URL-fragment string</a>. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="absolute-url-string">absolute-URL string<span id="syntax-url-absolute"></span></dfn> must be one of the following: </p> <ul class="brief"> <li> <p>a <a data-link-type="dfn" href="#url-scheme-string" id="ref-for-url-scheme-string">URL-scheme string</a> that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive③">ASCII case-insensitive</a> match for a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme⑦">special scheme</a> and not an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive④">ASCII case-insensitive</a> match for "<code>file</code>", followed by U+003A (:) and a <a data-link-type="dfn" href="#scheme-relative-special-url-string" id="ref-for-scheme-relative-special-url-string">scheme-relative-special-URL string</a> </p> <li> <p>a <a data-link-type="dfn" href="#url-scheme-string" id="ref-for-url-scheme-string①">URL-scheme string</a> that is <em>not</em> an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑤">ASCII case-insensitive</a> match for a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme⑧">special scheme</a>, followed by U+003A (:) and a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string②">relative-URL string</a> </p> <li> <p>a <a data-link-type="dfn" href="#url-scheme-string" id="ref-for-url-scheme-string②">URL-scheme string</a> that is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-case-insensitive" id="ref-for-ascii-case-insensitive⑥">ASCII case-insensitive</a> match for "<code>file</code>", followed by U+003A (:) and a <a data-link-type="dfn" href="#scheme-relative-file-url-string" id="ref-for-scheme-relative-file-url-string">scheme-relative-file-URL string</a> </p> </ul> <p>any optionally followed by U+003F (?) and a <a data-link-type="dfn" href="#url-query-string" id="ref-for-url-query-string">URL-query string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-scheme-string">URL-scheme string<span id="syntax-url-scheme"></span></dfn> must be one <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alpha" id="ref-for-ascii-alpha②">ASCII alpha</a>, followed by zero or more of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alphanumeric" id="ref-for-ascii-alphanumeric①">ASCII alphanumeric</a>, U+002B (+), U+002D (-), and U+002E (.). <a data-link-type="dfn" href="#url-scheme-string" id="ref-for-url-scheme-string③">Schemes</a> should be registered in the <cite>IANA URI [sic] Schemes</cite> registry. <a data-link-type="biblio" href="#biblio-iana-uri-schemes" title="Uniform Resource Identifier (URI) Schemes">[IANA-URI-SCHEMES]</a> <a data-link-type="biblio" href="#biblio-rfc7595" title="Guidelines and Registration Procedures for URI Schemes">[RFC7595]</a> </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="relative-url-with-fragment-string">relative-URL-with-fragment string<span id="syntax-url-relative-with-fragment"></span></dfn> must be a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string③">relative-URL string</a>, optionally followed by U+0023 (#) and a <a data-link-type="dfn" href="#url-fragment-string" id="ref-for-url-fragment-string①">URL-fragment string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="relative-url-string">relative-URL string<span id="syntax-url-relative"></span></dfn> must be one of the following, switching on <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url⑦">base URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①①">scheme</a>: </p> <dl class="switch"> <dt>A <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme⑨">special scheme</a> that is not "<code>file</code>" <dd> <p>a <a data-link-type="dfn" href="#scheme-relative-special-url-string" id="ref-for-scheme-relative-special-url-string①">scheme-relative-special-URL string</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string">path-absolute-URL string</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-relative-scheme-less-url-string" id="ref-for-path-relative-scheme-less-url-string">path-relative-scheme-less-URL string</a> </p> <dt>"<code>file</code>" <dd> <p>a <a data-link-type="dfn" href="#scheme-relative-file-url-string" id="ref-for-scheme-relative-file-url-string①">scheme-relative-file-URL string</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string①">path-absolute-URL string</a> if <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url⑧">base URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host⑤">host</a> is an <a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host③">empty host</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-absolute-non-windows-file-url-string" id="ref-for-path-absolute-non-windows-file-url-string">path-absolute-non-Windows-file-URL string</a> if <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url⑨">base URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host⑥">host</a> is not an <a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host④">empty host</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-relative-scheme-less-url-string" id="ref-for-path-relative-scheme-less-url-string①">path-relative-scheme-less-URL string</a> </p> <dt>Otherwise <dd> <p>a <a data-link-type="dfn" href="#scheme-relative-url-string" id="ref-for-scheme-relative-url-string">scheme-relative-URL string</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string②">path-absolute-URL string</a> </p> <dd> <p>a <a data-link-type="dfn" href="#path-relative-scheme-less-url-string" id="ref-for-path-relative-scheme-less-url-string②">path-relative-scheme-less-URL string</a> </p> </dl> <p>any optionally followed by U+003F (?) and a <a data-link-type="dfn" href="#url-query-string" id="ref-for-url-query-string①">URL-query string</a>. </p> <p class="note" role="note">A non-null <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①⓪">base URL</a> is necessary when <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser⑧">parsing</a> a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string④">relative-URL string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="scheme-relative-special-url-string">scheme-relative-special-URL string</dfn> must be "<code>//</code>", followed by a <a data-link-type="dfn" href="#valid-host-string" id="ref-for-valid-host-string③">valid host string</a>, optionally followed by U+003A (:) and a <a data-link-type="dfn" href="#url-port-string" id="ref-for-url-port-string">URL-port string</a>, optionally followed by a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string③">path-absolute-URL string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-port-string">URL-port string<span id="syntax-url-port"></span></dfn> must be one of the following: </p> <ul class="brief"> <li> <p>the empty string </p> <li> <p>one or more <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit⑥">ASCII digits</a> representing a decimal number that is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#16-bit-unsigned-integer" id="ref-for-16-bit-unsigned-integer②">16-bit unsigned integer</a>. </p> </ul> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="scheme-relative-url-string">scheme-relative-URL string<span id="syntax-url-scheme-relative"></span></dfn> must be "<code>//</code>", followed by an <a data-link-type="dfn" href="#opaque-host-and-port-string" id="ref-for-opaque-host-and-port-string">opaque-host-and-port string</a>, optionally followed by a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string④">path-absolute-URL string</a>. </p> <p>An <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="opaque-host-and-port-string">opaque-host-and-port string</dfn> must be either the empty string or: a <a data-link-type="dfn" href="#valid-opaque-host-string" id="ref-for-valid-opaque-host-string">valid opaque-host string</a>, optionally followed by U+003A (:) and a <a data-link-type="dfn" href="#url-port-string" id="ref-for-url-port-string①">URL-port string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="scheme-relative-file-url-string">scheme-relative-file-URL string<span id="syntax-url-file-scheme-relative"></span></dfn> must be "<code>//</code>", followed by one of the following: </p> <ul class="brief"> <li> <p>a <a data-link-type="dfn" href="#valid-host-string" id="ref-for-valid-host-string④">valid host string</a>, optionally followed by a <a data-link-type="dfn" href="#path-absolute-non-windows-file-url-string" id="ref-for-path-absolute-non-windows-file-url-string①">path-absolute-non-Windows-file-URL string</a> </p> <li> <p>a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string⑤">path-absolute-URL string</a>. </p> </ul> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="path-absolute-url-string">path-absolute-URL string<span id="syntax-url-path-absolute"></span></dfn> must be U+002F (/) followed by a <a data-link-type="dfn" href="#path-relative-url-string" id="ref-for-path-relative-url-string">path-relative-URL string</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="path-absolute-non-windows-file-url-string">path-absolute-non-Windows-file-URL string<span id="syntax-url-file-path-absolute"></span></dfn> must be a <a data-link-type="dfn" href="#path-absolute-url-string" id="ref-for-path-absolute-url-string⑥">path-absolute-URL string</a> that does not start with: U+002F (/), followed by a <a data-link-type="dfn" href="#windows-drive-letter" id="ref-for-windows-drive-letter②">Windows drive letter</a>, followed by U+002F (/). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="path-relative-url-string">path-relative-URL string<span id="syntax-url-path-relative"></span></dfn> must be zero or more <a data-link-type="dfn" href="#url-path-segment-string" id="ref-for-url-path-segment-string">URL-path-segment strings</a>, separated from each other by U+002F (/), and not start with U+002F (/). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="path-relative-scheme-less-url-string">path-relative-scheme-less-URL string<span id="syntax-url-path-relative-scheme-less"></span></dfn> must be a <a data-link-type="dfn" href="#path-relative-url-string" id="ref-for-path-relative-url-string①">path-relative-URL string</a> that does not start with: a <a data-link-type="dfn" href="#url-scheme-string" id="ref-for-url-scheme-string④">URL-scheme string</a>, followed by U+003A (:). </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-path-segment-string">URL-path-segment string<span id="syntax-url-path-segment"></span></dfn> must be one of the following: </p> <ul class="brief"> <li> <p>zero or more <a data-link-type="dfn" href="#url-units" id="ref-for-url-units②">URL units</a> excluding U+002F (/) and U+003F (?), that together are not a <a data-link-type="dfn" href="#single-dot-path-segment" id="ref-for-single-dot-path-segment">single-dot URL path segment</a> or a <a data-link-type="dfn" href="#double-dot-path-segment" id="ref-for-double-dot-path-segment">double-dot URL path segment</a>. </p> <li> <p>a <a data-link-type="dfn" href="#single-dot-path-segment" id="ref-for-single-dot-path-segment①">single-dot URL path segment</a> </p> <li> <p>a <a data-link-type="dfn" href="#double-dot-path-segment" id="ref-for-double-dot-path-segment①">double-dot URL path segment</a>. </p> </ul> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-query-string">URL-query string<span id="syntax-url-query"></span></dfn> must be zero or more <a data-link-type="dfn" href="#url-units" id="ref-for-url-units③">URL units</a>. </p> <p>A <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="url-fragment-string">URL-fragment string<span id="syntax-url-fragment"></span></dfn> must be zero or more <a data-link-type="dfn" href="#url-units" id="ref-for-url-units④">URL units</a>. </p> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="URL code point" id="url-code-points">URL code points</dfn> are <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alphanumeric" id="ref-for-ascii-alphanumeric②">ASCII alphanumeric</a>, U+0021 (!), U+0024 ($), U+0026 (&amp;), U+0027 ('), U+0028 LEFT PARENTHESIS, U+0029 RIGHT PARENTHESIS, U+002A (*), U+002B (+), U+002C (,), U+002D (-), U+002E (.), U+002F (/), U+003A (:), U+003B (;), U+003D (=), U+003F (?), U+0040 (@), U+005F (_), U+007E (~), and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑦">code points</a> in the range U+00A0 to U+10FFFD, inclusive, excluding <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#surrogate" id="ref-for-surrogate">surrogates</a> and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#noncharacter" id="ref-for-noncharacter">noncharacters</a>. </p> <p class="note" role="note">Code points greater than U+007F DELETE will be converted to <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte③">percent-encoded bytes</a> by the <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser⑨">URL parser</a>. </p> <p class="note" role="note">In HTML, when the document encoding is a legacy encoding, code points in the <a data-link-type="dfn" href="#url-query-string" id="ref-for-url-query-string②">URL-query string</a> that are higher than U+007F DELETE will be converted to <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte④">percent-encoded bytes</a> <em>using the document’s encoding</em>. This can cause problems if a URL that works in one document is copied to another document that uses a different document encoding. Using the <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8③">UTF-8</a> encoding everywhere solves this problem. </p> <div class="example" id="query-encoding-example"> <a class="self-link" href="#query-encoding-example"></a> <p>For example, consider this HTML document: </p> <pre><code class="lang-html highlight"><c- cp>&lt;!doctype html></c-> <c- p>&lt;</c-><c- f>meta</c-> <c- e>charset</c-><c- o>=</c-><c- s>"windows-1252"</c-><c- p>></c-> <c- p>&lt;</c-><c- f>a</c-> <c- e>href</c-><c- o>=</c-><c- s>"?sm&amp;ouml;rg&amp;aring;sbord"</c-><c- p>></c->Test<c- p>&lt;/</c-><c- f>a</c-><c- p>></c-></code></pre> <p>Since the document encoding is windows-1252, the link’s <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⑧">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②">query</a> will be "<code>sm%F6rg%E5sbord</code>". If the document encoding had been UTF-8, it would instead be "<code>sm%C3%B6rg%C3%A5sbord</code>". </p> </div> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="url-units">URL units</dfn> are <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points①">URL code points</a> and <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte⑤">percent-encoded bytes</a>. </p> <p class="note" role="note"><a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte⑥">Percent-encoded bytes</a> can be used to encode code points that are not <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points②">URL code points</a> or are excluded from being written. </p> <hr> <p class="note" role="note">There is no way to express a <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username②">username</a> or <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password②">password</a> of a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url③⑨">URL record</a> within a <a data-link-type="dfn" href="#valid-url-string" id="ref-for-valid-url-string⑤">valid URL string</a>. </p> <h3 class="heading settled" data-level="4.4" id="url-parsing"><span class="secno">4.4. </span><span class="content">URL parsing</span><a class="self-link" href="#url-parsing"></a></h3> <div class="algorithm" data-algorithm="URL parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-url-parser">URL parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string⑧">scalar value string</a> <var>input</var>, with an optional null or <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①①">base URL</a> <var>base</var> (default null) and an optional <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encoding" id="ref-for-encoding①">encoding</a> <var>encoding</var> (default <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8④">UTF-8</a>), and then runs these steps: </p> <p class="note" role="note">Non-web-browser implementations only need to implement the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser">basic URL parser</a>. </p> <p class="note" role="note">How user input in the web browser’s address bar is converted to a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⓪">URL record</a> is out-of-scope of this standard. This standard does include <a href="#url-rendering">URL rendering requirements</a> as they pertain trust decisions. </p> <ol> <li> <p>Let <var>url</var> be the result of running the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①">basic URL parser</a> on <var>input</var> with <var>base</var> and <var>encoding</var>. </p> <li> <p>If <var>url</var> is failure, return failure. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①②">scheme</a> is not "<code>blob</code>", return <var>url</var>. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-blob-entry" id="ref-for-concept-url-blob-entry①">blob URL entry</a> to the result of <a data-link-type="dfn" href="https://w3c.github.io/FileAPI/#blob-url-resolve" id="ref-for-blob-url-resolve">resolving the blob URL</a> <var>url</var>, if that did not return failure, and null otherwise. </p> <li> <p>Return <var>url</var>. </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="basic URL parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-basic-url-parser">basic URL parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string⑨">scalar value string</a> <var>input</var>, with an optional null or <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①②">base URL</a> <var>base</var> (default null), an optional <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encoding" id="ref-for-encoding②">encoding</a> <var>encoding</var> (default <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8⑤">UTF-8</a>), an optional <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④①">URL</a> <dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="basic-url-parser-url"><var>url</var></dfn>, and an optional state override <dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="basic-url-parser-state-override"><var>state override</var></dfn>, and then runs these steps: </p> <div class="note" role="note"> <p>The <var>encoding</var> argument is a legacy concept only relevant for <cite>HTML</cite>. The <var>url</var> and <var>state override</var> arguments are only for use by various APIs. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> </p> <p>When the <var>url</var> and <var>state override</var> arguments are not passed, the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser②">basic URL parser</a> returns either a new <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④②">URL</a> or failure. If they are passed, the algorithm modifies the passed <var>url</var> and can terminate without returning anything. </p> </div> <ol> <li> <p>If <var>url</var> is not given: </p> <ol> <li> <p>Set <var>url</var> to a new <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④③">URL</a>. </p> <li> <p>If <var>input</var> contains any leading or trailing <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#c0-control-or-space" id="ref-for-c0-control-or-space">C0 control or space</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit②">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③①">validation error</a>. </p> <li> <p>Remove any leading and trailing <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#c0-control-or-space" id="ref-for-c0-control-or-space①">C0 control or space</a> from <var>input</var>. </p> </ol> <li> <p>If <var>input</var> contains any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-tab-or-newline" id="ref-for-ascii-tab-or-newline">ASCII tab or newline</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit③">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③②">validation error</a>. </p> <li> <p>Remove all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-tab-or-newline" id="ref-for-ascii-tab-or-newline①">ASCII tab or newline</a> from <var>input</var>. </p> <li> <p>Let <var>state</var> be <var>state override</var> if given, or <a data-link-type="dfn" href="#scheme-start-state" id="ref-for-scheme-start-state">scheme start state</a> otherwise. </p> <li> <p>Set <var>encoding</var> to the result of <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#get-an-output-encoding" id="ref-for-get-an-output-encoding">getting an output encoding</a> from <var>encoding</var>. </p> <li> <p>Let <var>buffer</var> be the empty string. </p> <li> <p>Let <var>atSignSeen</var>, <var>insideBrackets</var>, and <var>passwordTokenSeen</var> be false. </p> <li> <p>Let <var>pointer</var> be a <a data-link-type="dfn" href="#pointer" id="ref-for-pointer⑧">pointer</a> for <var>input</var>. </p> <li> <p>Keep running the following state machine by switching on <var>state</var>. If after a run <var>pointer</var> points to the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point⑦">EOF code point</a>, go to the next step. Otherwise, increase <var>pointer</var> by 1 and continue with the state machine. </p> <dl class="switch"> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="scheme-start-state">scheme start state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c①⑨">c</a> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alpha" id="ref-for-ascii-alpha③">ASCII alpha</a>, append <a data-link-type="dfn" href="#c" id="ref-for-c②⓪">c</a>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-lowercase" id="ref-for-ascii-lowercase①">lowercased</a>, to <var>buffer</var>, and set <var>state</var> to <a data-link-type="dfn" href="#scheme-state" id="ref-for-scheme-state">scheme state</a>. </p> <li> <p>Otherwise, if <var>state override</var> is not given, set <var>state</var> to <a data-link-type="dfn" href="#no-scheme-state" id="ref-for-no-scheme-state">no scheme state</a> and decrease <var>pointer</var> by 1. </p> <li> <p>Otherwise, return failure. </p> <p class="note" role="note">This indication of failure is used exclusively by the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#location" id="ref-for-location">Location</a></code> object’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-protocol" id="ref-for-dom-location-protocol">protocol</a></code> setter. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="scheme-state">scheme state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c②①">c</a> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-alphanumeric" id="ref-for-ascii-alphanumeric③">ASCII alphanumeric</a>, U+002B (+), U+002D (-), or U+002E (.), append <a data-link-type="dfn" href="#c" id="ref-for-c②②">c</a>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-lowercase" id="ref-for-ascii-lowercase②">lowercased</a>, to <var>buffer</var>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c②③">c</a> is U+003A (:), then: </p> <ol> <li> <p>If <var>state override</var> is given, then: </p> <ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①③">scheme</a> is a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme①⓪">special scheme</a> and <var>buffer</var> is not a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme①①">special scheme</a>, then return. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①④">scheme</a> is not a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme①②">special scheme</a> and <var>buffer</var> is a <a data-link-type="dfn" href="#special-scheme" id="ref-for-special-scheme①③">special scheme</a>, then return. </p> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#include-credentials" id="ref-for-include-credentials①">includes credentials</a> or has a non-null <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①">port</a>, and <var>buffer</var> is "<code>file</code>", then return. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⑤">scheme</a> is "<code>file</code>" and its <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host⑦">host</a> is an <a data-link-type="dfn" href="#empty-host" id="ref-for-empty-host⑤">empty host</a>, then return. </p> </ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⑥">scheme</a> to <var>buffer</var>. </p> <li> <p>If <var>state override</var> is given, then: </p> <ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port②">port</a> is <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⑦">scheme</a>’s <a data-link-type="dfn" href="#default-port" id="ref-for-default-port②">default port</a>, then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port③">port</a> to null. </p> <li> <p>Return. </p> </ol> <li> <p>Set <var>buffer</var> to the empty string. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⑧">scheme</a> is "<code>file</code>", then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#remaining" id="ref-for-remaining④">remaining</a> does not start with "<code>//</code>", <a data-link-type="dfn" href="#special-scheme-missing-following-solidus" id="ref-for-special-scheme-missing-following-solidus">special-scheme-missing-following-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③③">validation error</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#file-state" id="ref-for-file-state">file state</a>. </p> </ol> <li> <p>Otherwise, if <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special②">is special</a>, <var>base</var> is non-null, and <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme①⑨">scheme</a> is <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⓪">scheme</a>: </p> <ol> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#assert" id="ref-for-assert①">Assert</a>: <var>base</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special③">is special</a> (and therefore does not have an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path④">opaque path</a>). </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#special-relative-or-authority-state" id="ref-for-special-relative-or-authority-state">special relative or authority state</a>. </p> </ol> <li> <p>Otherwise, if <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special④">is special</a>, set <var>state</var> to <a data-link-type="dfn" href="#special-authority-slashes-state" id="ref-for-special-authority-slashes-state">special authority slashes state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#remaining" id="ref-for-remaining⑤">remaining</a> starts with an U+002F (/), set <var>state</var> to <a data-link-type="dfn" href="#path-or-authority-state" id="ref-for-path-or-authority-state">path or authority state</a> and increase <var>pointer</var> by 1. </p> <li> <p>Otherwise, set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path⑤">path</a> to the empty string and set <var>state</var> to <a data-link-type="dfn" href="#cannot-be-a-base-url-path-state" id="ref-for-cannot-be-a-base-url-path-state">opaque path state</a>. </p> </ol> <li> <p>Otherwise, if <var>state override</var> is not given, set <var>buffer</var> to the empty string, <var>state</var> to <a data-link-type="dfn" href="#no-scheme-state" id="ref-for-no-scheme-state①">no scheme state</a>, and start over (from the first code point in <var>input</var>). </p> <li> <p>Otherwise, return failure. </p> <p class="note" role="note">This indication of failure is used exclusively by the <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#location" id="ref-for-location①">Location</a></code> object’s <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-protocol" id="ref-for-dom-location-protocol①">protocol</a></code> setter. Furthermore, the non-failure termination earlier in this state is an intentional difference for defining that setter. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="no-scheme-state">no scheme state</dfn> <dd> <ol> <li> <p>If <var>base</var> is null, or <var>base</var> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path⑤">opaque path</a> and <a data-link-type="dfn" href="#c" id="ref-for-c②④">c</a> is not U+0023 (#), <a data-link-type="dfn" href="#missing-scheme-non-relative-url" id="ref-for-missing-scheme-non-relative-url">missing-scheme-non-relative-URL</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③④">validation error</a>, return failure. </p> <li> <p>Otherwise, if <var>base</var> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path⑥">opaque path</a> and <a data-link-type="dfn" href="#c" id="ref-for-c②⑤">c</a> is U+0023 (#), set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②①">scheme</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②②">scheme</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path⑥">path</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path⑦">path</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query③">query</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query④">query</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment②">fragment</a> to the empty string, and set <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state">fragment state</a>. </p> <li> <p>Otherwise, if <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②③">scheme</a> is not "<code>file</code>", set <var>state</var> to <a data-link-type="dfn" href="#relative-state" id="ref-for-relative-state">relative state</a> and decrease <var>pointer</var> by 1. </p> <li> <p>Otherwise, set <var>state</var> to <a data-link-type="dfn" href="#file-state" id="ref-for-file-state①">file state</a> and decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="special-relative-or-authority-state">special relative or authority state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c②⑥">c</a> is U+002F (/) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining⑥">remaining</a> starts with U+002F (/), then set <var>state</var> to <a data-link-type="dfn" href="#special-authority-ignore-slashes-state" id="ref-for-special-authority-ignore-slashes-state">special authority ignore slashes state</a> and increase <var>pointer</var> by 1. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="#special-scheme-missing-following-solidus" id="ref-for-special-scheme-missing-following-solidus①">special-scheme-missing-following-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⑤">validation error</a>, set <var>state</var> to <a data-link-type="dfn" href="#relative-state" id="ref-for-relative-state①">relative state</a> and decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="path-or-authority-state">path or authority state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c②⑦">c</a> is U+002F (/), then set <var>state</var> to <a data-link-type="dfn" href="#authority-state" id="ref-for-authority-state">authority state</a>. </p> <li> <p>Otherwise, set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state">path state</a>, and decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="relative-state">relative state</dfn> <dd> <ol> <li> <p>Assert: <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②④">scheme</a> is not "<code>file</code>". </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⑤">scheme</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⑥">scheme</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c②⑧">c</a> is U+002F (/), then set <var>state</var> to <a data-link-type="dfn" href="#relative-slash-state" id="ref-for-relative-slash-state">relative slash state</a>. </p> <li> <p>Otherwise, if <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special⑤">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c②⑨">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⑥">validation error</a>, set <var>state</var> to <a data-link-type="dfn" href="#relative-slash-state" id="ref-for-relative-slash-state①">relative slash state</a>. </p> <li> <p>Otherwise: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username③">username</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username④">username</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password③">password</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password④">password</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host⑧">host</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host⑨">host</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port④">port</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port⑤">port</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path⑧">path</a> to a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-clone" id="ref-for-list-clone">clone</a> of <var>base</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path⑨">path</a>, and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query⑤">query</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query⑥">query</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c③⓪">c</a> is U+003F (?), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query⑦">query</a> to the empty string, and <var>state</var> to <a data-link-type="dfn" href="#query-state" id="ref-for-query-state">query state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c③①">c</a> is U+0023 (#), set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment③">fragment</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state①">fragment state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c③②">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point⑧">EOF code point</a>: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query⑧">query</a> to null. </p> <li> <p><a data-link-type="dfn" href="#shorten-a-urls-path" id="ref-for-shorten-a-urls-path">Shorten</a> <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⓪">path</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state①">path state</a> and decrease <var>pointer</var> by 1. </p> </ol> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="relative-slash-state">relative slash state</dfn> <dd> <ol> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special⑥">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c③③">c</a> is U+002F (/) or U+005C (\), then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c③④">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus①">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⑦">validation error</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#special-authority-ignore-slashes-state" id="ref-for-special-authority-ignore-slashes-state①">special authority ignore slashes state</a>. </p> </ol> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c③⑤">c</a> is U+002F (/), then set <var>state</var> to <a data-link-type="dfn" href="#authority-state" id="ref-for-authority-state①">authority state</a>. </p> <li> <p>Otherwise, set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username⑤">username</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username⑥">username</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password⑤">password</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password⑥">password</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⓪">host</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①①">host</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port⑥">port</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port⑦">port</a>, <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state②">path state</a>, and then, decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="special-authority-slashes-state">special authority slashes state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c③⑥">c</a> is U+002F (/) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining⑦">remaining</a> starts with U+002F (/), then set <var>state</var> to <a data-link-type="dfn" href="#special-authority-ignore-slashes-state" id="ref-for-special-authority-ignore-slashes-state②">special authority ignore slashes state</a> and increase <var>pointer</var> by 1. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="#special-scheme-missing-following-solidus" id="ref-for-special-scheme-missing-following-solidus②">special-scheme-missing-following-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⑧">validation error</a>, set <var>state</var> to <a data-link-type="dfn" href="#special-authority-ignore-slashes-state" id="ref-for-special-authority-ignore-slashes-state③">special authority ignore slashes state</a> and decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="special-authority-ignore-slashes-state">special authority ignore slashes state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c③⑦">c</a> is neither U+002F (/) nor U+005C (\), then set <var>state</var> to <a data-link-type="dfn" href="#authority-state" id="ref-for-authority-state②">authority state</a> and decrease <var>pointer</var> by 1. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="#special-scheme-missing-following-solidus" id="ref-for-special-scheme-missing-following-solidus③">special-scheme-missing-following-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error③⑨">validation error</a>. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="authority-state">authority state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c③⑧">c</a> is U+0040 (@), then: </p> <ol> <li> <p><a data-link-type="dfn" href="#invalid-credentials" id="ref-for-invalid-credentials">Invalid-credentials</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⓪">validation error</a>. </p> <li> <p>If <var>atSignSeen</var> is true, then prepend "<code>%40</code>" to <var>buffer</var>. </p> <li> <p>Set <var>atSignSeen</var> to true. </p> <li> <p>For each <var>codePoint</var> in <var>buffer</var>: </p> <ol> <li> <p>If <var>codePoint</var> is U+003A (:) and <var>passwordTokenSeen</var> is false, then set <var>passwordTokenSeen</var> to true and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue④">continue</a>. </p> <li> <p>Let <var>encodedCodePoints</var> be the result of running <a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode②">UTF-8 percent-encode</a> <var>codePoint</var> using the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set⑥">userinfo percent-encode set</a>. </p> <li> <p>If <var>passwordTokenSeen</var> is true, then append <var>encodedCodePoints</var> to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password⑦">password</a>. </p> <li> <p>Otherwise, append <var>encodedCodePoints</var> to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username⑦">username</a>. </p> </ol> <li> <p>Set <var>buffer</var> to the empty string. </p> </ol> <li> <p>Otherwise, if one of the following is true: </p> <ul class="brief"> <li> <p><a data-link-type="dfn" href="#c" id="ref-for-c③⑨">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point⑨">EOF code point</a>, U+002F (/), U+003F (?), or U+0023 (#) </p> <li> <p><var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special⑦">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c④⓪">c</a> is U+005C (\) </p> </ul> <p>then: </p> <ol> <li> <p>If <var>atSignSeen</var> is true and <var>buffer</var> is the empty string, <a data-link-type="dfn" href="#host-missing" id="ref-for-host-missing">host-missing</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④①">validation error</a>, return failure. </p> <li> <p>Decrease <var>pointer</var> by <var>buffer</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#string-code-point-length" id="ref-for-string-code-point-length①">code point length</a> + 1, set <var>buffer</var> to the empty string, and set <var>state</var> to <a data-link-type="dfn" href="#host-state" id="ref-for-host-state">host state</a>. </p> </ol> <li> <p>Otherwise, append <a data-link-type="dfn" href="#c" id="ref-for-c④①">c</a> to <var>buffer</var>. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="host-state">host state</dfn> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="hostname-state">hostname state</dfn> <dd> <ol> <li> <p>If <var>state override</var> is given and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⑦">scheme</a> is "<code>file</code>", then decrease <var>pointer</var> by 1 and set <var>state</var> to <a data-link-type="dfn" href="#file-host-state" id="ref-for-file-host-state">file host state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c④②">c</a> is U+003A (:) and <var>insideBrackets</var> is false, then: </p> <ol> <li> <p>If <var>buffer</var> is the empty string, <a data-link-type="dfn" href="#host-missing" id="ref-for-host-missing①">host-missing</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④②">validation error</a>, return failure. </p> <li> <p>If <var>state override</var> is given and <var>state override</var> is <a data-link-type="dfn" href="#hostname-state" id="ref-for-hostname-state">hostname state</a>, then return. </p> <li> <p>Let <var>host</var> be the result of <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser⑧">host parsing</a> <var>buffer</var> with <var>url</var> <a data-link-type="dfn" href="#is-not-special" id="ref-for-is-not-special①">is not special</a>. </p> <li> <p>If <var>host</var> is failure, then return failure. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①②">host</a> to <var>host</var>, <var>buffer</var> to the empty string, and <var>state</var> to <a data-link-type="dfn" href="#port-state" id="ref-for-port-state">port state</a>. </p> </ol> <li> <p>Otherwise, if one of the following is true: </p> <ul class="brief"> <li> <p><a data-link-type="dfn" href="#c" id="ref-for-c④③">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⓪">EOF code point</a>, U+002F (/), U+003F (?), or U+0023 (#) </p> <li> <p><var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special⑧">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c④④">c</a> is U+005C (\) </p> </ul> <p>then decrease <var>pointer</var> by 1, and then: </p> <ol> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special⑨">is special</a> and <var>buffer</var> is the empty string, <a data-link-type="dfn" href="#host-missing" id="ref-for-host-missing②">host-missing</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④③">validation error</a>, return failure. </p> <li> <p>Otherwise, if <var>state override</var> is given, <var>buffer</var> is the empty string, and either <var>url</var> <a data-link-type="dfn" href="#include-credentials" id="ref-for-include-credentials②">includes credentials</a> or <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port⑧">port</a> is non-null, return. </p> <li> <p>Let <var>host</var> be the result of <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser⑨">host parsing</a> <var>buffer</var> with <var>url</var> <a data-link-type="dfn" href="#is-not-special" id="ref-for-is-not-special②">is not special</a>. </p> <li> <p>If <var>host</var> is failure, then return failure. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①③">host</a> to <var>host</var>, <var>buffer</var> to the empty string, and <var>state</var> to <a data-link-type="dfn" href="#path-start-state" id="ref-for-path-start-state">path start state</a>. </p> <li> <p>If <var>state override</var> is given, then return. </p> </ol> <li> <p>Otherwise: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c④⑤">c</a> is U+005B ([), then set <var>insideBrackets</var> to true. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c④⑥">c</a> is U+005D (]), then set <var>insideBrackets</var> to false. </p> <li> <p>Append <a data-link-type="dfn" href="#c" id="ref-for-c④⑦">c</a> to <var>buffer</var>. </p> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="port-state">port state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c④⑧">c</a> is an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit⑦">ASCII digit</a>, append <a data-link-type="dfn" href="#c" id="ref-for-c④⑨">c</a> to <var>buffer</var>. </p> <li> <p>Otherwise, if one of the following is true: </p> <ul class="brief"> <li> <p><a data-link-type="dfn" href="#c" id="ref-for-c⑤⓪">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①①">EOF code point</a>, U+002F (/), U+003F (?), or U+0023 (#) </p> <li> <p><var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①⓪">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c⑤①">c</a> is U+005C (\) </p> <li> <p><var>state override</var> is given </p> </ul> <p>then: </p> <ol> <li> <p>If <var>buffer</var> is not the empty string, then: </p> <ol> <li> <p>Let <var>port</var> be the mathematical integer value that is represented by <var>buffer</var> in radix-10 using <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-digit" id="ref-for-ascii-digit⑧">ASCII digits</a> for digits with values 0 through 9. </p> <li> <p>If <var>port</var> is not a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#16-bit-unsigned-integer" id="ref-for-16-bit-unsigned-integer③">16-bit unsigned integer</a>, <a data-link-type="dfn" href="#port-out-of-range" id="ref-for-port-out-of-range">port-out-of-range</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④④">validation error</a>, return failure. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port⑨">port</a> to null, if <var>port</var> is <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⑧">scheme</a>’s <a data-link-type="dfn" href="#default-port" id="ref-for-default-port③">default port</a>; otherwise to <var>port</var>. </p> <li> <p>Set <var>buffer</var> to the empty string. </p> </ol> <li> <p>If <var>state override</var> is given, then return. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-start-state" id="ref-for-path-start-state①">path start state</a> and decrease <var>pointer</var> by 1. </p> </ol> <li> <p>Otherwise, <a data-link-type="dfn" href="#port-invalid" id="ref-for-port-invalid">port-invalid</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⑤">validation error</a>, return failure. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="file-state">file state</dfn> <dd> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme②⑨">scheme</a> to "<code>file</code>". </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①④">host</a> to the empty string. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤②">c</a> is U+002F (/) or U+005C (\), then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤③">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus②">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⑥">validation error</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#file-slash-state" id="ref-for-file-slash-state">file slash state</a>. </p> </ol> <li> <p>Otherwise, if <var>base</var> is non-null and <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⓪">scheme</a> is "<code>file</code>": </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⑤">host</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⑥">host</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①①">path</a> to a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-clone" id="ref-for-list-clone①">clone</a> of <var>base</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①②">path</a>, and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query⑨">query</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⓪">query</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤④">c</a> is U+003F (?), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①①">query</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#query-state" id="ref-for-query-state①">query state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c⑤⑤">c</a> is U+0023 (#), set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment④">fragment</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state②">fragment state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c⑤⑥">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①②">EOF code point</a>: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①②">query</a> to null. </p> <li> <p>If the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string" id="ref-for-code-point-substring-to-the-end-of-the-string①">code point substring</a> from <var>pointer</var> to the end of <var>input</var> does not <a data-link-type="dfn" href="#start-with-a-windows-drive-letter" id="ref-for-start-with-a-windows-drive-letter①">start with a Windows drive letter</a>, then <a data-link-type="dfn" href="#shorten-a-urls-path" id="ref-for-shorten-a-urls-path①">shorten</a> <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①③">path</a>. </p> <li> <p>Otherwise: </p> <ol> <li> <p><a data-link-type="dfn" href="#file-invalid-windows-drive-letter" id="ref-for-file-invalid-windows-drive-letter">File-invalid-Windows-drive-letter</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⑦">validation error</a>. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①④">path</a> to « ». </p> </ol> <p class="note" role="note">This is a (platform-independent) Windows drive letter quirk. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state③">path state</a> and decrease <var>pointer</var> by 1. </p> </ol> </ol> <li> <p>Otherwise, set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state④">path state</a>, and decrease <var>pointer</var> by 1. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="file-slash-state">file slash state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤⑦">c</a> is U+002F (/) or U+005C (\), then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤⑧">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus③">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⑧">validation error</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#file-host-state" id="ref-for-file-host-state①">file host state</a>. </p> </ol> <li> <p>Otherwise: </p> <ol> <li> <p>If <var>base</var> is non-null and <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③①">scheme</a> is "<code>file</code>", then: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⑦">host</a> to <var>base</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⑧">host</a>. </p> <li> <p>If the <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string" id="ref-for-code-point-substring-to-the-end-of-the-string②">code point substring</a> from <var>pointer</var> to the end of <var>input</var> does not <a data-link-type="dfn" href="#start-with-a-windows-drive-letter" id="ref-for-start-with-a-windows-drive-letter②">start with a Windows drive letter</a> and <var>base</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⑤">path</a>[0] is a <a data-link-type="dfn" href="#normalized-windows-drive-letter" id="ref-for-normalized-windows-drive-letter②">normalized Windows drive letter</a>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append①">append</a> <var>base</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⑥">path</a>[0] to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⑦">path</a>. </p> <p class="note" role="note">This is a (platform-independent) Windows drive letter quirk. </p> </ol> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state⑤">path state</a>, and decrease <var>pointer</var> by 1. </p> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="file-host-state">file host state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑤⑨">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①③">EOF code point</a>, U+002F (/), U+005C (\), U+003F (?), or U+0023 (#), then decrease <var>pointer</var> by 1 and then: </p> <ol> <li> <p>If <var>state override</var> is not given and <var>buffer</var> is a <a data-link-type="dfn" href="#windows-drive-letter" id="ref-for-windows-drive-letter③">Windows drive letter</a>, <a data-link-type="dfn" href="#file-invalid-windows-drive-letter-host" id="ref-for-file-invalid-windows-drive-letter-host">file-invalid-Windows-drive-letter-host</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error④⑨">validation error</a>, set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state⑥">path state</a>. </p> <p class="note" role="note">This is a (platform-independent) Windows drive letter quirk. <var>buffer</var> is not reset here and instead used in the <a data-link-type="dfn" href="#path-state" id="ref-for-path-state⑦">path state</a>. </p> <li> <p>Otherwise, if <var>buffer</var> is the empty string, then: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host①⑨">host</a> to the empty string. </p> <li> <p>If <var>state override</var> is given, then return. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-start-state" id="ref-for-path-start-state②">path start state</a>. </p> </ol> <li> <p>Otherwise, run these steps: </p> <ol> <li> <p>Let <var>host</var> be the result of <a data-link-type="dfn" href="#concept-host-parser" id="ref-for-concept-host-parser①⓪">host parsing</a> <var>buffer</var> with <var>url</var> <a data-link-type="dfn" href="#is-not-special" id="ref-for-is-not-special③">is not special</a>. </p> <li> <p>If <var>host</var> is failure, then return failure. </p> <li> <p>If <var>host</var> is "<code title>localhost</code>", then set <var>host</var> to the empty string. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⓪">host</a> to <var>host</var>. </p> <li> <p>If <var>state override</var> is given, then return. </p> <li> <p>Set <var>buffer</var> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#path-start-state" id="ref-for-path-start-state③">path start state</a>. </p> </ol> </ol> <li> <p>Otherwise, append <a data-link-type="dfn" href="#c" id="ref-for-c⑥⓪">c</a> to <var>buffer</var>. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="path-start-state">path start state</dfn> <dd> <ol> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①①">is special</a>, then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑥①">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus④">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⓪">validation error</a>. </p> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state⑧">path state</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑥②">c</a> is neither U+002F (/) nor U+005C (\), then decrease <var>pointer</var> by 1. </p> </ol> <li> <p>Otherwise, if <var>state override</var> is not given and <a data-link-type="dfn" href="#c" id="ref-for-c⑥③">c</a> is U+003F (?), set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①③">query</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#query-state" id="ref-for-query-state②">query state</a>. </p> <li> <p>Otherwise, if <var>state override</var> is not given and <a data-link-type="dfn" href="#c" id="ref-for-c⑥④">c</a> is U+0023 (#), set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment⑤">fragment</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state③">fragment state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c⑥⑤">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①④">EOF code point</a>: </p> <ol> <li> <p>Set <var>state</var> to <a data-link-type="dfn" href="#path-state" id="ref-for-path-state⑨">path state</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑥⑥">c</a> is not U+002F (/), then decrease <var>pointer</var> by 1. </p> </ol> <li> <p>Otherwise, if <var>state override</var> is given and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②①">host</a> is null, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append②">append</a> the empty string to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⑧">path</a>. </p> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="path-state">path state</dfn> <dd> <ol> <li> <p>If one of the following is true: </p> <ul class="brief"> <li> <p><a data-link-type="dfn" href="#c" id="ref-for-c⑥⑦">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⑤">EOF code point</a> or U+002F (/) </p> <li> <p><var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①②">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c⑥⑧">c</a> is U+005C (\) </p> <li> <p><var>state override</var> is not given and <a data-link-type="dfn" href="#c" id="ref-for-c⑥⑨">c</a> is U+003F (?) or U+0023 (#) </p> </ul> <p>then: </p> <ol> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①③">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c⑦⓪">c</a> is U+005C (\), <a data-link-type="dfn" href="#invalid-reverse-solidus" id="ref-for-invalid-reverse-solidus⑤">invalid-reverse-solidus</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤①">validation error</a>. </p> <li> <p>If <var>buffer</var> is a <a data-link-type="dfn" href="#double-dot-path-segment" id="ref-for-double-dot-path-segment②">double-dot URL path segment</a>, then: </p> <ol> <li> <p><a data-link-type="dfn" href="#shorten-a-urls-path" id="ref-for-shorten-a-urls-path②">Shorten</a> <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path①⑨">path</a>. </p> <li> <p>If neither <a data-link-type="dfn" href="#c" id="ref-for-c⑦①">c</a> is U+002F (/), nor <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①④">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c⑦②">c</a> is U+005C (\), <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append③">append</a> the empty string to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⓪">path</a>. </p> <p class="note" role="note">This means that for input <code>/usr/..</code> the result is <code>/</code> and not a lack of a path. </p> </ol> <li> <p>Otherwise, if <var>buffer</var> is a <a data-link-type="dfn" href="#single-dot-path-segment" id="ref-for-single-dot-path-segment②">single-dot URL path segment</a> and if neither <a data-link-type="dfn" href="#c" id="ref-for-c⑦③">c</a> is U+002F (/), nor <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①⑤">is special</a> and <a data-link-type="dfn" href="#c" id="ref-for-c⑦④">c</a> is U+005C (\), <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append④">append</a> the empty string to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②①">path</a>. </p> <li> <p>Otherwise, if <var>buffer</var> is not a <a data-link-type="dfn" href="#single-dot-path-segment" id="ref-for-single-dot-path-segment③">single-dot URL path segment</a>, then: </p> <ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③②">scheme</a> is "<code>file</code>", <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②②">path</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-is-empty" id="ref-for-list-is-empty">is empty</a>, and <var>buffer</var> is a <a data-link-type="dfn" href="#windows-drive-letter" id="ref-for-windows-drive-letter④">Windows drive letter</a>, then replace the second code point in <var>buffer</var> with U+003A (:). </p> <p class="note" role="note">This is a (platform-independent) Windows drive letter quirk. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑤">Append</a> <var>buffer</var> to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②③">path</a>. </p> </ol> <li> <p>Set <var>buffer</var> to the empty string. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑦⑤">c</a> is U+003F (?), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①④">query</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#query-state" id="ref-for-query-state③">query state</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑦⑥">c</a> is U+0023 (#), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment⑥">fragment</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state④">fragment state</a>. </p> </ol> <li> <p>Otherwise, run these steps: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑦⑦">c</a> is not a <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points③">URL code point</a> and not U+0025 (%), <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit④">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤②">validation error</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑦⑧">c</a> is U+0025 (%) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining⑧">remaining</a> does not start with two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit⑥">ASCII hex digits</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit⑤">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤③">validation error</a>. </p> <li> <p><a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode③">UTF-8 percent-encode</a> <a data-link-type="dfn" href="#c" id="ref-for-c⑦⑨">c</a> using the <a data-link-type="dfn" href="#path-percent-encode-set" id="ref-for-path-percent-encode-set①">path percent-encode set</a> and append the result to <var>buffer</var>. </p> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="cannot-be-a-base-url-path-state">opaque path state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑧⓪">c</a> is U+003F (?), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⑤">query</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#query-state" id="ref-for-query-state④">query state</a>. </p> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c⑧①">c</a> is U+0023 (#), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment⑦">fragment</a> to the empty string and <var>state</var> to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state⑤">fragment state</a>. </p> <li> <p>Otherwise: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑧②">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⑥">EOF code point</a>, not a <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points④">URL code point</a>, and not U+0025 (%), <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit⑥">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤④">validation error</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑧③">c</a> is U+0025 (%) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining⑨">remaining</a> does not start with two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit⑦">ASCII hex digits</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit⑦">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⑤">validation error</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑧④">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⑦">EOF code point</a>, <a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode④">UTF-8 percent-encode</a> <a data-link-type="dfn" href="#c" id="ref-for-c⑧⑤">c</a> using the <a data-link-type="dfn" href="#c0-control-percent-encode-set" id="ref-for-c0-control-percent-encode-set③">C0 control percent-encode set</a> and append the result to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②④">path</a>. </p> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="query-state">query state</dfn> <dd> <ol> <li> <p>If <var>encoding</var> is not <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8⑥">UTF-8</a> and one of the following is true: </p> <ul class="brief"> <li> <p><var>url</var> <a data-link-type="dfn" href="#is-not-special" id="ref-for-is-not-special④">is not special</a> </p> <li> <p><var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③③">scheme</a> is "<code>ws</code>" or "<code>wss</code>" </p> </ul> <p>then set <var>encoding</var> to <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8⑦">UTF-8</a>. </p> <li> <p>If one of the following is true: </p> <ul class="brief"> <li> <p><var>state override</var> is not given and <a data-link-type="dfn" href="#c" id="ref-for-c⑧⑥">c</a> is U+0023 (#) </p> <li> <p><a data-link-type="dfn" href="#c" id="ref-for-c⑧⑦">c</a> is the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⑧">EOF code point</a> </p> </ul> <p>then: </p> <ol> <li> <p>Let <var>queryPercentEncodeSet</var> be the <a data-link-type="dfn" href="#special-query-percent-encode-set" id="ref-for-special-query-percent-encode-set">special-query percent-encode set</a> if <var>url</var> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①⑥">is special</a>; otherwise the <a data-link-type="dfn" href="#query-percent-encode-set" id="ref-for-query-percent-encode-set③">query percent-encode set</a>. </p> <li> <p><a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding⑤">Percent-encode after encoding</a>, with <var>encoding</var>, <var>buffer</var>, and <var>queryPercentEncodeSet</var>, and append the result to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⑥">query</a>. </p> <p class="note" role="note">This operation cannot be invoked code-point-for-code-point due to the stateful <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#iso-2022-jp-encoder" id="ref-for-iso-2022-jp-encoder">ISO-2022-JP encoder</a>. </p> <li> <p>Set <var>buffer</var> to the empty string. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑧⑧">c</a> is U+0023 (#), then set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment⑧">fragment</a> to the empty string and state to <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state⑥">fragment state</a>. </p> </ol> <li> <p>Otherwise, if <a data-link-type="dfn" href="#c" id="ref-for-c⑧⑨">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point①⑨">EOF code point</a>: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑨⓪">c</a> is not a <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points⑤">URL code point</a> and not U+0025 (%), <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit⑧">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⑥">validation error</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑨①">c</a> is U+0025 (%) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining①⓪">remaining</a> does not start with two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit⑧">ASCII hex digits</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit⑨">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⑦">validation error</a>. </p> <li> <p>Append <a data-link-type="dfn" href="#c" id="ref-for-c⑨②">c</a> to <var>buffer</var>. </p> </ol> </ol> <dt><dfn class="dfn-paneled" data-dfn-for="basic URL parser" data-dfn-type="dfn" data-export id="fragment-state">fragment state</dfn> <dd> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑨③">c</a> is not the <a data-link-type="dfn" href="#eof-code-point" id="ref-for-eof-code-point②⓪">EOF code point</a>, then: </p> <ol> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑨④">c</a> is not a <a data-link-type="dfn" href="#url-code-points" id="ref-for-url-code-points⑥">URL code point</a> and not U+0025 (%), <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit①⓪">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⑧">validation error</a>. </p> <li> <p>If <a data-link-type="dfn" href="#c" id="ref-for-c⑨⑤">c</a> is U+0025 (%) and <a data-link-type="dfn" href="#remaining" id="ref-for-remaining①①">remaining</a> does not start with two <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-hex-digit" id="ref-for-ascii-hex-digit⑨">ASCII hex digits</a>, <a data-link-type="dfn" href="#invalid-url-unit" id="ref-for-invalid-url-unit①①">invalid-URL-unit</a> <a data-link-type="dfn" href="#validation-error" id="ref-for-validation-error⑤⑨">validation error</a>. </p> <li> <p><a data-link-type="dfn" href="#utf-8-percent-encode" id="ref-for-utf-8-percent-encode⑤">UTF-8 percent-encode</a> <a data-link-type="dfn" href="#c" id="ref-for-c⑨⑥">c</a> using the <a data-link-type="dfn" href="#fragment-percent-encode-set" id="ref-for-fragment-percent-encode-set①">fragment percent-encode set</a> and append the result to <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment⑨">fragment</a>. </p> </ol> </ol> </dl> <li> <p>Return <var>url</var>. </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="set the username" data-algorithm-for="url"> <p>To <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="set-the-username">set the username</dfn> given a <var>url</var> and <var>username</var>, set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username⑧">username</a> to the result of running <a data-link-type="dfn" href="#string-utf-8-percent-encode" id="ref-for-string-utf-8-percent-encode③">UTF-8 percent-encode</a> on <var>username</var> using the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set⑦">userinfo percent-encode set</a>. </p> </div> <div class="algorithm" data-algorithm="set the password" data-algorithm-for="url"> <p>To <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="set-the-password">set the password</dfn> given a <var>url</var> and <var>password</var>, set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password⑧">password</a> to the result of running <a data-link-type="dfn" href="#string-utf-8-percent-encode" id="ref-for-string-utf-8-percent-encode④">UTF-8 percent-encode</a> on <var>password</var> using the <a data-link-type="dfn" href="#userinfo-percent-encode-set" id="ref-for-userinfo-percent-encode-set⑧">userinfo percent-encode set</a>. </p> </div> <h3 class="heading settled" data-level="4.5" id="url-serializing"><span class="secno">4.5. </span><span class="content">URL serializing</span><a class="self-link" href="#url-serializing"></a></h3> <div class="algorithm" data-algorithm="URL serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-url-serializer">URL serializer</dfn> takes a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④④">URL</a> <var>url</var>, with an optional boolean <dfn class="dfn-paneled" data-dfn-for="URL serializer" data-dfn-type="dfn" data-export id="url-serializer-exclude-fragment"><var>exclude fragment</var></dfn> (default false), and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string②①">ASCII string</a>. </p> <ol> <li> <p>Let <var>output</var> be <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③④">scheme</a> and U+003A (:) concatenated. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②②">host</a> is non-null: </p> <ol> <li> <p>Append "<code>//</code>" to <var>output</var>. </p> <li> <p>If <var>url</var> <a data-link-type="dfn" href="#include-credentials" id="ref-for-include-credentials③">includes credentials</a>, then: </p> <ol> <li> <p>Append <var>url</var>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username⑨">username</a> to <var>output</var>. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password⑨">password</a> is not the empty string, then append U+003A (:), followed by <var>url</var>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password①⓪">password</a>, to <var>output</var>. </p> <li> <p>Append U+0040 (@) to <var>output</var>. </p> </ol> <li> <p>Append <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②③">host</a>, <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer④">serialized</a>, to <var>output</var>. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①⓪">port</a> is non-null, append U+003A (:) followed by <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①①">port</a>, <a data-link-type="dfn" href="#serialize-an-integer" id="ref-for-serialize-an-integer①">serialized</a>, to <var>output</var>. </p> </ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②④">host</a> is null, <var>url</var> does not have an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path⑦">opaque path</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⑤">path</a>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size⑤">size</a> is greater than 1, and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⑥">path</a>[0] is the empty string, then append U+002F (/) followed by U+002E (.) to <var>output</var>. </p> <p class="note" role="note">This prevents <code>web+demo:/.//not-a-host/</code> or <code>web+demo:/path/..//not-a-host/</code>, when <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser①⓪">parsed</a> and then <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer⑤">serialized</a>, from ending up as <code>web+demo://not-a-host/</code> (they end up as <code>web+demo:/.//not-a-host/</code>). </p> <li> <p>Append the result of <a data-link-type="dfn" href="#url-path-serializer" id="ref-for-url-path-serializer">URL path serializing</a> <var>url</var> to <var>output</var>. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⑦">query</a> is non-null, append U+003F (?), followed by <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⑧">query</a>, to <var>output</var>. </p> <li> <p>If <var>exclude fragment</var> is false and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①⓪">fragment</a> is non-null, then append U+0023 (#), followed by <var>url</var>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①①">fragment</a>, to <var>output</var>. </p> <li> <p>Return <var>output</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="URL path serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="URL path serializer|URL path serializing" id="url-path-serializer">URL path serializer</dfn> takes a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⑤">URL</a> <var>url</var> and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string②②">ASCII string</a>. </p> <ol> <li> <p>If <var>url</var> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path⑧">opaque path</a>, then return <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⑦">path</a>. </p> <li> <p>Let <var>output</var> be the empty string. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate⑤">For each</a> <var>segment</var> of <var>url</var>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⑧">path</a>: append U+002F (/) followed by <var>segment</var> to <var>output</var>. </p> <li> <p>Return <var>output</var>. </p> </ol> </div> <h3 class="heading settled" data-level="4.6" id="url-equivalence"><span class="secno">4.6. </span><span class="content">URL equivalence</span><a class="self-link" href="#url-equivalence"></a></h3> <div class="algorithm" data-algorithm="equal"> <p>To determine whether a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⑥">URL</a> <var>A</var> <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export data-lt="equal" id="concept-url-equals">equals</dfn> <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⑦">URL</a> <var>B</var>, with an optional boolean <dfn class="dfn-paneled" data-dfn-for="url/equals" data-dfn-type="dfn" data-export id="url-equals-exclude-fragments"><var>exclude fragments</var></dfn> (default false), run these steps: </p> <ol> <li> <p>Let <var>serializedA</var> be the result of <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer⑥">serializing</a> <var>A</var>, with <a data-link-type="dfn" href="#url-serializer-exclude-fragment" id="ref-for-url-serializer-exclude-fragment"><i>exclude fragment</i></a> set to <var>exclude fragments</var>. </p> <li> <p>Let <var>serializedB</var> be the result of <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer⑦">serializing</a> <var>B</var>, with <a data-link-type="dfn" href="#url-serializer-exclude-fragment" id="ref-for-url-serializer-exclude-fragment①"><i>exclude fragment</i></a> set to <var>exclude fragments</var>. </p> <li> <p>Return true if <var>serializedA</var> is <var>serializedB</var>; otherwise false. </p> </ol> </div> <h3 class="heading settled" data-level="4.7" id="origin"><span class="secno">4.7. </span><span class="content">Origin</span><a class="self-link" href="#origin"></a></h3> <p class="note" role="note">See <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin" id="ref-for-concept-origin①">origin</a>’s definition in <cite>HTML</cite> for the necessary background information. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> </p> <div class="algorithm" data-algorithm="origin" data-algorithm-for="url"> <p>The <dfn class="dfn-paneled" data-dfn-for="url" data-dfn-type="dfn" data-export id="concept-url-origin">origin</dfn> of a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⑧">URL</a> <var>url</var> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin" id="ref-for-concept-origin②">origin</a> returned by running these steps, switching on <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⑤">scheme</a>: </p> <dl class="switch"> <dt>"<code>blob</code>" <dd> <ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-blob-entry" id="ref-for-concept-url-blob-entry②">blob URL entry</a> is non-null, then return <var>url</var>’s <a data-link-type="dfn" href="#concept-url-blob-entry" id="ref-for-concept-url-blob-entry③">blob URL entry</a>’s <a data-link-type="dfn" href="https://w3c.github.io/FileAPI/#blob-url-entry-environment" id="ref-for-blob-url-entry-environment">environment</a>’s <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin" id="ref-for-concept-settings-object-origin">origin</a>. </p> <li> <p>Let <var>pathURL</var> be the result of <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser③">parsing</a> the result of <a data-link-type="dfn" href="#url-path-serializer" id="ref-for-url-path-serializer①">URL path serializing</a> <var>url</var>. </p> <li> <p>If <var>pathURL</var> is failure, then return a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque" id="ref-for-concept-origin-opaque">opaque origin</a>. </p> <li> <p>If <var>pathURL</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⑥">scheme</a> is "<code>http</code>", "<code>https</code>", or "<code>file</code>", then return <var>pathURL</var>’s <a data-link-type="dfn" href="#concept-url-origin" id="ref-for-concept-url-origin">origin</a>. </p> <li> <p>Return a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque" id="ref-for-concept-origin-opaque①">opaque origin</a>. </p> </ol> <p class="example" id="example-43b5cea5"><a class="self-link" href="#example-43b5cea5"></a>The <a data-link-type="dfn" href="#concept-url-origin" id="ref-for-concept-url-origin①">origin</a> of <code>blob:https://whatwg.org/d0360e2f-caee-469f-9a2f-87d5b0456f6f</code> is the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-tuple" id="ref-for-concept-origin-tuple">tuple origin</a> ("<code>https</code>", "<code>whatwg.org</code>", null, null). </p> <dt>"<code>ftp</code>" <dt>"<code>http</code>" <dt>"<code>https</code>" <dt>"<code>ws</code>" <dt>"<code>wss</code>" <dd> <p>Return the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-tuple" id="ref-for-concept-origin-tuple①">tuple origin</a> (<var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⑦">scheme</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⑤">host</a>, <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①②">port</a>, null). </p> <dt>"<code>file</code>" <dd> <p>Unfortunate as it is, this is left as an exercise to the reader. When in doubt, return a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque" id="ref-for-concept-origin-opaque②">opaque origin</a>. </p> <dt>Otherwise <dd> <p>Return a new <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque" id="ref-for-concept-origin-opaque③">opaque origin</a>. </p> <p class="note" role="note">This does indeed mean that these <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url④⑨">URLs</a> cannot be <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#same-origin" id="ref-for-same-origin">same origin</a> with themselves. </p> </dl> </div> <h3 class="heading settled" data-level="4.8" id="url-rendering"><span class="secno">4.8. </span><span class="content">URL rendering</span><a class="self-link" href="#url-rendering"></a></h3> <p>A <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⓪">URL</a> should be rendered in its <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer⑧">serialized</a> form, with modifications described below, when the primary purpose of displaying a URL is to have the user make a security or trust decision. For example, users are expected to make trust decisions based on a URL rendered in the browser address bar. </p> <h4 class="heading settled" data-level="4.8.1" id="url-rendering-simplification"><span class="secno">4.8.1. </span><span class="content">Simplify non-human-readable or irrelevant components</span><a class="self-link" href="#url-rendering-simplification"></a></h4> <p>Remove components that can provide opportunities for spoofing or distract from security-relevant information: </p> <ul> <li> <p>Browsers may render only a URL’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⑥">host</a> in places where it is important for end users to distinguish between the host and other parts of the URL such as the <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path②⑨">path</a>. Browsers may consider simplifying the host further to draw attention to its <a data-link-type="dfn" href="#host-registrable-domain" id="ref-for-host-registrable-domain①">registrable domain</a>. For example, browsers may omit a leading <code>www</code> or <code>m</code> <a data-link-type="dfn" href="#domain-label" id="ref-for-domain-label①">domain label</a> to simplify the host, or display its registrable domain only to remove spoofing opportunities posted by subdomains (e.g., <code>https://examplecorp.attacker.com/</code>). </p> <li> <p>Browsers should not render a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤①">URL</a>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username①⓪">username</a> and <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password①①">password</a>, as they can be mistaken for a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤②">URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⑦">host</a> (e.g., <code>https://examplecorp.com@attacker.example/</code>). </p> <li> <p>Browsers may render a URL without its <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⑧">scheme</a> if the display surface only ever permits a single scheme (such as a browser feature that omits <code>https://</code> because it is only enabled for secure origins). Otherwise, the scheme may be replaced or supplemented with a human-readable string (e.g., "Not secure"), a security indicator icon, or both. </p> </ul> <h4 class="heading settled" data-level="4.8.2" id="url-rendering-elision"><span class="secno">4.8.2. </span><span class="content">Elision</span><a class="self-link" href="#url-rendering-elision"></a></h4> <p>In a space-constrained display, URLs should be elided carefully to avoid misleading the user when making a security decision: </p> <ul> <li> <p>Browsers should ensure that at least the <a data-link-type="dfn" href="#host-registrable-domain" id="ref-for-host-registrable-domain②">registrable domain</a> can be shown when the URL is rendered (to avoid showing, e.g., <code>...examplecorp.com</code> when loading <code>https://not-really-examplecorp.com/</code>). </p> <li> <p>When the full <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⑧">host</a> cannot be rendered, browsers should elide <a data-link-type="dfn" href="#domain-label" id="ref-for-domain-label②">domain labels</a> starting from the lowest-level domain label. For example, <code>examplecorp.com.evil.com</code> should be elided as <code>...com.evil.com</code>, not <code>examplecorp.com...</code>. (Note that bidirectional text means that the lowest-level domain label may not appear on the left.) </p> </ul> <h4 class="heading settled" data-level="4.8.3" id="url-rendering-i18n"><span class="secno">4.8.3. </span><span class="content">Internationalization and special characters</span><a class="self-link" href="#url-rendering-i18n"></a></h4> <p>Internationalized domain names (IDNs), special characters, and bidirectional text should be handled with care to prevent spoofing: </p> <ul> <li> <p>Browsers should render a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤③">URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host②⑨">host</a> by running <a data-link-type="dfn" href="#concept-domain-to-unicode" id="ref-for-concept-domain-to-unicode①">domain to Unicode</a> with the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤④">URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③⓪">host</a> and false. </p> <p class="note" role="note">Various characters can be used in homograph spoofing attacks. Consider detecting confusable characters and warning when they are in use. <a data-link-type="biblio" href="#biblio-idnfaq" title="Internationalized Domain Names (IDN) FAQ">[IDNFAQ]</a> <a data-link-type="biblio" href="#biblio-uts39" title="Unicode Security Mechanisms">[UTS39]</a> </p> <li> <p>URLs are particularly prone to confusion between host and path when they contain bidirectional text, so in this case it is particularly advisable to only render a URL’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③①">host</a>. For readability, other parts of the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⑤">URL</a>, if rendered, should have their sequences of <a data-link-type="dfn" href="#percent-encoded-byte" id="ref-for-percent-encoded-byte⑦">percent-encoded bytes</a> replaced with code points resulting from running <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom②">UTF-8 decode without BOM</a> on the <a data-link-type="dfn" href="#string-percent-decode" id="ref-for-string-percent-decode⑤">percent-decoding</a> of those sequences, unless that renders those sequences invisible. Browsers may choose to not decode certain sequences that present spoofing risks (e.g., U+1F512 (🔒)). </p> <li> <p>Browsers should render bidirectional text as if it were in a left-to-right embedding. <a data-link-type="biblio" href="#biblio-bidi" title="Unicode Bidirectional Algorithm">[BIDI]</a> </p> <p class="note" role="note">Unfortunately, as rendered <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⑥">URLs</a> are strings and can appear anywhere, a specific bidirectional algorithm for rendered <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⑦">URLs</a> would not see wide adoption. Bidirectional text interacts with the parts of a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⑧">URL</a> in ways that can cause the rendering to be different from the model. Users of bidirectional languages can come to expect this, particularly in plain text environments. </p> </ul> <h2 class="heading settled" data-level="5" id="application/x-www-form-urlencoded"><span class="secno">5. </span><span class="content"><code>application/x-www-form-urlencoded</code></span><a class="self-link" href="#application/x-www-form-urlencoded"></a></h2> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export id="concept-urlencoded"><code>application/x-www-form-urlencoded</code></dfn> format provides a way to encode a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list④">list</a> of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①">tuples</a>, each consisting of a name and a value. </p> <p class="note" role="note">The <code>application/x-www-form-urlencoded</code> format is in many ways an aberrant monstrosity, the result of many years of implementation accidents and compromises leading to a set of requirements necessary for interoperability, but in no way representing good design practices. In particular, readers are cautioned to pay close attention to the twisted details involving repeated (and in some cases nested) conversions between character encodings and byte sequences. Unfortunately the format is in widespread use due to the prevalence of HTML forms. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> </p> <h3 class="heading settled" data-level="5.1" id="urlencoded-parsing"><span class="secno">5.1. </span><span class="content"><code>application/x-www-form-urlencoded</code> parsing</span><a class="self-link" href="#urlencoded-parsing"></a></h3> <p class="note" role="note">A legacy server-oriented implementation might have to support <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encoding" id="ref-for-encoding③">encodings</a> other than <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8⑧">UTF-8</a> as well as have special logic for tuples of which the name is `<code>_charset</code>`. Such logic is not described here as only <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8⑨">UTF-8</a> is conforming. </p> <div class="algorithm" data-algorithm="urlencoded parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="urlencoded parser" id="concept-urlencoded-parser"><code>application/x-www-form-urlencoded</code> parser</dfn> takes a byte sequence <var>input</var>, and then runs these steps: </p> <ol> <li> <p>Let <var>sequences</var> be the result of splitting <var>input</var> on 0x26 (&amp;). </p> <li> <p>Let <var>output</var> be an initially empty <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑤">list</a> of name-value tuples where both name and value hold a string. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate⑥">For each</a> byte sequence <var>bytes</var> in <var>sequences</var>: </p> <ol> <li> <p>If <var>bytes</var> is the empty byte sequence, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#iteration-continue" id="ref-for-iteration-continue⑤">continue</a>. </p> <li> <p>If <var>bytes</var> contains a 0x3D (=), then let <var>name</var> be the bytes from the start of <var>bytes</var> up to but excluding its first 0x3D (=), and let <var>value</var> be the bytes, if any, after the first 0x3D (=) up to the end of <var>bytes</var>. If 0x3D (=) is the first byte, then <var>name</var> will be the empty byte sequence. If it is the last, then <var>value</var> will be the empty byte sequence. </p> <li> <p>Otherwise, let <var>name</var> have the value of <var>bytes</var> and let <var>value</var> be the empty byte sequence. </p> <li> <p>Replace any 0x2B (+) in <var>name</var> and <var>value</var> with 0x20 (SP). </p> <li> <p>Let <var>nameString</var> and <var>valueString</var> be the result of running <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-decode-without-bom" id="ref-for-utf-8-decode-without-bom③">UTF-8 decode without BOM</a> on the <a data-link-type="dfn" href="#percent-decode" id="ref-for-percent-decode②">percent-decoding</a> of <var>name</var> and <var>value</var>, respectively. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑥">Append</a> (<var>nameString</var>, <var>valueString</var>) to <var>output</var>. </p> </ol> <li> <p>Return <var>output</var>. </p> </ol> </div> <h3 class="heading settled" data-level="5.2" id="urlencoded-serializing"><span class="secno">5.2. </span><span class="content"><code>application/x-www-form-urlencoded</code> serializing</span><a class="self-link" href="#urlencoded-serializing"></a></h3> <div class="algorithm" data-algorithm="urlencoded serializer"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="urlencoded serializer" id="concept-urlencoded-serializer"><code>application/x-www-form-urlencoded</code> serializer</dfn> takes a list of name-value tuples <var>tuples</var>, with an optional <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#encoding" id="ref-for-encoding④">encoding</a> <var>encoding</var> (default <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8①⓪">UTF-8</a>), and then runs these steps. They return an <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#ascii-string" id="ref-for-ascii-string②③">ASCII string</a>. </p> <ol> <li> <p>Set <var>encoding</var> to the result of <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#get-an-output-encoding" id="ref-for-get-an-output-encoding①">getting an output encoding</a> from <var>encoding</var>. </p> <li> <p>Let <var>output</var> be the empty string. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate⑦">For each</a> <var>tuple</var> of <var>tuples</var>: </p> <ol> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#assert" id="ref-for-assert②">Assert</a>: <var>tuple</var>’s name and <var>tuple</var>’s value are <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string①⓪">scalar value strings</a>. </p> <li> <p>Let <var>name</var> be the result of running <a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding⑥">percent-encode after encoding</a> with <var>encoding</var>, <var>tuple</var>’s name, the <a data-link-type="dfn" href="#application-x-www-form-urlencoded-percent-encode-set" id="ref-for-application-x-www-form-urlencoded-percent-encode-set②"><code>application/x-www-form-urlencoded</code> percent-encode set</a>, and true. </p> <li> <p>Let <var>value</var> be the result of running <a data-link-type="dfn" href="#string-percent-encode-after-encoding" id="ref-for-string-percent-encode-after-encoding⑦">percent-encode after encoding</a> with <var>encoding</var>, <var>tuple</var>’s value, the <a data-link-type="dfn" href="#application-x-www-form-urlencoded-percent-encode-set" id="ref-for-application-x-www-form-urlencoded-percent-encode-set③"><code>application/x-www-form-urlencoded</code> percent-encode set</a>, and true. </p> <li> <p>If <var>output</var> is not the empty string, then append U+0026 (&amp;) to <var>output</var>. </p> <li>Append <var>name</var>, followed by U+003D (=), followed by <var>value</var>, to <var>output</var>. </ol> <li>Return <var>output</var>. </ol> </div> <h3 class="heading settled" data-level="5.3" id="urlencoded-hooks"><span class="secno">5.3. </span><span class="content">Hooks</span><a class="self-link" href="#urlencoded-hooks"></a></h3> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-lt="urlencoded string parser" data-noexport id="concept-urlencoded-string-parser"><code>application/x-www-form-urlencoded</code> string parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string①①">scalar value string</a> <var>input</var>, <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8-encode" id="ref-for-utf-8-encode①">UTF-8 encodes</a> it, and then returns the result of <a data-link-type="dfn" href="#concept-urlencoded-parser" id="ref-for-concept-urlencoded-parser"><code>application/x-www-form-urlencoded</code> parsing</a> it. </p> <h2 class="heading settled" data-level="6" id="api"><span class="secno">6. </span><span class="content">API</span><a class="self-link" href="#api"></a></h2> <p>This section uses terminology from <cite>Web IDL</cite>. Browser user agents must support this API. JavaScript implementations should support this API. Other user agents or programming languages are encouraged to use an API suitable to their needs, which might not be this one. <a data-link-type="biblio" href="#biblio-webidl" title="Web IDL Standard">[WEBIDL]</a> </p> <h3 class="heading settled" data-level="6.1" id="url-class"><span class="secno">6.1. </span><span class="content">URL class</span><a class="self-link" href="#url-class"></a></h3> <pre class="idl highlight def">[Exposed=*, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#LegacyWindowAlias" id="ref-for-LegacyWindowAlias"><c- g>LegacyWindowAlias</c-></a>=<dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="webkiturl"><code><c- n>webkitURL</c-></code></dfn>] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="url"><code><c- g>URL</c-></code></dfn> { <a class="idl-code" data-link-type="constructor" href="#dom-url-url" id="ref-for-dom-url-url"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/URL(url, base), URL/constructor(url, base), URL/URL(url), URL/constructor(url)" data-dfn-type="argument" data-export id="dom-url-url-url-base-url"><code><c- g>url</c-></code></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/URL(url, base), URL/constructor(url, base), URL/URL(url), URL/constructor(url)" data-dfn-type="argument" data-export id="dom-url-url-url-base-base"><code><c- g>base</c-></code></dfn>); <c- b>static</c-> <a data-link-type="idl-name" href="#url" id="ref-for-url①"><c- n>URL</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-url-parse" id="ref-for-dom-url-parse"><c- g>parse</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/parse(url, base), URL/parse(url)" data-dfn-type="argument" data-export id="dom-url-parse-url-base-url"><code><c- g>url</c-></code></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/parse(url, base), URL/parse(url)" data-dfn-type="argument" data-export id="dom-url-parse-url-base-base"><code><c- g>base</c-></code></dfn>); <c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="method" href="#dom-url-canparse" id="ref-for-dom-url-canparse"><c- g>canParse</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString④"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/canParse(url, base), URL/canParse(url)" data-dfn-type="argument" data-export id="dom-url-canparse-url-base-url"><code><c- g>url</c-></code></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString⑤"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URL/canParse(url, base), URL/canParse(url)" data-dfn-type="argument" data-export id="dom-url-canparse-url-base-base"><code><c- g>base</c-></code></dfn>); <dfn class="dfn-paneled" data-dfn-for="URL" data-dfn-type="dfn" data-export data-lt="stringification behavior" id="URL-stringification-behavior"><c- b>stringifier</c-></dfn> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString⑥"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-href" id="ref-for-dom-url-href"><c- g>href</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString⑦"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#dom-url-origin" id="ref-for-dom-url-origin"><c- g>origin</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString⑧"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-protocol" id="ref-for-dom-url-protocol"><c- g>protocol</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString⑨"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-username" id="ref-for-dom-url-username"><c- g>username</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⓪"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-password" id="ref-for-dom-url-password"><c- g>password</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①①"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-host" id="ref-for-dom-url-host"><c- g>host</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①②"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-hostname" id="ref-for-dom-url-hostname"><c- g>hostname</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①③"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-port" id="ref-for-dom-url-port"><c- g>port</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①④"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-pathname" id="ref-for-dom-url-pathname"><c- g>pathname</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⑤"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-search" id="ref-for-dom-url-search"><c- g>search</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject" id="ref-for-SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#urlsearchparams" id="ref-for-urlsearchparams"><c- n>URLSearchParams</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="URLSearchParams" href="#dom-url-searchparams" id="ref-for-dom-url-searchparams"><c- g>searchParams</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⑥"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-hash" id="ref-for-dom-url-hash"><c- g>hash</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⑦"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="method" href="#dom-url-tojson" id="ref-for-dom-url-tojson"><c- g>toJSON</c-></a>(); }; </pre> <p>A <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url②">URL</a></code> object has an associated: </p> <ul class="brief"> <li><dfn class="dfn-paneled" data-dfn-for="URL" data-dfn-type="dfn" data-noexport id="concept-url-url">URL</dfn>: a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑤⑨">URL</a>. <li><dfn class="dfn-paneled" data-dfn-for="URL" data-dfn-type="dfn" data-noexport id="concept-url-query-object">query object</dfn>: a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams①">URLSearchParams</a></code> object. </ul> <div class="algorithm" data-algorithm="potentially strip trailing spaces from an opaque path"> <p>To <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="potentially-strip-trailing-spaces-from-an-opaque-path">potentially strip trailing spaces from an opaque path</dfn> given a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url③">URL</a></code> object <var>url</var>: </p> <ol> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url">URL</a> does not have an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path⑨">opaque path</a>, then return. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①">URL</a>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①②">fragment</a> is non-null, then return. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query①⑨">query</a> is non-null, then return. </p> <li> <p>Remove all trailing U+0020 SPACE <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑧">code points</a> from <var>url</var>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③⓪">path</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="API URL parser"> <p>The <dfn class="dfn-paneled" data-dfn-type="dfn" data-noexport id="api-url-parser">API URL parser</dfn> takes a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string①②">scalar value string</a> <var>url</var> and an optional null-or-<a data-link-type="dfn" href="https://infra.spec.whatwg.org/#scalar-value-string" id="ref-for-scalar-value-string①③">scalar value string</a> <var>base</var> (default null), and then runs these steps: </p> <ol> <li> <p>Let <var>parsedBase</var> be null. </p> <li> <p>If <var>base</var> is non-null: </p> <ol> <li> <p>Set <var>parsedBase</var> to the result of running the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser④">basic URL parser</a> on <var>base</var>. </p> <li> <p>If <var>parsedBase</var> is failure, then return failure. </p> </ol> <li> <p>Return the result of running the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser⑤">basic URL parser</a> on <var>url</var> with <var>parsedBase</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="initialize" data-algorithm-for="URL"> <p>To <dfn class="dfn-paneled" data-dfn-for="URL" data-dfn-type="dfn" data-noexport id="url-initialize">initialize</dfn> a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url④">URL</a></code> object <var>url</var> with a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⓪">URL</a> <var>urlRecord</var>: </p> <ol> <li> <p>Let <var>query</var> be <var>urlRecord</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②⓪">query</a>, if that is non-null; otherwise the empty string. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④">URL</a> to <var>urlRecord</var>. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object">query object</a> to a new <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams②">URLSearchParams</a></code> object. </p> <li> <p><a data-link-type="dfn" href="#urlsearchparams-initialize" id="ref-for-urlsearchparams-initialize">Initialize</a> <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object①">query object</a> with <var>query</var>. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object②">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-url-object" id="ref-for-concept-urlsearchparams-url-object">URL object</a> to <var>url</var>. </p> </ol> </div> <hr> <div class="algorithm" data-algorithm="URL(url, base)" data-algorithm-for="URL"> <p id="constructors">The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="constructor" data-export data-lt="URL(url, base)|constructor(url, base)|URL(url)|constructor(url)" id="dom-url-url"><code>new URL(<var>url</var>, <var>base</var>)</code></dfn> constructor steps are: </p> <ol> <li> <p>Let <var>parsedURL</var> be the result of running the <a data-link-type="dfn" href="#api-url-parser" id="ref-for-api-url-parser">API URL parser</a> on <var>url</var> with <var>base</var>, if given. </p> <li> <p>If <var>parsedURL</var> is failure, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror">TypeError</a></code>. </p> <li> <p><a data-link-type="dfn" href="#url-initialize" id="ref-for-url-initialize">Initialize</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this">this</a> with <var>parsedURL</var>. </p> </ol> </div> <div class="example" id="example-5434421b"> <a class="self-link" href="#example-5434421b"></a> <p>To <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser⑥">parse</a> a string into a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥①">URL</a> without using a <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①③">base URL</a>, invoke the <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url⑤">URL</a></code> constructor with a single argument: </p> <pre><code class="lang-javascript highlight"><c- a>var</c-> input <c- o>=</c-> <c- u>"https://example.org/💩"</c-><c- p>,</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c->input<c- p>)</c-> url<c- p>.</c->pathname <c- c1>// "/%F0%9F%92%A9"</c-></code></pre> <p>This throws an exception if the input is a <a data-link-type="dfn" href="#relative-url-string" id="ref-for-relative-url-string⑤">relative-URL string</a>: </p> <pre><code class="lang-javascript highlight"><c- k>try</c-> <c- p>{</c-> <c- a>var</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"/🍣🍺"</c-><c- p>)</c-> <c- p>}</c-> <c- k>catch</c-><c- p>(</c->e<c- p>)</c-> <c- p>{</c-> <c- c1>// that happened</c-> <c- p>}</c-></code></pre> <p>For those cases a <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①④">base URL</a> is necessary: </p> <pre><code class="lang-javascript highlight"><c- a>var</c-> input <c- o>=</c-> <c- u>"/🍣🍺"</c-><c- p>,</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c->input<c- p>,</c-> document<c- p>.</c->baseURI<c- p>)</c-> url<c- p>.</c->href <c- c1>// "https://url.spec.whatwg.org/%F0%9F%8D%A3%F0%9F%8D%BA"</c-></code></pre> <p>A <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url⑥">URL</a></code> object can be used as a <a data-link-type="dfn" href="#concept-base-url" id="ref-for-concept-base-url①⑤">base URL</a> (as the IDL requires a string as argument, a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url⑦">URL</a></code> object stringifies to its <code class="idl"><a data-link-type="idl" href="#dom-url-href" id="ref-for-dom-url-href①">href</a></code> getter return value):</p> <pre><code class="lang-javascript highlight"><c- a>var</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"🏳️‍🌈"</c-><c- p>,</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"https://pride.example/hello-world"</c-><c- p>))</c-> url<c- p>.</c->pathname <c- c1>// "/%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%F0%9F%8C%88"</c-></code></pre> </div> <hr> <div class="algorithm" data-algorithm="parse(url, base)" data-algorithm-for="URL"> <p>The static <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="method" data-export data-lt="parse(url, base)|parse(url)" id="dom-url-parse"><code>parse(<var>url</var>, <var>base</var>)</code></dfn> method steps are: </p> <ol> <li> <p>Let <var>parsedURL</var> be the result of running the <a data-link-type="dfn" href="#api-url-parser" id="ref-for-api-url-parser①">API URL parser</a> on <var>url</var> with <var>base</var>, if given. </p> <li> <p>If <var>parsedURL</var> is failure, then return null. </p> <li> <p>Let <var>url</var> be a new <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url⑧">URL</a></code> object. </p> <li> <p><a data-link-type="dfn" href="#url-initialize" id="ref-for-url-initialize①">Initialize</a> <var>url</var> with <var>parsedURL</var>. </p> <li> <p>Return <var>url</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="canParse(url, base)" data-algorithm-for="URL"> <p>The static <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="method" data-export data-lt="canParse(url, base)|canParse(url)" id="dom-url-canparse"><code>canParse(<var>url</var>, <var>base</var>)</code></dfn> method steps are: </p> <ol> <li> <p>Let <var>parsedURL</var> be the result of running the <a data-link-type="dfn" href="#api-url-parser" id="ref-for-api-url-parser②">API URL parser</a> on <var>url</var> with <var>base</var>, if given. </p> <li> <p>If <var>parsedURL</var> is failure, then return false. </p> <li> <p>Return true. </p> </ol> </div> <hr id="urlutils-members"> <div class="algorithm" data-algorithm="href getter"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-href"><code>href</code></dfn> getter steps and the <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="method" data-export id="dom-url-tojson"><code>toJSON()</code></dfn> method steps are to return the <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer⑨">serialization</a> of <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url⑤">URL</a>. </p> </div> <div class="algorithm" data-algorithm="href setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-href" id="ref-for-dom-url-href②">href</a></code> setter steps are: </p> <ol> <li> <p>Let <var>parsedURL</var> be the result of running the <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser⑦">basic URL parser</a> on the given value. </p> <li> <p>If <var>parsedURL</var> is failure, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw①">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror①">TypeError</a></code>. </p> <li> <p>Set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url⑥">URL</a> to <var>parsedURL</var>. </p> <li> <p>Empty <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③">this</a>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object③">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list">list</a>. </p> <li> <p>Let <var>query</var> be <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url⑦">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②①">query</a>. </p> <li> <p>If <var>query</var> is non-null, then set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤">this</a>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object④">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①">list</a> to the result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser" id="ref-for-concept-urlencoded-string-parser">parsing</a> <var>query</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="origin" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-origin"><code>origin</code></dfn> getter steps are to return the <a data-link-type="dfn" href="https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin" id="ref-for-ascii-serialisation-of-an-origin">serialization</a> of <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url⑧">URL</a>’s <a data-link-type="dfn" href="#concept-url-origin" id="ref-for-concept-url-origin②">origin</a>. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> </p> </div> <div class="algorithm" data-algorithm="protocol" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-protocol"><code>protocol</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑦">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url⑨">URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme" id="ref-for-concept-url-scheme③⑨">scheme</a>, followed by U+003A (:). </p> </div> <div class="algorithm" data-algorithm="protocol setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-protocol" id="ref-for-dom-url-protocol①">protocol</a></code> setter steps are to <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser⑧">basic URL parse</a> the given value, followed by U+003A (:), with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑧">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⓪">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url"><i>url</i></a> and <a data-link-type="dfn" href="#scheme-start-state" id="ref-for-scheme-start-state①">scheme start state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override"><i>state override</i></a>. </p> </div> <div class="algorithm" data-algorithm="username" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-username"><code>username</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑨">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①①">URL</a>’s <a data-link-type="dfn" href="#concept-url-username" id="ref-for-concept-url-username①①">username</a>. </p> </div> <div class="algorithm" data-algorithm="username setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-username" id="ref-for-dom-url-username①">username</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⓪">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①②">URL</a> <a data-link-type="dfn" href="#cannot-have-a-username-password-port" id="ref-for-cannot-have-a-username-password-port">cannot have a username/password/port</a>, then return. </p> <li> <p><a data-link-type="dfn" href="#set-the-username" id="ref-for-set-the-username">Set the username</a> given <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①①">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①③">URL</a> and the given value. </p> </ol> </div> <div class="algorithm" data-algorithm="password" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-password"><code>password</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①②">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①④">URL</a>’s <a data-link-type="dfn" href="#concept-url-password" id="ref-for-concept-url-password①②">password</a>. </p> </div> <div class="algorithm" data-algorithm="password setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-password" id="ref-for-dom-url-password①">password</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①③">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⑤">URL</a> <a data-link-type="dfn" href="#cannot-have-a-username-password-port" id="ref-for-cannot-have-a-username-password-port①">cannot have a username/password/port</a>, then return. </p> <li> <p><a data-link-type="dfn" href="#set-the-password" id="ref-for-set-the-password">Set the password</a> given <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①④">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⑥">URL</a> and the given value. </p> </ol> </div> <div class="algorithm" data-algorithm="host" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-host"><code>host</code></dfn> getter steps are: </p> <ol> <li> <p>Let <var>url</var> be <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⑤">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⑦">URL</a>. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③②">host</a> is null, then return the empty string. </p> <li> <p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①③">port</a> is null, return <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③③">host</a>, <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer⑤">serialized</a>. </p> <li> <p>Return <var>url</var>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③④">host</a>, <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer⑥">serialized</a>, followed by U+003A (:) and <var>url</var>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①④">port</a>, <a data-link-type="dfn" href="#serialize-an-integer" id="ref-for-serialize-an-integer②">serialized</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="host setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-host" id="ref-for-dom-url-host①">host</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⑥">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⑧">URL</a> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path①⓪">opaque path</a>, then return. </p> <li> <p><a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser⑨">Basic URL parse</a> the given value with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⑦">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url①⑨">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url①"><i>url</i></a> and <a data-link-type="dfn" href="#host-state" id="ref-for-host-state①">host state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override①"><i>state override</i></a>. </p> </ol> <p class="note" role="note">If the given value for the <code><a class="idl-code" data-link-type="attribute" href="#dom-url-host" id="ref-for-dom-url-host②">host</a></code> setter lacks a <a data-link-type="dfn" href="#url-port-string" id="ref-for-url-port-string②">port</a>, <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⑧">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⓪">URL</a>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①⑤">port</a> will not change. This can be unexpected as <code>host</code> getter does return a <a data-link-type="dfn" href="#url-port-string" id="ref-for-url-port-string③">URL-port string</a> so one might have assumed the setter to always "reset" both. </p> </div> <div class="algorithm" data-algorithm="hostname" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-hostname"><code>hostname</code></dfn> getter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this①⑨">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②①">URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③⑤">host</a> is null, then return the empty string. </p> <li> <p>Return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⓪">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②②">URL</a>’s <a data-link-type="dfn" href="#concept-url-host" id="ref-for-concept-url-host③⑥">host</a>, <a data-link-type="dfn" href="#concept-host-serializer" id="ref-for-concept-host-serializer⑦">serialized</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="hostname setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-hostname" id="ref-for-dom-url-hostname①">hostname</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②①">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②③">URL</a> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path①①">opaque path</a>, then return. </p> <li> <p><a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①⓪">Basic URL parse</a> the given value with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②②">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②④">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url②"><i>url</i></a> and <a data-link-type="dfn" href="#hostname-state" id="ref-for-hostname-state①">hostname state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override②"><i>state override</i></a>. </p> </ol> </div> <div class="algorithm" data-algorithm="port" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-port"><code>port</code></dfn> getter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②③">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⑤">URL</a>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①⑥">port</a> is null, then return the empty string. </p> <li> <p>Return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②④">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⑥">URL</a>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①⑦">port</a>, <a data-link-type="dfn" href="#serialize-an-integer" id="ref-for-serialize-an-integer③">serialized</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="port setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-port" id="ref-for-dom-url-port①">port</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⑤">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⑦">URL</a> <a data-link-type="dfn" href="#cannot-have-a-username-password-port" id="ref-for-cannot-have-a-username-password-port②">cannot have a username/password/port</a>, then return. </p> <li> <p>If the given value is the empty string, then set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⑥">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⑧">URL</a>’s <a data-link-type="dfn" href="#concept-url-port" id="ref-for-concept-url-port①⑧">port</a> to null.</p> <li> <p>Otherwise, <a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①①">basic URL parse</a> the given value with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⑦">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url②⑨">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url③"><i>url</i></a> and <a data-link-type="dfn" href="#port-state" id="ref-for-port-state①">port state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override③"><i>state override</i></a>. </p> </ol> </div> <div class="algorithm" data-algorithm="pathname" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-pathname"><code>pathname</code></dfn> getter steps are to return the result of <a data-link-type="dfn" href="#url-path-serializer" id="ref-for-url-path-serializer②">URL path serializing</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⑧">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⓪">URL</a>. </p> </div> <div class="algorithm" data-algorithm="pathname setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-pathname" id="ref-for-dom-url-pathname①">pathname</a></code> setter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this②⑨">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③①">URL</a> has an <a data-link-type="dfn" href="#url-opaque-path" id="ref-for-url-opaque-path①②">opaque path</a>, then return. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-empty" id="ref-for-list-empty">Empty</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⓪">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③②">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③①">path</a>. </p> <li> <p><a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①②">Basic URL parse</a> the given value with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③①">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③③">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url④"><i>url</i></a> and <a data-link-type="dfn" href="#path-start-state" id="ref-for-path-start-state④">path start state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override④"><i>state override</i></a>. </p> </ol> </div> <div class="algorithm" data-algorithm="search" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-search"><code>search</code></dfn> getter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③②">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③④">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②②">query</a> is either null or the empty string, then return the empty string. </p> <li> <p>Return U+003F (?), followed by <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③③">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⑤">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②③">query</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="search setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-search" id="ref-for-dom-url-search①">search</a></code> setter steps are: </p> <ol> <li> <p>Let <var>url</var> be <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③④">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⑥">URL</a>. </p> <li> <p>If the given value is the empty string: </p> <ol> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②④">query</a> to null. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-empty" id="ref-for-list-empty①">Empty</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⑤">this</a>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object⑤">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list②">list</a>. </p> <li> <p><a data-link-type="dfn" href="#potentially-strip-trailing-spaces-from-an-opaque-path" id="ref-for-potentially-strip-trailing-spaces-from-an-opaque-path">Potentially strip trailing spaces from an opaque path</a> with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⑥">this</a>. </p> <li> <p>Return. </p> </ol> <li> <p>Let <var>input</var> be the given value with a single leading U+003F (?) removed, if any. </p> <li> <p>Set <var>url</var>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②⑤">query</a> to the empty string. </p> <li> <p><a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①③">Basic URL parse</a> <var>input</var> with <var>url</var> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url⑤"><i>url</i></a> and <a data-link-type="dfn" href="#query-state" id="ref-for-query-state⑤">query state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override⑤"><i>state override</i></a>. </p> <li> <p>Set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⑦">this</a>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object⑥">query object</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list③">list</a> to the result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser" id="ref-for-concept-urlencoded-string-parser①">parsing</a> <var>input</var>. </p> </ol> <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#dom-url-search" id="ref-for-dom-url-search②">search</a></code> setter has the potential to remove trailing U+0020 SPACE <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#code-point" id="ref-for-code-point⑨">code points</a> from <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⑧">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⑦">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③②">path</a>. It does this so that running the <a data-link-type="dfn" href="#concept-url-parser" id="ref-for-concept-url-parser①①">URL parser</a> on the output of running the <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer①⓪">URL serializer</a> on <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this③⑨">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⑧">URL</a> does not yield a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥②">URL</a> that is not <a data-link-type="dfn" href="#concept-url-equals" id="ref-for-concept-url-equals①">equal</a>. </p> </div> <div class="algorithm" data-algorithm="searchParams" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-searchparams"><code>searchParams</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⓪">this</a>’s <a data-link-type="dfn" href="#concept-url-query-object" id="ref-for-concept-url-query-object⑦">query object</a>. </p> </div> <div class="algorithm" data-algorithm="hash" data-algorithm-for="URL"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URL" data-dfn-type="attribute" data-export id="dom-url-hash"><code>hash</code></dfn> getter steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④①">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url③⑨">URL</a>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①③">fragment</a> is either null or the empty string, then return the empty string. </p> <li> <p>Return U+0023 (#), followed by <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④②">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④⓪">URL</a>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①④">fragment</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="hash setter"> <p>The <code><a class="idl-code" data-link-type="attribute" href="#dom-url-hash" id="ref-for-dom-url-hash①">hash</a></code> setter steps are: </p> <ol> <li> <p>If the given value is the empty string: </p> <ol> <li> <p>Set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④③">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④①">URL</a>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①⑤">fragment</a> to null. </p> <li> <p><a data-link-type="dfn" href="#potentially-strip-trailing-spaces-from-an-opaque-path" id="ref-for-potentially-strip-trailing-spaces-from-an-opaque-path①">Potentially strip trailing spaces from an opaque path</a> with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④④">this</a>. </p> <li> <p>Return. </p> </ol> <li> <p>Let <var>input</var> be the given value with a single leading U+0023 (#) removed, if any. </p> <li> <p>Set <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⑤">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④②">URL</a>’s <a data-link-type="dfn" href="#concept-url-fragment" id="ref-for-concept-url-fragment①⑥">fragment</a> to the empty string. </p> <li> <p><a data-link-type="dfn" href="#concept-basic-url-parser" id="ref-for-concept-basic-url-parser①④">Basic URL parse</a> <var>input</var> with <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⑥">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④③">URL</a> as <a data-link-type="dfn" href="#basic-url-parser-url" id="ref-for-basic-url-parser-url⑥"><i>url</i></a> and <a data-link-type="dfn" href="#fragment-state" id="ref-for-fragment-state⑦">fragment state</a> as <a data-link-type="dfn" href="#basic-url-parser-state-override" id="ref-for-basic-url-parser-state-override⑥"><i>state override</i></a>. </p> </ol> <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="#dom-url-hash" id="ref-for-dom-url-hash②">hash</a></code> setter has the potential to change <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⑦">this</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④④">URL</a>’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③③">path</a> in a manner equivalent to the <code class="idl"><a data-link-type="idl" href="#dom-url-search" id="ref-for-dom-url-search③">search</a></code> setter. </p> </div> <h3 class="heading settled" data-level="6.2" id="interface-urlsearchparams"><span class="secno">6.2. </span><span class="content">URLSearchParams class</span><a class="self-link" href="#interface-urlsearchparams"></a></h3> <pre class="idl highlight def">[Exposed=*] <c- b>interface</c-> <dfn class="dfn-paneled idl-code" data-dfn-type="interface" data-export id="urlsearchparams"><code><c- g>URLSearchParams</c-></code></dfn> { <a class="idl-code" data-link-type="constructor" href="#dom-urlsearchparams-urlsearchparams" id="ref-for-dom-urlsearchparams-urlsearchparams"><c- g>constructor</c-></a>(<c- b>optional</c-> (<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence①"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⑧"><c- b>USVString</c-></a>>> <c- b>or</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-record" id="ref-for-idl-record"><c- b>record</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString①⑨"><c- b>USVString</c-></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⓪"><c- b>USVString</c-></a>> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②①"><c- b>USVString</c-></a>) <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/URLSearchParams(init), URLSearchParams/constructor(init), URLSearchParams/URLSearchParams(), URLSearchParams/constructor()" data-dfn-type="argument" data-export id="dom-urlsearchparams-urlsearchparams-init-init"><code><c- g>init</c-></code></dfn> = ""); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long" id="ref-for-idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long" href="#dom-urlsearchparams-size" id="ref-for-dom-urlsearchparams-size"><c- g>size</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-append" id="ref-for-dom-urlsearchparams-append"><c- g>append</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②②"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/append(name, value)" data-dfn-type="argument" data-export id="dom-urlsearchparams-append-name-value-name"><code><c- g>name</c-></code></dfn>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②③"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/append(name, value)" data-dfn-type="argument" data-export id="dom-urlsearchparams-append-name-value-value"><code><c- g>value</c-></code></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined①"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-delete" id="ref-for-dom-urlsearchparams-delete"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②④"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/delete(name, value), URLSearchParams/delete(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-delete-name-value-name"><code><c- g>name</c-></code></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⑤"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/delete(name, value), URLSearchParams/delete(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-delete-name-value-value"><code><c- g>value</c-></code></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⑥"><c- b>USVString</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-get" id="ref-for-dom-urlsearchparams-get"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⑦"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/get(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-get-name-name"><code><c- g>name</c-></code></dfn>); <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence②"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⑧"><c- b>USVString</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-getall" id="ref-for-dom-urlsearchparams-getall"><c- g>getAll</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString②⑨"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/getAll(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-getall-name-name"><code><c- g>name</c-></code></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean" id="ref-for-idl-boolean①"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-has" id="ref-for-dom-urlsearchparams-has"><c- g>has</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③⓪"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/has(name, value), URLSearchParams/has(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-has-name-value-name"><code><c- g>name</c-></code></dfn>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③①"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/has(name, value), URLSearchParams/has(name)" data-dfn-type="argument" data-export id="dom-urlsearchparams-has-name-value-value"><code><c- g>value</c-></code></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined②"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-set" id="ref-for-dom-urlsearchparams-set"><c- g>set</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③②"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/set(name, value)" data-dfn-type="argument" data-export id="dom-urlsearchparams-set-name-value-name"><code><c- g>name</c-></code></dfn>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③③"><c- b>USVString</c-></a> <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams/set(name, value)" data-dfn-type="argument" data-export id="dom-urlsearchparams-set-name-value-value"><code><c- g>value</c-></code></dfn>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined" id="ref-for-idl-undefined③"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-sort" id="ref-for-dom-urlsearchparams-sort"><c- g>sort</c-></a>(); <c- b>iterable</c->&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③④"><c- b>USVString</c-></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString" id="ref-for-idl-USVString③⑤"><c- b>USVString</c-></a>>; <a data-link-type="dfn" href="#urlsearchparams-stringification-behavior" id="ref-for-urlsearchparams-stringification-behavior"><c- b>stringifier</c-></a>; }; </pre> <div class="example" id="example-constructing-urlsearchparams"> <a class="self-link" href="#example-constructing-urlsearchparams"></a> <p>Constructing and stringifying a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams③">URLSearchParams</a></code> object is fairly straightforward: </p> <pre><code class="lang-javascript highlight"><c- a>let</c-> params <c- o>=</c-> <c- ow>new</c-> URLSearchParams<c- p>({</c->key<c- o>:</c-> <c- u>"730d67"</c-><c- p>})</c-> params<c- p>.</c->toString<c- p>()</c-> <c- c1>// "key=730d67"</c-></code></pre> </div> <div class="note" role="note"> <p>As a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams④">URLSearchParams</a></code> object uses the <a data-link-type="dfn" href="#concept-urlencoded" id="ref-for-concept-urlencoded"><code>application/x-www-form-urlencoded</code></a> format underneath there are some difference with how it encodes certain code points compared to a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url⑨">URL</a></code> object (including <code class="idl"><a data-link-type="idl" href="#dom-url-href" id="ref-for-dom-url-href③">href</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-url-search" id="ref-for-dom-url-search④">search</a></code>). This can be especially surprising when using <code class="idl"><a data-link-type="idl" href="#dom-url-searchparams" id="ref-for-dom-url-searchparams①">searchParams</a></code> to operate on a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥③">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②⑥">query</a>. </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- t>'https://example.com/?a=b ~'</c-><c- p>);</c-> console<c- p>.</c->log<c- p>(</c->url<c- p>.</c->href<c- p>);</c-> <c- c1>// "https://example.com/?a=b%20~"</c-> url<c- p>.</c->searchParams<c- p>.</c->sort<c- p>();</c-> console<c- p>.</c->log<c- p>(</c->url<c- p>.</c->href<c- p>);</c-> <c- c1>// "https://example.com/?a=b+%7E"</c-></code></pre> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- t>'https://example.com/?a=~&amp;b=%7E'</c-><c- p>);</c-> console<c- p>.</c->log<c- p>(</c->url<c- p>.</c->search<c- p>);</c-> <c- c1>// "?a=~&amp;b=%7E"</c-> console<c- p>.</c->log<c- p>(</c->url<c- p>.</c->searchParams<c- p>.</c->get<c- p>(</c-><c- t>'a'</c-><c- p>));</c-> <c- c1>// "~"</c-> console<c- p>.</c->log<c- p>(</c->url<c- p>.</c->searchParams<c- p>.</c->get<c- p>(</c-><c- t>'b'</c-><c- p>));</c-> <c- c1>// "~"</c-></code></pre> <p><code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams⑤">URLSearchParams</a></code> objects will percent-encode anything in the <a data-link-type="dfn" href="#application-x-www-form-urlencoded-percent-encode-set" id="ref-for-application-x-www-form-urlencoded-percent-encode-set④"><code>application/x-www-form-urlencoded</code> percent-encode set</a>, and will encode U+0020 SPACE as U+002B (+). </p> <p>Ignoring encodings (use <a data-link-type="dfn" href="https://encoding.spec.whatwg.org/#utf-8" id="ref-for-utf-8①①">UTF-8</a>), <code class="idl"><a data-link-type="idl" href="#dom-url-search" id="ref-for-dom-url-search⑤">search</a></code> will percent-encode anything in the <a data-link-type="dfn" href="#query-percent-encode-set" id="ref-for-query-percent-encode-set④">query percent-encode set</a> or the <a data-link-type="dfn" href="#special-query-percent-encode-set" id="ref-for-special-query-percent-encode-set①">special-query percent-encode set</a> (depending on whether or not the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥④">URL</a> <a data-link-type="dfn" href="#is-special" id="ref-for-is-special①⑦">is special</a>). </p> </div> <p>A <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams⑥">URLSearchParams</a></code> object has an associated: </p> <ul class="brief"> <li><dfn class="dfn-paneled" data-dfn-for="URLSearchParams" data-dfn-type="dfn" data-export id="concept-urlsearchparams-list">list</dfn>: a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list" id="ref-for-list⑥">list</a> of <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple②">tuples</a> each consisting of a name and a value, initially empty. <li><dfn class="dfn-paneled" data-dfn-for="URLSearchParams" data-dfn-type="dfn" data-export id="concept-urlsearchparams-url-object">URL object</dfn>: null or a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url①⓪">URL</a></code> object, initially null. </ul> <p class="note" role="note">A <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams⑦">URLSearchParams</a></code> object with a non-null <a data-link-type="dfn" href="#concept-urlsearchparams-url-object" id="ref-for-concept-urlsearchparams-url-object①">URL object</a> has the potential to change that object’s <a data-link-type="dfn" href="#concept-url-path" id="ref-for-concept-url-path③④">path</a> in a manner equivalent to the <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url①①">URL</a></code> object’s <code class="idl"><a data-link-type="idl" href="#dom-url-search" id="ref-for-dom-url-search⑥">search</a></code> and <code class="idl"><a data-link-type="idl" href="#dom-url-hash" id="ref-for-dom-url-hash③">hash</a></code> setters. </p> <div class="algorithm" data-algorithm="initialize" data-algorithm-for="URLSearchParams"> <p>To <dfn class="dfn-paneled" data-dfn-for="URLSearchParams" data-dfn-type="dfn" data-noexport id="urlsearchparams-initialize">initialize<span id="concept-urlsearchparams-new"></span></dfn> a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams⑧">URLSearchParams</a></code> object <var>query</var> with <var>init</var>: </p> <ol> <li> <p>If <var>init</var> is a <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence" id="ref-for-idl-sequence③">sequence</a>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-iterate" id="ref-for-list-iterate⑧">for each</a> <var>innerSequence</var> of <var>init</var>: </p> <ol> <li> <p>If <var>innerSequence</var>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size⑥">size</a> is not 2, then <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-throw" id="ref-for-dfn-throw②">throw</a> a <code class="idl"><a data-link-type="idl" href="https://webidl.spec.whatwg.org/#exceptiondef-typeerror" id="ref-for-exceptiondef-typeerror②">TypeError</a></code>. </p> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑦">Append</a> (<var>innerSequence</var>[0], <var>innerSequence</var>[1]) to <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list④">list</a>. </p> </ol> <li> <p>Otherwise, if <var>init</var> is a <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-record" id="ref-for-idl-record①">record</a>, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#map-iterate" id="ref-for-map-iterate">for each</a> <var>name</var> → <var>value</var> of <var>init</var>, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑧">append</a> (<var>name</var>, <var>value</var>) to <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list⑤">list</a>. </p> <li> <p>Otherwise: </p> <ol> <li> <p>Assert: <var>init</var> is a string. </p> <li> <p>Set <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list⑥">list</a> to the result of <a data-link-type="dfn" href="#concept-urlencoded-string-parser" id="ref-for-concept-urlencoded-string-parser②">parsing</a> <var>init</var>. </p> </ol> </ol> </div> <div class="algorithm" data-algorithm="update" data-algorithm-for="URLSearchParams"> <p>To <dfn class="dfn-paneled" data-dfn-for="URLSearchParams" data-dfn-type="dfn" data-noexport id="concept-urlsearchparams-update">update</dfn> a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams⑨">URLSearchParams</a></code> object <var>query</var>: </p> <ol> <li> <p>If <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-url-object" id="ref-for-concept-urlsearchparams-url-object②">URL object</a> is null, then return. </p> <li> <p>Let <var>serializedQuery</var> be the <a data-link-type="dfn" href="#concept-urlencoded-serializer" id="ref-for-concept-urlencoded-serializer">serialization</a> of <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list⑦">list</a>. </p> <li> <p>If <var>serializedQuery</var> is the empty string, then set <var>serializedQuery</var> to null. </p> <li> <p>Set <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-url-object" id="ref-for-concept-urlsearchparams-url-object③">URL object</a>’s <a data-link-type="dfn" href="#concept-url-url" id="ref-for-concept-url-url④⑤">URL</a>’s <a data-link-type="dfn" href="#concept-url-query" id="ref-for-concept-url-query②⑦">query</a> to <var>serializedQuery</var>. </p> <li> <p>If <var>serializedQuery</var> is null, then <a data-link-type="dfn" href="#potentially-strip-trailing-spaces-from-an-opaque-path" id="ref-for-potentially-strip-trailing-spaces-from-an-opaque-path②">potentially strip trailing spaces from an opaque path</a> with <var>query</var>’s <a data-link-type="dfn" href="#concept-urlsearchparams-url-object" id="ref-for-concept-urlsearchparams-url-object④">URL object</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="URLSearchParams(init)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="constructor" data-export data-lt="URLSearchParams(init)|constructor(init)|URLSearchParams()|constructor()" id="dom-urlsearchparams-urlsearchparams"><code>new URLSearchParams(<var>init</var>)</code></dfn> constructor steps are:</p> <ol> <li> <p>If <var>init</var> is a string and starts with U+003F (?), then remove the first code point from <var>init</var>. </p> <li> <p><a data-link-type="dfn" href="#urlsearchparams-initialize" id="ref-for-urlsearchparams-initialize①">Initialize</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⑧">this</a> with <var>init</var>. </p> </ol> </div> <div class="algorithm" data-algorithm="size" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="attribute" data-export id="dom-urlsearchparams-size"><code>size</code></dfn> getter steps are to return <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this④⑨">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list⑧">list</a>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-size" id="ref-for-list-size⑦">size</a>. </p> </div> <div class="algorithm" data-algorithm="append(name, value)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export id="dom-urlsearchparams-append"><code>append(<var>name</var>, <var>value</var>)</code></dfn> method steps are: </p> <ol> <li> <p><a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append⑨">Append</a> (<var>name</var>, <var>value</var>) to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⓪">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list⑨">list</a>. </p> <li> <p><a data-link-type="dfn" href="#concept-urlsearchparams-update" id="ref-for-concept-urlsearchparams-update">Update</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤①">this</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="delete(name, value)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export data-lt="delete(name, value)|delete(name)" id="dom-urlsearchparams-delete"><code>delete(<var>name</var>, <var>value</var>)</code></dfn> method steps are: </p> <ol> <li> <p>If <var>value</var> is given, then <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove④">remove</a> all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple③">tuples</a> whose name is <var>name</var> and value is <var>value</var> from <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤②">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⓪">list</a>. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove⑤">remove</a> all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple④">tuples</a> whose name is <var>name</var> from <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤③">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①①">list</a>. </p> <li> <p><a data-link-type="dfn" href="#concept-urlsearchparams-update" id="ref-for-concept-urlsearchparams-update①">Update</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤④">this</a>. </p> </ol> </div> <div class="algorithm" data-algorithm="get(name)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export id="dom-urlsearchparams-get"><code>get(<var>name</var>)</code></dfn> method steps are to return the value of the first <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple⑤">tuple</a> whose name is <var>name</var> in <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⑤">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①②">list</a>, if there is such a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple⑥">tuple</a>; otherwise null. </p> </div> <div class="algorithm" data-algorithm="getAll(name)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export id="dom-urlsearchparams-getall"><code>getAll(<var>name</var>)</code></dfn> method steps are to return the values of all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple⑦">tuples</a> whose name is <var>name</var> in <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⑥">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①③">list</a>, in list order; otherwise the empty sequence. </p> </div> <div class="algorithm" data-algorithm="has(name, value)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export data-lt="has(name, value)|has(name)" id="dom-urlsearchparams-has"><code>has(<var>name</var>, <var>value</var>)</code></dfn> method steps are: </p> <ol> <li> <p>If <var>value</var> is given and there is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple⑧">tuple</a> whose name is <var>name</var> and value is <var>value</var> in <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⑦">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①④">list</a>, then return true. </p> <li> <p>If <var>value</var> is not given and there is a <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple⑨">tuple</a> whose name is <var>name</var> in <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⑧">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⑤">list</a>, then return true. </p> <li> <p>Return false. </p> </ol> </div> <div class="algorithm" data-algorithm="set(name, value)" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export id="dom-urlsearchparams-set"><code>set(<var>name</var>, <var>value</var>)</code></dfn> method steps are: </p> <ol> <li> <p>If <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑤⑨">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⑥">list</a> <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-contain" id="ref-for-list-contain">contains</a> any <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①⓪">tuples</a> whose name is <var>name</var>, then set the value of the first such <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①①">tuple</a> to <var>value</var> and <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-remove" id="ref-for-list-remove⑥">remove</a> the others. </p> <li> <p>Otherwise, <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#list-append" id="ref-for-list-append①⓪">append</a> (<var>name</var>, <var>value</var>) to <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥⓪">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⑦">list</a>. </p> <li> <p><a data-link-type="dfn" href="#concept-urlsearchparams-update" id="ref-for-concept-urlsearchparams-update②">Update</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥①">this</a>. </p> </ol> </div> <hr> <div class="example" id="example-searchparams-sort"> <a class="self-link" href="#example-searchparams-sort"></a> <p>It can be useful to sort the name-value tuples in a <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams①⓪">URLSearchParams</a></code> object, in particular to increase cache hits. This can be accomplished through invoking the <code class="idl"><a data-link-type="idl" href="#dom-urlsearchparams-sort" id="ref-for-dom-urlsearchparams-sort①">sort()</a></code> method: </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> url <c- o>=</c-> <c- ow>new</c-> URL<c- p>(</c-><c- u>"https://example.org/?q=🏳️‍🌈&amp;key=e1f7bc78"</c-><c- p>);</c-> url<c- p>.</c->searchParams<c- p>.</c->sort<c- p>();</c-> url<c- p>.</c->search<c- p>;</c-> <c- c1>// "?key=e1f7bc78&amp;q=%F0%9F%8F%B3%EF%B8%8F%E2%80%8D%F0%9F%8C%88"</c-></code></pre> <p>To avoid altering the original input, e.g., for comparison purposes, construct a new <code class="idl"><a data-link-type="idl" href="#urlsearchparams" id="ref-for-urlsearchparams①①">URLSearchParams</a></code> object: </p> <pre><code class="lang-javascript highlight"><c- a>const</c-> sorted <c- o>=</c-> <c- ow>new</c-> URLSearchParams<c- p>(</c->url<c- p>.</c->search<c- p>)</c-> sorted<c- p>.</c->sort<c- p>()</c-></code></pre> </div> <div class="algorithm" data-algorithm="sort()" data-algorithm-for="URLSearchParams"> <p>The <dfn class="dfn-paneled idl-code" data-dfn-for="URLSearchParams" data-dfn-type="method" data-export id="dom-urlsearchparams-sort"><code>sort()</code></dfn> method steps are: </p> <ol> <li> <p>Sort all <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①②">tuples</a> in <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥②">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⑧">list</a>, if any, by their names. Sorting must be done by comparison of code units. The relative order between <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①③">tuples</a> with equal names must be preserved. </p> <li> <p><a data-link-type="dfn" href="#concept-urlsearchparams-update" id="ref-for-concept-urlsearchparams-update③">Update</a> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥③">this</a>. </p> </ol> </div> <hr> <p>The <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#dfn-value-pairs-to-iterate-over" id="ref-for-dfn-value-pairs-to-iterate-over">value pairs to iterate over</a> are <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥④">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list①⑨">list</a>’s <a data-link-type="dfn" href="https://infra.spec.whatwg.org/#tuple" id="ref-for-tuple①④">tuples</a> with the key being the name and the value being the value. </p> <p>The <dfn class="dfn-paneled" data-dfn-for="URLSearchParams" data-dfn-type="dfn" data-lt="stringificationbehavior" data-noexport id="urlsearchparams-stringification-behavior">stringification behavior</dfn> steps are to return the <a data-link-type="dfn" href="#concept-urlencoded-serializer" id="ref-for-concept-urlencoded-serializer①">serialization</a> of <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#this" id="ref-for-this⑥⑤">this</a>’s <a data-link-type="dfn" href="#concept-urlsearchparams-list" id="ref-for-concept-urlsearchparams-list②⓪">list</a>. </p> <h3 class="heading settled" data-level="6.3" id="url-apis-elsewhere"><span class="secno">6.3. </span><span class="content">URL APIs elsewhere</span><a class="self-link" href="#url-apis-elsewhere"></a></h3> <p>A standard that exposes <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⑤">URLs</a>, should expose the <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⑥">URL</a> as a string (by <a data-link-type="dfn" href="#concept-url-serializer" id="ref-for-concept-url-serializer①①">serializing</a> an internal <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⑦">URL</a>). A standard should not expose a <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⑧">URL</a> using a <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url①②">URL</a></code> object. <code class="idl"><a data-link-type="idl" href="#url" id="ref-for-url①③">URL</a></code> objects are meant for <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑥⑨">URL</a> manipulation. In IDL the USVString type should be used. </p> <p class="note" role="note">The higher-level notion here is that values are to be exposed as immutable data structures. </p> <p>If a standard decides to use a variant of the name "URL" for a feature it defines, it should name such a feature "url" (i.e., lowercase and with an "l" at the end). Names such as "URL", "URI", and "IRI" should not be used. However, if the name is a compound, "URL" (i.e., uppercase) is preferred, e.g., "newURL" and "oldURL". </p> <p class="note" role="note">The <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource" id="ref-for-eventsource">EventSource</a></code> and <code class="idl"><a data-link-type="idl" href="https://html.spec.whatwg.org/multipage/nav-history-apis.html#hashchangeevent" id="ref-for-hashchangeevent">HashChangeEvent</a></code> interfaces in <cite>HTML</cite> are examples of proper naming. <a data-link-type="biblio" href="#biblio-html" title="HTML Standard">[HTML]</a> </p> <h2 class="no-num heading settled" id="acknowledgments"><span class="content">Acknowledgments</span><a class="self-link" href="#acknowledgments"></a></h2> <p>There have been a lot of people that have helped make <a data-link-type="dfn" href="#concept-url" id="ref-for-concept-url⑦⓪">URLs</a> more interoperable over the years and thereby furthered the goals of this standard. Likewise many people have helped making this standard what it is today. </p> <p>With that, many thanks to 100の人, Adam Barth, Addison Phillips, Adrián Chaves, Adrien Ricciardi, Albert Wiersch, Alex Christensen, Alexis Hunt, Alexandre Morgaut, Alexis Hunt, Alwin Blok, Andrew Sullivan, Arkadiusz Michalski, Behnam Esfahbod, Bobby Holley, Boris Zbarsky, Brad Hill, Brandon Ross, Cailyn Hansen, Chris Dumez, Chris Rebert, Corey Farwell, Dan Appelquist, Daniel Bratell, Daniel Stenberg, David Burns, David Håsäther, David Sheets, David Singer, David Walp, Domenic Denicola, Emily Schechter, Emily Stark, Eric Lawrence, Erik Arvidsson, Gavin Carothers, Geoff Richards, Glenn Maynard, Gordon P. Hemsley, hemanth, Henri Sivonen, Ian Hickson, Ilya Grigorik, Italo A. Casas, Jakub Gieryluk, James Graham, James Manger, James Ross, Jeff Hodges, Jeffrey Posnick, Jeffrey Yasskin, Joe Duarte, Joshua Bell, Jxck, Karl Wagner, Kemal Zebari, 田村健人 (Kent TAMURA), Kevin Grandon, Kornel Lesiński, Larry Masinter, Leif Halvard Silli, Mark Amery, Mark Davis, Marcos Cáceres, Marijn Kruisselbrink, Martin Dürst, Mathias Bynens, Matt Falkenhagen, Matt Giuca, Michael Peick, Michael™ Smith, Michal Bukovský, Michel Suignard, Mikaël Geljić, Noah Levitt, Peter Occil, Philip Jägenstedt, Philippe Ombredanne, Prayag Verma, Rimas Misevičius, Robert Kieffer, Rodney Rehm, Roy Fielding, Ryan Sleevi, Sam Ruby, Sam Sneddon, Santiago M. Mola, Sebastian Mayr, Simon Pieters, Simon Sapin, Steven Vachon, Stuart Cook, Sven Uhlig, Tab Atkins, 吉野剛史 (Takeshi Yoshino), Tantek Çelik, Tiancheng "Timothy" Gu, Tim Berners-Lee, 簡冠庭 (Tim Guan-tin Chien), Titi_Alone, Tomek Wytrębowicz, Trevor Rowbotham, Tristan Seligmann, Valentin Gosu, Vyacheslav Matva, Wei Wang, Wolf Lammen, 山岸和利 (Yamagishi Kazutoshi), Yongsheng Zhang, 成瀬ゆい (Yui Naruse), and zealousidealroll for being awesome! </p> <p>This standard is written by <a href="https://annevankesteren.nl/" lang="nl">Anne van Kesteren</a> (<a href="https://www.apple.com/">Apple</a>, <a href="mailto:annevk@annevk.nl">annevk@annevk.nl</a>). </p> <h2 class="no-num heading settled" id="ipr"><span class="content">Intellectual property rights</span><a class="self-link" href="#ipr"></a></h2> <p>Copyright © WHATWG (Apple, Google, Mozilla, Microsoft). This work is licensed under a <a href="https://creativecommons.org/licenses/by/4.0/" rel="license">Creative Commons Attribution 4.0 International License</a>. To the extent portions of it are incorporated into source code, such portions in the source code are licensed under the <a href="https://opensource.org/licenses/BSD-3-Clause" rel="license">BSD 3-Clause License</a> instead.</p> <p>This is the Living Standard. Those interested in the patent-review version should view the <a href="/review-drafts/2024-08/">Living Standard Review Draft</a>.</p> </main> <script> "use strict"; if ("serviceWorker" in navigator) { navigator.serviceWorker.register("/service-worker.js"); } </script> <h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2> <h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3> <ul class="index"> <li><a href="#absolute-url-string">absolute-URL string</a><span>, in § 4.3</span> <li><a href="#absolute-url-with-fragment-string">absolute-URL-with-fragment string</a><span>, in § 4.3</span> <li><a href="#api-url-parser">API URL parser</a><span>, in § 6.1</span> <li><a href="#dom-urlsearchparams-append">append(name, value)</a><span>, in § 6.2</span> <li><a href="#concept-urlencoded">application/x-www-form-urlencoded</a><span>, in § 5</span> <li><a href="#application-x-www-form-urlencoded-percent-encode-set">application/x-www-form-urlencoded percent-encode set</a><span>, in § 1.3</span> <li><a href="#authority-state">authority state</a><span>, in § 4.4</span> <li><a href="#concept-base-url">base URL</a><span>, in § 4.2</span> <li><a href="#concept-basic-url-parser">basic URL parser</a><span>, in § 4.4</span> <li><a href="#concept-url-blob-entry">blob URL entry</a><span>, in § 4.1</span> <li><a href="#c">c</a><span>, in § 1.2</span> <li><a href="#c0-control-percent-encode-set">C0 control percent-encode set</a><span>, in § 1.3</span> <li><a href="#cannot-have-a-username-password-port">cannot have a username/password/port</a><span>, in § 4.2</span> <li><a href="#dom-url-canparse">canParse(url)</a><span>, in § 6.1</span> <li><a href="#dom-url-canparse">canParse(url, base)</a><span>, in § 6.1</span> <li><a href="#component-percent-encode-set">component percent-encode set</a><span>, in § 1.3</span> <li><a href="#dom-urlsearchparams-urlsearchparams">constructor()</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-urlsearchparams">constructor(init)</a><span>, in § 6.2</span> <li><a href="#dom-url-url">constructor(url)</a><span>, in § 6.1</span> <li><a href="#dom-url-url">constructor(url, base)</a><span>, in § 6.1</span> <li><a href="#default-port">default port</a><span>, in § 4.2</span> <li><a href="#dom-urlsearchparams-delete">delete(name)</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-delete">delete(name, value)</a><span>, in § 6.2</span> <li><a href="#concept-domain">domain</a><span>, in § 3.1</span> <li><a href="#domain-invalid-code-point">domain-invalid-code-point</a><span>, in § 1.1</span> <li><a href="#domain-label">domain label</a><span>, in § 3.1</span> <li><a href="#concept-domain-to-ascii">domain to ASCII</a><span>, in § 3.3</span> <li><a href="#validation-error-domain-to-ascii">domain-to-ASCII</a><span>, in § 1.1</span> <li><a href="#concept-domain-to-unicode">domain to Unicode</a><span>, in § 3.3</span> <li><a href="#domain-to-unicode">domain-to-Unicode</a><span>, in § 1.1</span> <li><a href="#double-dot-path-segment">double-dot URL path segment</a><span>, in § 4.1</span> <li><a href="#empty-host">empty host</a><span>, in § 3.1</span> <li><a href="#ends-in-a-number-checker">ends in a number checker</a><span>, in § 3.5</span> <li><a href="#eof-code-point">EOF code point</a><span>, in § 1.2</span> <li> equal <ul> <li><a href="#concept-host-equals">dfn for host</a><span>, in § 3.7</span> <li><a href="#concept-url-equals">dfn for url</a><span>, in § 4.6</span> </ul> <li><a href="#url-serializer-exclude-fragment">exclude fragment</a><span>, in § 4.5</span> <li><a href="#url-equals-exclude-fragments">exclude fragments</a><span>, in § 4.6</span> <li><a href="#file-host-state">file host state</a><span>, in § 4.4</span> <li><a href="#file-invalid-windows-drive-letter">file-invalid-Windows-drive-letter</a><span>, in § 1.1</span> <li><a href="#file-invalid-windows-drive-letter-host">file-invalid-Windows-drive-letter-host</a><span>, in § 1.1</span> <li><a href="#file-slash-state">file slash state</a><span>, in § 4.4</span> <li><a href="#file-state">file state</a><span>, in § 4.4</span> <li><a href="#find-the-ipv6-address-compressed-piece-index">find the IPv6 address compressed piece index</a><span>, in § 3.6</span> <li><a href="#forbidden-domain-code-point">forbidden domain code point</a><span>, in § 3.2</span> <li><a href="#forbidden-host-code-point">forbidden host code point</a><span>, in § 3.2</span> <li><a href="#concept-url-fragment">fragment</a><span>, in § 4.1</span> <li><a href="#fragment-percent-encode-set">fragment percent-encode set</a><span>, in § 1.3</span> <li><a href="#fragment-state">fragment state</a><span>, in § 4.4</span> <li><a href="#dom-urlsearchparams-getall">getAll(name)</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-get">get(name)</a><span>, in § 6.2</span> <li><a href="#dom-url-hash">hash</a><span>, in § 6.1</span> <li><a href="#dom-urlsearchparams-has">has(name)</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-has">has(name, value)</a><span>, in § 6.2</span> <li> host <ul> <li><a href="#dom-url-host">attribute for URL</a><span>, in § 6.1</span> <li><a href="#concept-host">definition of</a><span>, in § 3.1</span> <li><a href="#concept-url-host">dfn for url</a><span>, in § 4.1</span> </ul> <li><a href="#host-invalid-code-point">host-invalid-code-point</a><span>, in § 1.1</span> <li><a href="#host-missing">host-missing</a><span>, in § 1.1</span> <li><a href="#dom-url-hostname">hostname</a><span>, in § 6.1</span> <li><a href="#hostname-state">hostname state</a><span>, in § 4.4</span> <li><a href="#concept-host-parser">host parser</a><span>, in § 3.5</span> <li><a href="#concept-host-parser">host parsing</a><span>, in § 3.5</span> <li><a href="#concept-host-serializer">host serializer</a><span>, in § 3.6</span> <li><a href="#host-state">host state</a><span>, in § 4.4</span> <li><a href="#dom-url-href">href</a><span>, in § 6.1</span> <li><a href="#include-credentials">include credentials</a><span>, in § 4.2</span> <li><a href="#include-credentials">includes credentials</a><span>, in § 4.2</span> <li> initialize <ul> <li><a href="#url-initialize">dfn for URL</a><span>, in § 6.1</span> <li><a href="#urlsearchparams-initialize">dfn for URLSearchParams</a><span>, in § 6.2</span> </ul> <li><a href="#invalid-credentials">invalid-credentials</a><span>, in § 1.1</span> <li><a href="#invalid-reverse-solidus">invalid-reverse-solidus</a><span>, in § 1.1</span> <li><a href="#invalid-url-unit">invalid-URL-unit</a><span>, in § 1.1</span> <li><a href="#ip-address">IP address</a><span>, in § 3.1</span> <li><a href="#concept-ipv4">IPv4 address</a><span>, in § 3.1</span> <li><a href="#ipv4-empty-part">IPv4-empty-part</a><span>, in § 1.1</span> <li><a href="#ipv4-in-ipv6-invalid-code-point">IPv4-in-IPv6-invalid-code-point</a><span>, in § 1.1</span> <li><a href="#ipv4-in-ipv6-out-of-range-part">IPv4-in-IPv6-out-of-range-part</a><span>, in § 1.1</span> <li><a href="#ipv4-in-ipv6-too-few-parts">IPv4-in-IPv6-too-few-parts</a><span>, in § 1.1</span> <li><a href="#ipv4-in-ipv6-too-many-pieces">IPv4-in-IPv6-too-many-pieces</a><span>, in § 1.1</span> <li><a href="#ipv4-non-decimal-part">IPv4-non-decimal-part</a><span>, in § 1.1</span> <li><a href="#ipv4-non-numeric-part">IPv4-non-numeric-part</a><span>, in § 1.1</span> <li><a href="#ipv4-number-parser">IPv4 number parser</a><span>, in § 3.5</span> <li><a href="#ipv4-out-of-range-part">IPv4-out-of-range-part</a><span>, in § 1.1</span> <li><a href="#concept-ipv4-parser">IPv4 parser</a><span>, in § 3.5</span> <li><a href="#concept-ipv4-serializer">IPv4 serializer</a><span>, in § 3.6</span> <li><a href="#ipv4-too-many-parts">IPv4-too-many-parts</a><span>, in § 1.1</span> <li><a href="#concept-ipv6">IPv6 address</a><span>, in § 3.1</span> <li><a href="#ipv6-invalid-code-point">IPv6-invalid-code-point</a><span>, in § 1.1</span> <li><a href="#ipv6-invalid-compression">IPv6-invalid-compression</a><span>, in § 1.1</span> <li><a href="#ipv6-multiple-compression">IPv6-multiple-compression</a><span>, in § 1.1</span> <li><a href="#concept-ipv6-parser">IPv6 parser</a><span>, in § 3.5</span> <li><a href="#concept-ipv6-serializer">IPv6 serializer</a><span>, in § 3.6</span> <li><a href="#ipv6-too-few-pieces">IPv6-too-few-pieces</a><span>, in § 1.1</span> <li><a href="#ipv6-too-many-pieces">IPv6-too-many-pieces</a><span>, in § 1.1</span> <li><a href="#ipv6-unclosed">IPv6-unclosed</a><span>, in § 1.1</span> <li><a href="#is-not-special">is not special</a><span>, in § 4.2</span> <li><a href="#is-special">is special</a><span>, in § 4.2</span> <li><a href="#concept-urlsearchparams-list">list</a><span>, in § 6.2</span> <li><a href="#missing-scheme-non-relative-url">missing-scheme-non-relative-URL</a><span>, in § 1.1</span> <li><a href="#normalized-windows-drive-letter">normalized Windows drive letter</a><span>, in § 4.2</span> <li><a href="#no-scheme-state">no scheme state</a><span>, in § 4.4</span> <li><a href="#opaque-host">opaque host</a><span>, in § 3.1</span> <li><a href="#opaque-host-and-port-string">opaque-host-and-port string</a><span>, in § 4.3</span> <li><a href="#concept-opaque-host-parser">opaque-host parser</a><span>, in § 3.5</span> <li><a href="#url-opaque-path">opaque path</a><span>, in § 4.2</span> <li><a href="#cannot-be-a-base-url-path-state">opaque path state</a><span>, in § 4.4</span> <li> origin <ul> <li><a href="#dom-url-origin">attribute for URL</a><span>, in § 6.1</span> <li><a href="#concept-url-origin">dfn for url</a><span>, in § 4.7</span> </ul> <li><a href="#dom-url-parse">parse(url)</a><span>, in § 6.1</span> <li><a href="#dom-url-parse">parse(url, base)</a><span>, in § 6.1</span> <li> password <ul> <li><a href="#dom-url-password">attribute for URL</a><span>, in § 6.1</span> <li><a href="#concept-url-password">dfn for url</a><span>, in § 4.1</span> </ul> <li><a href="#concept-url-path">path</a><span>, in § 4.1</span> <li><a href="#path-absolute-non-windows-file-url-string">path-absolute-non-Windows-file-URL string</a><span>, in § 4.3</span> <li><a href="#path-absolute-url-string">path-absolute-URL string</a><span>, in § 4.3</span> <li><a href="#dom-url-pathname">pathname</a><span>, in § 6.1</span> <li><a href="#path-or-authority-state">path or authority state</a><span>, in § 4.4</span> <li><a href="#path-percent-encode-set">path percent-encode set</a><span>, in § 1.3</span> <li><a href="#path-relative-scheme-less-url-string">path-relative-scheme-less-URL string</a><span>, in § 4.3</span> <li><a href="#path-relative-url-string">path-relative-URL string</a><span>, in § 4.3</span> <li><a href="#path-start-state">path start state</a><span>, in § 4.4</span> <li><a href="#path-state">path state</a><span>, in § 4.4</span> <li> percent-decode <ul> <li><a href="#percent-decode">dfn for byte sequence</a><span>, in § 1.3</span> <li><a href="#string-percent-decode">dfn for string</a><span>, in § 1.3</span> </ul> <li><a href="#percent-encode">percent-encode</a><span>, in § 1.3</span> <li><a href="#string-percent-encode-after-encoding">percent-encode after encoding</a><span>, in § 1.3</span> <li><a href="#percent-encoded-byte">percent-encoded byte</a><span>, in § 1.3</span> <li><a href="#concept-ipv6-piece">pieces</a><span>, in § 3.1</span> <li><a href="#pointer">pointer</a><span>, in § 1.2</span> <li> port <ul> <li><a href="#dom-url-port">attribute for URL</a><span>, in § 6.1</span> <li><a href="#concept-url-port">dfn for url</a><span>, in § 4.1</span> </ul> <li><a href="#port-invalid">port-invalid</a><span>, in § 1.1</span> <li><a href="#port-out-of-range">port-out-of-range</a><span>, in § 1.1</span> <li><a href="#port-state">port state</a><span>, in § 4.4</span> <li><a href="#potentially-strip-trailing-spaces-from-an-opaque-path">potentially strip trailing spaces from an opaque path</a><span>, in § 6.1</span> <li><a href="#dom-url-protocol">protocol</a><span>, in § 6.1</span> <li><a href="#host-public-suffix">public suffix</a><span>, in § 3.2</span> <li><a href="#concept-url-query">query</a><span>, in § 4.1</span> <li><a href="#concept-url-query-object">query object</a><span>, in § 6.1</span> <li><a href="#query-percent-encode-set">query percent-encode set</a><span>, in § 1.3</span> <li><a href="#query-state">query state</a><span>, in § 4.4</span> <li><a href="#host-registrable-domain">registrable domain</a><span>, in § 3.2</span> <li><a href="#relative-slash-state">relative slash state</a><span>, in § 4.4</span> <li><a href="#relative-state">relative state</a><span>, in § 4.4</span> <li><a href="#relative-url-string">relative-URL string</a><span>, in § 4.3</span> <li><a href="#relative-url-with-fragment-string">relative-URL-with-fragment string</a><span>, in § 4.3</span> <li><a href="#remaining">remaining</a><span>, in § 1.2</span> <li><a href="#concept-url-scheme">scheme</a><span>, in § 4.1</span> <li><a href="#scheme-relative-file-url-string">scheme-relative-file-URL string</a><span>, in § 4.3</span> <li><a href="#scheme-relative-special-url-string">scheme-relative-special-URL string</a><span>, in § 4.3</span> <li><a href="#scheme-relative-url-string">scheme-relative-URL string</a><span>, in § 4.3</span> <li><a href="#scheme-start-state">scheme start state</a><span>, in § 4.4</span> <li><a href="#scheme-state">scheme state</a><span>, in § 4.4</span> <li><a href="#dom-url-search">search</a><span>, in § 6.1</span> <li><a href="#dom-url-searchparams">searchParams</a><span>, in § 6.1</span> <li><a href="#serialize-an-integer">serialize an integer</a><span>, in § 1</span> <li><a href="#dom-urlsearchparams-set">set(name, value)</a><span>, in § 6.2</span> <li><a href="#set-the-password">set the password</a><span>, in § 4.4</span> <li><a href="#set-the-username">set the username</a><span>, in § 4.4</span> <li><a href="#shorten-a-urls-path">shorten</a><span>, in § 4.2</span> <li><a href="#shorten-a-urls-path">shorten a url’s path</a><span>, in § 4.2</span> <li><a href="#single-dot-path-segment">single-dot URL path segment</a><span>, in § 4.1</span> <li><a href="#dom-urlsearchparams-size">size</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-sort">sort()</a><span>, in § 6.2</span> <li><a href="#special-authority-ignore-slashes-state">special authority ignore slashes state</a><span>, in § 4.4</span> <li><a href="#special-authority-slashes-state">special authority slashes state</a><span>, in § 4.4</span> <li><a href="#special-query-percent-encode-set">special-query percent-encode set</a><span>, in § 1.3</span> <li><a href="#special-relative-or-authority-state">special relative or authority state</a><span>, in § 4.4</span> <li><a href="#special-scheme">special scheme</a><span>, in § 4.2</span> <li><a href="#special-scheme-missing-following-solidus">special-scheme-missing-following-solidus</a><span>, in § 1.1</span> <li><a href="#start-with-a-windows-drive-letter">starts with a Windows drive letter</a><span>, in § 4.2</span> <li><a href="#start-with-a-windows-drive-letter">start with a Windows drive letter</a><span>, in § 4.2</span> <li><a href="#basic-url-parser-state-override">state override</a><span>, in § 4.4</span> <li><a href="#URL-stringification-behavior">stringification behavior</a><span>, in § 6.1</span> <li><a href="#urlsearchparams-stringification-behavior">stringificationbehavior</a><span>, in § 6.2</span> <li><a href="#dom-url-tojson">toJSON()</a><span>, in § 6.1</span> <li><a href="#concept-urlsearchparams-update">update</a><span>, in § 6.2</span> <li> URL <ul> <li><a href="#url">(interface)</a><span>, in § 6.1</span> <li><a href="#concept-url">definition of</a><span>, in § 4.1</span> <li><a href="#concept-url-url">dfn for URL</a><span>, in § 6.1</span> </ul> <li><a href="#basic-url-parser-url">url</a><span>, in § 4.4</span> <li><a href="#url-code-points">URL code point</a><span>, in § 4.3</span> <li><a href="#concept-urlencoded-parser">urlencoded parser</a><span>, in § 5.1</span> <li><a href="#concept-urlencoded-serializer">urlencoded serializer</a><span>, in § 5.2</span> <li><a href="#concept-urlencoded-string-parser">urlencoded string parser</a><span>, in § 5.3</span> <li><a href="#url-fragment-string">URL-fragment string</a><span>, in § 4.3</span> <li><a href="#concept-urlsearchparams-url-object">URL object</a><span>, in § 6.2</span> <li><a href="#concept-url-parser">URL parser</a><span>, in § 4.4</span> <li><a href="#url-path">URL path</a><span>, in § 4.1</span> <li><a href="#url-path-segment">URL path segment</a><span>, in § 4.1</span> <li><a href="#url-path-segment-string">URL-path-segment string</a><span>, in § 4.3</span> <li><a href="#url-path-serializer">URL path serializer</a><span>, in § 4.5</span> <li><a href="#url-path-serializer">URL path serializing</a><span>, in § 4.5</span> <li><a href="#url-port-string">URL-port string</a><span>, in § 4.3</span> <li><a href="#url-query-string">URL-query string</a><span>, in § 4.3</span> <li><a href="#concept-url">URL record</a><span>, in § 4.1</span> <li><a href="#url-scheme-string">URL-scheme string</a><span>, in § 4.3</span> <li><a href="#urlsearchparams">URLSearchParams</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-urlsearchparams">URLSearchParams()</a><span>, in § 6.2</span> <li><a href="#dom-urlsearchparams-urlsearchparams">URLSearchParams(init)</a><span>, in § 6.2</span> <li><a href="#concept-url-serializer">URL serializer</a><span>, in § 4.5</span> <li><a href="#url-units">URL units</a><span>, in § 4.3</span> <li><a href="#dom-url-url">URL(url)</a><span>, in § 6.1</span> <li><a href="#dom-url-url">URL(url, base)</a><span>, in § 6.1</span> <li><a href="#userinfo-percent-encode-set">userinfo percent-encode set</a><span>, in § 1.3</span> <li> username <ul> <li><a href="#dom-url-username">attribute for URL</a><span>, in § 6.1</span> <li><a href="#concept-url-username">dfn for url</a><span>, in § 4.1</span> </ul> <li> UTF-8 percent-encode <ul> <li><a href="#utf-8-percent-encode">dfn for code point</a><span>, in § 1.3</span> <li><a href="#string-utf-8-percent-encode">dfn for string</a><span>, in § 1.3</span> </ul> <li><a href="#validation-error">validation error</a><span>, in § 1.1</span> <li><a href="#valid-domain">valid domain</a><span>, in § 3.4</span> <li><a href="#valid-domain-string">valid domain string</a><span>, in § 3.4</span> <li><a href="#valid-host-string">valid host string</a><span>, in § 3.4</span> <li><a href="#valid-ipv4-address-string">valid IPv4-address string</a><span>, in § 3.4</span> <li><a href="#valid-ipv6-address-string">valid IPv6-address string</a><span>, in § 3.4</span> <li><a href="#valid-opaque-host-string">valid opaque-host string</a><span>, in § 3.4</span> <li><a href="#valid-url-string">valid URL string</a><span>, in § 4.3</span> <li><a href="#webkiturl">webkitURL</a><span>, in § 6.1</span> <li><a href="#windows-drive-letter">Windows drive letter</a><span>, in § 4.2</span> </ul> <h3 class="no-num no-ref heading settled" id="index-defined-elsewhere"><span class="content">Terms defined by reference</span><a class="self-link" href="#index-defined-elsewhere"></a></h3> <ul class="index"> <li> <a data-link-type="biblio">[ECMA-262]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="1df6fe6d">"encodeURIComponent() [sic]"</span> </ul> <li> <a data-link-type="biblio">[ENCODING]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="c992ac73">encode or fail</span> <li><span class="dfn-paneled" id="65bee524">encoding</span> <li><span class="dfn-paneled" id="b468b1cd">get an output encoding</span> <li><span class="dfn-paneled" id="5313f397">getting an encoder</span> <li><span class="dfn-paneled" id="63ab4a31">I/O queue</span> <li><span class="dfn-paneled" id="7125fbb8">ISO-2022-JP</span> <li><span class="dfn-paneled" id="27996bbe">ISO-2022-JP encoder</span> <li><span class="dfn-paneled" id="c07adfd3">Shift_JIS</span> <li><span class="dfn-paneled" id="bffb633e">UTF-8</span> <li><span class="dfn-paneled" id="a3033be5">UTF-8 decode without BOM</span> <li><span class="dfn-paneled" id="f256859a">UTF-8 decode without BOM or fail</span> <li><span class="dfn-paneled" id="0303e8e5">UTF-8 encode</span> </ul> <li> <a data-link-type="biblio">[FILEAPI]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="ef301390">blob URL entry</span> <li><span class="dfn-paneled" id="1b543e90">blob URL store</span> <li><span class="dfn-paneled" id="a08f319f">environment</span> <li><span class="dfn-paneled" id="2879bf39">resolve a blob URL</span> </ul> <li> <a data-link-type="biblio">[HTML]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="daecad44">EventSource</span> <li><span class="dfn-paneled" id="78492a07">HashChangeEvent</span> <li><span class="dfn-paneled" id="cc549724">Location</span> <li><span class="dfn-paneled" id="b01b1359">opaque origin</span> <li><span class="dfn-paneled" id="086e3aff">origin</span> <li><span class="dfn-paneled" id="43ac8374">origin <small>(for environment settings object)</small></span> <li><span class="dfn-paneled" id="b68b04de">protocol</span> <li><span class="dfn-paneled" id="2c95c4a9">registerProtocolHandler(scheme, url)</span> <li><span class="dfn-paneled" id="7393da89">same origin</span> <li><span class="dfn-paneled" id="feac4ab3">same site</span> <li><span class="dfn-paneled" id="0757a962">schemelessly same site</span> <li><span class="dfn-paneled" id="dae0bfde">serialization of an origin</span> <li><span class="dfn-paneled" id="1d2aa117">tuple origin</span> </ul> <li> <a data-link-type="biblio">[INFRA]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="f18e8ea1">128-bit unsigned integer</span> <li><span class="dfn-paneled" id="4ce873ee">16-bit unsigned integer</span> <li><span class="dfn-paneled" id="d17867da">32-bit unsigned integer</span> <li><span class="dfn-paneled" id="53275e46">append</span> <li><span class="dfn-paneled" id="02f9bf93">ASCII alpha</span> <li><span class="dfn-paneled" id="f43d6978">ASCII alphanumeric</span> <li><span class="dfn-paneled" id="617d690e">ASCII byte</span> <li><span class="dfn-paneled" id="7f9469b5">ASCII case-insensitive</span> <li><span class="dfn-paneled" id="ddc587b1">ASCII code point</span> <li><span class="dfn-paneled" id="3b38c2fe">ASCII digit</span> <li><span class="dfn-paneled" id="57ca97cc">ASCII hex digit</span> <li><span class="dfn-paneled" id="6f2dfa22">ASCII lowercase</span> <li><span class="dfn-paneled" id="2d5a2765">ASCII string</span> <li><span class="dfn-paneled" id="3896d56a">ASCII tab or newline</span> <li><span class="dfn-paneled" id="610029ae">ASCII upper hex digit</span> <li><span class="dfn-paneled" id="77b4c09a">assert</span> <li><span class="dfn-paneled" id="7b0d918d">break</span> <li><span class="dfn-paneled" id="f5354b9d">byte</span> <li><span class="dfn-paneled" id="3de9e659">byte sequence</span> <li><span class="dfn-paneled" id="0e2d3ffe">c0 control</span> <li><span class="dfn-paneled" id="85a5b3fc">c0 control or space</span> <li><span class="dfn-paneled" id="027e3e49">clone</span> <li><span class="dfn-paneled" id="915aff5e">code point</span> <li><span class="dfn-paneled" id="4ef39030">code point length</span> <li><span class="dfn-paneled" id="b8906bbb">code point substring to the end of the string</span> <li><span class="dfn-paneled" id="ae8def21">contain</span> <li><span class="dfn-paneled" id="f937b7b6">continue</span> <li><span class="dfn-paneled" id="03afaf9c">empty</span> <li><span class="dfn-paneled" id="9c05f1bf">ends with</span> <li><span class="dfn-paneled" id="16d07e10">for each <small>(for list)</small></span> <li><span class="dfn-paneled" id="45209803">for each <small>(for map)</small></span> <li><span class="dfn-paneled" id="fb8f82b0">indices</span> <li><span class="dfn-paneled" id="6b815fdd">is empty</span> <li><span class="dfn-paneled" id="d8b963e8">isomorphic decode</span> <li><span class="dfn-paneled" id="5afbefcd">item</span> <li><span class="dfn-paneled" id="0fa357c3">length</span> <li><span class="dfn-paneled" id="649608b9">list</span> <li><span class="dfn-paneled" id="4fb3d0dd">noncharacter</span> <li><span class="dfn-paneled" id="99c988d6">remove</span> <li><span class="dfn-paneled" id="ecf251b4">scalar value</span> <li><span class="dfn-paneled" id="762869d3">scalar value string</span> <li><span class="dfn-paneled" id="0204d188">size</span> <li><span class="dfn-paneled" id="54627f47">starts with</span> <li><span class="dfn-paneled" id="e5fc5b88">strictly split</span> <li><span class="dfn-paneled" id="0698d556">string</span> <li><span class="dfn-paneled" id="984221ca">struct</span> <li><span class="dfn-paneled" id="a3fb968a">surrogate</span> <li><span class="dfn-paneled" id="0e8de730">tuple</span> <li><span class="dfn-paneled" id="34f375cb">value <small>(for byte)</small></span> <li><span class="dfn-paneled" id="bb049306">value <small>(for code point)</small></span> </ul> <li> <a data-link-type="biblio">[UTS46]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="674f2f2d">ToASCII</span> <li><span class="dfn-paneled" id="28e987f8">ToUnicode</span> </ul> <li> <a data-link-type="biblio">[WEBIDL]</a> defines the following terms: <ul> <li><span class="dfn-paneled" id="cdb15a77">LegacyWindowAlias</span> <li><span class="dfn-paneled" id="a5c91173">SameObject</span> <li><span class="dfn-paneled" id="82ca3efc">TypeError</span> <li><span class="dfn-paneled" id="b0d7f3c3">USVString</span> <li><span class="dfn-paneled" id="5372cca8">boolean</span> <li><span class="dfn-paneled" id="7787d359">record</span> <li><span class="dfn-paneled" id="9cce47fd">sequence</span> <li><span class="dfn-paneled" id="4013a022">this</span> <li><span class="dfn-paneled" id="b4cfa5ce">throw</span> <li><span class="dfn-paneled" id="5f90bbfb">undefined</span> <li><span class="dfn-paneled" id="e97a9688">unsigned long</span> <li><span class="dfn-paneled" id="42a03705">value pairs to iterate over</span> </ul> </ul> <h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span><a class="self-link" href="#references"></a></h2> <h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3> <dl> <dt id="biblio-bidi">[BIDI] <dd>Manish Goregaokar मनीष गोरेगांवकर; Robin Leroy. <a href="https://www.unicode.org/reports/tr9/tr9-50.html"><cite>Unicode Bidirectional Algorithm</cite></a>. 2 September 2024. Unicode Standard Annex #9. URL: <a href="https://www.unicode.org/reports/tr9/tr9-50.html">https://www.unicode.org/reports/tr9/tr9-50.html</a> <dt id="biblio-encoding">[ENCODING] <dd>Anne van Kesteren. <a href="https://encoding.spec.whatwg.org/"><cite>Encoding Standard</cite></a>. Living Standard. URL: <a href="https://encoding.spec.whatwg.org/">https://encoding.spec.whatwg.org/</a> <dt id="biblio-fileapi">[FILEAPI] <dd>Marijn Kruisselbrink. <a href="https://w3c.github.io/FileAPI/"><cite>File API</cite></a>. URL: <a href="https://w3c.github.io/FileAPI/">https://w3c.github.io/FileAPI/</a> <dt id="biblio-html">[HTML] <dd>Anne van Kesteren; et al. <a href="https://html.spec.whatwg.org/multipage/"><cite>HTML Standard</cite></a>. Living Standard. URL: <a href="https://html.spec.whatwg.org/multipage/">https://html.spec.whatwg.org/multipage/</a> <dt id="biblio-iana-uri-schemes">[IANA-URI-SCHEMES] <dd><a href="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml"><cite>Uniform Resource Identifier (URI) Schemes</cite></a>. URL: <a href="https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml">https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml</a> <dt id="biblio-infra">[INFRA] <dd>Anne van Kesteren; Domenic Denicola. <a href="https://infra.spec.whatwg.org/"><cite>Infra Standard</cite></a>. Living Standard. URL: <a href="https://infra.spec.whatwg.org/">https://infra.spec.whatwg.org/</a> <dt id="biblio-psl">[PSL] <dd><cite><a href="https://publicsuffix.org/">Public Suffix List</a></cite>. Mozilla Foundation. <dt id="biblio-rfc4291">[RFC4291] <dd>R. Hinden; S. Deering. <a href="https://www.rfc-editor.org/rfc/rfc4291"><cite>IP Version 6 Addressing Architecture</cite></a>. February 2006. Draft Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc4291">https://www.rfc-editor.org/rfc/rfc4291</a> <dt id="biblio-uts46">[UTS46] <dd>Mark Davis; Markus Scherer. <a href="https://www.unicode.org/reports/tr46/tr46-33.html"><cite>Unicode IDNA Compatibility Processing</cite></a>. 30 August 2024. Unicode Technical Standard #46. URL: <a href="https://www.unicode.org/reports/tr46/tr46-33.html">https://www.unicode.org/reports/tr46/tr46-33.html</a> <dt id="biblio-webidl">[WEBIDL] <dd>Edgar Chen; Timothy Gu. <a href="https://webidl.spec.whatwg.org/"><cite>Web IDL Standard</cite></a>. Living Standard. URL: <a href="https://webidl.spec.whatwg.org/">https://webidl.spec.whatwg.org/</a> </dl> <h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span><a class="self-link" href="#informative"></a></h3> <dl> <dt id="biblio-ecma-262">[ECMA-262] <dd><a href="https://tc39.es/ecma262/multipage/"><cite>ECMAScript Language Specification</cite></a>. URL: <a href="https://tc39.es/ecma262/multipage/">https://tc39.es/ecma262/multipage/</a> <dt id="biblio-idnfaq">[IDNFAQ] <dd><a href="https://unicode.org/faq/idn.html"><cite>Internationalized Domain Names (IDN) FAQ</cite></a>. URL: <a href="https://unicode.org/faq/idn.html">https://unicode.org/faq/idn.html</a> <dt id="biblio-rfc1034">[RFC1034] <dd>P. Mockapetris. <a href="https://www.rfc-editor.org/rfc/rfc1034"><cite>Domain names - concepts and facilities</cite></a>. November 1987. Internet Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc1034">https://www.rfc-editor.org/rfc/rfc1034</a> <dt id="biblio-rfc3986">[RFC3986] <dd>T. Berners-Lee; R. Fielding; L. Masinter. <a href="https://www.rfc-editor.org/rfc/rfc3986"><cite>Uniform Resource Identifier (URI): Generic Syntax</cite></a>. January 2005. Internet Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc3986">https://www.rfc-editor.org/rfc/rfc3986</a> <dt id="biblio-rfc3987">[RFC3987] <dd>M. Duerst; M. Suignard. <a href="https://www.rfc-editor.org/rfc/rfc3987"><cite>Internationalized Resource Identifiers (IRIs)</cite></a>. January 2005. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc3987">https://www.rfc-editor.org/rfc/rfc3987</a> <dt id="biblio-rfc5890">[RFC5890] <dd>J. Klensin. <a href="https://www.rfc-editor.org/rfc/rfc5890"><cite>Internationalized Domain Names for Applications (IDNA): Definitions and Document Framework</cite></a>. August 2010. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc5890">https://www.rfc-editor.org/rfc/rfc5890</a> <dt id="biblio-rfc5952">[RFC5952] <dd>S. Kawamura; M. Kawashima. <a href="https://www.rfc-editor.org/rfc/rfc5952"><cite>A Recommendation for IPv6 Address Text Representation</cite></a>. August 2010. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc5952">https://www.rfc-editor.org/rfc/rfc5952</a> <dt id="biblio-rfc6454">[RFC6454] <dd>A. Barth. <a href="https://www.rfc-editor.org/rfc/rfc6454"><cite>The Web Origin Concept</cite></a>. December 2011. Proposed Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc6454">https://www.rfc-editor.org/rfc/rfc6454</a> <dt id="biblio-rfc7595">[RFC7595] <dd>D. Thaler, Ed.; T. Hansen; T. Hardie. <a href="https://www.rfc-editor.org/rfc/rfc7595"><cite>Guidelines and Registration Procedures for URI Schemes</cite></a>. June 2015. Best Current Practice. URL: <a href="https://www.rfc-editor.org/rfc/rfc7595">https://www.rfc-editor.org/rfc/rfc7595</a> <dt id="biblio-rfc791">[RFC791] <dd>J. Postel. <a href="https://www.rfc-editor.org/rfc/rfc791"><cite>Internet Protocol</cite></a>. September 1981. Internet Standard. URL: <a href="https://www.rfc-editor.org/rfc/rfc791">https://www.rfc-editor.org/rfc/rfc791</a> <dt id="biblio-utr36">[UTR36] <dd>Mark Davis; Michel Suignard. <a href="https://www.unicode.org/reports/tr36/tr36-15.html"><cite>Unicode Security Considerations</cite></a>. 19 September 2014. Unicode Technical Report #36. URL: <a href="https://www.unicode.org/reports/tr36/tr36-15.html">https://www.unicode.org/reports/tr36/tr36-15.html</a> <dt id="biblio-uts39">[UTS39] <dd>Mark Davis; Michel Suignard. <a href="https://www.unicode.org/reports/tr39/tr39-30.html"><cite>Unicode Security Mechanisms</cite></a>. 3 September 2024. Unicode Technical Standard #39. URL: <a href="https://www.unicode.org/reports/tr39/tr39-30.html">https://www.unicode.org/reports/tr39/tr39-30.html</a> </dl> <h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2> <pre class="idl highlight def">[Exposed=*, <a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#LegacyWindowAlias"><c- g>LegacyWindowAlias</c-></a>=<a href="#webkiturl"><code><c- n>webkitURL</c-></code></a>] <c- b>interface</c-> <a href="#url"><code><c- g>URL</c-></code></a> { <a class="idl-code" data-link-type="constructor" href="#dom-url-url"><c- g>constructor</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-url-url-base-url"><code><c- g>url</c-></code></a>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-url-url-base-base"><code><c- g>base</c-></code></a>); <c- b>static</c-> <a data-link-type="idl-name" href="#url"><c- n>URL</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-url-parse"><c- g>parse</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-parse-url-base-url"><code><c- g>url</c-></code></a>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-parse-url-base-base"><code><c- g>base</c-></code></a>); <c- b>static</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="method" href="#dom-url-canparse"><c- g>canParse</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-canparse-url-base-url"><code><c- g>url</c-></code></a>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-url-canparse-url-base-base"><code><c- g>base</c-></code></a>); <a href="#URL-stringification-behavior"><c- b>stringifier</c-></a> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-href"><c- g>href</c-></a>; <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="USVString" href="#dom-url-origin"><c- g>origin</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-protocol"><c- g>protocol</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-username"><c- g>username</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-password"><c- g>password</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-host"><c- g>host</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-hostname"><c- g>hostname</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-port"><c- g>port</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-pathname"><c- g>pathname</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-search"><c- g>search</c-></a>; [<a class="idl-code" data-link-type="extended-attribute" href="https://webidl.spec.whatwg.org/#SameObject"><c- g>SameObject</c-></a>] <c- b>readonly</c-> <c- b>attribute</c-> <a data-link-type="idl-name" href="#urlsearchparams"><c- n>URLSearchParams</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="URLSearchParams" href="#dom-url-searchparams"><c- g>searchParams</c-></a>; <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="attribute" data-type="USVString" href="#dom-url-hash"><c- g>hash</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a class="idl-code" data-link-type="method" href="#dom-url-tojson"><c- g>toJSON</c-></a>(); }; [Exposed=*] <c- b>interface</c-> <a href="#urlsearchparams"><code><c- g>URLSearchParams</c-></code></a> { <a class="idl-code" data-link-type="constructor" href="#dom-urlsearchparams-urlsearchparams"><c- g>constructor</c-></a>(<c- b>optional</c-> (<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>>> <c- b>or</c-> <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-record"><c- b>record</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>> <c- b>or</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>) <a href="#dom-urlsearchparams-urlsearchparams-init-init"><code><c- g>init</c-></code></a> = ""); <c- b>readonly</c-> <c- b>attribute</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-unsigned-long"><c- b>unsigned</c-> <c- b>long</c-></a> <a class="idl-code" data-link-type="attribute" data-readonly data-type="unsigned long" href="#dom-urlsearchparams-size"><c- g>size</c-></a>; <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-append"><c- g>append</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-append-name-value-name"><code><c- g>name</c-></code></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-append-name-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-delete"><c- g>delete</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-delete-name-value-name"><code><c- g>name</c-></code></a>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-delete-name-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>? <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-get"><c- g>get</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-get-name-name"><code><c- g>name</c-></code></a>); <a data-link-type="dfn" href="https://webidl.spec.whatwg.org/#idl-sequence"><c- b>sequence</c-></a>&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-getall"><c- g>getAll</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-getall-name-name"><code><c- g>name</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-boolean"><c- b>boolean</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-has"><c- g>has</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-has-name-value-name"><code><c- g>name</c-></code></a>, <c- b>optional</c-> <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-has-name-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-set"><c- g>set</c-></a>(<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-set-name-value-name"><code><c- g>name</c-></code></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a> <a href="#dom-urlsearchparams-set-name-value-value"><code><c- g>value</c-></code></a>); <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-undefined"><c- b>undefined</c-></a> <a class="idl-code" data-link-type="method" href="#dom-urlsearchparams-sort"><c- g>sort</c-></a>(); <c- b>iterable</c->&lt;<a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>, <a class="idl-code" data-link-type="interface" href="https://webidl.spec.whatwg.org/#idl-USVString"><c- b>USVString</c-></a>>; <a data-link-type="dfn" href="#urlsearchparams-stringification-behavior"><c- b>stringifier</c-></a>; }; </pre> <details class="mdn-anno unpositioned" data-anno-for="constructors"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/URL" title="The URL() constructor returns a newly created URL object representing the URL defined by the parameters.">URL/URL</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>26+</span></span><span class="safari yes"><span>Safari</span><span>14.1+</span></span><span class="chrome yes"><span>Chrome</span><span>19+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>10.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="ref-for-dom-url-canparse"> <summary><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/canParse_static" title="The URL.canParse() static method of the URL interface returns a boolean indicating whether or not an absolute URL, or a relative URL combined with a base URL, are parsable and valid.">URL/canParse_static</a></p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>115+</span></span><span class="safari yes"><span>Safari</span><span>17+</span></span><span class="chrome no"><span>Chrome</span><span>None</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink no"><span>Edge</span><span>None</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>20.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-hash"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/hash" title="The hash property of the URL interface is a string containing a &apos;#&apos; followed by the fragment identifier of the URL.">URL/hash</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-host"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/host" title="The host property of the URL interface is a string containing the host, that is the hostname, and then, if the port of the URL is nonempty, a &apos;:&apos;, followed by the port of the URL.">URL/host</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-hostname"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/hostname" title="The hostname property of the URL interface is a string containing the domain name of the URL.">URL/hostname</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-href"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/href" title="The href property of the URL interface is a string containing the whole URL.">URL/href</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-origin"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/origin" title="The origin read-only property of the URL interface returns a string containing the Unicode serialization of the origin of the represented URL.">URL/origin</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>26+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>6.0+</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-password"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/password" title="The password property of the URL interface is a string containing the password specified before the domain name.">URL/password</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>26+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>6.0+</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-pathname"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/pathname" title="The pathname property of the URL interface represents a location in a hierarchical structure. It is a string constructed from a list of path segments, each of which is prefixed by a / character. If the URL has no path segments, the value of its pathname property will be the empty string.">URL/pathname</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-port"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/port" title="The port property of the URL interface is a string containing the port number of the URL.">URL/port</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-protocol"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/protocol" title="The protocol property of the URL interface is a string representing the protocol scheme of the URL, including the final &apos;:&apos;.">URL/protocol</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-search"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/search" title="The search property of the URL interface is a search string, also called a query string, that is a string containing a &apos;?&apos; followed by the parameters of the URL.">URL/search</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>22+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>13+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-searchparams"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/searchParams" title="The searchParams readonly property of the URL interface returns a URLSearchParams object allowing access to the GET decoded query arguments contained in the URL.">URL/searchParams</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>51+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-tojson"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/toJSON" title="The toJSON() method of the URL interface returns a string containing a serialized version of the URL, although in practice it seems to have the same effect as URL.toString().">URL/toJSON</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>54+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>71+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.7.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="URL-stringification-behavior"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/toString" title="The URL.toString() stringifier method returns a string containing the whole URL. It is effectively a read-only version of URL.href.">URL/toString</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>54+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>19+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>6.0+</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-url-username"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL/username" title="The username property of the URL interface is a string containing the username specified before the domain name.">URL/username</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>26+</span></span><span class="safari yes"><span>Safari</span><span>10+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android yes"><span>Samsung Internet</span><span>6.0+</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="api"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URL" title="The URL interface is used to parse, construct, normalize, and encode URLs. It works by providing properties which allow you to easily read and modify the components of a URL.">URL</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>19+</span></span><span class="safari yes"><span>Safari</span><span>7+</span></span><span class="chrome yes"><span>Chrome</span><span>32+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>12+</span></span><span class="ie yes"><span>IE</span><span>10+</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android yes"><span>Android WebView</span><span>4.4+</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>10.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-urlsearchparams"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams" title="The URLSearchParams() constructor creates and returns a new URLSearchParams object.">URLSearchParams/URLSearchParams</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/entries" title="The entries() method of the URLSearchParams interface returns an iterator allowing iteration through all key/value pairs contained in this object. The iterator returns key/value pairs in the same order as they appear in the query string. The key and value of each pair are string objects.">URLSearchParams/entries</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>44+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/forEach" title="The forEach() method of the URLSearchParams interface allows iteration through all values contained in this object via a callback function.">URLSearchParams/forEach</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>44+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/keys" title="The keys() method of the URLSearchParams interface returns an iterator allowing iteration through all keys contained in this object. The keys are string objects.">URLSearchParams/keys</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>44+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/values" title="The values() method of the URLsearchParams interface returns an iterator allowing iteration through all values contained in this object. The values are string objects.">URLSearchParams/values</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>44+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-append"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/append" title="The append() method of the URLSearchParams interface appends a specified key/value pair as a new search parameter.">URLSearchParams/append</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-delete"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/delete" title="The delete() method of the URLSearchParams interface deletes specified parameters and their associated value(s) from the list of all search parameters.">URLSearchParams/delete</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>14+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-get"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/get" title="The get() method of the URLSearchParams interface returns the first value associated to the given search parameter.">URLSearchParams/get</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-getall"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/getAll" title="The getAll() method of the URLSearchParams interface returns all the values associated with a given search parameter as an array.">URLSearchParams/getAll</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-has"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/has" title="The has() method of the URLSearchParams interface returns a boolean value that indicates whether the specified parameter is in the search parameters.">URLSearchParams/has</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-set"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/set" title="The set() method of the URLSearchParams interface sets the value associated with a given search parameter to the given value. If there were several matching values, this method deletes the others. If the search parameter doesn&apos;t exist, this method creates it.">URLSearchParams/set</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-size"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/size" title="The read-only URLSearchParams.size property indicates the total number of search parameter entries.">URLSearchParams/size</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>112+</span></span><span class="safari yes"><span>Safari</span><span>17+</span></span><span class="chrome yes"><span>Chrome</span><span>113+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>113+</span></span> <hr> <span class="edge no"><span>Edge (Legacy)</span><span>?</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>19.0.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="dom-urlsearchparams-sort"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/sort" title="The URLSearchParams.sort() method sorts all key/value pairs contained in this object in place and returns undefined. The sort order is according to unicode code points of the keys. This method uses a stable sorting algorithm (i.e. the relative order between key/value pairs with equal keys will be preserved).">URLSearchParams/sort</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>54+</span></span><span class="safari yes"><span>Safari</span><span>11+</span></span><span class="chrome yes"><span>Chrome</span><span>61+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.7.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="urlsearchparams-stringification-behavior"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/toString" title="The toString() method of the URLSearchParams interface returns a query string suitable for use in a URL.">URLSearchParams/toString</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>7.5.0+</span></span> </div> </div> </details> <details class="mdn-anno unpositioned" data-anno-for="urlsearchparams"> <summary><b class="all-engines-flag" title="This feature is in all current engines.">✔</b><span>MDN</span></summary> <div class="feature"> <p><a href="https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams" title="The URLSearchParams interface defines utility methods to work with the query string of a URL.">URLSearchParams</a></p> <p class="all-engines-text">In all current engines.</p> <div class="support"> <span class="firefox yes"><span>Firefox</span><span>29+</span></span><span class="safari yes"><span>Safari</span><span>10.1+</span></span><span class="chrome yes"><span>Chrome</span><span>49+</span></span> <hr> <span class="opera no"><span>Opera</span><span>?</span></span><span class="edge_blink yes"><span>Edge</span><span>79+</span></span> <hr> <span class="edge yes"><span>Edge (Legacy)</span><span>17+</span></span><span class="ie no"><span>IE</span><span>None</span></span> <hr> <span class="firefox_android no"><span>Firefox for Android</span><span>?</span></span><span class="safari_ios no"><span>iOS Safari</span><span>?</span></span><span class="chrome_android no"><span>Chrome for Android</span><span>?</span></span><span class="webview_android no"><span>Android WebView</span><span>?</span></span><span class="samsunginternet_android no"><span>Samsung Internet</span><span>?</span></span><span class="opera_android no"><span>Opera Mobile</span><span>?</span></span> <hr> <span class="nodejs yes"><span>Node.js</span><span>10.0.0+</span></span> </div> </div> </details> <script>/* Boilerplate: script-dom-helper */ "use strict"; function query(sel) { return document.querySelector(sel); } function queryAll(sel) { return [...document.querySelectorAll(sel)]; } function iter(obj) { if(!obj) return []; var it = obj[Symbol.iterator]; if(it) return it; return Object.entries(obj); } function mk(tagname, attrs, ...children) { const el = document.createElement(tagname); for(const [k,v] of iter(attrs)) { if(k.slice(0,3) == "_on") { const eventName = k.slice(3); el.addEventListener(eventName, v); } else if(k[0] == "_") { // property, not attribute el[k.slice(1)] = v; } else { if(v === false || v == null) { continue; } else if(v === true) { el.setAttribute(k, ""); continue; } else { el.setAttribute(k, v); } } } append(el, children); return el; } /* Create shortcuts for every known HTML element */ [ "a", "abbr", "acronym", "address", "applet", "area", "article", "aside", "audio", "b", "base", "basefont", "bdo", "big", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "font", "footer", "form", "frame", "frameset", "head", "header", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "meta", "meter", "nav", "nobr", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "pre", "progress", "q", "s", "samp", "script", "section", "select", "small", "source", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "u", "ul", "var", "video", "wbr", "xmp", ].forEach(tagname=>{ mk[tagname] = (...args) => mk(tagname, ...args); }); function* nodesFromChildList(children) { for(const child of children.flat(Infinity)) { if(child instanceof Node) { yield child; } else { yield new Text(child); } } } function append(el, ...children) { for(const child of nodesFromChildList(children)) { if(el instanceof Node) el.appendChild(child); else el.push(child); } return el; } function insertAfter(el, ...children) { for(const child of nodesFromChildList(children)) { el.parentNode.insertBefore(child, el.nextSibling); } return el; } function clearContents(el) { el.innerHTML = ""; return el; } function parseHTML(markup) { if(markup.toLowerCase().trim().indexOf('<!doctype') === 0) { const doc = document.implementation.createHTMLDocument(""); doc.documentElement.innerHTML = markup; return doc; } else { const el = mk.template({}); el.innerHTML = markup; return el.content; } }</script> <script>/* Boilerplate: script-dfn-panel */ "use strict"; { let dfnPanelData = { "0204d188": {"dfnID":"0204d188","dfnText":"size","external":true,"refSections":[{"refs":[{"id":"ref-for-list-size"},{"id":"ref-for-list-size\u2460"},{"id":"ref-for-list-size\u2461"},{"id":"ref-for-list-size\u2462"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-list-size\u2463"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-list-size\u2464"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-list-size\u2465"},{"id":"ref-for-list-size\u2466"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list-size"}, "027e3e49": {"dfnID":"027e3e49","dfnText":"clone","external":true,"refSections":[{"refs":[{"id":"ref-for-list-clone"},{"id":"ref-for-list-clone\u2460"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#list-clone"}, "02f9bf93": {"dfnID":"02f9bf93","dfnText":"ASCII alpha","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-alpha"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-ascii-alpha\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-ascii-alpha\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-ascii-alpha\u2462"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-alpha"}, "0303e8e5": {"dfnID":"0303e8e5","dfnText":"UTF-8 encode","external":true,"refSections":[{"refs":[{"id":"ref-for-utf-8-encode"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-utf-8-encode\u2460"}],"title":"5.3. Hooks"}],"url":"https://encoding.spec.whatwg.org/#utf-8-encode"}, "03afaf9c": {"dfnID":"03afaf9c","dfnText":"empty","external":true,"refSections":[{"refs":[{"id":"ref-for-list-empty"},{"id":"ref-for-list-empty\u2460"}],"title":"6.1. URL class"}],"url":"https://infra.spec.whatwg.org/#list-empty"}, "0698d556": {"dfnID":"0698d556","dfnText":"string","external":true,"refSections":[{"refs":[{"id":"ref-for-string"},{"id":"ref-for-string\u2460"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-string\u2461"},{"id":"ref-for-string\u2462"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-string\u2463"}],"title":"3.3. IDNA"}],"url":"https://infra.spec.whatwg.org/#string"}, "0757a962": {"dfnID":"0757a962","dfnText":"schemelessly same site","external":true,"refSections":[{"refs":[{"id":"ref-for-schemelessly-same-site"}],"title":"3.2. Host miscellaneous"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site"}, "086e3aff": {"dfnID":"086e3aff","dfnText":"origin","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-origin"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-concept-origin\u2460"},{"id":"ref-for-concept-origin\u2461"}],"title":"4.7. Origin"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin"}, "0e2d3ffe": {"dfnID":"0e2d3ffe","dfnText":"c0 control","external":true,"refSections":[{"refs":[{"id":"ref-for-c0-control"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-c0-control\u2460"}],"title":"3.2. Host miscellaneous"}],"url":"https://infra.spec.whatwg.org/#c0-control"}, "0e8de730": {"dfnID":"0e8de730","dfnText":"tuple","external":true,"refSections":[{"refs":[{"id":"ref-for-tuple"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-tuple\u2460"}],"title":"5. application/x-www-form-urlencoded"},{"refs":[{"id":"ref-for-tuple\u2461"},{"id":"ref-for-tuple\u2462"},{"id":"ref-for-tuple\u2463"},{"id":"ref-for-tuple\u2464"},{"id":"ref-for-tuple\u2465"},{"id":"ref-for-tuple\u2466"},{"id":"ref-for-tuple\u2467"},{"id":"ref-for-tuple\u2468"},{"id":"ref-for-tuple\u2460\u24ea"},{"id":"ref-for-tuple\u2460\u2460"},{"id":"ref-for-tuple\u2460\u2461"},{"id":"ref-for-tuple\u2460\u2462"},{"id":"ref-for-tuple\u2460\u2463"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#tuple"}, "0fa357c3": {"dfnID":"0fa357c3","dfnText":"length","external":true,"refSections":[{"refs":[{"id":"ref-for-string-length"},{"id":"ref-for-string-length\u2460"}],"title":"4.2. URL miscellaneous"}],"url":"https://infra.spec.whatwg.org/#string-length"}, "16d07e10": {"dfnID":"16d07e10","dfnText":"for each (for list)","external":true,"refSections":[{"refs":[{"id":"ref-for-list-iterate"},{"id":"ref-for-list-iterate\u2460"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-list-iterate\u2461"},{"id":"ref-for-list-iterate\u2462"},{"id":"ref-for-list-iterate\u2463"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-list-iterate\u2464"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-list-iterate\u2465"}],"title":"5.1. application/x-www-form-urlencoded parsing"},{"refs":[{"id":"ref-for-list-iterate\u2466"}],"title":"5.2. application/x-www-form-urlencoded serializing"},{"refs":[{"id":"ref-for-list-iterate\u2467"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list-iterate"}, "1b543e90": {"dfnID":"1b543e90","dfnText":"blob URL store","external":true,"refSections":[{"refs":[{"id":"ref-for-BlobURLStore"}],"title":"4.1. URL representation"}],"url":"https://w3c.github.io/FileAPI/#BlobURLStore"}, "1d2aa117": {"dfnID":"1d2aa117","dfnText":"tuple origin","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-origin-tuple"},{"id":"ref-for-concept-origin-tuple\u2460"}],"title":"4.7. Origin"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-tuple"}, "1df6fe6d": {"dfnID":"1df6fe6d","dfnText":"\"encodeURIComponent() [sic]\"","external":true,"refSections":[{"refs":[{"id":"ref-for-sec-encodeuricomponent-uricomponent"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent"}, "27996bbe": {"dfnID":"27996bbe","dfnText":"ISO-2022-JP encoder","external":true,"refSections":[{"refs":[{"id":"ref-for-iso-2022-jp-encoder"}],"title":"4.4. URL parsing"}],"url":"https://encoding.spec.whatwg.org/#iso-2022-jp-encoder"}, "2879bf39": {"dfnID":"2879bf39","dfnText":"resolve a blob URL","external":true,"refSections":[{"refs":[{"id":"ref-for-blob-url-resolve"}],"title":"4.4. URL parsing"}],"url":"https://w3c.github.io/FileAPI/#blob-url-resolve"}, "28e987f8": {"dfnID":"28e987f8","dfnText":"ToUnicode","external":true,"refSections":[{"refs":[{"id":"ref-for-ToUnicode"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-ToUnicode\u2460"}],"title":"3.3. IDNA"}],"url":"https://www.unicode.org/reports/tr46/#ToUnicode"}, "2c95c4a9": {"dfnID":"2c95c4a9","dfnText":"registerProtocolHandler(scheme, url)","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-navigator-registerprotocolhandler"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-registerprotocolhandler"}, "2d5a2765": {"dfnID":"2d5a2765","dfnText":"ASCII string","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-string"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-ascii-string\u2460"},{"id":"ref-for-ascii-string\u2461"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-ascii-string\u2462"},{"id":"ref-for-ascii-string\u2463"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-ascii-string\u2464"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-ascii-string\u2465"},{"id":"ref-for-ascii-string\u2466"},{"id":"ref-for-ascii-string\u2467"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-ascii-string\u2468"},{"id":"ref-for-ascii-string\u2460\u24ea"},{"id":"ref-for-ascii-string\u2460\u2460"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-ascii-string\u2460\u2461"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-ascii-string\u2460\u2462"},{"id":"ref-for-ascii-string\u2460\u2463"},{"id":"ref-for-ascii-string\u2460\u2464"},{"id":"ref-for-ascii-string\u2460\u2465"},{"id":"ref-for-ascii-string\u2460\u2466"},{"id":"ref-for-ascii-string\u2460\u2467"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-ascii-string\u2460\u2468"},{"id":"ref-for-ascii-string\u2461\u24ea"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-ascii-string\u2461\u2460"},{"id":"ref-for-ascii-string\u2461\u2461"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-ascii-string\u2461\u2462"}],"title":"5.2. application/x-www-form-urlencoded serializing"}],"url":"https://infra.spec.whatwg.org/#ascii-string"}, "34f375cb": {"dfnID":"34f375cb","dfnText":"value (for byte)","external":true,"refSections":[{"refs":[{"id":"ref-for-byte-value"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#byte-value"}, "3896d56a": {"dfnID":"3896d56a","dfnText":"ASCII tab or newline","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-tab-or-newline"},{"id":"ref-for-ascii-tab-or-newline\u2460"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-tab-or-newline"}, "3b38c2fe": {"dfnID":"3b38c2fe","dfnText":"ASCII digit","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-digit"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-ascii-digit\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-ascii-digit\u2461"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-ascii-digit\u2462"},{"id":"ref-for-ascii-digit\u2463"},{"id":"ref-for-ascii-digit\u2464"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-ascii-digit\u2465"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-ascii-digit\u2466"},{"id":"ref-for-ascii-digit\u2467"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-digit"}, "3de9e659": {"dfnID":"3de9e659","dfnText":"byte sequence","external":true,"refSections":[{"refs":[{"id":"ref-for-byte-sequence"},{"id":"ref-for-byte-sequence\u2460"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#byte-sequence"}, "4013a022": {"dfnID":"4013a022","dfnText":"this","external":true,"refSections":[{"refs":[{"id":"ref-for-this"},{"id":"ref-for-this\u2460"},{"id":"ref-for-this\u2461"},{"id":"ref-for-this\u2462"},{"id":"ref-for-this\u2463"},{"id":"ref-for-this\u2464"},{"id":"ref-for-this\u2465"},{"id":"ref-for-this\u2466"},{"id":"ref-for-this\u2467"},{"id":"ref-for-this\u2468"},{"id":"ref-for-this\u2460\u24ea"},{"id":"ref-for-this\u2460\u2460"},{"id":"ref-for-this\u2460\u2461"},{"id":"ref-for-this\u2460\u2462"},{"id":"ref-for-this\u2460\u2463"},{"id":"ref-for-this\u2460\u2464"},{"id":"ref-for-this\u2460\u2465"},{"id":"ref-for-this\u2460\u2466"},{"id":"ref-for-this\u2460\u2467"},{"id":"ref-for-this\u2460\u2468"},{"id":"ref-for-this\u2461\u24ea"},{"id":"ref-for-this\u2461\u2460"},{"id":"ref-for-this\u2461\u2461"},{"id":"ref-for-this\u2461\u2462"},{"id":"ref-for-this\u2461\u2463"},{"id":"ref-for-this\u2461\u2464"},{"id":"ref-for-this\u2461\u2465"},{"id":"ref-for-this\u2461\u2466"},{"id":"ref-for-this\u2461\u2467"},{"id":"ref-for-this\u2461\u2468"},{"id":"ref-for-this\u2462\u24ea"},{"id":"ref-for-this\u2462\u2460"},{"id":"ref-for-this\u2462\u2461"},{"id":"ref-for-this\u2462\u2462"},{"id":"ref-for-this\u2462\u2463"},{"id":"ref-for-this\u2462\u2464"},{"id":"ref-for-this\u2462\u2465"},{"id":"ref-for-this\u2462\u2466"},{"id":"ref-for-this\u2462\u2467"},{"id":"ref-for-this\u2462\u2468"},{"id":"ref-for-this\u2463\u24ea"},{"id":"ref-for-this\u2463\u2460"},{"id":"ref-for-this\u2463\u2461"},{"id":"ref-for-this\u2463\u2462"},{"id":"ref-for-this\u2463\u2463"},{"id":"ref-for-this\u2463\u2464"},{"id":"ref-for-this\u2463\u2465"},{"id":"ref-for-this\u2463\u2466"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-this\u2463\u2467"},{"id":"ref-for-this\u2463\u2468"},{"id":"ref-for-this\u2464\u24ea"},{"id":"ref-for-this\u2464\u2460"},{"id":"ref-for-this\u2464\u2461"},{"id":"ref-for-this\u2464\u2462"},{"id":"ref-for-this\u2464\u2463"},{"id":"ref-for-this\u2464\u2464"},{"id":"ref-for-this\u2464\u2465"},{"id":"ref-for-this\u2464\u2466"},{"id":"ref-for-this\u2464\u2467"},{"id":"ref-for-this\u2464\u2468"},{"id":"ref-for-this\u2465\u24ea"},{"id":"ref-for-this\u2465\u2460"},{"id":"ref-for-this\u2465\u2461"},{"id":"ref-for-this\u2465\u2462"},{"id":"ref-for-this\u2465\u2463"},{"id":"ref-for-this\u2465\u2464"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#this"}, "42a03705": {"dfnID":"42a03705","dfnText":"value pairs to iterate over","external":true,"refSections":[{"refs":[{"id":"ref-for-dfn-value-pairs-to-iterate-over"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#dfn-value-pairs-to-iterate-over"}, "43ac8374": {"dfnID":"43ac8374","dfnText":"origin (for environment settings object)","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-settings-object-origin"}],"title":"4.7. Origin"}],"url":"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin"}, "45209803": {"dfnID":"45209803","dfnText":"for each (for map)","external":true,"refSections":[{"refs":[{"id":"ref-for-map-iterate"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#map-iterate"}, "4ce873ee": {"dfnID":"4ce873ee","dfnText":"16-bit unsigned integer","external":true,"refSections":[{"refs":[{"id":"ref-for-16-bit-unsigned-integer"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-16-bit-unsigned-integer\u2460"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-16-bit-unsigned-integer\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-16-bit-unsigned-integer\u2462"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#16-bit-unsigned-integer"}, "4ef39030": {"dfnID":"4ef39030","dfnText":"code point length","external":true,"refSections":[{"refs":[{"id":"ref-for-string-code-point-length"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-string-code-point-length\u2460"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#string-code-point-length"}, "4fb3d0dd": {"dfnID":"4fb3d0dd","dfnText":"noncharacter","external":true,"refSections":[{"refs":[{"id":"ref-for-noncharacter"}],"title":"4.3. URL writing"}],"url":"https://infra.spec.whatwg.org/#noncharacter"}, "5313f397": {"dfnID":"5313f397","dfnText":"getting an encoder","external":true,"refSections":[{"refs":[{"id":"ref-for-get-an-encoder"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://encoding.spec.whatwg.org/#get-an-encoder"}, "53275e46": {"dfnID":"53275e46","dfnText":"append","external":true,"refSections":[{"refs":[{"id":"ref-for-list-append"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-list-append\u2460"},{"id":"ref-for-list-append\u2461"},{"id":"ref-for-list-append\u2462"},{"id":"ref-for-list-append\u2463"},{"id":"ref-for-list-append\u2464"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-list-append\u2465"}],"title":"5.1. application/x-www-form-urlencoded parsing"},{"refs":[{"id":"ref-for-list-append\u2466"},{"id":"ref-for-list-append\u2467"},{"id":"ref-for-list-append\u2468"},{"id":"ref-for-list-append\u2460\u24ea"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list-append"}, "5372cca8": {"dfnID":"5372cca8","dfnText":"boolean","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-boolean"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-idl-boolean\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-boolean"}, "54627f47": {"dfnID":"54627f47","dfnText":"starts with","external":true,"refSections":[{"refs":[{"id":"ref-for-string-starts-with"}],"title":"3.3. IDNA"}],"url":"https://infra.spec.whatwg.org/#string-starts-with"}, "57ca97cc": {"dfnID":"57ca97cc","dfnText":"ASCII hex digit","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-hex-digit"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-ascii-hex-digit\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-ascii-hex-digit\u2461"},{"id":"ref-for-ascii-hex-digit\u2462"},{"id":"ref-for-ascii-hex-digit\u2463"},{"id":"ref-for-ascii-hex-digit\u2464"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-ascii-hex-digit\u2465"},{"id":"ref-for-ascii-hex-digit\u2466"},{"id":"ref-for-ascii-hex-digit\u2467"},{"id":"ref-for-ascii-hex-digit\u2468"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-hex-digit"}, "5afbefcd": {"dfnID":"5afbefcd","dfnText":"item","external":true,"refSections":[{"refs":[{"id":"ref-for-list-item"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-list-item\u2460"},{"id":"ref-for-list-item\u2461"},{"id":"ref-for-list-item\u2462"},{"id":"ref-for-list-item\u2463"},{"id":"ref-for-list-item\u2464"},{"id":"ref-for-list-item\u2465"},{"id":"ref-for-list-item\u2466"},{"id":"ref-for-list-item\u2467"},{"id":"ref-for-list-item\u2468"}],"title":"3.5. Host parsing"}],"url":"https://infra.spec.whatwg.org/#list-item"}, "5f90bbfb": {"dfnID":"5f90bbfb","dfnText":"undefined","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-undefined"},{"id":"ref-for-idl-undefined\u2460"},{"id":"ref-for-idl-undefined\u2461"},{"id":"ref-for-idl-undefined\u2462"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-undefined"}, "610029ae": {"dfnID":"610029ae","dfnText":"ASCII upper hex digit","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-upper-hex-digit"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#ascii-upper-hex-digit"}, "617d690e": {"dfnID":"617d690e","dfnText":"ASCII byte","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-byte"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#ascii-byte"}, "63ab4a31": {"dfnID":"63ab4a31","dfnText":"I/O queue","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-stream"},{"id":"ref-for-concept-stream\u2460"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://encoding.spec.whatwg.org/#concept-stream"}, "649608b9": {"dfnID":"649608b9","dfnText":"list","external":true,"refSections":[{"refs":[{"id":"ref-for-list"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-list\u2460"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-list\u2461"},{"id":"ref-for-list\u2462"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-list\u2463"}],"title":"5. application/x-www-form-urlencoded"},{"refs":[{"id":"ref-for-list\u2464"}],"title":"5.1. application/x-www-form-urlencoded parsing"},{"refs":[{"id":"ref-for-list\u2465"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list"}, "65bee524": {"dfnID":"65bee524","dfnText":"encoding","external":true,"refSections":[{"refs":[{"id":"ref-for-encoding"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-encoding\u2460"},{"id":"ref-for-encoding\u2461"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-encoding\u2462"}],"title":"5.1. application/x-www-form-urlencoded parsing"},{"refs":[{"id":"ref-for-encoding\u2463"}],"title":"5.2. application/x-www-form-urlencoded serializing"}],"url":"https://encoding.spec.whatwg.org/#encoding"}, "674f2f2d": {"dfnID":"674f2f2d","dfnText":"ToASCII","external":true,"refSections":[{"refs":[{"id":"ref-for-ToASCII"},{"id":"ref-for-ToASCII\u2460"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-ToASCII\u2461"}],"title":"3.3. IDNA"}],"url":"https://www.unicode.org/reports/tr46/#ToASCII"}, "6b815fdd": {"dfnID":"6b815fdd","dfnText":"is empty","external":true,"refSections":[{"refs":[{"id":"ref-for-list-is-empty"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#list-is-empty"}, "6f2dfa22": {"dfnID":"6f2dfa22","dfnText":"ASCII lowercase","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-lowercase"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-ascii-lowercase\u2460"},{"id":"ref-for-ascii-lowercase\u2461"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-lowercase"}, "7125fbb8": {"dfnID":"7125fbb8","dfnText":"ISO-2022-JP","external":true,"refSections":[{"refs":[{"id":"ref-for-iso-2022-jp"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://encoding.spec.whatwg.org/#iso-2022-jp"}, "7393da89": {"dfnID":"7393da89","dfnText":"same origin","external":true,"refSections":[{"refs":[{"id":"ref-for-same-origin"}],"title":"4.7. Origin"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#same-origin"}, "762869d3": {"dfnID":"762869d3","dfnText":"scalar value string","external":true,"refSections":[{"refs":[{"id":"ref-for-scalar-value-string"},{"id":"ref-for-scalar-value-string\u2460"},{"id":"ref-for-scalar-value-string\u2461"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-scalar-value-string\u2462"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-scalar-value-string\u2463"},{"id":"ref-for-scalar-value-string\u2464"},{"id":"ref-for-scalar-value-string\u2465"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-scalar-value-string\u2466"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-scalar-value-string\u2467"},{"id":"ref-for-scalar-value-string\u2468"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-scalar-value-string\u2460\u24ea"}],"title":"5.2. application/x-www-form-urlencoded serializing"},{"refs":[{"id":"ref-for-scalar-value-string\u2460\u2460"}],"title":"5.3. Hooks"},{"refs":[{"id":"ref-for-scalar-value-string\u2460\u2461"},{"id":"ref-for-scalar-value-string\u2460\u2462"}],"title":"6.1. URL class"}],"url":"https://infra.spec.whatwg.org/#scalar-value-string"}, "7787d359": {"dfnID":"7787d359","dfnText":"record","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-record"},{"id":"ref-for-idl-record\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-record"}, "77b4c09a": {"dfnID":"77b4c09a","dfnText":"assert","external":true,"refSections":[{"refs":[{"id":"ref-for-assert"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-assert\u2460"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-assert\u2461"}],"title":"5.2. application/x-www-form-urlencoded serializing"}],"url":"https://infra.spec.whatwg.org/#assert"}, "78492a07": {"dfnID":"78492a07","dfnText":"HashChangeEvent","external":true,"refSections":[{"refs":[{"id":"ref-for-hashchangeevent"}],"title":"6.3. URL APIs elsewhere"}],"url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#hashchangeevent"}, "7b0d918d": {"dfnID":"7b0d918d","dfnText":"break","external":true,"refSections":[{"refs":[{"id":"ref-for-iteration-break"}],"title":"3.5. Host parsing"}],"url":"https://infra.spec.whatwg.org/#iteration-break"}, "7f9469b5": {"dfnID":"7f9469b5","dfnText":"ASCII case-insensitive","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-case-insensitive"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-ascii-case-insensitive\u2460"},{"id":"ref-for-ascii-case-insensitive\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-ascii-case-insensitive\u2462"},{"id":"ref-for-ascii-case-insensitive\u2463"},{"id":"ref-for-ascii-case-insensitive\u2464"},{"id":"ref-for-ascii-case-insensitive\u2465"}],"title":"4.3. URL writing"}],"url":"https://infra.spec.whatwg.org/#ascii-case-insensitive"}, "82ca3efc": {"dfnID":"82ca3efc","dfnText":"TypeError","external":true,"refSections":[{"refs":[{"id":"ref-for-exceptiondef-typeerror"},{"id":"ref-for-exceptiondef-typeerror\u2460"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-exceptiondef-typeerror\u2461"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#exceptiondef-typeerror"}, "85a5b3fc": {"dfnID":"85a5b3fc","dfnText":"c0 control or space","external":true,"refSections":[{"refs":[{"id":"ref-for-c0-control-or-space"},{"id":"ref-for-c0-control-or-space\u2460"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#c0-control-or-space"}, "915aff5e": {"dfnID":"915aff5e","dfnText":"code point","external":true,"refSections":[{"refs":[{"id":"ref-for-code-point"},{"id":"ref-for-code-point\u2460"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-code-point\u2461"},{"id":"ref-for-code-point\u2462"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-code-point\u2463"}],"title":"2. Security considerations"},{"refs":[{"id":"ref-for-code-point\u2464"},{"id":"ref-for-code-point\u2465"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-code-point\u2466"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-code-point\u2467"},{"id":"ref-for-code-point\u2468"}],"title":"6.1. URL class"}],"url":"https://infra.spec.whatwg.org/#code-point"}, "984221ca": {"dfnID":"984221ca","dfnText":"struct","external":true,"refSections":[{"refs":[{"id":"ref-for-struct"}],"title":"4.1. URL representation"}],"url":"https://infra.spec.whatwg.org/#struct"}, "99c988d6": {"dfnID":"99c988d6","dfnText":"remove","external":true,"refSections":[{"refs":[{"id":"ref-for-list-remove"},{"id":"ref-for-list-remove\u2460"},{"id":"ref-for-list-remove\u2461"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-list-remove\u2462"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-list-remove\u2463"},{"id":"ref-for-list-remove\u2464"},{"id":"ref-for-list-remove\u2465"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list-remove"}, "9c05f1bf": {"dfnID":"9c05f1bf","dfnText":"ends with","external":true,"refSections":[{"refs":[{"id":"ref-for-string-ends-with"},{"id":"ref-for-string-ends-with\u2460"},{"id":"ref-for-string-ends-with\u2461"},{"id":"ref-for-string-ends-with\u2462"}],"title":"3.2. Host miscellaneous"}],"url":"https://infra.spec.whatwg.org/#string-ends-with"}, "9cce47fd": {"dfnID":"9cce47fd","dfnText":"sequence","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-sequence"},{"id":"ref-for-idl-sequence\u2460"},{"id":"ref-for-idl-sequence\u2461"},{"id":"ref-for-idl-sequence\u2462"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-sequence"}, "URL-stringification-behavior": {"dfnID":"URL-stringification-behavior","dfnText":"stringifier","external":false,"refSections":[],"url":"#URL-stringification-behavior"}, "a08f319f": {"dfnID":"a08f319f","dfnText":"environment","external":true,"refSections":[{"refs":[{"id":"ref-for-blob-url-entry-environment"}],"title":"4.7. Origin"}],"url":"https://w3c.github.io/FileAPI/#blob-url-entry-environment"}, "a3033be5": {"dfnID":"a3033be5","dfnText":"UTF-8 decode without BOM","external":true,"refSections":[{"refs":[{"id":"ref-for-utf-8-decode-without-bom"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-utf-8-decode-without-bom\u2460"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-utf-8-decode-without-bom\u2461"}],"title":"4.8.3. Internationalization and special characters"},{"refs":[{"id":"ref-for-utf-8-decode-without-bom\u2462"}],"title":"5.1. application/x-www-form-urlencoded parsing"}],"url":"https://encoding.spec.whatwg.org/#utf-8-decode-without-bom"}, "a3fb968a": {"dfnID":"a3fb968a","dfnText":"surrogate","external":true,"refSections":[{"refs":[{"id":"ref-for-surrogate"}],"title":"4.3. URL writing"}],"url":"https://infra.spec.whatwg.org/#surrogate"}, "a5c91173": {"dfnID":"a5c91173","dfnText":"SameObject","external":true,"refSections":[{"refs":[{"id":"ref-for-SameObject"}],"title":"6.1. URL class"}],"url":"https://webidl.spec.whatwg.org/#SameObject"}, "absolute-url-string": {"dfnID":"absolute-url-string","dfnText":"absolute-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-absolute-url-string"}],"title":"4.3. URL writing"}],"url":"#absolute-url-string"}, "absolute-url-with-fragment-string": {"dfnID":"absolute-url-with-fragment-string","dfnText":"absolute-URL-with-fragment string","external":false,"refSections":[{"refs":[{"id":"ref-for-absolute-url-with-fragment-string"}],"title":"4.3. URL writing"}],"url":"#absolute-url-with-fragment-string"}, "ae8def21": {"dfnID":"ae8def21","dfnText":"contain","external":true,"refSections":[{"refs":[{"id":"ref-for-list-contain"}],"title":"6.2. URLSearchParams class"}],"url":"https://infra.spec.whatwg.org/#list-contain"}, "api-url-parser": {"dfnID":"api-url-parser","dfnText":"API URL parser","external":false,"refSections":[{"refs":[{"id":"ref-for-api-url-parser"},{"id":"ref-for-api-url-parser\u2460"},{"id":"ref-for-api-url-parser\u2461"}],"title":"6.1. URL class"}],"url":"#api-url-parser"}, "application-x-www-form-urlencoded-percent-encode-set": {"dfnID":"application-x-www-form-urlencoded-percent-encode-set","dfnText":"application/x-www-form-urlencoded percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-application-x-www-form-urlencoded-percent-encode-set"},{"id":"ref-for-application-x-www-form-urlencoded-percent-encode-set\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-application-x-www-form-urlencoded-percent-encode-set\u2461"},{"id":"ref-for-application-x-www-form-urlencoded-percent-encode-set\u2462"}],"title":"5.2. application/x-www-form-urlencoded serializing"},{"refs":[{"id":"ref-for-application-x-www-form-urlencoded-percent-encode-set\u2463"}],"title":"6.2. URLSearchParams class"}],"url":"#application-x-www-form-urlencoded-percent-encode-set"}, "authority-state": {"dfnID":"authority-state","dfnText":"authority state","external":false,"refSections":[{"refs":[{"id":"ref-for-authority-state"},{"id":"ref-for-authority-state\u2460"},{"id":"ref-for-authority-state\u2461"}],"title":"4.4. URL parsing"}],"url":"#authority-state"}, "b01b1359": {"dfnID":"b01b1359","dfnText":"opaque origin","external":true,"refSections":[{"refs":[{"id":"ref-for-concept-origin-opaque"},{"id":"ref-for-concept-origin-opaque\u2460"},{"id":"ref-for-concept-origin-opaque\u2461"},{"id":"ref-for-concept-origin-opaque\u2462"}],"title":"4.7. Origin"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque"}, "b0d7f3c3": {"dfnID":"b0d7f3c3","dfnText":"USVString","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-USVString"},{"id":"ref-for-idl-USVString\u2460"},{"id":"ref-for-idl-USVString\u2461"},{"id":"ref-for-idl-USVString\u2462"},{"id":"ref-for-idl-USVString\u2463"},{"id":"ref-for-idl-USVString\u2464"},{"id":"ref-for-idl-USVString\u2465"},{"id":"ref-for-idl-USVString\u2466"},{"id":"ref-for-idl-USVString\u2467"},{"id":"ref-for-idl-USVString\u2468"},{"id":"ref-for-idl-USVString\u2460\u24ea"},{"id":"ref-for-idl-USVString\u2460\u2460"},{"id":"ref-for-idl-USVString\u2460\u2461"},{"id":"ref-for-idl-USVString\u2460\u2462"},{"id":"ref-for-idl-USVString\u2460\u2463"},{"id":"ref-for-idl-USVString\u2460\u2464"},{"id":"ref-for-idl-USVString\u2460\u2465"},{"id":"ref-for-idl-USVString\u2460\u2466"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-idl-USVString\u2460\u2467"},{"id":"ref-for-idl-USVString\u2460\u2468"},{"id":"ref-for-idl-USVString\u2461\u24ea"},{"id":"ref-for-idl-USVString\u2461\u2460"},{"id":"ref-for-idl-USVString\u2461\u2461"},{"id":"ref-for-idl-USVString\u2461\u2462"},{"id":"ref-for-idl-USVString\u2461\u2463"},{"id":"ref-for-idl-USVString\u2461\u2464"},{"id":"ref-for-idl-USVString\u2461\u2465"},{"id":"ref-for-idl-USVString\u2461\u2466"},{"id":"ref-for-idl-USVString\u2461\u2467"},{"id":"ref-for-idl-USVString\u2461\u2468"},{"id":"ref-for-idl-USVString\u2462\u24ea"},{"id":"ref-for-idl-USVString\u2462\u2460"},{"id":"ref-for-idl-USVString\u2462\u2461"},{"id":"ref-for-idl-USVString\u2462\u2462"},{"id":"ref-for-idl-USVString\u2462\u2463"},{"id":"ref-for-idl-USVString\u2462\u2464"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-USVString"}, "b468b1cd": {"dfnID":"b468b1cd","dfnText":"get an output encoding","external":true,"refSections":[{"refs":[{"id":"ref-for-get-an-output-encoding"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-get-an-output-encoding\u2460"}],"title":"5.2. application/x-www-form-urlencoded serializing"}],"url":"https://encoding.spec.whatwg.org/#get-an-output-encoding"}, "b4cfa5ce": {"dfnID":"b4cfa5ce","dfnText":"throw","external":true,"refSections":[{"refs":[{"id":"ref-for-dfn-throw"},{"id":"ref-for-dfn-throw\u2460"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-dfn-throw\u2461"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#dfn-throw"}, "b68b04de": {"dfnID":"b68b04de","dfnText":"protocol","external":true,"refSections":[{"refs":[{"id":"ref-for-dom-location-protocol"},{"id":"ref-for-dom-location-protocol\u2460"}],"title":"4.4. URL parsing"}],"url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-protocol"}, "b8906bbb": {"dfnID":"b8906bbb","dfnText":"code point substring to the end of the string","external":true,"refSections":[{"refs":[{"id":"ref-for-code-point-substring-to-the-end-of-the-string"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-code-point-substring-to-the-end-of-the-string\u2460"},{"id":"ref-for-code-point-substring-to-the-end-of-the-string\u2461"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string"}, "basic-url-parser-state-override": {"dfnID":"basic-url-parser-state-override","dfnText":"state override","external":false,"refSections":[{"refs":[{"id":"ref-for-basic-url-parser-state-override"},{"id":"ref-for-basic-url-parser-state-override\u2460"},{"id":"ref-for-basic-url-parser-state-override\u2461"},{"id":"ref-for-basic-url-parser-state-override\u2462"},{"id":"ref-for-basic-url-parser-state-override\u2463"},{"id":"ref-for-basic-url-parser-state-override\u2464"},{"id":"ref-for-basic-url-parser-state-override\u2465"}],"title":"6.1. URL class"}],"url":"#basic-url-parser-state-override"}, "basic-url-parser-url": {"dfnID":"basic-url-parser-url","dfnText":"url","external":false,"refSections":[{"refs":[{"id":"ref-for-basic-url-parser-url"},{"id":"ref-for-basic-url-parser-url\u2460"},{"id":"ref-for-basic-url-parser-url\u2461"},{"id":"ref-for-basic-url-parser-url\u2462"},{"id":"ref-for-basic-url-parser-url\u2463"},{"id":"ref-for-basic-url-parser-url\u2464"},{"id":"ref-for-basic-url-parser-url\u2465"}],"title":"6.1. URL class"}],"url":"#basic-url-parser-url"}, "bb049306": {"dfnID":"bb049306","dfnText":"value (for code point)","external":true,"refSections":[{"refs":[{"id":"ref-for-code-point-value"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#code-point-value"}, "bffb633e": {"dfnID":"bffb633e","dfnText":"UTF-8","external":true,"refSections":[{"refs":[{"id":"ref-for-utf-8"},{"id":"ref-for-utf-8\u2460"},{"id":"ref-for-utf-8\u2461"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-utf-8\u2462"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-utf-8\u2463"},{"id":"ref-for-utf-8\u2464"},{"id":"ref-for-utf-8\u2465"},{"id":"ref-for-utf-8\u2466"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-utf-8\u2467"},{"id":"ref-for-utf-8\u2468"}],"title":"5.1. application/x-www-form-urlencoded parsing"},{"refs":[{"id":"ref-for-utf-8\u2460\u24ea"}],"title":"5.2. application/x-www-form-urlencoded serializing"},{"refs":[{"id":"ref-for-utf-8\u2460\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"https://encoding.spec.whatwg.org/#utf-8"}, "c": {"dfnID":"c","dfnText":"c","external":false,"refSections":[{"refs":[{"id":"ref-for-c"},{"id":"ref-for-c\u2460"},{"id":"ref-for-c\u2461"},{"id":"ref-for-c\u2462"},{"id":"ref-for-c\u2463"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-c\u2464"},{"id":"ref-for-c\u2465"},{"id":"ref-for-c\u2466"},{"id":"ref-for-c\u2467"},{"id":"ref-for-c\u2468"},{"id":"ref-for-c\u2460\u24ea"},{"id":"ref-for-c\u2460\u2460"},{"id":"ref-for-c\u2460\u2461"},{"id":"ref-for-c\u2460\u2462"},{"id":"ref-for-c\u2460\u2463"},{"id":"ref-for-c\u2460\u2464"},{"id":"ref-for-c\u2460\u2465"},{"id":"ref-for-c\u2460\u2466"},{"id":"ref-for-c\u2460\u2467"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-c\u2460\u2468"},{"id":"ref-for-c\u2461\u24ea"},{"id":"ref-for-c\u2461\u2460"},{"id":"ref-for-c\u2461\u2461"},{"id":"ref-for-c\u2461\u2462"},{"id":"ref-for-c\u2461\u2463"},{"id":"ref-for-c\u2461\u2464"},{"id":"ref-for-c\u2461\u2465"},{"id":"ref-for-c\u2461\u2466"},{"id":"ref-for-c\u2461\u2467"},{"id":"ref-for-c\u2461\u2468"},{"id":"ref-for-c\u2462\u24ea"},{"id":"ref-for-c\u2462\u2460"},{"id":"ref-for-c\u2462\u2461"},{"id":"ref-for-c\u2462\u2462"},{"id":"ref-for-c\u2462\u2463"},{"id":"ref-for-c\u2462\u2464"},{"id":"ref-for-c\u2462\u2465"},{"id":"ref-for-c\u2462\u2466"},{"id":"ref-for-c\u2462\u2467"},{"id":"ref-for-c\u2462\u2468"},{"id":"ref-for-c\u2463\u24ea"},{"id":"ref-for-c\u2463\u2460"},{"id":"ref-for-c\u2463\u2461"},{"id":"ref-for-c\u2463\u2462"},{"id":"ref-for-c\u2463\u2463"},{"id":"ref-for-c\u2463\u2464"},{"id":"ref-for-c\u2463\u2465"},{"id":"ref-for-c\u2463\u2466"},{"id":"ref-for-c\u2463\u2467"},{"id":"ref-for-c\u2463\u2468"},{"id":"ref-for-c\u2464\u24ea"},{"id":"ref-for-c\u2464\u2460"},{"id":"ref-for-c\u2464\u2461"},{"id":"ref-for-c\u2464\u2462"},{"id":"ref-for-c\u2464\u2463"},{"id":"ref-for-c\u2464\u2464"},{"id":"ref-for-c\u2464\u2465"},{"id":"ref-for-c\u2464\u2466"},{"id":"ref-for-c\u2464\u2467"},{"id":"ref-for-c\u2464\u2468"},{"id":"ref-for-c\u2465\u24ea"},{"id":"ref-for-c\u2465\u2460"},{"id":"ref-for-c\u2465\u2461"},{"id":"ref-for-c\u2465\u2462"},{"id":"ref-for-c\u2465\u2463"},{"id":"ref-for-c\u2465\u2464"},{"id":"ref-for-c\u2465\u2465"},{"id":"ref-for-c\u2465\u2466"},{"id":"ref-for-c\u2465\u2467"},{"id":"ref-for-c\u2465\u2468"},{"id":"ref-for-c\u2466\u24ea"},{"id":"ref-for-c\u2466\u2460"},{"id":"ref-for-c\u2466\u2461"},{"id":"ref-for-c\u2466\u2462"},{"id":"ref-for-c\u2466\u2463"},{"id":"ref-for-c\u2466\u2464"},{"id":"ref-for-c\u2466\u2465"},{"id":"ref-for-c\u2466\u2466"},{"id":"ref-for-c\u2466\u2467"},{"id":"ref-for-c\u2466\u2468"},{"id":"ref-for-c\u2467\u24ea"},{"id":"ref-for-c\u2467\u2460"},{"id":"ref-for-c\u2467\u2461"},{"id":"ref-for-c\u2467\u2462"},{"id":"ref-for-c\u2467\u2463"},{"id":"ref-for-c\u2467\u2464"},{"id":"ref-for-c\u2467\u2465"},{"id":"ref-for-c\u2467\u2466"},{"id":"ref-for-c\u2467\u2467"},{"id":"ref-for-c\u2467\u2468"},{"id":"ref-for-c\u2468\u24ea"},{"id":"ref-for-c\u2468\u2460"},{"id":"ref-for-c\u2468\u2461"},{"id":"ref-for-c\u2468\u2462"},{"id":"ref-for-c\u2468\u2463"},{"id":"ref-for-c\u2468\u2464"},{"id":"ref-for-c\u2468\u2465"}],"title":"4.4. URL parsing"}],"url":"#c"}, "c0-control-percent-encode-set": {"dfnID":"c0-control-percent-encode-set","dfnText":"C0 control percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-c0-control-percent-encode-set"},{"id":"ref-for-c0-control-percent-encode-set\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-c0-control-percent-encode-set\u2461"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-c0-control-percent-encode-set\u2462"}],"title":"4.4. URL parsing"}],"url":"#c0-control-percent-encode-set"}, "c07adfd3": {"dfnID":"c07adfd3","dfnText":"Shift_JIS","external":true,"refSections":[{"refs":[{"id":"ref-for-shift_jis"},{"id":"ref-for-shift_jis\u2460"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://encoding.spec.whatwg.org/#shift_jis"}, "c992ac73": {"dfnID":"c992ac73","dfnText":"encode or fail","external":true,"refSections":[{"refs":[{"id":"ref-for-encode-or-fail"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://encoding.spec.whatwg.org/#encode-or-fail"}, "cannot-be-a-base-url-path-state": {"dfnID":"cannot-be-a-base-url-path-state","dfnText":"opaque path state","external":false,"refSections":[{"refs":[{"id":"ref-for-cannot-be-a-base-url-path-state"}],"title":"4.4. URL parsing"}],"url":"#cannot-be-a-base-url-path-state"}, "cannot-have-a-username-password-port": {"dfnID":"cannot-have-a-username-password-port","dfnText":"cannot have a username/password/port","external":false,"refSections":[{"refs":[{"id":"ref-for-cannot-have-a-username-password-port"},{"id":"ref-for-cannot-have-a-username-password-port\u2460"},{"id":"ref-for-cannot-have-a-username-password-port\u2461"}],"title":"6.1. URL class"}],"url":"#cannot-have-a-username-password-port"}, "cc549724": {"dfnID":"cc549724","dfnText":"Location","external":true,"refSections":[{"refs":[{"id":"ref-for-location"},{"id":"ref-for-location\u2460"}],"title":"4.4. URL parsing"}],"url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#location"}, "cdb15a77": {"dfnID":"cdb15a77","dfnText":"LegacyWindowAlias","external":true,"refSections":[{"refs":[{"id":"ref-for-LegacyWindowAlias"}],"title":"6.1. URL class"}],"url":"https://webidl.spec.whatwg.org/#LegacyWindowAlias"}, "component-percent-encode-set": {"dfnID":"component-percent-encode-set","dfnText":"component percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-component-percent-encode-set"},{"id":"ref-for-component-percent-encode-set\u2460"}],"title":"1.3. Percent-encoded bytes"}],"url":"#component-percent-encode-set"}, "concept-base-url": {"dfnID":"concept-base-url","dfnText":"base URL","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-base-url"},{"id":"ref-for-concept-base-url\u2460"},{"id":"ref-for-concept-base-url\u2461"},{"id":"ref-for-concept-base-url\u2462"},{"id":"ref-for-concept-base-url\u2463"},{"id":"ref-for-concept-base-url\u2464"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-concept-base-url\u2465"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-base-url\u2466"},{"id":"ref-for-concept-base-url\u2467"},{"id":"ref-for-concept-base-url\u2468"},{"id":"ref-for-concept-base-url\u2460\u24ea"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-base-url\u2460\u2460"},{"id":"ref-for-concept-base-url\u2460\u2461"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-base-url\u2460\u2462"},{"id":"ref-for-concept-base-url\u2460\u2463"},{"id":"ref-for-concept-base-url\u2460\u2464"}],"title":"6.1. URL class"}],"url":"#concept-base-url"}, "concept-basic-url-parser": {"dfnID":"concept-basic-url-parser","dfnText":"basic URL parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-basic-url-parser"},{"id":"ref-for-concept-basic-url-parser\u2460"},{"id":"ref-for-concept-basic-url-parser\u2461"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-basic-url-parser\u2462"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-basic-url-parser\u2463"},{"id":"ref-for-concept-basic-url-parser\u2464"},{"id":"ref-for-concept-basic-url-parser\u2465"},{"id":"ref-for-concept-basic-url-parser\u2466"},{"id":"ref-for-concept-basic-url-parser\u2467"},{"id":"ref-for-concept-basic-url-parser\u2468"},{"id":"ref-for-concept-basic-url-parser\u2460\u24ea"},{"id":"ref-for-concept-basic-url-parser\u2460\u2460"},{"id":"ref-for-concept-basic-url-parser\u2460\u2461"},{"id":"ref-for-concept-basic-url-parser\u2460\u2462"},{"id":"ref-for-concept-basic-url-parser\u2460\u2463"}],"title":"6.1. URL class"}],"url":"#concept-basic-url-parser"}, "concept-domain": {"dfnID":"concept-domain","dfnText":"domain","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-domain"},{"id":"ref-for-concept-domain\u2460"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-domain\u2461"},{"id":"ref-for-concept-domain\u2462"},{"id":"ref-for-concept-domain\u2463"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-domain\u2464"},{"id":"ref-for-concept-domain\u2465"},{"id":"ref-for-concept-domain\u2466"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-concept-domain\u2467"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-concept-domain\u2468"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-concept-domain\u2460\u24ea"}],"title":"4.1. URL representation"}],"url":"#concept-domain"}, "concept-domain-to-ascii": {"dfnID":"concept-domain-to-ascii","dfnText":"domain to ASCII","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-domain-to-ascii"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-concept-domain-to-ascii\u2460"},{"id":"ref-for-concept-domain-to-ascii\u2461"}],"title":"3.5. Host parsing"}],"url":"#concept-domain-to-ascii"}, "concept-domain-to-unicode": {"dfnID":"concept-domain-to-unicode","dfnText":"domain to Unicode","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-domain-to-unicode"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-concept-domain-to-unicode\u2460"}],"title":"4.8.3. Internationalization and special characters"}],"url":"#concept-domain-to-unicode"}, "concept-host": {"dfnID":"concept-host","dfnText":"host","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-host"},{"id":"ref-for-concept-host\u2460"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-concept-host\u2461"}],"title":"2. Security considerations"},{"refs":[{"id":"ref-for-concept-host\u2462"},{"id":"ref-for-concept-host\u2463"},{"id":"ref-for-concept-host\u2464"},{"id":"ref-for-concept-host\u2465"},{"id":"ref-for-concept-host\u2466"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-host\u2467"},{"id":"ref-for-concept-host\u2468"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-host\u2460\u24ea"},{"id":"ref-for-concept-host\u2460\u2460"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-concept-host\u2460\u2461"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-concept-host\u2460\u2462"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-concept-host\u2460\u2463"},{"id":"ref-for-concept-host\u2460\u2464"}],"title":"3.7. Host equivalence"},{"refs":[{"id":"ref-for-concept-host\u2460\u2465"}],"title":"4.1. URL representation"}],"url":"#concept-host"}, "concept-host-equals": {"dfnID":"concept-host-equals","dfnText":"equals","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-host-equals"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-host-equals\u2460"}],"title":"3.2. Host miscellaneous"}],"url":"#concept-host-equals"}, "concept-host-parser": {"dfnID":"concept-host-parser","dfnText":"host parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-host-parser"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-host-parser\u2460"},{"id":"ref-for-concept-host-parser\u2461"},{"id":"ref-for-concept-host-parser\u2462"},{"id":"ref-for-concept-host-parser\u2463"},{"id":"ref-for-concept-host-parser\u2464"},{"id":"ref-for-concept-host-parser\u2465"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-host-parser\u2466"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-concept-host-parser\u2467"},{"id":"ref-for-concept-host-parser\u2468"},{"id":"ref-for-concept-host-parser\u2460\u24ea"}],"title":"4.4. URL parsing"}],"url":"#concept-host-parser"}, "concept-host-serializer": {"dfnID":"concept-host-serializer","dfnText":"host serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-host-serializer"},{"id":"ref-for-concept-host-serializer\u2460"},{"id":"ref-for-concept-host-serializer\u2461"},{"id":"ref-for-concept-host-serializer\u2462"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-host-serializer\u2463"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-host-serializer\u2464"},{"id":"ref-for-concept-host-serializer\u2465"},{"id":"ref-for-concept-host-serializer\u2466"}],"title":"6.1. URL class"}],"url":"#concept-host-serializer"}, "concept-ipv4": {"dfnID":"concept-ipv4","dfnText":"IPv4 address","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv4"},{"id":"ref-for-concept-ipv4\u2460"},{"id":"ref-for-concept-ipv4\u2461"},{"id":"ref-for-concept-ipv4\u2462"},{"id":"ref-for-concept-ipv4\u2463"},{"id":"ref-for-concept-ipv4\u2464"},{"id":"ref-for-concept-ipv4\u2465"},{"id":"ref-for-concept-ipv4\u2466"},{"id":"ref-for-concept-ipv4\u2467"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-concept-ipv4\u2468"},{"id":"ref-for-concept-ipv4\u2460\u24ea"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-ipv4\u2460\u2460"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-ipv4\u2460\u2461"},{"id":"ref-for-concept-ipv4\u2460\u2462"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-concept-ipv4\u2460\u2463"},{"id":"ref-for-concept-ipv4\u2460\u2464"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-concept-ipv4\u2460\u2465"}],"title":"4.1. URL representation"}],"url":"#concept-ipv4"}, "concept-ipv4-parser": {"dfnID":"concept-ipv4-parser","dfnText":"IPv4 parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv4-parser"},{"id":"ref-for-concept-ipv4-parser\u2460"},{"id":"ref-for-concept-ipv4-parser\u2461"}],"title":"3.5. Host parsing"}],"url":"#concept-ipv4-parser"}, "concept-ipv4-serializer": {"dfnID":"concept-ipv4-serializer","dfnText":"IPv4 serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv4-serializer"}],"title":"3.6. Host serializing"}],"url":"#concept-ipv4-serializer"}, "concept-ipv6": {"dfnID":"concept-ipv6","dfnText":"IPv6 address","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv6"},{"id":"ref-for-concept-ipv6\u2460"},{"id":"ref-for-concept-ipv6\u2461"},{"id":"ref-for-concept-ipv6\u2462"},{"id":"ref-for-concept-ipv6\u2463"},{"id":"ref-for-concept-ipv6\u2464"},{"id":"ref-for-concept-ipv6\u2465"},{"id":"ref-for-concept-ipv6\u2466"},{"id":"ref-for-concept-ipv6\u2467"},{"id":"ref-for-concept-ipv6\u2468"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-concept-ipv6\u2460\u24ea"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-concept-ipv6\u2460\u2460"},{"id":"ref-for-concept-ipv6\u2460\u2461"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-ipv6\u2460\u2462"},{"id":"ref-for-concept-ipv6\u2460\u2463"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-concept-ipv6\u2460\u2464"},{"id":"ref-for-concept-ipv6\u2460\u2465"},{"id":"ref-for-concept-ipv6\u2460\u2466"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-concept-ipv6\u2460\u2467"}],"title":"4.1. URL representation"}],"url":"#concept-ipv6"}, "concept-ipv6-parser": {"dfnID":"concept-ipv6-parser","dfnText":"IPv6 parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv6-parser"},{"id":"ref-for-concept-ipv6-parser\u2460"}],"title":"3.5. Host parsing"}],"url":"#concept-ipv6-parser"}, "concept-ipv6-piece": {"dfnID":"concept-ipv6-piece","dfnText":"pieces","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv6-piece"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-concept-ipv6-piece\u2460"},{"id":"ref-for-concept-ipv6-piece\u2461"},{"id":"ref-for-concept-ipv6-piece\u2462"}],"title":"3.6. Host serializing"}],"url":"#concept-ipv6-piece"}, "concept-ipv6-serializer": {"dfnID":"concept-ipv6-serializer","dfnText":"IPv6 serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-ipv6-serializer"}],"title":"3.6. Host serializing"}],"url":"#concept-ipv6-serializer"}, "concept-opaque-host-parser": {"dfnID":"concept-opaque-host-parser","dfnText":"opaque-host parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-opaque-host-parser"}],"title":"3.5. Host parsing"}],"url":"#concept-opaque-host-parser"}, "concept-url": {"dfnID":"concept-url","dfnText":"URL","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-url\u2460"},{"id":"ref-for-concept-url\u2461"},{"id":"ref-for-concept-url\u2462"},{"id":"ref-for-concept-url\u2463"},{"id":"ref-for-concept-url\u2464"},{"id":"ref-for-concept-url\u2465"}],"title":"2. Security considerations"},{"refs":[{"id":"ref-for-concept-url\u2466"},{"id":"ref-for-concept-url\u2467"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-url\u2468"},{"id":"ref-for-concept-url\u2460\u24ea"},{"id":"ref-for-concept-url\u2460\u2460"},{"id":"ref-for-concept-url\u2460\u2461"},{"id":"ref-for-concept-url\u2460\u2462"},{"id":"ref-for-concept-url\u2460\u2463"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-concept-url\u2460\u2464"},{"id":"ref-for-concept-url\u2460\u2465"},{"id":"ref-for-concept-url\u2460\u2466"},{"id":"ref-for-concept-url\u2460\u2467"},{"id":"ref-for-concept-url\u2460\u2468"},{"id":"ref-for-concept-url\u2461\u24ea"},{"id":"ref-for-concept-url\u2461\u2460"},{"id":"ref-for-concept-url\u2461\u2461"},{"id":"ref-for-concept-url\u2461\u2462"},{"id":"ref-for-concept-url\u2461\u2463"},{"id":"ref-for-concept-url\u2461\u2464"},{"id":"ref-for-concept-url\u2461\u2465"},{"id":"ref-for-concept-url\u2461\u2466"},{"id":"ref-for-concept-url\u2461\u2467"},{"id":"ref-for-concept-url\u2461\u2468"},{"id":"ref-for-concept-url\u2462\u24ea"},{"id":"ref-for-concept-url\u2462\u2460"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url\u2462\u2461"},{"id":"ref-for-concept-url\u2462\u2462"},{"id":"ref-for-concept-url\u2462\u2463"},{"id":"ref-for-concept-url\u2462\u2464"},{"id":"ref-for-concept-url\u2462\u2465"},{"id":"ref-for-concept-url\u2462\u2466"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url\u2462\u2467"},{"id":"ref-for-concept-url\u2462\u2468"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url\u2463\u24ea"},{"id":"ref-for-concept-url\u2463\u2460"},{"id":"ref-for-concept-url\u2463\u2461"},{"id":"ref-for-concept-url\u2463\u2462"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url\u2463\u2463"},{"id":"ref-for-concept-url\u2463\u2464"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url\u2463\u2465"},{"id":"ref-for-concept-url\u2463\u2466"}],"title":"4.6. URL equivalence"},{"refs":[{"id":"ref-for-concept-url\u2463\u2467"},{"id":"ref-for-concept-url\u2463\u2468"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-url\u2464\u24ea"}],"title":"4.8. URL rendering"},{"refs":[{"id":"ref-for-concept-url\u2464\u2460"},{"id":"ref-for-concept-url\u2464\u2461"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url\u2464\u2462"},{"id":"ref-for-concept-url\u2464\u2463"},{"id":"ref-for-concept-url\u2464\u2464"},{"id":"ref-for-concept-url\u2464\u2465"},{"id":"ref-for-concept-url\u2464\u2466"},{"id":"ref-for-concept-url\u2464\u2467"}],"title":"4.8.3. Internationalization and special characters"},{"refs":[{"id":"ref-for-concept-url\u2464\u2468"},{"id":"ref-for-concept-url\u2465\u24ea"},{"id":"ref-for-concept-url\u2465\u2460"},{"id":"ref-for-concept-url\u2465\u2461"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-url\u2465\u2462"},{"id":"ref-for-concept-url\u2465\u2463"}],"title":"6.2. URLSearchParams class"},{"refs":[{"id":"ref-for-concept-url\u2465\u2464"},{"id":"ref-for-concept-url\u2465\u2465"},{"id":"ref-for-concept-url\u2465\u2466"},{"id":"ref-for-concept-url\u2465\u2467"},{"id":"ref-for-concept-url\u2465\u2468"}],"title":"6.3. URL APIs elsewhere"},{"refs":[{"id":"ref-for-concept-url\u2466\u24ea"}],"title":"Acknowledgments"}],"url":"#concept-url"}, "concept-url-blob-entry": {"dfnID":"concept-url-blob-entry","dfnText":"blob URL entry","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-blob-entry"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-blob-entry\u2460"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-blob-entry\u2461"},{"id":"ref-for-concept-url-blob-entry\u2462"}],"title":"4.7. Origin"}],"url":"#concept-url-blob-entry"}, "concept-url-equals": {"dfnID":"concept-url-equals","dfnText":"equals","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-equals"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-concept-url-equals\u2460"}],"title":"6.1. URL class"}],"url":"#concept-url-equals"}, "concept-url-fragment": {"dfnID":"concept-url-fragment","dfnText":"fragment","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-fragment"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-url-fragment\u2460"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-fragment\u2461"},{"id":"ref-for-concept-url-fragment\u2462"},{"id":"ref-for-concept-url-fragment\u2463"},{"id":"ref-for-concept-url-fragment\u2464"},{"id":"ref-for-concept-url-fragment\u2465"},{"id":"ref-for-concept-url-fragment\u2466"},{"id":"ref-for-concept-url-fragment\u2467"},{"id":"ref-for-concept-url-fragment\u2468"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-fragment\u2460\u24ea"},{"id":"ref-for-concept-url-fragment\u2460\u2460"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-fragment\u2460\u2461"},{"id":"ref-for-concept-url-fragment\u2460\u2462"},{"id":"ref-for-concept-url-fragment\u2460\u2463"},{"id":"ref-for-concept-url-fragment\u2460\u2464"},{"id":"ref-for-concept-url-fragment\u2460\u2465"}],"title":"6.1. URL class"}],"url":"#concept-url-fragment"}, "concept-url-host": {"dfnID":"concept-url-host","dfnText":"host","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-host"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-concept-url-host\u2460"},{"id":"ref-for-concept-url-host\u2461"},{"id":"ref-for-concept-url-host\u2462"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-host\u2463"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-host\u2464"},{"id":"ref-for-concept-url-host\u2465"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-host\u2466"},{"id":"ref-for-concept-url-host\u2467"},{"id":"ref-for-concept-url-host\u2468"},{"id":"ref-for-concept-url-host\u2460\u24ea"},{"id":"ref-for-concept-url-host\u2460\u2460"},{"id":"ref-for-concept-url-host\u2460\u2461"},{"id":"ref-for-concept-url-host\u2460\u2462"},{"id":"ref-for-concept-url-host\u2460\u2463"},{"id":"ref-for-concept-url-host\u2460\u2464"},{"id":"ref-for-concept-url-host\u2460\u2465"},{"id":"ref-for-concept-url-host\u2460\u2466"},{"id":"ref-for-concept-url-host\u2460\u2467"},{"id":"ref-for-concept-url-host\u2460\u2468"},{"id":"ref-for-concept-url-host\u2461\u24ea"},{"id":"ref-for-concept-url-host\u2461\u2460"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-host\u2461\u2461"},{"id":"ref-for-concept-url-host\u2461\u2462"},{"id":"ref-for-concept-url-host\u2461\u2463"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-host\u2461\u2464"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-url-host\u2461\u2465"},{"id":"ref-for-concept-url-host\u2461\u2466"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url-host\u2461\u2467"}],"title":"4.8.2. Elision"},{"refs":[{"id":"ref-for-concept-url-host\u2461\u2468"},{"id":"ref-for-concept-url-host\u2462\u24ea"},{"id":"ref-for-concept-url-host\u2462\u2460"}],"title":"4.8.3. Internationalization and special characters"},{"refs":[{"id":"ref-for-concept-url-host\u2462\u2461"},{"id":"ref-for-concept-url-host\u2462\u2462"},{"id":"ref-for-concept-url-host\u2462\u2463"},{"id":"ref-for-concept-url-host\u2462\u2464"},{"id":"ref-for-concept-url-host\u2462\u2465"}],"title":"6.1. URL class"}],"url":"#concept-url-host"}, "concept-url-origin": {"dfnID":"concept-url-origin","dfnText":"origin","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-origin"},{"id":"ref-for-concept-url-origin\u2460"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-url-origin\u2461"}],"title":"6.1. URL class"}],"url":"#concept-url-origin"}, "concept-url-parser": {"dfnID":"concept-url-parser","dfnText":"URL parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-parser"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-url-parser\u2460"},{"id":"ref-for-concept-url-parser\u2461"},{"id":"ref-for-concept-url-parser\u2462"},{"id":"ref-for-concept-url-parser\u2463"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-concept-url-parser\u2464"},{"id":"ref-for-concept-url-parser\u2465"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-parser\u2466"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-parser\u2467"},{"id":"ref-for-concept-url-parser\u2468"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-parser\u2460\u24ea"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-parser\u2460\u2460"}],"title":"6.1. URL class"}],"url":"#concept-url-parser"}, "concept-url-password": {"dfnID":"concept-url-password","dfnText":"password","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-password"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-password\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-password\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-password\u2462"},{"id":"ref-for-concept-url-password\u2463"},{"id":"ref-for-concept-url-password\u2464"},{"id":"ref-for-concept-url-password\u2465"},{"id":"ref-for-concept-url-password\u2466"},{"id":"ref-for-concept-url-password\u2467"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-password\u2468"},{"id":"ref-for-concept-url-password\u2460\u24ea"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-password\u2460\u2460"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url-password\u2460\u2461"}],"title":"6.1. URL class"}],"url":"#concept-url-password"}, "concept-url-path": {"dfnID":"concept-url-path","dfnText":"path","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-path"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-url-path\u2460"},{"id":"ref-for-concept-url-path\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-path\u2462"},{"id":"ref-for-concept-url-path\u2463"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-path\u2464"},{"id":"ref-for-concept-url-path\u2465"},{"id":"ref-for-concept-url-path\u2466"},{"id":"ref-for-concept-url-path\u2467"},{"id":"ref-for-concept-url-path\u2468"},{"id":"ref-for-concept-url-path\u2460\u24ea"},{"id":"ref-for-concept-url-path\u2460\u2460"},{"id":"ref-for-concept-url-path\u2460\u2461"},{"id":"ref-for-concept-url-path\u2460\u2462"},{"id":"ref-for-concept-url-path\u2460\u2463"},{"id":"ref-for-concept-url-path\u2460\u2464"},{"id":"ref-for-concept-url-path\u2460\u2465"},{"id":"ref-for-concept-url-path\u2460\u2466"},{"id":"ref-for-concept-url-path\u2460\u2467"},{"id":"ref-for-concept-url-path\u2460\u2468"},{"id":"ref-for-concept-url-path\u2461\u24ea"},{"id":"ref-for-concept-url-path\u2461\u2460"},{"id":"ref-for-concept-url-path\u2461\u2461"},{"id":"ref-for-concept-url-path\u2461\u2462"},{"id":"ref-for-concept-url-path\u2461\u2463"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-path\u2461\u2464"},{"id":"ref-for-concept-url-path\u2461\u2465"},{"id":"ref-for-concept-url-path\u2461\u2466"},{"id":"ref-for-concept-url-path\u2461\u2467"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-path\u2461\u2468"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url-path\u2462\u24ea"},{"id":"ref-for-concept-url-path\u2462\u2460"},{"id":"ref-for-concept-url-path\u2462\u2461"},{"id":"ref-for-concept-url-path\u2462\u2462"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-url-path\u2462\u2463"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-url-path"}, "concept-url-port": {"dfnID":"concept-url-port","dfnText":"port","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-port"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-port\u2460"},{"id":"ref-for-concept-url-port\u2461"},{"id":"ref-for-concept-url-port\u2462"},{"id":"ref-for-concept-url-port\u2463"},{"id":"ref-for-concept-url-port\u2464"},{"id":"ref-for-concept-url-port\u2465"},{"id":"ref-for-concept-url-port\u2466"},{"id":"ref-for-concept-url-port\u2467"},{"id":"ref-for-concept-url-port\u2468"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-port\u2460\u24ea"},{"id":"ref-for-concept-url-port\u2460\u2460"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-port\u2460\u2461"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-url-port\u2460\u2462"},{"id":"ref-for-concept-url-port\u2460\u2463"},{"id":"ref-for-concept-url-port\u2460\u2464"},{"id":"ref-for-concept-url-port\u2460\u2465"},{"id":"ref-for-concept-url-port\u2460\u2466"},{"id":"ref-for-concept-url-port\u2460\u2467"}],"title":"6.1. URL class"}],"url":"#concept-url-port"}, "concept-url-query": {"dfnID":"concept-url-query","dfnText":"query","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-query"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-concept-url-query\u2460"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-query\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-query\u2462"},{"id":"ref-for-concept-url-query\u2463"},{"id":"ref-for-concept-url-query\u2464"},{"id":"ref-for-concept-url-query\u2465"},{"id":"ref-for-concept-url-query\u2466"},{"id":"ref-for-concept-url-query\u2467"},{"id":"ref-for-concept-url-query\u2468"},{"id":"ref-for-concept-url-query\u2460\u24ea"},{"id":"ref-for-concept-url-query\u2460\u2460"},{"id":"ref-for-concept-url-query\u2460\u2461"},{"id":"ref-for-concept-url-query\u2460\u2462"},{"id":"ref-for-concept-url-query\u2460\u2463"},{"id":"ref-for-concept-url-query\u2460\u2464"},{"id":"ref-for-concept-url-query\u2460\u2465"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-query\u2460\u2466"},{"id":"ref-for-concept-url-query\u2460\u2467"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-query\u2460\u2468"},{"id":"ref-for-concept-url-query\u2461\u24ea"},{"id":"ref-for-concept-url-query\u2461\u2460"},{"id":"ref-for-concept-url-query\u2461\u2461"},{"id":"ref-for-concept-url-query\u2461\u2462"},{"id":"ref-for-concept-url-query\u2461\u2463"},{"id":"ref-for-concept-url-query\u2461\u2464"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-url-query\u2461\u2465"},{"id":"ref-for-concept-url-query\u2461\u2466"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-url-query"}, "concept-url-query-object": {"dfnID":"concept-url-query-object","dfnText":"query object","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-query-object"},{"id":"ref-for-concept-url-query-object\u2460"},{"id":"ref-for-concept-url-query-object\u2461"},{"id":"ref-for-concept-url-query-object\u2462"},{"id":"ref-for-concept-url-query-object\u2463"},{"id":"ref-for-concept-url-query-object\u2464"},{"id":"ref-for-concept-url-query-object\u2465"},{"id":"ref-for-concept-url-query-object\u2466"}],"title":"6.1. URL class"}],"url":"#concept-url-query-object"}, "concept-url-scheme": {"dfnID":"concept-url-scheme","dfnText":"scheme","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-scheme"},{"id":"ref-for-concept-url-scheme\u2460"},{"id":"ref-for-concept-url-scheme\u2461"},{"id":"ref-for-concept-url-scheme\u2462"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-concept-url-scheme\u2463"},{"id":"ref-for-concept-url-scheme\u2464"},{"id":"ref-for-concept-url-scheme\u2465"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-scheme\u2466"},{"id":"ref-for-concept-url-scheme\u2467"},{"id":"ref-for-concept-url-scheme\u2468"},{"id":"ref-for-concept-url-scheme\u2460\u24ea"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-scheme\u2460\u2460"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-scheme\u2460\u2461"},{"id":"ref-for-concept-url-scheme\u2460\u2462"},{"id":"ref-for-concept-url-scheme\u2460\u2463"},{"id":"ref-for-concept-url-scheme\u2460\u2464"},{"id":"ref-for-concept-url-scheme\u2460\u2465"},{"id":"ref-for-concept-url-scheme\u2460\u2466"},{"id":"ref-for-concept-url-scheme\u2460\u2467"},{"id":"ref-for-concept-url-scheme\u2460\u2468"},{"id":"ref-for-concept-url-scheme\u2461\u24ea"},{"id":"ref-for-concept-url-scheme\u2461\u2460"},{"id":"ref-for-concept-url-scheme\u2461\u2461"},{"id":"ref-for-concept-url-scheme\u2461\u2462"},{"id":"ref-for-concept-url-scheme\u2461\u2463"},{"id":"ref-for-concept-url-scheme\u2461\u2464"},{"id":"ref-for-concept-url-scheme\u2461\u2465"},{"id":"ref-for-concept-url-scheme\u2461\u2466"},{"id":"ref-for-concept-url-scheme\u2461\u2467"},{"id":"ref-for-concept-url-scheme\u2461\u2468"},{"id":"ref-for-concept-url-scheme\u2462\u24ea"},{"id":"ref-for-concept-url-scheme\u2462\u2460"},{"id":"ref-for-concept-url-scheme\u2462\u2461"},{"id":"ref-for-concept-url-scheme\u2462\u2462"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-scheme\u2462\u2463"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-scheme\u2462\u2464"},{"id":"ref-for-concept-url-scheme\u2462\u2465"},{"id":"ref-for-concept-url-scheme\u2462\u2466"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-concept-url-scheme\u2462\u2467"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url-scheme\u2462\u2468"}],"title":"6.1. URL class"}],"url":"#concept-url-scheme"}, "concept-url-serializer": {"dfnID":"concept-url-serializer","dfnText":"URL serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-serializer"},{"id":"ref-for-concept-url-serializer\u2460"},{"id":"ref-for-concept-url-serializer\u2461"},{"id":"ref-for-concept-url-serializer\u2462"},{"id":"ref-for-concept-url-serializer\u2463"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-concept-url-serializer\u2464"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-serializer\u2465"},{"id":"ref-for-concept-url-serializer\u2466"}],"title":"4.6. URL equivalence"},{"refs":[{"id":"ref-for-concept-url-serializer\u2467"}],"title":"4.8. URL rendering"},{"refs":[{"id":"ref-for-concept-url-serializer\u2468"},{"id":"ref-for-concept-url-serializer\u2460\u24ea"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-url-serializer\u2460\u2460"}],"title":"6.3. URL APIs elsewhere"}],"url":"#concept-url-serializer"}, "concept-url-url": {"dfnID":"concept-url-url","dfnText":"URL","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-url"},{"id":"ref-for-concept-url-url\u2460"},{"id":"ref-for-concept-url-url\u2461"},{"id":"ref-for-concept-url-url\u2462"},{"id":"ref-for-concept-url-url\u2463"},{"id":"ref-for-concept-url-url\u2464"},{"id":"ref-for-concept-url-url\u2465"},{"id":"ref-for-concept-url-url\u2466"},{"id":"ref-for-concept-url-url\u2467"},{"id":"ref-for-concept-url-url\u2468"},{"id":"ref-for-concept-url-url\u2460\u24ea"},{"id":"ref-for-concept-url-url\u2460\u2460"},{"id":"ref-for-concept-url-url\u2460\u2461"},{"id":"ref-for-concept-url-url\u2460\u2462"},{"id":"ref-for-concept-url-url\u2460\u2463"},{"id":"ref-for-concept-url-url\u2460\u2464"},{"id":"ref-for-concept-url-url\u2460\u2465"},{"id":"ref-for-concept-url-url\u2460\u2466"},{"id":"ref-for-concept-url-url\u2460\u2467"},{"id":"ref-for-concept-url-url\u2460\u2468"},{"id":"ref-for-concept-url-url\u2461\u24ea"},{"id":"ref-for-concept-url-url\u2461\u2460"},{"id":"ref-for-concept-url-url\u2461\u2461"},{"id":"ref-for-concept-url-url\u2461\u2462"},{"id":"ref-for-concept-url-url\u2461\u2463"},{"id":"ref-for-concept-url-url\u2461\u2464"},{"id":"ref-for-concept-url-url\u2461\u2465"},{"id":"ref-for-concept-url-url\u2461\u2466"},{"id":"ref-for-concept-url-url\u2461\u2467"},{"id":"ref-for-concept-url-url\u2461\u2468"},{"id":"ref-for-concept-url-url\u2462\u24ea"},{"id":"ref-for-concept-url-url\u2462\u2460"},{"id":"ref-for-concept-url-url\u2462\u2461"},{"id":"ref-for-concept-url-url\u2462\u2462"},{"id":"ref-for-concept-url-url\u2462\u2463"},{"id":"ref-for-concept-url-url\u2462\u2464"},{"id":"ref-for-concept-url-url\u2462\u2465"},{"id":"ref-for-concept-url-url\u2462\u2466"},{"id":"ref-for-concept-url-url\u2462\u2467"},{"id":"ref-for-concept-url-url\u2462\u2468"},{"id":"ref-for-concept-url-url\u2463\u24ea"},{"id":"ref-for-concept-url-url\u2463\u2460"},{"id":"ref-for-concept-url-url\u2463\u2461"},{"id":"ref-for-concept-url-url\u2463\u2462"},{"id":"ref-for-concept-url-url\u2463\u2463"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-url-url\u2463\u2464"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-url-url"}, "concept-url-username": {"dfnID":"concept-url-username","dfnText":"username","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-url-username"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-concept-url-username\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-concept-url-username\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-concept-url-username\u2462"},{"id":"ref-for-concept-url-username\u2463"},{"id":"ref-for-concept-url-username\u2464"},{"id":"ref-for-concept-url-username\u2465"},{"id":"ref-for-concept-url-username\u2466"},{"id":"ref-for-concept-url-username\u2467"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-concept-url-username\u2468"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-concept-url-username\u2460\u24ea"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-concept-url-username\u2460\u2460"}],"title":"6.1. URL class"}],"url":"#concept-url-username"}, "concept-urlencoded": {"dfnID":"concept-urlencoded","dfnText":"application/x-www-form-urlencoded","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlencoded"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlencoded"}, "concept-urlencoded-parser": {"dfnID":"concept-urlencoded-parser","dfnText":"application/x-www-form-urlencoded parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlencoded-parser"}],"title":"5.3. Hooks"}],"url":"#concept-urlencoded-parser"}, "concept-urlencoded-serializer": {"dfnID":"concept-urlencoded-serializer","dfnText":"application/x-www-form-urlencoded serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlencoded-serializer"},{"id":"ref-for-concept-urlencoded-serializer\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlencoded-serializer"}, "concept-urlencoded-string-parser": {"dfnID":"concept-urlencoded-string-parser","dfnText":"application/x-www-form-urlencoded string parser","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlencoded-string-parser"},{"id":"ref-for-concept-urlencoded-string-parser\u2460"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-urlencoded-string-parser\u2461"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlencoded-string-parser"}, "concept-urlsearchparams-list": {"dfnID":"concept-urlsearchparams-list","dfnText":"list","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlsearchparams-list"},{"id":"ref-for-concept-urlsearchparams-list\u2460"},{"id":"ref-for-concept-urlsearchparams-list\u2461"},{"id":"ref-for-concept-urlsearchparams-list\u2462"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-urlsearchparams-list\u2463"},{"id":"ref-for-concept-urlsearchparams-list\u2464"},{"id":"ref-for-concept-urlsearchparams-list\u2465"},{"id":"ref-for-concept-urlsearchparams-list\u2466"},{"id":"ref-for-concept-urlsearchparams-list\u2467"},{"id":"ref-for-concept-urlsearchparams-list\u2468"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u24ea"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2460"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2461"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2462"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2463"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2464"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2465"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2466"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2467"},{"id":"ref-for-concept-urlsearchparams-list\u2460\u2468"},{"id":"ref-for-concept-urlsearchparams-list\u2461\u24ea"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlsearchparams-list"}, "concept-urlsearchparams-update": {"dfnID":"concept-urlsearchparams-update","dfnText":"update","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlsearchparams-update"},{"id":"ref-for-concept-urlsearchparams-update\u2460"},{"id":"ref-for-concept-urlsearchparams-update\u2461"},{"id":"ref-for-concept-urlsearchparams-update\u2462"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlsearchparams-update"}, "concept-urlsearchparams-url-object": {"dfnID":"concept-urlsearchparams-url-object","dfnText":"URL object","external":false,"refSections":[{"refs":[{"id":"ref-for-concept-urlsearchparams-url-object"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-concept-urlsearchparams-url-object\u2460"},{"id":"ref-for-concept-urlsearchparams-url-object\u2461"},{"id":"ref-for-concept-urlsearchparams-url-object\u2462"},{"id":"ref-for-concept-urlsearchparams-url-object\u2463"}],"title":"6.2. URLSearchParams class"}],"url":"#concept-urlsearchparams-url-object"}, "d17867da": {"dfnID":"d17867da","dfnText":"32-bit unsigned integer","external":true,"refSections":[{"refs":[{"id":"ref-for-32-bit-unsigned-integer"}],"title":"3.1. Host representation"}],"url":"https://infra.spec.whatwg.org/#32-bit-unsigned-integer"}, "d8b963e8": {"dfnID":"d8b963e8","dfnText":"isomorphic decode","external":true,"refSections":[{"refs":[{"id":"ref-for-isomorphic-decode"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#isomorphic-decode"}, "dae0bfde": {"dfnID":"dae0bfde","dfnText":"serialization of an origin","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-serialisation-of-an-origin"}],"title":"6.1. URL class"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin"}, "daecad44": {"dfnID":"daecad44","dfnText":"EventSource","external":true,"refSections":[{"refs":[{"id":"ref-for-eventsource"}],"title":"6.3. URL APIs elsewhere"}],"url":"https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource"}, "ddc587b1": {"dfnID":"ddc587b1","dfnText":"ASCII code point","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-code-point"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#ascii-code-point"}, "default-port": {"dfnID":"default-port","dfnText":"default port","external":false,"refSections":[{"refs":[{"id":"ref-for-default-port"},{"id":"ref-for-default-port\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-default-port\u2461"},{"id":"ref-for-default-port\u2462"}],"title":"4.4. URL parsing"}],"url":"#default-port"}, "dom-url-canparse": {"dfnID":"dom-url-canparse","dfnText":"canParse(url, base)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-canparse"}],"title":"6.1. URL class"}],"url":"#dom-url-canparse"}, "dom-url-canparse-url-base-base": {"dfnID":"dom-url-canparse-url-base-base","dfnText":"base","external":false,"refSections":[],"url":"#dom-url-canparse-url-base-base"}, "dom-url-canparse-url-base-url": {"dfnID":"dom-url-canparse-url-base-url","dfnText":"url","external":false,"refSections":[],"url":"#dom-url-canparse-url-base-url"}, "dom-url-hash": {"dfnID":"dom-url-hash","dfnText":"hash","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-hash"},{"id":"ref-for-dom-url-hash\u2460"},{"id":"ref-for-dom-url-hash\u2461"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-dom-url-hash\u2462"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-url-hash"}, "dom-url-host": {"dfnID":"dom-url-host","dfnText":"host","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-host"},{"id":"ref-for-dom-url-host\u2460"},{"id":"ref-for-dom-url-host\u2461"}],"title":"6.1. URL class"}],"url":"#dom-url-host"}, "dom-url-hostname": {"dfnID":"dom-url-hostname","dfnText":"hostname","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-hostname"},{"id":"ref-for-dom-url-hostname\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-hostname"}, "dom-url-href": {"dfnID":"dom-url-href","dfnText":"href","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-href"},{"id":"ref-for-dom-url-href\u2460"},{"id":"ref-for-dom-url-href\u2461"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-dom-url-href\u2462"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-url-href"}, "dom-url-origin": {"dfnID":"dom-url-origin","dfnText":"origin","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-origin"}],"title":"6.1. URL class"}],"url":"#dom-url-origin"}, "dom-url-parse": {"dfnID":"dom-url-parse","dfnText":"parse(url, base)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-parse"}],"title":"6.1. URL class"}],"url":"#dom-url-parse"}, "dom-url-parse-url-base-base": {"dfnID":"dom-url-parse-url-base-base","dfnText":"base","external":false,"refSections":[],"url":"#dom-url-parse-url-base-base"}, "dom-url-parse-url-base-url": {"dfnID":"dom-url-parse-url-base-url","dfnText":"url","external":false,"refSections":[],"url":"#dom-url-parse-url-base-url"}, "dom-url-password": {"dfnID":"dom-url-password","dfnText":"password","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-password"},{"id":"ref-for-dom-url-password\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-password"}, "dom-url-pathname": {"dfnID":"dom-url-pathname","dfnText":"pathname","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-pathname"},{"id":"ref-for-dom-url-pathname\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-pathname"}, "dom-url-port": {"dfnID":"dom-url-port","dfnText":"port","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-port"},{"id":"ref-for-dom-url-port\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-port"}, "dom-url-protocol": {"dfnID":"dom-url-protocol","dfnText":"protocol","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-protocol"},{"id":"ref-for-dom-url-protocol\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-protocol"}, "dom-url-search": {"dfnID":"dom-url-search","dfnText":"search","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-search"},{"id":"ref-for-dom-url-search\u2460"},{"id":"ref-for-dom-url-search\u2461"},{"id":"ref-for-dom-url-search\u2462"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-dom-url-search\u2463"},{"id":"ref-for-dom-url-search\u2464"},{"id":"ref-for-dom-url-search\u2465"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-url-search"}, "dom-url-searchparams": {"dfnID":"dom-url-searchparams","dfnText":"searchParams","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-searchparams"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-dom-url-searchparams\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-url-searchparams"}, "dom-url-tojson": {"dfnID":"dom-url-tojson","dfnText":"toJSON()","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-tojson"}],"title":"6.1. URL class"}],"url":"#dom-url-tojson"}, "dom-url-url": {"dfnID":"dom-url-url","dfnText":"new URL(url, base)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-url"}],"title":"6.1. URL class"}],"url":"#dom-url-url"}, "dom-url-url-url-base-base": {"dfnID":"dom-url-url-url-base-base","dfnText":"base","external":false,"refSections":[],"url":"#dom-url-url-url-base-base"}, "dom-url-url-url-base-url": {"dfnID":"dom-url-url-url-base-url","dfnText":"url","external":false,"refSections":[],"url":"#dom-url-url-url-base-url"}, "dom-url-username": {"dfnID":"dom-url-username","dfnText":"username","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-url-username"},{"id":"ref-for-dom-url-username\u2460"}],"title":"6.1. URL class"}],"url":"#dom-url-username"}, "dom-urlsearchparams-append": {"dfnID":"dom-urlsearchparams-append","dfnText":"append(name, value)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-append"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-append"}, "dom-urlsearchparams-append-name-value-name": {"dfnID":"dom-urlsearchparams-append-name-value-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-append-name-value-name"}, "dom-urlsearchparams-append-name-value-value": {"dfnID":"dom-urlsearchparams-append-name-value-value","dfnText":"value","external":false,"refSections":[],"url":"#dom-urlsearchparams-append-name-value-value"}, "dom-urlsearchparams-delete": {"dfnID":"dom-urlsearchparams-delete","dfnText":"delete(name, value)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-delete"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-delete"}, "dom-urlsearchparams-delete-name-value-name": {"dfnID":"dom-urlsearchparams-delete-name-value-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-delete-name-value-name"}, "dom-urlsearchparams-delete-name-value-value": {"dfnID":"dom-urlsearchparams-delete-name-value-value","dfnText":"value","external":false,"refSections":[],"url":"#dom-urlsearchparams-delete-name-value-value"}, "dom-urlsearchparams-get": {"dfnID":"dom-urlsearchparams-get","dfnText":"get(name)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-get"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-get"}, "dom-urlsearchparams-get-name-name": {"dfnID":"dom-urlsearchparams-get-name-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-get-name-name"}, "dom-urlsearchparams-getall": {"dfnID":"dom-urlsearchparams-getall","dfnText":"getAll(name)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-getall"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-getall"}, "dom-urlsearchparams-getall-name-name": {"dfnID":"dom-urlsearchparams-getall-name-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-getall-name-name"}, "dom-urlsearchparams-has": {"dfnID":"dom-urlsearchparams-has","dfnText":"has(name, value)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-has"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-has"}, "dom-urlsearchparams-has-name-value-name": {"dfnID":"dom-urlsearchparams-has-name-value-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-has-name-value-name"}, "dom-urlsearchparams-has-name-value-value": {"dfnID":"dom-urlsearchparams-has-name-value-value","dfnText":"value","external":false,"refSections":[],"url":"#dom-urlsearchparams-has-name-value-value"}, "dom-urlsearchparams-set": {"dfnID":"dom-urlsearchparams-set","dfnText":"set(name, value)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-set"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-set"}, "dom-urlsearchparams-set-name-value-name": {"dfnID":"dom-urlsearchparams-set-name-value-name","dfnText":"name","external":false,"refSections":[],"url":"#dom-urlsearchparams-set-name-value-name"}, "dom-urlsearchparams-set-name-value-value": {"dfnID":"dom-urlsearchparams-set-name-value-value","dfnText":"value","external":false,"refSections":[],"url":"#dom-urlsearchparams-set-name-value-value"}, "dom-urlsearchparams-size": {"dfnID":"dom-urlsearchparams-size","dfnText":"size","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-size"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-size"}, "dom-urlsearchparams-sort": {"dfnID":"dom-urlsearchparams-sort","dfnText":"sort()","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-sort"},{"id":"ref-for-dom-urlsearchparams-sort\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-sort"}, "dom-urlsearchparams-urlsearchparams": {"dfnID":"dom-urlsearchparams-urlsearchparams","dfnText":"new URLSearchParams(init)","external":false,"refSections":[{"refs":[{"id":"ref-for-dom-urlsearchparams-urlsearchparams"}],"title":"6.2. URLSearchParams class"}],"url":"#dom-urlsearchparams-urlsearchparams"}, "dom-urlsearchparams-urlsearchparams-init-init": {"dfnID":"dom-urlsearchparams-urlsearchparams-init-init","dfnText":"init","external":false,"refSections":[],"url":"#dom-urlsearchparams-urlsearchparams-init-init"}, "domain-invalid-code-point": {"dfnID":"domain-invalid-code-point","dfnText":"domain-invalid-code-point","external":false,"refSections":[{"refs":[{"id":"ref-for-domain-invalid-code-point"}],"title":"3.5. Host parsing"}],"url":"#domain-invalid-code-point"}, "domain-label": {"dfnID":"domain-label","dfnText":"domain labels","external":false,"refSections":[{"refs":[{"id":"ref-for-domain-label"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-domain-label\u2460"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-domain-label\u2461"}],"title":"4.8.2. Elision"}],"url":"#domain-label"}, "domain-to-unicode": {"dfnID":"domain-to-unicode","dfnText":"domain-to-Unicode","external":false,"refSections":[{"refs":[{"id":"ref-for-domain-to-unicode"}],"title":"3.3. IDNA"}],"url":"#domain-to-unicode"}, "double-dot-path-segment": {"dfnID":"double-dot-path-segment","dfnText":"double-dot URL path segment","external":false,"refSections":[{"refs":[{"id":"ref-for-double-dot-path-segment"},{"id":"ref-for-double-dot-path-segment\u2460"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-double-dot-path-segment\u2461"}],"title":"4.4. URL parsing"}],"url":"#double-dot-path-segment"}, "e5fc5b88": {"dfnID":"e5fc5b88","dfnText":"strictly split","external":true,"refSections":[{"refs":[{"id":"ref-for-strictly-split"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-strictly-split\u2460"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-strictly-split\u2461"},{"id":"ref-for-strictly-split\u2462"}],"title":"3.5. Host parsing"}],"url":"https://infra.spec.whatwg.org/#strictly-split"}, "e97a9688": {"dfnID":"e97a9688","dfnText":"unsigned long","external":true,"refSections":[{"refs":[{"id":"ref-for-idl-unsigned-long"}],"title":"6.2. URLSearchParams class"}],"url":"https://webidl.spec.whatwg.org/#idl-unsigned-long"}, "ecf251b4": {"dfnID":"ecf251b4","dfnText":"scalar value","external":true,"refSections":[{"refs":[{"id":"ref-for-scalar-value"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#scalar-value"}, "ef301390": {"dfnID":"ef301390","dfnText":"blob URL entry","external":true,"refSections":[{"refs":[{"id":"ref-for-blob-url-entry"}],"title":"4.1. URL representation"}],"url":"https://w3c.github.io/FileAPI/#blob-url-entry"}, "empty-host": {"dfnID":"empty-host","dfnText":"empty host","external":false,"refSections":[{"refs":[{"id":"ref-for-empty-host"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-empty-host\u2460"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-empty-host\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-empty-host\u2462"},{"id":"ref-for-empty-host\u2463"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-empty-host\u2464"}],"title":"4.4. URL parsing"}],"url":"#empty-host"}, "ends-in-a-number-checker": {"dfnID":"ends-in-a-number-checker","dfnText":"ends in a number checker","external":false,"refSections":[{"refs":[{"id":"ref-for-ends-in-a-number-checker"}],"title":"3.5. Host parsing"}],"url":"#ends-in-a-number-checker"}, "eof-code-point": {"dfnID":"eof-code-point","dfnText":"EOF code point","external":false,"refSections":[{"refs":[{"id":"ref-for-eof-code-point"},{"id":"ref-for-eof-code-point\u2460"},{"id":"ref-for-eof-code-point\u2461"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-eof-code-point\u2462"},{"id":"ref-for-eof-code-point\u2463"},{"id":"ref-for-eof-code-point\u2464"},{"id":"ref-for-eof-code-point\u2465"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-eof-code-point\u2466"},{"id":"ref-for-eof-code-point\u2467"},{"id":"ref-for-eof-code-point\u2468"},{"id":"ref-for-eof-code-point\u2460\u24ea"},{"id":"ref-for-eof-code-point\u2460\u2460"},{"id":"ref-for-eof-code-point\u2460\u2461"},{"id":"ref-for-eof-code-point\u2460\u2462"},{"id":"ref-for-eof-code-point\u2460\u2463"},{"id":"ref-for-eof-code-point\u2460\u2464"},{"id":"ref-for-eof-code-point\u2460\u2465"},{"id":"ref-for-eof-code-point\u2460\u2466"},{"id":"ref-for-eof-code-point\u2460\u2467"},{"id":"ref-for-eof-code-point\u2460\u2468"},{"id":"ref-for-eof-code-point\u2461\u24ea"}],"title":"4.4. URL parsing"}],"url":"#eof-code-point"}, "f18e8ea1": {"dfnID":"f18e8ea1","dfnText":"128-bit unsigned integer","external":true,"refSections":[{"refs":[{"id":"ref-for-128-bit-unsigned-integer"}],"title":"3.1. Host representation"}],"url":"https://infra.spec.whatwg.org/#128-bit-unsigned-integer"}, "f256859a": {"dfnID":"f256859a","dfnText":"UTF-8 decode without BOM or fail","external":true,"refSections":[{"refs":[{"id":"ref-for-utf-8-decode-without-bom-or-fail"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-utf-8-decode-without-bom-or-fail\u2460"}],"title":"3.5. Host parsing"}],"url":"https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail"}, "f43d6978": {"dfnID":"f43d6978","dfnText":"ASCII alphanumeric","external":true,"refSections":[{"refs":[{"id":"ref-for-ascii-alphanumeric"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-ascii-alphanumeric\u2460"},{"id":"ref-for-ascii-alphanumeric\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-ascii-alphanumeric\u2462"}],"title":"4.4. URL parsing"}],"url":"https://infra.spec.whatwg.org/#ascii-alphanumeric"}, "f5354b9d": {"dfnID":"f5354b9d","dfnText":"byte","external":true,"refSections":[{"refs":[{"id":"ref-for-byte"}],"title":"1.3. Percent-encoded bytes"}],"url":"https://infra.spec.whatwg.org/#byte"}, "f937b7b6": {"dfnID":"f937b7b6","dfnText":"continue","external":true,"refSections":[{"refs":[{"id":"ref-for-iteration-continue"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-iteration-continue\u2460"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-iteration-continue\u2461"},{"id":"ref-for-iteration-continue\u2462"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-iteration-continue\u2463"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-iteration-continue\u2464"}],"title":"5.1. application/x-www-form-urlencoded parsing"}],"url":"https://infra.spec.whatwg.org/#iteration-continue"}, "fb8f82b0": {"dfnID":"fb8f82b0","dfnText":"indices","external":true,"refSections":[{"refs":[{"id":"ref-for-list-get-the-indices"},{"id":"ref-for-list-get-the-indices\u2460"}],"title":"3.6. Host serializing"}],"url":"https://infra.spec.whatwg.org/#list-get-the-indices"}, "feac4ab3": {"dfnID":"feac4ab3","dfnText":"same site","external":true,"refSections":[{"refs":[{"id":"ref-for-same-site"}],"title":"3.2. Host miscellaneous"}],"url":"https://html.spec.whatwg.org/multipage/browsers.html#same-site"}, "file-host-state": {"dfnID":"file-host-state","dfnText":"file host state","external":false,"refSections":[{"refs":[{"id":"ref-for-file-host-state"},{"id":"ref-for-file-host-state\u2460"}],"title":"4.4. URL parsing"}],"url":"#file-host-state"}, "file-invalid-windows-drive-letter": {"dfnID":"file-invalid-windows-drive-letter","dfnText":"file-invalid-Windows-drive-letter","external":false,"refSections":[{"refs":[{"id":"ref-for-file-invalid-windows-drive-letter"}],"title":"4.4. URL parsing"}],"url":"#file-invalid-windows-drive-letter"}, "file-invalid-windows-drive-letter-host": {"dfnID":"file-invalid-windows-drive-letter-host","dfnText":"file-invalid-Windows-drive-letter-host","external":false,"refSections":[{"refs":[{"id":"ref-for-file-invalid-windows-drive-letter-host"}],"title":"4.4. URL parsing"}],"url":"#file-invalid-windows-drive-letter-host"}, "file-slash-state": {"dfnID":"file-slash-state","dfnText":"file slash state","external":false,"refSections":[{"refs":[{"id":"ref-for-file-slash-state"}],"title":"4.4. URL parsing"}],"url":"#file-slash-state"}, "file-state": {"dfnID":"file-state","dfnText":"file state","external":false,"refSections":[{"refs":[{"id":"ref-for-file-state"},{"id":"ref-for-file-state\u2460"}],"title":"4.4. URL parsing"}],"url":"#file-state"}, "find-the-ipv6-address-compressed-piece-index": {"dfnID":"find-the-ipv6-address-compressed-piece-index","dfnText":"find the IPv6 address compressed piece index","external":false,"refSections":[{"refs":[{"id":"ref-for-find-the-ipv6-address-compressed-piece-index"}],"title":"3.6. Host serializing"}],"url":"#find-the-ipv6-address-compressed-piece-index"}, "forbidden-domain-code-point": {"dfnID":"forbidden-domain-code-point","dfnText":"forbidden domain code point","external":false,"refSections":[{"refs":[{"id":"ref-for-forbidden-domain-code-point"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-forbidden-domain-code-point\u2460"}],"title":"3.5. Host parsing"}],"url":"#forbidden-domain-code-point"}, "forbidden-host-code-point": {"dfnID":"forbidden-host-code-point","dfnText":"forbidden host code point","external":false,"refSections":[{"refs":[{"id":"ref-for-forbidden-host-code-point"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-forbidden-host-code-point\u2460"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-forbidden-host-code-point\u2461"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-forbidden-host-code-point\u2462"}],"title":"3.5. Host parsing"}],"url":"#forbidden-host-code-point"}, "fragment-percent-encode-set": {"dfnID":"fragment-percent-encode-set","dfnText":"fragment percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-fragment-percent-encode-set"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-fragment-percent-encode-set\u2460"}],"title":"4.4. URL parsing"}],"url":"#fragment-percent-encode-set"}, "fragment-state": {"dfnID":"fragment-state","dfnText":"fragment state","external":false,"refSections":[{"refs":[{"id":"ref-for-fragment-state"},{"id":"ref-for-fragment-state\u2460"},{"id":"ref-for-fragment-state\u2461"},{"id":"ref-for-fragment-state\u2462"},{"id":"ref-for-fragment-state\u2463"},{"id":"ref-for-fragment-state\u2464"},{"id":"ref-for-fragment-state\u2465"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-fragment-state\u2466"}],"title":"6.1. URL class"}],"url":"#fragment-state"}, "host-invalid-code-point": {"dfnID":"host-invalid-code-point","dfnText":"host-invalid-code-point","external":false,"refSections":[{"refs":[{"id":"ref-for-host-invalid-code-point"}],"title":"3.5. Host parsing"}],"url":"#host-invalid-code-point"}, "host-missing": {"dfnID":"host-missing","dfnText":"host-missing","external":false,"refSections":[{"refs":[{"id":"ref-for-host-missing"},{"id":"ref-for-host-missing\u2460"},{"id":"ref-for-host-missing\u2461"}],"title":"4.4. URL parsing"}],"url":"#host-missing"}, "host-public-suffix": {"dfnID":"host-public-suffix","dfnText":"public suffix","external":false,"refSections":[{"refs":[{"id":"ref-for-host-public-suffix"},{"id":"ref-for-host-public-suffix\u2460"},{"id":"ref-for-host-public-suffix\u2461"},{"id":"ref-for-host-public-suffix\u2462"}],"title":"3.2. Host miscellaneous"}],"url":"#host-public-suffix"}, "host-registrable-domain": {"dfnID":"host-registrable-domain","dfnText":"registrable domain","external":false,"refSections":[{"refs":[{"id":"ref-for-host-registrable-domain"}],"title":"3.2. Host miscellaneous"},{"refs":[{"id":"ref-for-host-registrable-domain\u2460"}],"title":"4.8.1. Simplify non-human-readable or irrelevant components"},{"refs":[{"id":"ref-for-host-registrable-domain\u2461"}],"title":"4.8.2. Elision"}],"url":"#host-registrable-domain"}, "host-state": {"dfnID":"host-state","dfnText":"host state","external":false,"refSections":[{"refs":[{"id":"ref-for-host-state"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-host-state\u2460"}],"title":"6.1. URL class"}],"url":"#host-state"}, "hostname-state": {"dfnID":"hostname-state","dfnText":"hostname state","external":false,"refSections":[{"refs":[{"id":"ref-for-hostname-state"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-hostname-state\u2460"}],"title":"6.1. URL class"}],"url":"#hostname-state"}, "include-credentials": {"dfnID":"include-credentials","dfnText":"includes credentials","external":false,"refSections":[{"refs":[{"id":"ref-for-include-credentials"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-include-credentials\u2460"},{"id":"ref-for-include-credentials\u2461"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-include-credentials\u2462"}],"title":"4.5. URL serializing"}],"url":"#include-credentials"}, "invalid-credentials": {"dfnID":"invalid-credentials","dfnText":"invalid-credentials","external":false,"refSections":[{"refs":[{"id":"ref-for-invalid-credentials"}],"title":"4.4. URL parsing"}],"url":"#invalid-credentials"}, "invalid-reverse-solidus": {"dfnID":"invalid-reverse-solidus","dfnText":"invalid-reverse-solidus","external":false,"refSections":[{"refs":[{"id":"ref-for-invalid-reverse-solidus"},{"id":"ref-for-invalid-reverse-solidus\u2460"},{"id":"ref-for-invalid-reverse-solidus\u2461"},{"id":"ref-for-invalid-reverse-solidus\u2462"},{"id":"ref-for-invalid-reverse-solidus\u2463"},{"id":"ref-for-invalid-reverse-solidus\u2464"}],"title":"4.4. URL parsing"}],"url":"#invalid-reverse-solidus"}, "invalid-url-unit": {"dfnID":"invalid-url-unit","dfnText":"invalid-URL-unit","external":false,"refSections":[{"refs":[{"id":"ref-for-invalid-url-unit"},{"id":"ref-for-invalid-url-unit\u2460"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-invalid-url-unit\u2461"},{"id":"ref-for-invalid-url-unit\u2462"},{"id":"ref-for-invalid-url-unit\u2463"},{"id":"ref-for-invalid-url-unit\u2464"},{"id":"ref-for-invalid-url-unit\u2465"},{"id":"ref-for-invalid-url-unit\u2466"},{"id":"ref-for-invalid-url-unit\u2467"},{"id":"ref-for-invalid-url-unit\u2468"},{"id":"ref-for-invalid-url-unit\u2460\u24ea"},{"id":"ref-for-invalid-url-unit\u2460\u2460"}],"title":"4.4. URL parsing"}],"url":"#invalid-url-unit"}, "ip-address": {"dfnID":"ip-address","dfnText":"IP address","external":false,"refSections":[{"refs":[{"id":"ref-for-ip-address"}],"title":"3.1. Host representation"}],"url":"#ip-address"}, "ipv4-empty-part": {"dfnID":"ipv4-empty-part","dfnText":"IPv4-empty-part","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-empty-part"}],"title":"3.5. Host parsing"}],"url":"#ipv4-empty-part"}, "ipv4-in-ipv6-invalid-code-point": {"dfnID":"ipv4-in-ipv6-invalid-code-point","dfnText":"IPv4-in-IPv6-invalid-code-point","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-in-ipv6-invalid-code-point"},{"id":"ref-for-ipv4-in-ipv6-invalid-code-point\u2460"},{"id":"ref-for-ipv4-in-ipv6-invalid-code-point\u2461"},{"id":"ref-for-ipv4-in-ipv6-invalid-code-point\u2462"}],"title":"3.5. Host parsing"}],"url":"#ipv4-in-ipv6-invalid-code-point"}, "ipv4-in-ipv6-out-of-range-part": {"dfnID":"ipv4-in-ipv6-out-of-range-part","dfnText":"IPv4-in-IPv6-out-of-range-part","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-in-ipv6-out-of-range-part"}],"title":"3.5. Host parsing"}],"url":"#ipv4-in-ipv6-out-of-range-part"}, "ipv4-in-ipv6-too-few-parts": {"dfnID":"ipv4-in-ipv6-too-few-parts","dfnText":"IPv4-in-IPv6-too-few-parts","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-in-ipv6-too-few-parts"}],"title":"3.5. Host parsing"}],"url":"#ipv4-in-ipv6-too-few-parts"}, "ipv4-in-ipv6-too-many-pieces": {"dfnID":"ipv4-in-ipv6-too-many-pieces","dfnText":"IPv4-in-IPv6-too-many-pieces","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-in-ipv6-too-many-pieces"}],"title":"3.5. Host parsing"}],"url":"#ipv4-in-ipv6-too-many-pieces"}, "ipv4-non-decimal-part": {"dfnID":"ipv4-non-decimal-part","dfnText":"IPv4-non-decimal-part","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-non-decimal-part"}],"title":"3.5. Host parsing"}],"url":"#ipv4-non-decimal-part"}, "ipv4-non-numeric-part": {"dfnID":"ipv4-non-numeric-part","dfnText":"IPv4-non-numeric-part","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-non-numeric-part"}],"title":"3.5. Host parsing"}],"url":"#ipv4-non-numeric-part"}, "ipv4-number-parser": {"dfnID":"ipv4-number-parser","dfnText":"IPv4 number parser","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-number-parser"},{"id":"ref-for-ipv4-number-parser\u2460"}],"title":"3.5. Host parsing"}],"url":"#ipv4-number-parser"}, "ipv4-out-of-range-part": {"dfnID":"ipv4-out-of-range-part","dfnText":"IPv4-out-of-range-part","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-out-of-range-part"}],"title":"3.5. Host parsing"}],"url":"#ipv4-out-of-range-part"}, "ipv4-too-many-parts": {"dfnID":"ipv4-too-many-parts","dfnText":"IPv4-too-many-parts","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv4-too-many-parts"}],"title":"3.5. Host parsing"}],"url":"#ipv4-too-many-parts"}, "ipv6-invalid-code-point": {"dfnID":"ipv6-invalid-code-point","dfnText":"IPv6-invalid-code-point","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-invalid-code-point"},{"id":"ref-for-ipv6-invalid-code-point\u2460"}],"title":"3.5. Host parsing"}],"url":"#ipv6-invalid-code-point"}, "ipv6-invalid-compression": {"dfnID":"ipv6-invalid-compression","dfnText":"IPv6-invalid-compression","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-invalid-compression"}],"title":"3.5. Host parsing"}],"url":"#ipv6-invalid-compression"}, "ipv6-multiple-compression": {"dfnID":"ipv6-multiple-compression","dfnText":"IPv6-multiple-compression","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-multiple-compression"}],"title":"3.5. Host parsing"}],"url":"#ipv6-multiple-compression"}, "ipv6-too-few-pieces": {"dfnID":"ipv6-too-few-pieces","dfnText":"IPv6-too-few-pieces","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-too-few-pieces"}],"title":"3.5. Host parsing"}],"url":"#ipv6-too-few-pieces"}, "ipv6-too-many-pieces": {"dfnID":"ipv6-too-many-pieces","dfnText":"IPv6-too-many-pieces","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-too-many-pieces"}],"title":"3.5. Host parsing"}],"url":"#ipv6-too-many-pieces"}, "ipv6-unclosed": {"dfnID":"ipv6-unclosed","dfnText":"IPv6-unclosed","external":false,"refSections":[{"refs":[{"id":"ref-for-ipv6-unclosed"}],"title":"3.5. Host parsing"}],"url":"#ipv6-unclosed"}, "is-not-special": {"dfnID":"is-not-special","dfnText":"is not special","external":false,"refSections":[{"refs":[{"id":"ref-for-is-not-special"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-is-not-special\u2460"},{"id":"ref-for-is-not-special\u2461"},{"id":"ref-for-is-not-special\u2462"},{"id":"ref-for-is-not-special\u2463"}],"title":"4.4. URL parsing"}],"url":"#is-not-special"}, "is-special": {"dfnID":"is-special","dfnText":"is special","external":false,"refSections":[{"refs":[{"id":"ref-for-is-special"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-is-special\u2460"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-is-special\u2461"},{"id":"ref-for-is-special\u2462"},{"id":"ref-for-is-special\u2463"},{"id":"ref-for-is-special\u2464"},{"id":"ref-for-is-special\u2465"},{"id":"ref-for-is-special\u2466"},{"id":"ref-for-is-special\u2467"},{"id":"ref-for-is-special\u2468"},{"id":"ref-for-is-special\u2460\u24ea"},{"id":"ref-for-is-special\u2460\u2460"},{"id":"ref-for-is-special\u2460\u2461"},{"id":"ref-for-is-special\u2460\u2462"},{"id":"ref-for-is-special\u2460\u2463"},{"id":"ref-for-is-special\u2460\u2464"},{"id":"ref-for-is-special\u2460\u2465"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-is-special\u2460\u2466"}],"title":"6.2. URLSearchParams class"}],"url":"#is-special"}, "missing-scheme-non-relative-url": {"dfnID":"missing-scheme-non-relative-url","dfnText":"missing-scheme-non-relative-URL","external":false,"refSections":[{"refs":[{"id":"ref-for-missing-scheme-non-relative-url"}],"title":"4.4. URL parsing"}],"url":"#missing-scheme-non-relative-url"}, "no-scheme-state": {"dfnID":"no-scheme-state","dfnText":"no scheme state","external":false,"refSections":[{"refs":[{"id":"ref-for-no-scheme-state"},{"id":"ref-for-no-scheme-state\u2460"}],"title":"4.4. URL parsing"}],"url":"#no-scheme-state"}, "normalized-windows-drive-letter": {"dfnID":"normalized-windows-drive-letter","dfnText":"normalized Windows drive letter","external":false,"refSections":[{"refs":[{"id":"ref-for-normalized-windows-drive-letter"},{"id":"ref-for-normalized-windows-drive-letter\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-normalized-windows-drive-letter\u2461"}],"title":"4.4. URL parsing"}],"url":"#normalized-windows-drive-letter"}, "opaque-host": {"dfnID":"opaque-host","dfnText":"opaque host","external":false,"refSections":[{"refs":[{"id":"ref-for-opaque-host"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-opaque-host\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-opaque-host\u2461"},{"id":"ref-for-opaque-host\u2462"},{"id":"ref-for-opaque-host\u2463"},{"id":"ref-for-opaque-host\u2464"},{"id":"ref-for-opaque-host\u2465"},{"id":"ref-for-opaque-host\u2466"},{"id":"ref-for-opaque-host\u2467"},{"id":"ref-for-opaque-host\u2468"},{"id":"ref-for-opaque-host\u2460\u24ea"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-opaque-host\u2460\u2460"},{"id":"ref-for-opaque-host\u2460\u2461"}],"title":"3.1. Host representation"},{"refs":[{"id":"ref-for-opaque-host\u2460\u2462"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-opaque-host\u2460\u2463"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-opaque-host\u2460\u2464"}],"title":"4.1. URL representation"}],"url":"#opaque-host"}, "opaque-host-and-port-string": {"dfnID":"opaque-host-and-port-string","dfnText":"opaque-host-and-port string","external":false,"refSections":[{"refs":[{"id":"ref-for-opaque-host-and-port-string"}],"title":"4.3. URL writing"}],"url":"#opaque-host-and-port-string"}, "path-absolute-non-windows-file-url-string": {"dfnID":"path-absolute-non-windows-file-url-string","dfnText":"path-absolute-non-Windows-file-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-path-absolute-non-windows-file-url-string"},{"id":"ref-for-path-absolute-non-windows-file-url-string\u2460"}],"title":"4.3. URL writing"}],"url":"#path-absolute-non-windows-file-url-string"}, "path-absolute-url-string": {"dfnID":"path-absolute-url-string","dfnText":"path-absolute-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-path-absolute-url-string"},{"id":"ref-for-path-absolute-url-string\u2460"},{"id":"ref-for-path-absolute-url-string\u2461"},{"id":"ref-for-path-absolute-url-string\u2462"},{"id":"ref-for-path-absolute-url-string\u2463"},{"id":"ref-for-path-absolute-url-string\u2464"},{"id":"ref-for-path-absolute-url-string\u2465"}],"title":"4.3. URL writing"}],"url":"#path-absolute-url-string"}, "path-or-authority-state": {"dfnID":"path-or-authority-state","dfnText":"path or authority state","external":false,"refSections":[{"refs":[{"id":"ref-for-path-or-authority-state"}],"title":"4.4. URL parsing"}],"url":"#path-or-authority-state"}, "path-percent-encode-set": {"dfnID":"path-percent-encode-set","dfnText":"path percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-path-percent-encode-set"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-path-percent-encode-set\u2460"}],"title":"4.4. URL parsing"}],"url":"#path-percent-encode-set"}, "path-relative-scheme-less-url-string": {"dfnID":"path-relative-scheme-less-url-string","dfnText":"path-relative-scheme-less-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-path-relative-scheme-less-url-string"},{"id":"ref-for-path-relative-scheme-less-url-string\u2460"},{"id":"ref-for-path-relative-scheme-less-url-string\u2461"}],"title":"4.3. URL writing"}],"url":"#path-relative-scheme-less-url-string"}, "path-relative-url-string": {"dfnID":"path-relative-url-string","dfnText":"path-relative-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-path-relative-url-string"},{"id":"ref-for-path-relative-url-string\u2460"}],"title":"4.3. URL writing"}],"url":"#path-relative-url-string"}, "path-start-state": {"dfnID":"path-start-state","dfnText":"path start state","external":false,"refSections":[{"refs":[{"id":"ref-for-path-start-state"},{"id":"ref-for-path-start-state\u2460"},{"id":"ref-for-path-start-state\u2461"},{"id":"ref-for-path-start-state\u2462"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-path-start-state\u2463"}],"title":"6.1. URL class"}],"url":"#path-start-state"}, "path-state": {"dfnID":"path-state","dfnText":"path state","external":false,"refSections":[{"refs":[{"id":"ref-for-path-state"},{"id":"ref-for-path-state\u2460"},{"id":"ref-for-path-state\u2461"},{"id":"ref-for-path-state\u2462"},{"id":"ref-for-path-state\u2463"},{"id":"ref-for-path-state\u2464"},{"id":"ref-for-path-state\u2465"},{"id":"ref-for-path-state\u2466"},{"id":"ref-for-path-state\u2467"},{"id":"ref-for-path-state\u2468"}],"title":"4.4. URL parsing"}],"url":"#path-state"}, "percent-decode": {"dfnID":"percent-decode","dfnText":"percent-decode","external":false,"refSections":[{"refs":[{"id":"ref-for-percent-decode"},{"id":"ref-for-percent-decode\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-percent-decode\u2461"}],"title":"5.1. application/x-www-form-urlencoded parsing"}],"url":"#percent-decode"}, "percent-encode": {"dfnID":"percent-encode","dfnText":"percent-encode","external":false,"refSections":[{"refs":[{"id":"ref-for-percent-encode"},{"id":"ref-for-percent-encode\u2460"}],"title":"1.3. Percent-encoded bytes"}],"url":"#percent-encode"}, "percent-encoded-byte": {"dfnID":"percent-encoded-byte","dfnText":"percent-encoded byte","external":false,"refSections":[{"refs":[{"id":"ref-for-percent-encoded-byte"},{"id":"ref-for-percent-encoded-byte\u2460"},{"id":"ref-for-percent-encoded-byte\u2461"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-percent-encoded-byte\u2462"},{"id":"ref-for-percent-encoded-byte\u2463"},{"id":"ref-for-percent-encoded-byte\u2464"},{"id":"ref-for-percent-encoded-byte\u2465"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-percent-encoded-byte\u2466"}],"title":"4.8.3. Internationalization and special characters"}],"url":"#percent-encoded-byte"}, "pointer": {"dfnID":"pointer","dfnText":"pointer","external":false,"refSections":[{"refs":[{"id":"ref-for-pointer"},{"id":"ref-for-pointer\u2460"},{"id":"ref-for-pointer\u2461"},{"id":"ref-for-pointer\u2462"},{"id":"ref-for-pointer\u2463"},{"id":"ref-for-pointer\u2464"},{"id":"ref-for-pointer\u2465"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-pointer\u2466"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-pointer\u2467"}],"title":"4.4. URL parsing"}],"url":"#pointer"}, "port-invalid": {"dfnID":"port-invalid","dfnText":"port-invalid","external":false,"refSections":[{"refs":[{"id":"ref-for-port-invalid"}],"title":"4.4. URL parsing"}],"url":"#port-invalid"}, "port-out-of-range": {"dfnID":"port-out-of-range","dfnText":"port-out-of-range","external":false,"refSections":[{"refs":[{"id":"ref-for-port-out-of-range"}],"title":"4.4. URL parsing"}],"url":"#port-out-of-range"}, "port-state": {"dfnID":"port-state","dfnText":"port state","external":false,"refSections":[{"refs":[{"id":"ref-for-port-state"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-port-state\u2460"}],"title":"6.1. URL class"}],"url":"#port-state"}, "potentially-strip-trailing-spaces-from-an-opaque-path": {"dfnID":"potentially-strip-trailing-spaces-from-an-opaque-path","dfnText":"potentially strip trailing spaces from an opaque path","external":false,"refSections":[{"refs":[{"id":"ref-for-potentially-strip-trailing-spaces-from-an-opaque-path"},{"id":"ref-for-potentially-strip-trailing-spaces-from-an-opaque-path\u2460"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-potentially-strip-trailing-spaces-from-an-opaque-path\u2461"}],"title":"6.2. URLSearchParams class"}],"url":"#potentially-strip-trailing-spaces-from-an-opaque-path"}, "query-percent-encode-set": {"dfnID":"query-percent-encode-set","dfnText":"query percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-query-percent-encode-set"},{"id":"ref-for-query-percent-encode-set\u2460"},{"id":"ref-for-query-percent-encode-set\u2461"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-query-percent-encode-set\u2462"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-query-percent-encode-set\u2463"}],"title":"6.2. URLSearchParams class"}],"url":"#query-percent-encode-set"}, "query-state": {"dfnID":"query-state","dfnText":"query state","external":false,"refSections":[{"refs":[{"id":"ref-for-query-state"},{"id":"ref-for-query-state\u2460"},{"id":"ref-for-query-state\u2461"},{"id":"ref-for-query-state\u2462"},{"id":"ref-for-query-state\u2463"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-query-state\u2464"}],"title":"6.1. URL class"}],"url":"#query-state"}, "relative-slash-state": {"dfnID":"relative-slash-state","dfnText":"relative slash state","external":false,"refSections":[{"refs":[{"id":"ref-for-relative-slash-state"},{"id":"ref-for-relative-slash-state\u2460"}],"title":"4.4. URL parsing"}],"url":"#relative-slash-state"}, "relative-state": {"dfnID":"relative-state","dfnText":"relative state","external":false,"refSections":[{"refs":[{"id":"ref-for-relative-state"},{"id":"ref-for-relative-state\u2460"}],"title":"4.4. URL parsing"}],"url":"#relative-state"}, "relative-url-string": {"dfnID":"relative-url-string","dfnText":"relative-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-relative-url-string"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-relative-url-string\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-relative-url-string\u2461"},{"id":"ref-for-relative-url-string\u2462"},{"id":"ref-for-relative-url-string\u2463"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-relative-url-string\u2464"}],"title":"6.1. URL class"}],"url":"#relative-url-string"}, "relative-url-with-fragment-string": {"dfnID":"relative-url-with-fragment-string","dfnText":"relative-URL-with-fragment string","external":false,"refSections":[{"refs":[{"id":"ref-for-relative-url-with-fragment-string"}],"title":"4.3. URL writing"}],"url":"#relative-url-with-fragment-string"}, "remaining": {"dfnID":"remaining","dfnText":"remaining","external":false,"refSections":[{"refs":[{"id":"ref-for-remaining"},{"id":"ref-for-remaining\u2460"},{"id":"ref-for-remaining\u2461"}],"title":"1.2. Parsers"},{"refs":[{"id":"ref-for-remaining\u2462"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-remaining\u2463"},{"id":"ref-for-remaining\u2464"},{"id":"ref-for-remaining\u2465"},{"id":"ref-for-remaining\u2466"},{"id":"ref-for-remaining\u2467"},{"id":"ref-for-remaining\u2468"},{"id":"ref-for-remaining\u2460\u24ea"},{"id":"ref-for-remaining\u2460\u2460"}],"title":"4.4. URL parsing"}],"url":"#remaining"}, "scheme-relative-file-url-string": {"dfnID":"scheme-relative-file-url-string","dfnText":"scheme-relative-file-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-scheme-relative-file-url-string"},{"id":"ref-for-scheme-relative-file-url-string\u2460"}],"title":"4.3. URL writing"}],"url":"#scheme-relative-file-url-string"}, "scheme-relative-special-url-string": {"dfnID":"scheme-relative-special-url-string","dfnText":"scheme-relative-special-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-scheme-relative-special-url-string"},{"id":"ref-for-scheme-relative-special-url-string\u2460"}],"title":"4.3. URL writing"}],"url":"#scheme-relative-special-url-string"}, "scheme-relative-url-string": {"dfnID":"scheme-relative-url-string","dfnText":"scheme-relative-URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-scheme-relative-url-string"}],"title":"4.3. URL writing"}],"url":"#scheme-relative-url-string"}, "scheme-start-state": {"dfnID":"scheme-start-state","dfnText":"scheme start state","external":false,"refSections":[{"refs":[{"id":"ref-for-scheme-start-state"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-scheme-start-state\u2460"}],"title":"6.1. URL class"}],"url":"#scheme-start-state"}, "scheme-state": {"dfnID":"scheme-state","dfnText":"scheme state","external":false,"refSections":[{"refs":[{"id":"ref-for-scheme-state"}],"title":"4.4. URL parsing"}],"url":"#scheme-state"}, "serialize-an-integer": {"dfnID":"serialize-an-integer","dfnText":"serialize an integer","external":false,"refSections":[{"refs":[{"id":"ref-for-serialize-an-integer"}],"title":"3.6. Host serializing"},{"refs":[{"id":"ref-for-serialize-an-integer\u2460"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-serialize-an-integer\u2461"},{"id":"ref-for-serialize-an-integer\u2462"}],"title":"6.1. URL class"}],"url":"#serialize-an-integer"}, "set-the-password": {"dfnID":"set-the-password","dfnText":"set the password","external":false,"refSections":[{"refs":[{"id":"ref-for-set-the-password"}],"title":"6.1. URL class"}],"url":"#set-the-password"}, "set-the-username": {"dfnID":"set-the-username","dfnText":"set the username","external":false,"refSections":[{"refs":[{"id":"ref-for-set-the-username"}],"title":"6.1. URL class"}],"url":"#set-the-username"}, "shorten-a-urls-path": {"dfnID":"shorten-a-urls-path","dfnText":"shorten a url\u2019s path","external":false,"refSections":[{"refs":[{"id":"ref-for-shorten-a-urls-path"},{"id":"ref-for-shorten-a-urls-path\u2460"},{"id":"ref-for-shorten-a-urls-path\u2461"}],"title":"4.4. URL parsing"}],"url":"#shorten-a-urls-path"}, "single-dot-path-segment": {"dfnID":"single-dot-path-segment","dfnText":"single-dot URL path segment","external":false,"refSections":[{"refs":[{"id":"ref-for-single-dot-path-segment"},{"id":"ref-for-single-dot-path-segment\u2460"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-single-dot-path-segment\u2461"},{"id":"ref-for-single-dot-path-segment\u2462"}],"title":"4.4. URL parsing"}],"url":"#single-dot-path-segment"}, "special-authority-ignore-slashes-state": {"dfnID":"special-authority-ignore-slashes-state","dfnText":"special authority ignore slashes state","external":false,"refSections":[{"refs":[{"id":"ref-for-special-authority-ignore-slashes-state"},{"id":"ref-for-special-authority-ignore-slashes-state\u2460"},{"id":"ref-for-special-authority-ignore-slashes-state\u2461"},{"id":"ref-for-special-authority-ignore-slashes-state\u2462"}],"title":"4.4. URL parsing"}],"url":"#special-authority-ignore-slashes-state"}, "special-authority-slashes-state": {"dfnID":"special-authority-slashes-state","dfnText":"special authority slashes state","external":false,"refSections":[{"refs":[{"id":"ref-for-special-authority-slashes-state"}],"title":"4.4. URL parsing"}],"url":"#special-authority-slashes-state"}, "special-query-percent-encode-set": {"dfnID":"special-query-percent-encode-set","dfnText":"special-query percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-special-query-percent-encode-set"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-special-query-percent-encode-set\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#special-query-percent-encode-set"}, "special-relative-or-authority-state": {"dfnID":"special-relative-or-authority-state","dfnText":"special relative or authority state","external":false,"refSections":[{"refs":[{"id":"ref-for-special-relative-or-authority-state"}],"title":"4.4. URL parsing"}],"url":"#special-relative-or-authority-state"}, "special-scheme": {"dfnID":"special-scheme","dfnText":"special scheme","external":false,"refSections":[{"refs":[{"id":"ref-for-special-scheme"},{"id":"ref-for-special-scheme\u2460"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-special-scheme\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-special-scheme\u2462"},{"id":"ref-for-special-scheme\u2463"},{"id":"ref-for-special-scheme\u2464"},{"id":"ref-for-special-scheme\u2465"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-special-scheme\u2466"},{"id":"ref-for-special-scheme\u2467"},{"id":"ref-for-special-scheme\u2468"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-special-scheme\u2460\u24ea"},{"id":"ref-for-special-scheme\u2460\u2460"},{"id":"ref-for-special-scheme\u2460\u2461"},{"id":"ref-for-special-scheme\u2460\u2462"}],"title":"4.4. URL parsing"}],"url":"#special-scheme"}, "special-scheme-missing-following-solidus": {"dfnID":"special-scheme-missing-following-solidus","dfnText":"special-scheme-missing-following-solidus","external":false,"refSections":[{"refs":[{"id":"ref-for-special-scheme-missing-following-solidus"},{"id":"ref-for-special-scheme-missing-following-solidus\u2460"},{"id":"ref-for-special-scheme-missing-following-solidus\u2461"},{"id":"ref-for-special-scheme-missing-following-solidus\u2462"}],"title":"4.4. URL parsing"}],"url":"#special-scheme-missing-following-solidus"}, "start-with-a-windows-drive-letter": {"dfnID":"start-with-a-windows-drive-letter","dfnText":"starts with a Windows drive letter","external":false,"refSections":[{"refs":[{"id":"ref-for-start-with-a-windows-drive-letter"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-start-with-a-windows-drive-letter\u2460"},{"id":"ref-for-start-with-a-windows-drive-letter\u2461"}],"title":"4.4. URL parsing"}],"url":"#start-with-a-windows-drive-letter"}, "string-percent-decode": {"dfnID":"string-percent-decode","dfnText":"percent-decode","external":false,"refSections":[{"refs":[{"id":"ref-for-string-percent-decode"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-string-percent-decode\u2460"},{"id":"ref-for-string-percent-decode\u2461"},{"id":"ref-for-string-percent-decode\u2462"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-string-percent-decode\u2463"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-string-percent-decode\u2464"}],"title":"4.8.3. Internationalization and special characters"}],"url":"#string-percent-decode"}, "string-percent-encode-after-encoding": {"dfnID":"string-percent-encode-after-encoding","dfnText":"percent-encode after encoding","external":false,"refSections":[{"refs":[{"id":"ref-for-string-percent-encode-after-encoding"},{"id":"ref-for-string-percent-encode-after-encoding\u2460"},{"id":"ref-for-string-percent-encode-after-encoding\u2461"},{"id":"ref-for-string-percent-encode-after-encoding\u2462"},{"id":"ref-for-string-percent-encode-after-encoding\u2463"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-string-percent-encode-after-encoding\u2464"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-string-percent-encode-after-encoding\u2465"},{"id":"ref-for-string-percent-encode-after-encoding\u2466"}],"title":"5.2. application/x-www-form-urlencoded serializing"}],"url":"#string-percent-encode-after-encoding"}, "string-utf-8-percent-encode": {"dfnID":"string-utf-8-percent-encode","dfnText":"UTF-8 percent-encode","external":false,"refSections":[{"refs":[{"id":"ref-for-string-utf-8-percent-encode"},{"id":"ref-for-string-utf-8-percent-encode\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-string-utf-8-percent-encode\u2461"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-string-utf-8-percent-encode\u2462"},{"id":"ref-for-string-utf-8-percent-encode\u2463"}],"title":"4.4. URL parsing"}],"url":"#string-utf-8-percent-encode"}, "url": {"dfnID":"url","dfnText":"URL","external":false,"refSections":[{"refs":[{"id":"ref-for-url"}],"title":"Goals"},{"refs":[{"id":"ref-for-url\u2460"},{"id":"ref-for-url\u2461"},{"id":"ref-for-url\u2462"},{"id":"ref-for-url\u2463"},{"id":"ref-for-url\u2464"},{"id":"ref-for-url\u2465"},{"id":"ref-for-url\u2466"},{"id":"ref-for-url\u2467"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-url\u2468"},{"id":"ref-for-url\u2460\u24ea"},{"id":"ref-for-url\u2460\u2460"}],"title":"6.2. URLSearchParams class"},{"refs":[{"id":"ref-for-url\u2460\u2461"},{"id":"ref-for-url\u2460\u2462"}],"title":"6.3. URL APIs elsewhere"}],"url":"#url"}, "url-code-points": {"dfnID":"url-code-points","dfnText":"URL code points","external":false,"refSections":[{"refs":[{"id":"ref-for-url-code-points"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-url-code-points\u2460"},{"id":"ref-for-url-code-points\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-url-code-points\u2462"},{"id":"ref-for-url-code-points\u2463"},{"id":"ref-for-url-code-points\u2464"},{"id":"ref-for-url-code-points\u2465"}],"title":"4.4. URL parsing"}],"url":"#url-code-points"}, "url-equals-exclude-fragments": {"dfnID":"url-equals-exclude-fragments","dfnText":"exclude fragments","external":false,"refSections":[],"url":"#url-equals-exclude-fragments"}, "url-fragment-string": {"dfnID":"url-fragment-string","dfnText":"URL-fragment string","external":false,"refSections":[{"refs":[{"id":"ref-for-url-fragment-string"},{"id":"ref-for-url-fragment-string\u2460"}],"title":"4.3. URL writing"}],"url":"#url-fragment-string"}, "url-initialize": {"dfnID":"url-initialize","dfnText":"initialize","external":false,"refSections":[{"refs":[{"id":"ref-for-url-initialize"},{"id":"ref-for-url-initialize\u2460"}],"title":"6.1. URL class"}],"url":"#url-initialize"}, "url-opaque-path": {"dfnID":"url-opaque-path","dfnText":"opaque path","external":false,"refSections":[{"refs":[{"id":"ref-for-url-opaque-path"},{"id":"ref-for-url-opaque-path\u2460"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-url-opaque-path\u2461"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-url-opaque-path\u2462"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-url-opaque-path\u2463"},{"id":"ref-for-url-opaque-path\u2464"},{"id":"ref-for-url-opaque-path\u2465"}],"title":"4.4. URL parsing"},{"refs":[{"id":"ref-for-url-opaque-path\u2466"},{"id":"ref-for-url-opaque-path\u2467"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-url-opaque-path\u2468"},{"id":"ref-for-url-opaque-path\u2460\u24ea"},{"id":"ref-for-url-opaque-path\u2460\u2460"},{"id":"ref-for-url-opaque-path\u2460\u2461"}],"title":"6.1. URL class"}],"url":"#url-opaque-path"}, "url-path": {"dfnID":"url-path","dfnText":"URL path","external":false,"refSections":[{"refs":[{"id":"ref-for-url-path"}],"title":"4.1. URL representation"}],"url":"#url-path"}, "url-path-segment": {"dfnID":"url-path-segment","dfnText":"URL path segment","external":false,"refSections":[{"refs":[{"id":"ref-for-url-path-segment"},{"id":"ref-for-url-path-segment\u2460"},{"id":"ref-for-url-path-segment\u2461"},{"id":"ref-for-url-path-segment\u2462"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-url-path-segment\u2463"}],"title":"4.2. URL miscellaneous"}],"url":"#url-path-segment"}, "url-path-segment-string": {"dfnID":"url-path-segment-string","dfnText":"URL-path-segment string","external":false,"refSections":[{"refs":[{"id":"ref-for-url-path-segment-string"}],"title":"4.3. URL writing"}],"url":"#url-path-segment-string"}, "url-path-serializer": {"dfnID":"url-path-serializer","dfnText":"URL path serializer","external":false,"refSections":[{"refs":[{"id":"ref-for-url-path-serializer"}],"title":"4.5. URL serializing"},{"refs":[{"id":"ref-for-url-path-serializer\u2460"}],"title":"4.7. Origin"},{"refs":[{"id":"ref-for-url-path-serializer\u2461"}],"title":"6.1. URL class"}],"url":"#url-path-serializer"}, "url-port-string": {"dfnID":"url-port-string","dfnText":"URL-port string","external":false,"refSections":[{"refs":[{"id":"ref-for-url-port-string"},{"id":"ref-for-url-port-string\u2460"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-url-port-string\u2461"},{"id":"ref-for-url-port-string\u2462"}],"title":"6.1. URL class"}],"url":"#url-port-string"}, "url-query-string": {"dfnID":"url-query-string","dfnText":"URL-query string","external":false,"refSections":[{"refs":[{"id":"ref-for-url-query-string"},{"id":"ref-for-url-query-string\u2460"},{"id":"ref-for-url-query-string\u2461"}],"title":"4.3. URL writing"}],"url":"#url-query-string"}, "url-scheme-string": {"dfnID":"url-scheme-string","dfnText":"URL-scheme string","external":false,"refSections":[{"refs":[{"id":"ref-for-url-scheme-string"},{"id":"ref-for-url-scheme-string\u2460"},{"id":"ref-for-url-scheme-string\u2461"},{"id":"ref-for-url-scheme-string\u2462"},{"id":"ref-for-url-scheme-string\u2463"}],"title":"4.3. URL writing"}],"url":"#url-scheme-string"}, "url-serializer-exclude-fragment": {"dfnID":"url-serializer-exclude-fragment","dfnText":"exclude fragment","external":false,"refSections":[{"refs":[{"id":"ref-for-url-serializer-exclude-fragment"},{"id":"ref-for-url-serializer-exclude-fragment\u2460"}],"title":"4.6. URL equivalence"}],"url":"#url-serializer-exclude-fragment"}, "url-units": {"dfnID":"url-units","dfnText":"URL units","external":false,"refSections":[{"refs":[{"id":"ref-for-url-units"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-url-units\u2460"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-url-units\u2461"},{"id":"ref-for-url-units\u2462"},{"id":"ref-for-url-units\u2463"}],"title":"4.3. URL writing"}],"url":"#url-units"}, "urlsearchparams": {"dfnID":"urlsearchparams","dfnText":"URLSearchParams","external":false,"refSections":[{"refs":[{"id":"ref-for-urlsearchparams"},{"id":"ref-for-urlsearchparams\u2460"},{"id":"ref-for-urlsearchparams\u2461"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-urlsearchparams\u2462"},{"id":"ref-for-urlsearchparams\u2463"},{"id":"ref-for-urlsearchparams\u2464"},{"id":"ref-for-urlsearchparams\u2465"},{"id":"ref-for-urlsearchparams\u2466"},{"id":"ref-for-urlsearchparams\u2467"},{"id":"ref-for-urlsearchparams\u2468"},{"id":"ref-for-urlsearchparams\u2460\u24ea"},{"id":"ref-for-urlsearchparams\u2460\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#urlsearchparams"}, "urlsearchparams-initialize": {"dfnID":"urlsearchparams-initialize","dfnText":"initialize","external":false,"refSections":[{"refs":[{"id":"ref-for-urlsearchparams-initialize"}],"title":"6.1. URL class"},{"refs":[{"id":"ref-for-urlsearchparams-initialize\u2460"}],"title":"6.2. URLSearchParams class"}],"url":"#urlsearchparams-initialize"}, "urlsearchparams-stringification-behavior": {"dfnID":"urlsearchparams-stringification-behavior","dfnText":"stringification behavior","external":false,"refSections":[{"refs":[{"id":"ref-for-urlsearchparams-stringification-behavior"}],"title":"6.2. URLSearchParams class"}],"url":"#urlsearchparams-stringification-behavior"}, "userinfo-percent-encode-set": {"dfnID":"userinfo-percent-encode-set","dfnText":"userinfo percent-encode set","external":false,"refSections":[{"refs":[{"id":"ref-for-userinfo-percent-encode-set"},{"id":"ref-for-userinfo-percent-encode-set\u2460"},{"id":"ref-for-userinfo-percent-encode-set\u2461"},{"id":"ref-for-userinfo-percent-encode-set\u2462"},{"id":"ref-for-userinfo-percent-encode-set\u2463"},{"id":"ref-for-userinfo-percent-encode-set\u2464"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-userinfo-percent-encode-set\u2465"},{"id":"ref-for-userinfo-percent-encode-set\u2466"},{"id":"ref-for-userinfo-percent-encode-set\u2467"}],"title":"4.4. URL parsing"}],"url":"#userinfo-percent-encode-set"}, "utf-8-percent-encode": {"dfnID":"utf-8-percent-encode","dfnText":"UTF-8 percent-encode","external":false,"refSections":[{"refs":[{"id":"ref-for-utf-8-percent-encode"},{"id":"ref-for-utf-8-percent-encode\u2460"}],"title":"1.3. Percent-encoded bytes"},{"refs":[{"id":"ref-for-utf-8-percent-encode\u2461"},{"id":"ref-for-utf-8-percent-encode\u2462"},{"id":"ref-for-utf-8-percent-encode\u2463"},{"id":"ref-for-utf-8-percent-encode\u2464"}],"title":"4.4. URL parsing"}],"url":"#utf-8-percent-encode"}, "valid-domain": {"dfnID":"valid-domain","dfnText":"valid domain","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-domain"},{"id":"ref-for-valid-domain\u2460"}],"title":"3.4. Host writing"}],"url":"#valid-domain"}, "valid-domain-string": {"dfnID":"valid-domain-string","dfnText":"valid domain string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-domain-string"}],"title":"3.4. Host writing"}],"url":"#valid-domain-string"}, "valid-host-string": {"dfnID":"valid-host-string","dfnText":"valid host string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-host-string"},{"id":"ref-for-valid-host-string\u2460"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-valid-host-string\u2461"}],"title":"3.4. Host writing"},{"refs":[{"id":"ref-for-valid-host-string\u2462"},{"id":"ref-for-valid-host-string\u2463"}],"title":"4.3. URL writing"}],"url":"#valid-host-string"}, "valid-ipv4-address-string": {"dfnID":"valid-ipv4-address-string","dfnText":"valid IPv4-address string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-ipv4-address-string"}],"title":"3.4. Host writing"}],"url":"#valid-ipv4-address-string"}, "valid-ipv6-address-string": {"dfnID":"valid-ipv6-address-string","dfnText":"valid IPv6-address string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-ipv6-address-string"},{"id":"ref-for-valid-ipv6-address-string\u2460"}],"title":"3.4. Host writing"}],"url":"#valid-ipv6-address-string"}, "valid-opaque-host-string": {"dfnID":"valid-opaque-host-string","dfnText":"valid opaque-host string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-opaque-host-string"}],"title":"4.3. URL writing"}],"url":"#valid-opaque-host-string"}, "valid-url-string": {"dfnID":"valid-url-string","dfnText":"valid URL string","external":false,"refSections":[{"refs":[{"id":"ref-for-valid-url-string"},{"id":"ref-for-valid-url-string\u2460"},{"id":"ref-for-valid-url-string\u2461"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-valid-url-string\u2462"},{"id":"ref-for-valid-url-string\u2463"}],"title":"4.1. URL representation"},{"refs":[{"id":"ref-for-valid-url-string\u2464"}],"title":"4.3. URL writing"}],"url":"#valid-url-string"}, "validation-error": {"dfnID":"validation-error","dfnText":"validation error","external":false,"refSections":[{"refs":[{"id":"ref-for-validation-error"},{"id":"ref-for-validation-error\u2460"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-validation-error\u2461"}],"title":"3. Hosts (domains and IP addresses)"},{"refs":[{"id":"ref-for-validation-error\u2462"},{"id":"ref-for-validation-error\u2463"},{"id":"ref-for-validation-error\u2464"}],"title":"3.3. IDNA"},{"refs":[{"id":"ref-for-validation-error\u2465"},{"id":"ref-for-validation-error\u2466"},{"id":"ref-for-validation-error\u2467"},{"id":"ref-for-validation-error\u2468"},{"id":"ref-for-validation-error\u2460\u24ea"},{"id":"ref-for-validation-error\u2460\u2460"},{"id":"ref-for-validation-error\u2460\u2461"},{"id":"ref-for-validation-error\u2460\u2462"},{"id":"ref-for-validation-error\u2460\u2463"},{"id":"ref-for-validation-error\u2460\u2464"},{"id":"ref-for-validation-error\u2460\u2465"},{"id":"ref-for-validation-error\u2460\u2466"},{"id":"ref-for-validation-error\u2460\u2467"},{"id":"ref-for-validation-error\u2460\u2468"},{"id":"ref-for-validation-error\u2461\u24ea"},{"id":"ref-for-validation-error\u2461\u2460"},{"id":"ref-for-validation-error\u2461\u2461"},{"id":"ref-for-validation-error\u2461\u2462"},{"id":"ref-for-validation-error\u2461\u2463"},{"id":"ref-for-validation-error\u2461\u2464"},{"id":"ref-for-validation-error\u2461\u2465"},{"id":"ref-for-validation-error\u2461\u2466"},{"id":"ref-for-validation-error\u2461\u2467"}],"title":"3.5. Host parsing"},{"refs":[{"id":"ref-for-validation-error\u2461\u2468"},{"id":"ref-for-validation-error\u2462\u24ea"}],"title":"4. URLs"},{"refs":[{"id":"ref-for-validation-error\u2462\u2460"},{"id":"ref-for-validation-error\u2462\u2461"},{"id":"ref-for-validation-error\u2462\u2462"},{"id":"ref-for-validation-error\u2462\u2463"},{"id":"ref-for-validation-error\u2462\u2464"},{"id":"ref-for-validation-error\u2462\u2465"},{"id":"ref-for-validation-error\u2462\u2466"},{"id":"ref-for-validation-error\u2462\u2467"},{"id":"ref-for-validation-error\u2462\u2468"},{"id":"ref-for-validation-error\u2463\u24ea"},{"id":"ref-for-validation-error\u2463\u2460"},{"id":"ref-for-validation-error\u2463\u2461"},{"id":"ref-for-validation-error\u2463\u2462"},{"id":"ref-for-validation-error\u2463\u2463"},{"id":"ref-for-validation-error\u2463\u2464"},{"id":"ref-for-validation-error\u2463\u2465"},{"id":"ref-for-validation-error\u2463\u2466"},{"id":"ref-for-validation-error\u2463\u2467"},{"id":"ref-for-validation-error\u2463\u2468"},{"id":"ref-for-validation-error\u2464\u24ea"},{"id":"ref-for-validation-error\u2464\u2460"},{"id":"ref-for-validation-error\u2464\u2461"},{"id":"ref-for-validation-error\u2464\u2462"},{"id":"ref-for-validation-error\u2464\u2463"},{"id":"ref-for-validation-error\u2464\u2464"},{"id":"ref-for-validation-error\u2464\u2465"},{"id":"ref-for-validation-error\u2464\u2466"},{"id":"ref-for-validation-error\u2464\u2467"},{"id":"ref-for-validation-error\u2464\u2468"}],"title":"4.4. URL parsing"}],"url":"#validation-error"}, "validation-error-domain-to-ascii": {"dfnID":"validation-error-domain-to-ascii","dfnText":"domain-to-ASCII","external":false,"refSections":[{"refs":[{"id":"ref-for-validation-error-domain-to-ascii"}],"title":"1.1. Writing"},{"refs":[{"id":"ref-for-validation-error-domain-to-ascii\u2460"},{"id":"ref-for-validation-error-domain-to-ascii\u2461"}],"title":"3.3. IDNA"}],"url":"#validation-error-domain-to-ascii"}, "webkiturl": {"dfnID":"webkiturl","dfnText":"webkitURL","external":false,"refSections":[],"url":"#webkiturl"}, "windows-drive-letter": {"dfnID":"windows-drive-letter","dfnText":"Windows drive letter","external":false,"refSections":[{"refs":[{"id":"ref-for-windows-drive-letter"},{"id":"ref-for-windows-drive-letter\u2460"}],"title":"4.2. URL miscellaneous"},{"refs":[{"id":"ref-for-windows-drive-letter\u2461"}],"title":"4.3. URL writing"},{"refs":[{"id":"ref-for-windows-drive-letter\u2462"},{"id":"ref-for-windows-drive-letter\u2463"}],"title":"4.4. URL parsing"}],"url":"#windows-drive-letter"}, }; document.addEventListener("DOMContentLoaded", ()=>{ genAllDfnPanels(); document.body.addEventListener("click", (e) => { // If not handled already, just hide all dfn panels. hideAllDfnPanels(); }); }); window.addEventListener("resize", () => { // Pin any visible dfn panel queryAll(".dfn-panel.on, .dfn-panel.activated").forEach(el=>positionDfnPanel(el)); }); function genAllDfnPanels() { for(const panelData of Object.values(dfnPanelData)) { const dfnID = panelData.dfnID; const dfn = document.getElementById(dfnID); if(!dfn) { console.log(`Can't find dfn#${dfnID}.`, panelData); continue; } dfn.panelData = panelData; insertDfnPopupAction(dfn); } } function genDfnPanel(dfn, { dfnID, url, dfnText, refSections, external }) { const dfnPanel = mk.aside({ class: "dfn-panel on", id: `infopanel-for-${dfnID}`, "data-for": dfnID, "aria-labelled-by":`infopaneltitle-for-${dfnID}`, }, mk.span({id:`infopaneltitle-for-${dfnID}`, style:"display:none"}, `Info about the '${dfnText}' ${external?"external":""} reference.`), mk.a({href:url, class:"dfn-link"}, url), refSections.length == 0 ? [] : mk.b({}, "Referenced in:"), mk.ul({}, ...refSections.map(section=> mk.li({}, ...section.refs.map((ref, refI)=> [ mk.a({ href: `#${ref.id}` }, (refI == 0) ? section.title : `(${refI + 1})` ), " ", ] ), ), ), ), genLinkingSyntaxes(dfn), ); dfnPanel.addEventListener('click', (event) => { if (event.target.nodeName == 'A') { scrollToTargetAndHighlight(event); pinDfnPanel(dfnPanel); } event.stopPropagation(); refocusOnTarget(event); }); dfnPanel.addEventListener('keydown', (event) => { if(event.keyCode == 27) { // Escape key hideDfnPanel({dfnPanel}); event.stopPropagation(); event.preventDefault(); } }); dfnPanel.dfn = dfn; dfn.dfnPanel = dfnPanel; return dfnPanel; } function hideAllDfnPanels() { // Delete the currently-active dfn panel. queryAll(".dfn-panel").forEach(dfnPanel=>hideDfnPanel({dfnPanel})); } function showDfnPanel(dfn) { hideAllDfnPanels(); // Only display one at a time. dfn.setAttribute("aria-expanded", "true"); const dfnPanel = genDfnPanel(dfn, dfn.panelData); // Give the dfn a unique tabindex, and then // give all the tabbable panel bits successive indexes. let tabIndex = 100; dfn.tabIndex = tabIndex++; const tabbable = dfnPanel.querySelectorAll(":is(a, button)"); for (const el of tabbable) { el.tabIndex = tabIndex++; } append(document.body, dfnPanel); positionDfnPanel(dfnPanel); } function positionDfnPanel(dfnPanel) { const dfn = dfnPanel.dfn; const dfnPos = getBounds(dfn); dfnPanel.style.top = dfnPos.bottom + "px"; dfnPanel.style.left = dfnPos.left + "px"; const panelPos = dfnPanel.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, dfnPos.left - overflowAmount); dfnPanel.style.left = newLeft + "px"; } } function pinDfnPanel(dfnPanel) { // Switch it to "activated" state, which pins it. dfnPanel.classList.add("activated"); dfnPanel.style.position = "fixed"; dfnPanel.style.left = null; dfnPanel.style.top = null; } function hideDfnPanel({dfn, dfnPanel}) { if(!dfnPanel) dfnPanel = dfn.dfnPanel; if(!dfn) dfn = dfnPanel.dfn; dfn.dfnPanel = undefined; dfnPanel.dfn = undefined; dfn.setAttribute("aria-expanded", "false"); dfn.tabIndex = undefined; dfnPanel.remove() } function toggleDfnPanel(dfn) { if(dfn.dfnPanel) { hideDfnPanel(dfn); } else { showDfnPanel(dfn); } } function insertDfnPopupAction(dfn) { dfn.setAttribute('role', 'button'); dfn.setAttribute('aria-expanded', 'false') dfn.tabIndex = 0; dfn.classList.add('has-dfn-panel'); dfn.addEventListener('click', (event) => { toggleDfnPanel(dfn); event.stopPropagation(); }); dfn.addEventListener('keypress', (event) => { const kc = event.keyCode; // 32->Space, 13->Enter if(kc == 32 || kc == 13) { toggleDfnPanel(dfn); event.stopPropagation(); event.preventDefault(); } }); } function refocusOnTarget(event) { const target = event.target; setTimeout(() => { // Refocus on the event.target element. // This is needed after browser scrolls to the destination. target.focus(); }); } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function scrollToTargetAndHighlight(event) { let hash = event.target.hash; if (hash) { hash = decodeURIComponent(hash.substring(1)); const dest = document.getElementById(hash); if (dest) { dest.classList.add('highlighted'); setTimeout(() => dest.classList.remove('highlighted'), 1000); } } } // Functions, divided by link type, that wrap an autolink's // contents with the appropriate outer syntax. // Alternately, a string naming another type they format // the same as. function needsFor(type) { switch(type) { case "descriptor": case "value": case "element-attr": case "attr-value": case "element-state": case "method": case "constructor": case "argument": case "attribute": case "const": case "dict-member": case "event": case "enum-value": case "stringifier": case "serializer": case "iterator": case "maplike": case "setlike": case "state": case "mode": case "context": case "facet": return true; default: return false; } } function refusesFor(type) { switch(type) { case "property": case "element": case "interface": case "namespace": case "callback": case "dictionary": case "enum": case "exception": case "typedef": case "http-header": case "permission": return true; default: return false; } } function linkFormatterFromType(type) { switch(type) { case 'scheme': case 'permission': case 'dfn': return (text) => `[=${text}=]`; case 'abstract-op': return (text) => `[\$${text}\$]`; case 'function': case 'at-rule': case 'selector': case 'value': return (text) => `''${text}''`; case 'http-header': return (text) => `[:${text}:]`; case 'interface': case 'constructor': case 'method': case 'argument': case 'attribute': case 'callback': case 'dictionary': case 'dict-member': case 'enum': case 'enum-value': case 'exception': case 'const': case 'typedef': case 'stringifier': case 'serializer': case 'iterator': case 'maplike': case 'setlike': case 'extended-attribute': case 'event': case 'idl': return (text) => `{{${text}}}`; case 'element-state': case 'element-attr': case 'attr-value': case 'element': return (element) => `<{${element}}>`; case 'grammar': return (text) => `${text} (within a <pre class=prod>)`; case 'type': return (text)=> `<<${text}>>`; case 'descriptor': case 'property': return (text) => `'${text}'`; default: return; }; }; function genLinkingSyntaxes(dfn) { if(dfn.tagName != "DFN") return; const type = dfn.getAttribute('data-dfn-type'); if(!type) { console.log(`<dfn> doesn't have a data-dfn-type:`, dfn); return []; } // Return a function that wraps link text based on the type const linkFormatter = linkFormatterFromType(type); if(!linkFormatter) { console.log(`<dfn> has an unknown data-dfn-type:`, dfn); return []; } let ltAlts; if(dfn.hasAttribute('data-lt')) { ltAlts = dfn.getAttribute('data-lt') .split("|") .map(x=>x.trim()); } else { ltAlts = [dfn.textContent.trim()]; } if(type == "type") { // lt of "<foo>", but "foo" is the interior; // <<foo/bar>> is how you write it with a for, // not <foo/<bar>> or whatever. for(var i = 0; i < ltAlts.length; i++) { const lt = ltAlts[i]; const match = /<(.*)>/.exec(lt); if(match) { ltAlts[i] = match[1]; } } } let forAlts; if(dfn.hasAttribute('data-dfn-for')) { forAlts = dfn.getAttribute('data-dfn-for') .split(",") .map(x=>x.trim()); } else { forAlts = ['']; } let linkingSyntaxes = []; if(!needsFor(type)) { for(const lt of ltAlts) { linkingSyntaxes.push(linkFormatter(lt)); } } if(!refusesFor(type)) { for(const f of forAlts) { linkingSyntaxes.push(linkFormatter(`${f}/${ltAlts[0]}`)) } } return [ mk.b({}, 'Possible linking syntaxes:'), mk.ul({}, ...linkingSyntaxes.map(link => { const copyLink = async () => await navigator.clipboard.writeText(link); return mk.li({}, mk.div({ class: 'link-item' }, mk.button({ class: 'copy-icon', title: 'Copy', type: 'button', _onclick: copyLink, tabindex: 0, }, mk.span({ class: 'icon' }) ), mk.span({}, link) ) ); }) ) ]; } } </script> <script>/* Boilerplate: script-position-annos */ "use strict"; { function repositionAnnoPanels(){ const panels = [...document.querySelectorAll("[data-anno-for]")]; hydratePanels(panels); let vSoFar = 0; for(const panel of panels.sort(cmpTops)) { if(panel.top < vSoFar) { panel.top = vSoFar; panel.style.top = vSoFar + "px"; } vSoFar = panel.top + panel.height + 15; } } function hydratePanels(panels) { const main = document.querySelector("main"); let mainRect; if(main) mainRect = main.getBoundingClientRect(); // First display them all, if they're not already visible. for(const panel of panels) { panel.classList.remove("unpositioned"); } // Measure them all for(const panel of panels) { const dfn = document.getElementById(panel.getAttribute("data-anno-for")); if(!dfn) { console.log("Can't find the annotation panel target:", panel); continue; } panel.dfn = dfn; panel.top = window.scrollY + dfn.getBoundingClientRect().top; let panelRect = panel.getBoundingClientRect(); panel.height = panelRect.height; if(main) { panel.overlappingMain = panelRect.left < mainRect.right; } else { panel.overlappingMain = false; } } // And finally position them for(const panel of panels) { const dfn = panel.dfn; if(!dfn) continue; panel.style.top = panel.top + "px"; panel.classList.toggle("overlapping-main", panel.overlappingMain); } } function cmpTops(a,b) { return a.top - b.top; } window.addEventListener("load", repositionAnnoPanels); window.addEventListener("resize", repositionAnnoPanels); } </script> <script>/* Boilerplate: script-ref-hints */ "use strict"; { let refsData = { "#absolute-url-string": {"displayText":"absolute-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"absolute-url string","type":"dfn","url":"#absolute-url-string"}, "#absolute-url-with-fragment-string": {"displayText":"absolute-url-with-fragment string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"absolute-url-with-fragment string","type":"dfn","url":"#absolute-url-with-fragment-string"}, "#api-url-parser": {"displayText":"api url parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"api url parser","type":"dfn","url":"#api-url-parser"}, "#application-x-www-form-urlencoded-percent-encode-set": {"displayText":"application/x-www-form-urlencoded percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"application/x-www-form-urlencoded percent-encode set","type":"dfn","url":"#application-x-www-form-urlencoded-percent-encode-set"}, "#authority-state": {"displayText":"authority state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"authority state","type":"dfn","url":"#authority-state"}, "#basic-url-parser-state-override": {"displayText":"state override","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"state override","type":"dfn","url":"#basic-url-parser-state-override"}, "#basic-url-parser-url": {"displayText":"url","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url","type":"dfn","url":"#basic-url-parser-url"}, "#c": {"displayText":"c","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"c","type":"dfn","url":"#c"}, "#c0-control-percent-encode-set": {"displayText":"c0 control percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"c0 control percent-encode set","type":"dfn","url":"#c0-control-percent-encode-set"}, "#cannot-be-a-base-url-path-state": {"displayText":"opaque path state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"opaque path state","type":"dfn","url":"#cannot-be-a-base-url-path-state"}, "#cannot-have-a-username-password-port": {"displayText":"cannot have a username/password/port","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"cannot have a username/password/port","type":"dfn","url":"#cannot-have-a-username-password-port"}, "#component-percent-encode-set": {"displayText":"component percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"component percent-encode set","type":"dfn","url":"#component-percent-encode-set"}, "#concept-base-url": {"displayText":"base url","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"base url","type":"dfn","url":"#concept-base-url"}, "#concept-basic-url-parser": {"displayText":"basic url parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"basic url parser","type":"dfn","url":"#concept-basic-url-parser"}, "#concept-domain": {"displayText":"domain","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain","type":"dfn","url":"#concept-domain"}, "#concept-domain-to-ascii": {"displayText":"domain to ascii","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain to ascii","type":"dfn","url":"#concept-domain-to-ascii"}, "#concept-domain-to-unicode": {"displayText":"domain to unicode","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain to unicode","type":"dfn","url":"#concept-domain-to-unicode"}, "#concept-host": {"displayText":"host","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host","type":"dfn","url":"#concept-host"}, "#concept-host-equals": {"displayText":"equal","export":true,"for_":["host"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"equal","type":"dfn","url":"#concept-host-equals"}, "#concept-host-parser": {"displayText":"host parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host parser","type":"dfn","url":"#concept-host-parser"}, "#concept-host-serializer": {"displayText":"host serializer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host serializer","type":"dfn","url":"#concept-host-serializer"}, "#concept-ipv4": {"displayText":"ipv4 address","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4 address","type":"dfn","url":"#concept-ipv4"}, "#concept-ipv4-parser": {"displayText":"ipv4 parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4 parser","type":"dfn","url":"#concept-ipv4-parser"}, "#concept-ipv4-serializer": {"displayText":"ipv4 serializer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4 serializer","type":"dfn","url":"#concept-ipv4-serializer"}, "#concept-ipv6": {"displayText":"ipv6 address","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6 address","type":"dfn","url":"#concept-ipv6"}, "#concept-ipv6-parser": {"displayText":"ipv6 parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6 parser","type":"dfn","url":"#concept-ipv6-parser"}, "#concept-ipv6-piece": {"displayText":"pieces","export":true,"for_":["IPv6 address"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"pieces","type":"dfn","url":"#concept-ipv6-piece"}, "#concept-ipv6-serializer": {"displayText":"ipv6 serializer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6 serializer","type":"dfn","url":"#concept-ipv6-serializer"}, "#concept-opaque-host-parser": {"displayText":"opaque-host parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"opaque-host parser","type":"dfn","url":"#concept-opaque-host-parser"}, "#concept-url": {"displayText":"url","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url","type":"dfn","url":"#concept-url"}, "#concept-url-blob-entry": {"displayText":"blob url entry","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"blob url entry","type":"dfn","url":"#concept-url-blob-entry"}, "#concept-url-equals": {"displayText":"equal","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"equal","type":"dfn","url":"#concept-url-equals"}, "#concept-url-fragment": {"displayText":"fragment","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"fragment","type":"dfn","url":"#concept-url-fragment"}, "#concept-url-host": {"displayText":"host","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host","type":"dfn","url":"#concept-url-host"}, "#concept-url-origin": {"displayText":"origin","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"origin","type":"dfn","url":"#concept-url-origin"}, "#concept-url-parser": {"displayText":"url parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url parser","type":"dfn","url":"#concept-url-parser"}, "#concept-url-password": {"displayText":"password","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"password","type":"dfn","url":"#concept-url-password"}, "#concept-url-path": {"displayText":"path","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path","type":"dfn","url":"#concept-url-path"}, "#concept-url-port": {"displayText":"port","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"port","type":"dfn","url":"#concept-url-port"}, "#concept-url-query": {"displayText":"query","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"query","type":"dfn","url":"#concept-url-query"}, "#concept-url-query-object": {"displayText":"query object","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"query object","type":"dfn","url":"#concept-url-query-object"}, "#concept-url-scheme": {"displayText":"scheme","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme","type":"dfn","url":"#concept-url-scheme"}, "#concept-url-serializer": {"displayText":"url serializer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url serializer","type":"dfn","url":"#concept-url-serializer"}, "#concept-url-url": {"displayText":"url","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url","type":"dfn","url":"#concept-url-url"}, "#concept-url-username": {"displayText":"username","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"username","type":"dfn","url":"#concept-url-username"}, "#concept-urlencoded": {"displayText":"application/x-www-form-urlencoded","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"application/x-www-form-urlencoded","type":"dfn","url":"#concept-urlencoded"}, "#concept-urlencoded-parser": {"displayText":"urlencoded parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"urlencoded parser","type":"dfn","url":"#concept-urlencoded-parser"}, "#concept-urlencoded-serializer": {"displayText":"urlencoded serializer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"urlencoded serializer","type":"dfn","url":"#concept-urlencoded-serializer"}, "#concept-urlencoded-string-parser": {"displayText":"urlencoded string parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"urlencoded string parser","type":"dfn","url":"#concept-urlencoded-string-parser"}, "#concept-urlsearchparams-list": {"displayText":"list","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"list","type":"dfn","url":"#concept-urlsearchparams-list"}, "#concept-urlsearchparams-update": {"displayText":"update","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"update","type":"dfn","url":"#concept-urlsearchparams-update"}, "#concept-urlsearchparams-url-object": {"displayText":"url object","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url object","type":"dfn","url":"#concept-urlsearchparams-url-object"}, "#default-port": {"displayText":"default port","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"default port","type":"dfn","url":"#default-port"}, "#dom-url-canparse": {"displayText":"canParse(url, base)","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"canParse(url, base)","type":"method","url":"#dom-url-canparse"}, "#dom-url-hash": {"displayText":"hash","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"hash","type":"attribute","url":"#dom-url-hash"}, "#dom-url-host": {"displayText":"host","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host","type":"attribute","url":"#dom-url-host"}, "#dom-url-hostname": {"displayText":"hostname","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"hostname","type":"attribute","url":"#dom-url-hostname"}, "#dom-url-href": {"displayText":"href","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"href","type":"attribute","url":"#dom-url-href"}, "#dom-url-origin": {"displayText":"origin","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"origin","type":"attribute","url":"#dom-url-origin"}, "#dom-url-parse": {"displayText":"parse(url, base)","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"parse(url, base)","type":"method","url":"#dom-url-parse"}, "#dom-url-password": {"displayText":"password","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"password","type":"attribute","url":"#dom-url-password"}, "#dom-url-pathname": {"displayText":"pathname","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"pathname","type":"attribute","url":"#dom-url-pathname"}, "#dom-url-port": {"displayText":"port","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"port","type":"attribute","url":"#dom-url-port"}, "#dom-url-protocol": {"displayText":"protocol","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"protocol","type":"attribute","url":"#dom-url-protocol"}, "#dom-url-search": {"displayText":"search","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"search","type":"attribute","url":"#dom-url-search"}, "#dom-url-searchparams": {"displayText":"searchParams","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"searchParams","type":"attribute","url":"#dom-url-searchparams"}, "#dom-url-tojson": {"displayText":"toJSON()","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"toJSON()","type":"method","url":"#dom-url-tojson"}, "#dom-url-url": {"displayText":"URL(url, base)","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"URL(url, base)","type":"constructor","url":"#dom-url-url"}, "#dom-url-username": {"displayText":"username","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"username","type":"attribute","url":"#dom-url-username"}, "#dom-urlsearchparams-append": {"displayText":"append(name, value)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"append(name, value)","type":"method","url":"#dom-urlsearchparams-append"}, "#dom-urlsearchparams-delete": {"displayText":"delete(name, value)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"delete(name, value)","type":"method","url":"#dom-urlsearchparams-delete"}, "#dom-urlsearchparams-get": {"displayText":"get(name)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"get(name)","type":"method","url":"#dom-urlsearchparams-get"}, "#dom-urlsearchparams-getall": {"displayText":"getAll(name)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"getAll(name)","type":"method","url":"#dom-urlsearchparams-getall"}, "#dom-urlsearchparams-has": {"displayText":"has(name, value)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"has(name, value)","type":"method","url":"#dom-urlsearchparams-has"}, "#dom-urlsearchparams-set": {"displayText":"set(name, value)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"set(name, value)","type":"method","url":"#dom-urlsearchparams-set"}, "#dom-urlsearchparams-size": {"displayText":"size","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"size","type":"attribute","url":"#dom-urlsearchparams-size"}, "#dom-urlsearchparams-sort": {"displayText":"sort()","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"sort()","type":"method","url":"#dom-urlsearchparams-sort"}, "#dom-urlsearchparams-urlsearchparams": {"displayText":"URLSearchParams(init)","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"URLSearchParams(init)","type":"constructor","url":"#dom-urlsearchparams-urlsearchparams"}, "#domain-invalid-code-point": {"displayText":"domain-invalid-code-point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain-invalid-code-point","type":"dfn","url":"#domain-invalid-code-point"}, "#domain-label": {"displayText":"domain label","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain label","type":"dfn","url":"#domain-label"}, "#domain-to-unicode": {"displayText":"domain-to-unicode","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain-to-unicode","type":"dfn","url":"#domain-to-unicode"}, "#double-dot-path-segment": {"displayText":"double-dot url path segment","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"double-dot url path segment","type":"dfn","url":"#double-dot-path-segment"}, "#empty-host": {"displayText":"empty host","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"empty host","type":"dfn","url":"#empty-host"}, "#ends-in-a-number-checker": {"displayText":"ends in a number checker","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ends in a number checker","type":"dfn","url":"#ends-in-a-number-checker"}, "#eof-code-point": {"displayText":"eof code point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"eof code point","type":"dfn","url":"#eof-code-point"}, "#file-host-state": {"displayText":"file host state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"file host state","type":"dfn","url":"#file-host-state"}, "#file-invalid-windows-drive-letter": {"displayText":"file-invalid-windows-drive-letter","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"file-invalid-windows-drive-letter","type":"dfn","url":"#file-invalid-windows-drive-letter"}, "#file-invalid-windows-drive-letter-host": {"displayText":"file-invalid-windows-drive-letter-host","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"file-invalid-windows-drive-letter-host","type":"dfn","url":"#file-invalid-windows-drive-letter-host"}, "#file-slash-state": {"displayText":"file slash state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"file slash state","type":"dfn","url":"#file-slash-state"}, "#file-state": {"displayText":"file state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"file state","type":"dfn","url":"#file-state"}, "#find-the-ipv6-address-compressed-piece-index": {"displayText":"find the ipv6 address compressed piece index","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"find the ipv6 address compressed piece index","type":"dfn","url":"#find-the-ipv6-address-compressed-piece-index"}, "#forbidden-domain-code-point": {"displayText":"forbidden domain code point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"forbidden domain code point","type":"dfn","url":"#forbidden-domain-code-point"}, "#forbidden-host-code-point": {"displayText":"forbidden host code point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"forbidden host code point","type":"dfn","url":"#forbidden-host-code-point"}, "#fragment-percent-encode-set": {"displayText":"fragment percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"fragment percent-encode set","type":"dfn","url":"#fragment-percent-encode-set"}, "#fragment-state": {"displayText":"fragment state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"fragment state","type":"dfn","url":"#fragment-state"}, "#host-invalid-code-point": {"displayText":"host-invalid-code-point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host-invalid-code-point","type":"dfn","url":"#host-invalid-code-point"}, "#host-missing": {"displayText":"host-missing","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host-missing","type":"dfn","url":"#host-missing"}, "#host-public-suffix": {"displayText":"public suffix","export":true,"for_":["host"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"public suffix","type":"dfn","url":"#host-public-suffix"}, "#host-registrable-domain": {"displayText":"registrable domain","export":true,"for_":["host"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"registrable domain","type":"dfn","url":"#host-registrable-domain"}, "#host-state": {"displayText":"host state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"host state","type":"dfn","url":"#host-state"}, "#hostname-state": {"displayText":"hostname state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"hostname state","type":"dfn","url":"#hostname-state"}, "#include-credentials": {"displayText":"includes credentials","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"includes credentials","type":"dfn","url":"#include-credentials"}, "#invalid-credentials": {"displayText":"invalid-credentials","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"invalid-credentials","type":"dfn","url":"#invalid-credentials"}, "#invalid-reverse-solidus": {"displayText":"invalid-reverse-solidus","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"invalid-reverse-solidus","type":"dfn","url":"#invalid-reverse-solidus"}, "#invalid-url-unit": {"displayText":"invalid-url-unit","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"invalid-url-unit","type":"dfn","url":"#invalid-url-unit"}, "#ip-address": {"displayText":"ip address","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ip address","type":"dfn","url":"#ip-address"}, "#ipv4-empty-part": {"displayText":"ipv4-empty-part","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-empty-part","type":"dfn","url":"#ipv4-empty-part"}, "#ipv4-in-ipv6-invalid-code-point": {"displayText":"ipv4-in-ipv6-invalid-code-point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-in-ipv6-invalid-code-point","type":"dfn","url":"#ipv4-in-ipv6-invalid-code-point"}, "#ipv4-in-ipv6-out-of-range-part": {"displayText":"ipv4-in-ipv6-out-of-range-part","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-in-ipv6-out-of-range-part","type":"dfn","url":"#ipv4-in-ipv6-out-of-range-part"}, "#ipv4-in-ipv6-too-few-parts": {"displayText":"ipv4-in-ipv6-too-few-parts","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-in-ipv6-too-few-parts","type":"dfn","url":"#ipv4-in-ipv6-too-few-parts"}, "#ipv4-in-ipv6-too-many-pieces": {"displayText":"ipv4-in-ipv6-too-many-pieces","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-in-ipv6-too-many-pieces","type":"dfn","url":"#ipv4-in-ipv6-too-many-pieces"}, "#ipv4-non-decimal-part": {"displayText":"ipv4-non-decimal-part","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-non-decimal-part","type":"dfn","url":"#ipv4-non-decimal-part"}, "#ipv4-non-numeric-part": {"displayText":"ipv4-non-numeric-part","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-non-numeric-part","type":"dfn","url":"#ipv4-non-numeric-part"}, "#ipv4-number-parser": {"displayText":"ipv4 number parser","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4 number parser","type":"dfn","url":"#ipv4-number-parser"}, "#ipv4-out-of-range-part": {"displayText":"ipv4-out-of-range-part","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-out-of-range-part","type":"dfn","url":"#ipv4-out-of-range-part"}, "#ipv4-too-many-parts": {"displayText":"ipv4-too-many-parts","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv4-too-many-parts","type":"dfn","url":"#ipv4-too-many-parts"}, "#ipv6-invalid-code-point": {"displayText":"ipv6-invalid-code-point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-invalid-code-point","type":"dfn","url":"#ipv6-invalid-code-point"}, "#ipv6-invalid-compression": {"displayText":"ipv6-invalid-compression","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-invalid-compression","type":"dfn","url":"#ipv6-invalid-compression"}, "#ipv6-multiple-compression": {"displayText":"ipv6-multiple-compression","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-multiple-compression","type":"dfn","url":"#ipv6-multiple-compression"}, "#ipv6-too-few-pieces": {"displayText":"ipv6-too-few-pieces","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-too-few-pieces","type":"dfn","url":"#ipv6-too-few-pieces"}, "#ipv6-too-many-pieces": {"displayText":"ipv6-too-many-pieces","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-too-many-pieces","type":"dfn","url":"#ipv6-too-many-pieces"}, "#ipv6-unclosed": {"displayText":"ipv6-unclosed","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"ipv6-unclosed","type":"dfn","url":"#ipv6-unclosed"}, "#is-not-special": {"displayText":"is not special","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"is not special","type":"dfn","url":"#is-not-special"}, "#is-special": {"displayText":"is special","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"is special","type":"dfn","url":"#is-special"}, "#missing-scheme-non-relative-url": {"displayText":"missing-scheme-non-relative-url","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"missing-scheme-non-relative-url","type":"dfn","url":"#missing-scheme-non-relative-url"}, "#no-scheme-state": {"displayText":"no scheme state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"no scheme state","type":"dfn","url":"#no-scheme-state"}, "#normalized-windows-drive-letter": {"displayText":"normalized windows drive letter","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"normalized windows drive letter","type":"dfn","url":"#normalized-windows-drive-letter"}, "#opaque-host": {"displayText":"opaque host","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"opaque host","type":"dfn","url":"#opaque-host"}, "#opaque-host-and-port-string": {"displayText":"opaque-host-and-port string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"opaque-host-and-port string","type":"dfn","url":"#opaque-host-and-port-string"}, "#path-absolute-non-windows-file-url-string": {"displayText":"path-absolute-non-windows-file-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path-absolute-non-windows-file-url string","type":"dfn","url":"#path-absolute-non-windows-file-url-string"}, "#path-absolute-url-string": {"displayText":"path-absolute-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path-absolute-url string","type":"dfn","url":"#path-absolute-url-string"}, "#path-or-authority-state": {"displayText":"path or authority state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path or authority state","type":"dfn","url":"#path-or-authority-state"}, "#path-percent-encode-set": {"displayText":"path percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path percent-encode set","type":"dfn","url":"#path-percent-encode-set"}, "#path-relative-scheme-less-url-string": {"displayText":"path-relative-scheme-less-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path-relative-scheme-less-url string","type":"dfn","url":"#path-relative-scheme-less-url-string"}, "#path-relative-url-string": {"displayText":"path-relative-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path-relative-url string","type":"dfn","url":"#path-relative-url-string"}, "#path-start-state": {"displayText":"path start state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path start state","type":"dfn","url":"#path-start-state"}, "#path-state": {"displayText":"path state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"path state","type":"dfn","url":"#path-state"}, "#percent-decode": {"displayText":"percent-decode","export":true,"for_":["byte sequence"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"percent-decode","type":"dfn","url":"#percent-decode"}, "#percent-encode": {"displayText":"percent-encode","export":true,"for_":["byte"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"percent-encode","type":"dfn","url":"#percent-encode"}, "#percent-encoded-byte": {"displayText":"percent-encoded byte","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"percent-encoded byte","type":"dfn","url":"#percent-encoded-byte"}, "#pointer": {"displayText":"pointer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"pointer","type":"dfn","url":"#pointer"}, "#port-invalid": {"displayText":"port-invalid","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"port-invalid","type":"dfn","url":"#port-invalid"}, "#port-out-of-range": {"displayText":"port-out-of-range","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"port-out-of-range","type":"dfn","url":"#port-out-of-range"}, "#port-state": {"displayText":"port state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"port state","type":"dfn","url":"#port-state"}, "#potentially-strip-trailing-spaces-from-an-opaque-path": {"displayText":"potentially strip trailing spaces from an opaque path","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"potentially strip trailing spaces from an opaque path","type":"dfn","url":"#potentially-strip-trailing-spaces-from-an-opaque-path"}, "#query-percent-encode-set": {"displayText":"query percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"query percent-encode set","type":"dfn","url":"#query-percent-encode-set"}, "#query-state": {"displayText":"query state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"query state","type":"dfn","url":"#query-state"}, "#relative-slash-state": {"displayText":"relative slash state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"relative slash state","type":"dfn","url":"#relative-slash-state"}, "#relative-state": {"displayText":"relative state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"relative state","type":"dfn","url":"#relative-state"}, "#relative-url-string": {"displayText":"relative-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"relative-url string","type":"dfn","url":"#relative-url-string"}, "#relative-url-with-fragment-string": {"displayText":"relative-url-with-fragment string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"relative-url-with-fragment string","type":"dfn","url":"#relative-url-with-fragment-string"}, "#remaining": {"displayText":"remaining","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"remaining","type":"dfn","url":"#remaining"}, "#scheme-relative-file-url-string": {"displayText":"scheme-relative-file-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme-relative-file-url string","type":"dfn","url":"#scheme-relative-file-url-string"}, "#scheme-relative-special-url-string": {"displayText":"scheme-relative-special-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme-relative-special-url string","type":"dfn","url":"#scheme-relative-special-url-string"}, "#scheme-relative-url-string": {"displayText":"scheme-relative-url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme-relative-url string","type":"dfn","url":"#scheme-relative-url-string"}, "#scheme-start-state": {"displayText":"scheme start state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme start state","type":"dfn","url":"#scheme-start-state"}, "#scheme-state": {"displayText":"scheme state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"scheme state","type":"dfn","url":"#scheme-state"}, "#serialize-an-integer": {"displayText":"serialize an integer","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"serialize an integer","type":"dfn","url":"#serialize-an-integer"}, "#set-the-password": {"displayText":"set the password","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"set the password","type":"dfn","url":"#set-the-password"}, "#set-the-username": {"displayText":"set the username","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"set the username","type":"dfn","url":"#set-the-username"}, "#shorten-a-urls-path": {"displayText":"shorten","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"shorten","type":"dfn","url":"#shorten-a-urls-path"}, "#single-dot-path-segment": {"displayText":"single-dot url path segment","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"single-dot url path segment","type":"dfn","url":"#single-dot-path-segment"}, "#special-authority-ignore-slashes-state": {"displayText":"special authority ignore slashes state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special authority ignore slashes state","type":"dfn","url":"#special-authority-ignore-slashes-state"}, "#special-authority-slashes-state": {"displayText":"special authority slashes state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special authority slashes state","type":"dfn","url":"#special-authority-slashes-state"}, "#special-query-percent-encode-set": {"displayText":"special-query percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special-query percent-encode set","type":"dfn","url":"#special-query-percent-encode-set"}, "#special-relative-or-authority-state": {"displayText":"special relative or authority state","export":true,"for_":["basic URL parser"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special relative or authority state","type":"dfn","url":"#special-relative-or-authority-state"}, "#special-scheme": {"displayText":"special scheme","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special scheme","type":"dfn","url":"#special-scheme"}, "#special-scheme-missing-following-solidus": {"displayText":"special-scheme-missing-following-solidus","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"special-scheme-missing-following-solidus","type":"dfn","url":"#special-scheme-missing-following-solidus"}, "#start-with-a-windows-drive-letter": {"displayText":"starts with a windows drive letter","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"starts with a windows drive letter","type":"dfn","url":"#start-with-a-windows-drive-letter"}, "#string-percent-decode": {"displayText":"percent-decode","export":true,"for_":["string"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"percent-decode","type":"dfn","url":"#string-percent-decode"}, "#string-percent-encode-after-encoding": {"displayText":"percent-encode after encoding","export":true,"for_":["string"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"percent-encode after encoding","type":"dfn","url":"#string-percent-encode-after-encoding"}, "#string-utf-8-percent-encode": {"displayText":"utf-8 percent-encode","export":true,"for_":["string"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"utf-8 percent-encode","type":"dfn","url":"#string-utf-8-percent-encode"}, "#url": {"displayText":"URL","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"URL","type":"interface","url":"#url"}, "#url-code-points": {"displayText":"url code point","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url code point","type":"dfn","url":"#url-code-points"}, "#url-fragment-string": {"displayText":"url-fragment string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url-fragment string","type":"dfn","url":"#url-fragment-string"}, "#url-initialize": {"displayText":"initialize","export":true,"for_":["URL"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"initialize","type":"dfn","url":"#url-initialize"}, "#url-opaque-path": {"displayText":"opaque path","export":true,"for_":["url"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"opaque path","type":"dfn","url":"#url-opaque-path"}, "#url-path": {"displayText":"url path","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url path","type":"dfn","url":"#url-path"}, "#url-path-segment": {"displayText":"url path segment","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url path segment","type":"dfn","url":"#url-path-segment"}, "#url-path-segment-string": {"displayText":"url-path-segment string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url-path-segment string","type":"dfn","url":"#url-path-segment-string"}, "#url-path-serializer": {"displayText":"url path serializing","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url path serializing","type":"dfn","url":"#url-path-serializer"}, "#url-port-string": {"displayText":"url-port string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url-port string","type":"dfn","url":"#url-port-string"}, "#url-query-string": {"displayText":"url-query string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url-query string","type":"dfn","url":"#url-query-string"}, "#url-scheme-string": {"displayText":"url-scheme string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url-scheme string","type":"dfn","url":"#url-scheme-string"}, "#url-serializer-exclude-fragment": {"displayText":"exclude fragment","export":true,"for_":["URL serializer"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"exclude fragment","type":"dfn","url":"#url-serializer-exclude-fragment"}, "#url-units": {"displayText":"url units","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"url units","type":"dfn","url":"#url-units"}, "#urlsearchparams": {"displayText":"URLSearchParams","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"URLSearchParams","type":"interface","url":"#urlsearchparams"}, "#urlsearchparams-initialize": {"displayText":"initialize","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"initialize","type":"dfn","url":"#urlsearchparams-initialize"}, "#urlsearchparams-stringification-behavior": {"displayText":"stringification behavior","export":true,"for_":["URLSearchParams"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"stringification behavior","type":"dfn","url":"#urlsearchparams-stringification-behavior"}, "#userinfo-percent-encode-set": {"displayText":"userinfo percent-encode set","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"userinfo percent-encode set","type":"dfn","url":"#userinfo-percent-encode-set"}, "#utf-8-percent-encode": {"displayText":"utf-8 percent-encode","export":true,"for_":["code point"],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"utf-8 percent-encode","type":"dfn","url":"#utf-8-percent-encode"}, "#valid-domain": {"displayText":"valid domain","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid domain","type":"dfn","url":"#valid-domain"}, "#valid-domain-string": {"displayText":"valid domain string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid domain string","type":"dfn","url":"#valid-domain-string"}, "#valid-host-string": {"displayText":"valid host string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid host string","type":"dfn","url":"#valid-host-string"}, "#valid-ipv4-address-string": {"displayText":"valid ipv4-address string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid ipv4-address string","type":"dfn","url":"#valid-ipv4-address-string"}, "#valid-ipv6-address-string": {"displayText":"valid ipv6-address string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid ipv6-address string","type":"dfn","url":"#valid-ipv6-address-string"}, "#valid-opaque-host-string": {"displayText":"valid opaque-host string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid opaque-host string","type":"dfn","url":"#valid-opaque-host-string"}, "#valid-url-string": {"displayText":"valid url string","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"valid url string","type":"dfn","url":"#valid-url-string"}, "#validation-error": {"displayText":"validation error","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"validation error","type":"dfn","url":"#validation-error"}, "#validation-error-domain-to-ascii": {"displayText":"domain-to-ascii","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"domain-to-ascii","type":"dfn","url":"#validation-error-domain-to-ascii"}, "#windows-drive-letter": {"displayText":"windows drive letter","export":true,"for_":[],"level":"","normative":true,"shortname":"url","spec":"url","status":"local","text":"windows drive letter","type":"dfn","url":"#windows-drive-letter"}, "https://encoding.spec.whatwg.org/#concept-stream": {"displayText":"I/O queue","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"i/o queue","type":"dfn","url":"https://encoding.spec.whatwg.org/#concept-stream"}, "https://encoding.spec.whatwg.org/#encode-or-fail": {"displayText":"encode or fail","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"encode or fail","type":"dfn","url":"https://encoding.spec.whatwg.org/#encode-or-fail"}, "https://encoding.spec.whatwg.org/#encoding": {"displayText":"encoding","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"encoding","type":"dfn","url":"https://encoding.spec.whatwg.org/#encoding"}, "https://encoding.spec.whatwg.org/#get-an-encoder": {"displayText":"getting an encoder","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"getting an encoder","type":"dfn","url":"https://encoding.spec.whatwg.org/#get-an-encoder"}, "https://encoding.spec.whatwg.org/#get-an-output-encoding": {"displayText":"get an output encoding","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"get an output encoding","type":"dfn","url":"https://encoding.spec.whatwg.org/#get-an-output-encoding"}, "https://encoding.spec.whatwg.org/#iso-2022-jp": {"displayText":"ISO-2022-JP","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"iso-2022-jp","type":"dfn","url":"https://encoding.spec.whatwg.org/#iso-2022-jp"}, "https://encoding.spec.whatwg.org/#iso-2022-jp-encoder": {"displayText":"ISO-2022-JP encoder","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"iso-2022-jp encoder","type":"dfn","url":"https://encoding.spec.whatwg.org/#iso-2022-jp-encoder"}, "https://encoding.spec.whatwg.org/#shift_jis": {"displayText":"Shift_JIS","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"shift_jis","type":"dfn","url":"https://encoding.spec.whatwg.org/#shift_jis"}, "https://encoding.spec.whatwg.org/#utf-8": {"displayText":"UTF-8","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"utf-8","type":"dfn","url":"https://encoding.spec.whatwg.org/#utf-8"}, "https://encoding.spec.whatwg.org/#utf-8-decode-without-bom": {"displayText":"UTF-8 decode without BOM","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"utf-8 decode without bom","type":"dfn","url":"https://encoding.spec.whatwg.org/#utf-8-decode-without-bom"}, "https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail": {"displayText":"UTF-8 decode without BOM or fail","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"utf-8 decode without bom or fail","type":"dfn","url":"https://encoding.spec.whatwg.org/#utf-8-decode-without-bom-or-fail"}, "https://encoding.spec.whatwg.org/#utf-8-encode": {"displayText":"UTF-8 encode","export":true,"for_":[],"level":"1","normative":true,"shortname":"encoding","spec":"encoding","status":"current","text":"utf-8 encode","type":"dfn","url":"https://encoding.spec.whatwg.org/#utf-8-encode"}, "https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin": {"displayText":"serialization of an origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"serialization of an origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#ascii-serialisation-of-an-origin"}, "https://html.spec.whatwg.org/multipage/browsers.html#concept-origin": {"displayText":"origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin"}, "https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque": {"displayText":"opaque origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"opaque origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-opaque"}, "https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-tuple": {"displayText":"tuple origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"tuple origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#concept-origin-tuple"}, "https://html.spec.whatwg.org/multipage/browsers.html#same-origin": {"displayText":"same origin","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"same origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#same-origin"}, "https://html.spec.whatwg.org/multipage/browsers.html#same-site": {"displayText":"same site","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"same site","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#same-site"}, "https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site": {"displayText":"schemelessly same site","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"schemelessly same site","type":"dfn","url":"https://html.spec.whatwg.org/multipage/browsers.html#schemelessly-same-site"}, "https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-protocol": {"displayText":"protocol","export":true,"for_":["Location"],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"protocol","type":"attribute","url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location-protocol"}, "https://html.spec.whatwg.org/multipage/nav-history-apis.html#hashchangeevent": {"displayText":"HashChangeEvent","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"HashChangeEvent","type":"interface","url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#hashchangeevent"}, "https://html.spec.whatwg.org/multipage/nav-history-apis.html#location": {"displayText":"Location","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"Location","type":"interface","url":"https://html.spec.whatwg.org/multipage/nav-history-apis.html#location"}, "https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource": {"displayText":"EventSource","export":true,"for_":[],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"EventSource","type":"interface","url":"https://html.spec.whatwg.org/multipage/server-sent-events.html#eventsource"}, "https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-registerprotocolhandler": {"displayText":"registerProtocolHandler(scheme, url)","export":true,"for_":["NavigatorContentUtils"],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"registerProtocolHandler(scheme, url)","type":"method","url":"https://html.spec.whatwg.org/multipage/system-state.html#dom-navigator-registerprotocolhandler"}, "https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin": {"displayText":"origin","export":true,"for_":["environment settings object"],"level":"1","normative":true,"shortname":"html","spec":"html","status":"current","text":"origin","type":"dfn","url":"https://html.spec.whatwg.org/multipage/webappapis.html#concept-settings-object-origin"}, "https://infra.spec.whatwg.org/#128-bit-unsigned-integer": {"displayText":"128-bit unsigned integer","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"128-bit unsigned integer","type":"dfn","url":"https://infra.spec.whatwg.org/#128-bit-unsigned-integer"}, "https://infra.spec.whatwg.org/#16-bit-unsigned-integer": {"displayText":"16-bit unsigned integer","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"16-bit unsigned integer","type":"dfn","url":"https://infra.spec.whatwg.org/#16-bit-unsigned-integer"}, "https://infra.spec.whatwg.org/#32-bit-unsigned-integer": {"displayText":"32-bit unsigned integer","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"32-bit unsigned integer","type":"dfn","url":"https://infra.spec.whatwg.org/#32-bit-unsigned-integer"}, "https://infra.spec.whatwg.org/#ascii-alpha": {"displayText":"ASCII alpha","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii alpha","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-alpha"}, "https://infra.spec.whatwg.org/#ascii-alphanumeric": {"displayText":"ASCII alphanumeric","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii alphanumeric","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-alphanumeric"}, "https://infra.spec.whatwg.org/#ascii-byte": {"displayText":"ASCII byte","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii byte","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-byte"}, "https://infra.spec.whatwg.org/#ascii-case-insensitive": {"displayText":"ASCII case-insensitive","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii case-insensitive","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-case-insensitive"}, "https://infra.spec.whatwg.org/#ascii-code-point": {"displayText":"ASCII code point","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii code point","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-code-point"}, "https://infra.spec.whatwg.org/#ascii-digit": {"displayText":"ASCII digit","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii digit","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-digit"}, "https://infra.spec.whatwg.org/#ascii-hex-digit": {"displayText":"ASCII hex digit","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii hex digit","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-hex-digit"}, "https://infra.spec.whatwg.org/#ascii-lowercase": {"displayText":"ASCII lowercase","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii lowercase","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-lowercase"}, "https://infra.spec.whatwg.org/#ascii-string": {"displayText":"ASCII string","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii string","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-string"}, "https://infra.spec.whatwg.org/#ascii-tab-or-newline": {"displayText":"ASCII tab or newline","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii tab or newline","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-tab-or-newline"}, "https://infra.spec.whatwg.org/#ascii-upper-hex-digit": {"displayText":"ASCII upper hex digit","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ascii upper hex digit","type":"dfn","url":"https://infra.spec.whatwg.org/#ascii-upper-hex-digit"}, "https://infra.spec.whatwg.org/#assert": {"displayText":"assert","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"assert","type":"dfn","url":"https://infra.spec.whatwg.org/#assert"}, "https://infra.spec.whatwg.org/#byte": {"displayText":"byte","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"byte","type":"dfn","url":"https://infra.spec.whatwg.org/#byte"}, "https://infra.spec.whatwg.org/#byte-sequence": {"displayText":"byte sequence","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"byte sequence","type":"dfn","url":"https://infra.spec.whatwg.org/#byte-sequence"}, "https://infra.spec.whatwg.org/#byte-value": {"displayText":"value","export":true,"for_":["byte"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"value","type":"dfn","url":"https://infra.spec.whatwg.org/#byte-value"}, "https://infra.spec.whatwg.org/#c0-control": {"displayText":"c0 control","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"c0 control","type":"dfn","url":"https://infra.spec.whatwg.org/#c0-control"}, "https://infra.spec.whatwg.org/#c0-control-or-space": {"displayText":"c0 control or space","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"c0 control or space","type":"dfn","url":"https://infra.spec.whatwg.org/#c0-control-or-space"}, "https://infra.spec.whatwg.org/#code-point": {"displayText":"code point","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"code point","type":"dfn","url":"https://infra.spec.whatwg.org/#code-point"}, "https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string": {"displayText":"code point substring to the end of the string","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"code point substring to the end of the string","type":"dfn","url":"https://infra.spec.whatwg.org/#code-point-substring-to-the-end-of-the-string"}, "https://infra.spec.whatwg.org/#code-point-value": {"displayText":"value","export":true,"for_":["code point"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"value","type":"dfn","url":"https://infra.spec.whatwg.org/#code-point-value"}, "https://infra.spec.whatwg.org/#isomorphic-decode": {"displayText":"isomorphic decode","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"isomorphic decode","type":"dfn","url":"https://infra.spec.whatwg.org/#isomorphic-decode"}, "https://infra.spec.whatwg.org/#iteration-break": {"displayText":"break","export":true,"for_":["iteration"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"break","type":"dfn","url":"https://infra.spec.whatwg.org/#iteration-break"}, "https://infra.spec.whatwg.org/#iteration-continue": {"displayText":"continue","export":true,"for_":["iteration"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"continue","type":"dfn","url":"https://infra.spec.whatwg.org/#iteration-continue"}, "https://infra.spec.whatwg.org/#list": {"displayText":"list","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"list","type":"dfn","url":"https://infra.spec.whatwg.org/#list"}, "https://infra.spec.whatwg.org/#list-append": {"displayText":"append","export":true,"for_":["list"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"append","type":"dfn","url":"https://infra.spec.whatwg.org/#list-append"}, "https://infra.spec.whatwg.org/#list-clone": {"displayText":"clone","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"clone","type":"dfn","url":"https://infra.spec.whatwg.org/#list-clone"}, "https://infra.spec.whatwg.org/#list-contain": {"displayText":"contain","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"contain","type":"dfn","url":"https://infra.spec.whatwg.org/#list-contain"}, "https://infra.spec.whatwg.org/#list-empty": {"displayText":"empty","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"empty","type":"dfn","url":"https://infra.spec.whatwg.org/#list-empty"}, "https://infra.spec.whatwg.org/#list-get-the-indices": {"displayText":"indices","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"indices","type":"dfn","url":"https://infra.spec.whatwg.org/#list-get-the-indices"}, "https://infra.spec.whatwg.org/#list-is-empty": {"displayText":"is empty","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"is empty","type":"dfn","url":"https://infra.spec.whatwg.org/#list-is-empty"}, "https://infra.spec.whatwg.org/#list-item": {"displayText":"item","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"item","type":"dfn","url":"https://infra.spec.whatwg.org/#list-item"}, "https://infra.spec.whatwg.org/#list-iterate": {"displayText":"for each","export":true,"for_":["list","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"for each","type":"dfn","url":"https://infra.spec.whatwg.org/#list-iterate"}, "https://infra.spec.whatwg.org/#list-remove": {"displayText":"remove","export":true,"for_":["list","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"remove","type":"dfn","url":"https://infra.spec.whatwg.org/#list-remove"}, "https://infra.spec.whatwg.org/#list-size": {"displayText":"size","export":true,"for_":["list","stack","queue","set"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"size","type":"dfn","url":"https://infra.spec.whatwg.org/#list-size"}, "https://infra.spec.whatwg.org/#map-iterate": {"displayText":"for each","export":true,"for_":["map"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"for each","type":"dfn","url":"https://infra.spec.whatwg.org/#map-iterate"}, "https://infra.spec.whatwg.org/#noncharacter": {"displayText":"noncharacter","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"noncharacter","type":"dfn","url":"https://infra.spec.whatwg.org/#noncharacter"}, "https://infra.spec.whatwg.org/#scalar-value": {"displayText":"scalar value","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"scalar value","type":"dfn","url":"https://infra.spec.whatwg.org/#scalar-value"}, "https://infra.spec.whatwg.org/#scalar-value-string": {"displayText":"scalar value string","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"scalar value string","type":"dfn","url":"https://infra.spec.whatwg.org/#scalar-value-string"}, "https://infra.spec.whatwg.org/#strictly-split": {"displayText":"strictly split","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"strictly split","type":"dfn","url":"https://infra.spec.whatwg.org/#strictly-split"}, "https://infra.spec.whatwg.org/#string": {"displayText":"string","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"string","type":"dfn","url":"https://infra.spec.whatwg.org/#string"}, "https://infra.spec.whatwg.org/#string-code-point-length": {"displayText":"code point length","export":true,"for_":["string","JavaScript string","ASCII string","isomorphic string","scalar value string"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"code point length","type":"dfn","url":"https://infra.spec.whatwg.org/#string-code-point-length"}, "https://infra.spec.whatwg.org/#string-ends-with": {"displayText":"ends with","export":true,"for_":["string"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"ends with","type":"dfn","url":"https://infra.spec.whatwg.org/#string-ends-with"}, "https://infra.spec.whatwg.org/#string-length": {"displayText":"length","export":true,"for_":["string","JavaScript string","ASCII string","isomorphic string","scalar value string"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"length","type":"dfn","url":"https://infra.spec.whatwg.org/#string-length"}, "https://infra.spec.whatwg.org/#string-starts-with": {"displayText":"starts with","export":true,"for_":["string"],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"starts with","type":"dfn","url":"https://infra.spec.whatwg.org/#string-starts-with"}, "https://infra.spec.whatwg.org/#struct": {"displayText":"struct","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"struct","type":"dfn","url":"https://infra.spec.whatwg.org/#struct"}, "https://infra.spec.whatwg.org/#surrogate": {"displayText":"surrogate","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"surrogate","type":"dfn","url":"https://infra.spec.whatwg.org/#surrogate"}, "https://infra.spec.whatwg.org/#tuple": {"displayText":"tuple","export":true,"for_":[],"level":"1","normative":true,"shortname":"infra","spec":"infra","status":"current","text":"tuple","type":"dfn","url":"https://infra.spec.whatwg.org/#tuple"}, "https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent": {"displayText":"\"encodeURIComponent() [sic]\"","export":true,"for_":[],"level":"262","normative":true,"shortname":"ecma","spec":"ecma-262","status":"anchor-block","text":"\"encodeURIComponent() [sic]\"","type":"method","url":"https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent"}, "https://w3c.github.io/FileAPI/#BlobURLStore": {"displayText":"blob URL store","export":true,"for_":[],"level":"1","normative":true,"shortname":"fileapi","spec":"fileapi","status":"current","text":"blob url store","type":"dfn","url":"https://w3c.github.io/FileAPI/#BlobURLStore"}, "https://w3c.github.io/FileAPI/#blob-url-entry": {"displayText":"blob URL entry","export":true,"for_":[],"level":"1","normative":true,"shortname":"fileapi","spec":"fileapi","status":"current","text":"blob url entry","type":"dfn","url":"https://w3c.github.io/FileAPI/#blob-url-entry"}, "https://w3c.github.io/FileAPI/#blob-url-entry-environment": {"displayText":"environment","export":true,"for_":["blob URL entry"],"level":"1","normative":true,"shortname":"fileapi","spec":"fileapi","status":"current","text":"environment","type":"dfn","url":"https://w3c.github.io/FileAPI/#blob-url-entry-environment"}, "https://w3c.github.io/FileAPI/#blob-url-resolve": {"displayText":"resolve a blob URL","export":true,"for_":[],"level":"1","normative":true,"shortname":"fileapi","spec":"fileapi","status":"current","text":"resolve a blob url","type":"dfn","url":"https://w3c.github.io/FileAPI/#blob-url-resolve"}, "https://webidl.spec.whatwg.org/#LegacyWindowAlias": {"displayText":"LegacyWindowAlias","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"LegacyWindowAlias","type":"extended-attribute","url":"https://webidl.spec.whatwg.org/#LegacyWindowAlias"}, "https://webidl.spec.whatwg.org/#SameObject": {"displayText":"SameObject","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"SameObject","type":"extended-attribute","url":"https://webidl.spec.whatwg.org/#SameObject"}, "https://webidl.spec.whatwg.org/#dfn-throw": {"displayText":"throw","export":true,"for_":["exception"],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"throw","type":"dfn","url":"https://webidl.spec.whatwg.org/#dfn-throw"}, "https://webidl.spec.whatwg.org/#dfn-value-pairs-to-iterate-over": {"displayText":"value pairs to iterate over","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"value pairs to iterate over","type":"dfn","url":"https://webidl.spec.whatwg.org/#dfn-value-pairs-to-iterate-over"}, "https://webidl.spec.whatwg.org/#exceptiondef-typeerror": {"displayText":"TypeError","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"TypeError","type":"exception","url":"https://webidl.spec.whatwg.org/#exceptiondef-typeerror"}, "https://webidl.spec.whatwg.org/#idl-USVString": {"displayText":"USVString","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"USVString","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-USVString"}, "https://webidl.spec.whatwg.org/#idl-boolean": {"displayText":"boolean","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"boolean","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-boolean"}, "https://webidl.spec.whatwg.org/#idl-record": {"displayText":"record","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"record","type":"dfn","url":"https://webidl.spec.whatwg.org/#idl-record"}, "https://webidl.spec.whatwg.org/#idl-sequence": {"displayText":"sequence","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"sequence","type":"dfn","url":"https://webidl.spec.whatwg.org/#idl-sequence"}, "https://webidl.spec.whatwg.org/#idl-undefined": {"displayText":"undefined","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"undefined","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-undefined"}, "https://webidl.spec.whatwg.org/#idl-unsigned-long": {"displayText":"unsigned long","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"unsigned long","type":"interface","url":"https://webidl.spec.whatwg.org/#idl-unsigned-long"}, "https://webidl.spec.whatwg.org/#this": {"displayText":"this","export":true,"for_":[],"level":"1","normative":true,"shortname":"webidl","spec":"webidl","status":"current","text":"this","type":"dfn","url":"https://webidl.spec.whatwg.org/#this"}, "https://www.unicode.org/reports/tr46/#ToASCII": {"displayText":"ToASCII","export":true,"for_":[],"level":"","normative":true,"shortname":"uts46","spec":"uts46","status":"anchor-block","text":"ToASCII","type":"abstract-op","url":"https://www.unicode.org/reports/tr46/#ToASCII"}, "https://www.unicode.org/reports/tr46/#ToUnicode": {"displayText":"ToUnicode","export":true,"for_":[],"level":"","normative":true,"shortname":"uts46","spec":"uts46","status":"anchor-block","text":"ToUnicode","type":"abstract-op","url":"https://www.unicode.org/reports/tr46/#ToUnicode"}, }; function mkRefHint(link, ref) { const linkText = link.textContent; let dfnTextElements = ''; if (ref.displayText.toLowerCase() != linkText.toLowerCase()) { // Give the original term if it's being displayed in a different way. // But allow casing differences, they're insignificant. dfnTextElements = mk.li({}, mk.b({}, "Term: "), mk.span({}, ref.displayText) ); } const forList = ref.for_; let forListElements; if(forList.length == 0) { forListElements = []; } else if(forList.length == 1) { forListElements = mk.li({}, mk.b({}, "For: "), mk.span({}, forList[0]), ); } else { forListElements = mk.li({}, mk.b({}, "For: "), mk.ul({}, ...forList.map(forItem => mk.li({}, mk.span({}, forItem) ), ), ), ); } const url = ref.url; const safeUrl = encodeURIComponent(url); const hintPanel = mk.aside({ class: "ref-hint", id: `ref-hint-for-${safeUrl}`, "data-for": url, "aria-labelled-by": `ref-hint-for-${safeUrl}`, }, mk.ul({}, dfnTextElements, mk.li({}, mk.b({}, "URL: "), mk.a({ href: url, class: "ref" }, url), ), mk.li({}, mk.b({}, "Type: "), mk.span({}, `${ref.type}`), ), mk.li({}, mk.b({}, "Spec: "), mk.span({}, `${ref.spec ? ref.spec : ''}`), ), forListElements ), ); hintPanel.forLink = link; setupRefHintEventListeners(link, hintPanel); return hintPanel; } function hideAllRefHints() { queryAll(".ref-hint").forEach(el=>hideRefHint(el)); } function hideRefHint(refHint) { const link = refHint.forLink; link.setAttribute("aria-expanded", "false"); if(refHint.teardownEventListeners) { refHint.teardownEventListeners(); } refHint.remove(); } function showRefHint(link) { if(link.classList.contains("dfn-link")) return; const url = link.getAttribute("href"); const ref = refsData[url]; if(!ref) return; hideAllRefHints(); // Only display one at this time. const refHint = mkRefHint(link, ref); append(document.body, refHint); link.setAttribute("aria-expanded", "true"); positionRefHint(refHint); } function setupRefHintEventListeners(link, refHint) { if (refHint.teardownEventListeners) return; // Add event handlers to hide the refHint after the user moves away // from both the link and refHint, if not hovering either within one second. let timeout = null; const startHidingRefHint = (event) => { if (timeout) { clearTimeout(timeout); } timeout = setTimeout(() => { hideRefHint(refHint); }, 1000); } const resetHidingRefHint = (event) => { if (timeout) clearTimeout(timeout); timeout = null; }; link.addEventListener("mouseleave", startHidingRefHint); link.addEventListener("mouseenter", resetHidingRefHint); link.addEventListener("blur", startHidingRefHint); link.addEventListener("focus", resetHidingRefHint); refHint.addEventListener("mouseleave", startHidingRefHint); refHint.addEventListener("mouseenter", resetHidingRefHint); refHint.addEventListener("blur", startHidingRefHint); refHint.addEventListener("focus", resetHidingRefHint); refHint.teardownEventListeners = () => { // remove event listeners resetHidingRefHint(); link.removeEventListener("mouseleave", startHidingRefHint); link.removeEventListener("mouseenter", resetHidingRefHint); link.removeEventListener("blur", startHidingRefHint); link.removeEventListener("focus", resetHidingRefHint); refHint.removeEventListener("mouseleave", startHidingRefHint); refHint.removeEventListener("mouseenter", resetHidingRefHint); refHint.removeEventListener("blur", startHidingRefHint); refHint.removeEventListener("focus", resetHidingRefHint); }; } function positionRefHint(refHint) { const link = refHint.forLink; const linkPos = getBounds(link); refHint.style.top = linkPos.bottom + "px"; refHint.style.left = linkPos.left + "px"; const panelPos = refHint.getBoundingClientRect(); const panelMargin = 8; const maxRight = document.body.parentNode.clientWidth - panelMargin; if (panelPos.right > maxRight) { const overflowAmount = panelPos.right - maxRight; const newLeft = Math.max(panelMargin, linkPos.left - overflowAmount); refHint.style.left = newLeft + "px"; } } // TODO: shared util // Returns the root-level absolute position {left and top} of element. function getBounds(el, relativeTo=document.body) { const relativeRect = relativeTo.getBoundingClientRect(); const elRect = el.getBoundingClientRect(); const top = elRect.top - relativeRect.top; const left = elRect.left - relativeRect.left; return { top, left, bottom: top + elRect.height, right: left + elRect.width, } } function showRefHintListener(e) { // If the target isn't in a link (or is a link), // just ignore it. let link = e.target.closest("a"); if(!link) return; // If the target is in a ref-hint panel // (aka a link in the already-open one), // also just ignore it. if(link.closest(".ref-hint")) return; // Otherwise, show the panel for the link. showRefHint(link); } function hideAllHintsListener(e) { // If the click is inside a ref-hint panel, ignore it. if(e.target.closest(".ref-hint")) return; // Otherwise, close all the current panels. hideAllRefHints(); } document.addEventListener("DOMContentLoaded", () => { document.body.addEventListener("mousedown", showRefHintListener); document.body.addEventListener("focus", showRefHintListener); document.body.addEventListener("click", hideAllHintsListener); }); window.addEventListener("resize", () => { // Hide any open ref hint. hideAllRefHints(); }); } </script> <script>/* Boilerplate: script-var-click-highlighting */ "use strict"; { /* Color-choosing design: * Colors are ordered by goodness. * On clicking a var, give it the earliest color with the lowest usage in the algorithm. * On re-clicking, re-use the var's most recent color if that's not currently being used elsewhere. */ const COLOR_COUNT = 7; document.addEventListener("click", e=>{ if(e.target.nodeName == "VAR") { highlightSameAlgoVars(e.target); } }); function highlightSameAlgoVars(v) { // Find the algorithm container. let algoContainer = findAlgoContainer(v); // Not highlighting document-global vars, // too likely to be unrelated. if(algoContainer == null) return; const varName = nameFromVar(v); if(!v.hasAttribute("data-var-color")) { const newColor = chooseHighlightColor(algoContainer, v); for(const el of algoContainer.querySelectorAll("var")) { if(nameFromVar(el) == varName) { el.setAttribute("data-var-color", newColor); el.setAttribute("data-var-last-color", newColor); } } } else { for(const el of algoContainer.querySelectorAll("var")) { if(nameFromVar(el) == varName) { el.removeAttribute("data-var-color"); } } } } function findAlgoContainer(el) { while(el != document.body) { if(el.hasAttribute("data-algorithm")) return el; el = el.parentNode; } return null; } function nameFromVar(el) { return el.textContent.replace(/(\s|\xa0)+/g, " ").trim(); } function colorCountsFromContainer(container) { const namesFromColor = Array.from({length:COLOR_COUNT}, x=>new Set()); for(let v of container.querySelectorAll("var[data-var-color]")) { let color = +v.getAttribute("data-var-color"); namesFromColor[color].add(nameFromVar(v)); } return namesFromColor.map(x=>x.size); } function leastUsedColor(colors) { // Find the earliest color with the lowest count. let minCount = Infinity; let minColor = null; for(var i = 0; i < colors.length; i++) { if(colors[i] < minCount) { minColor = i; minCount = colors[i]; } } return minColor; } function chooseHighlightColor(container, v) { const colorCounts = colorCountsFromContainer(container); if(v.hasAttribute("data-var-last-color")) { let color = +v.getAttribute("data-var-last-color"); if(colorCounts[color] == 0) return color; } return leastUsedColor(colorCounts); } } </script>

Pages: 1 2 3 4 5 6 7 8 9 10