[html5] r7710 - [e] (0) Integrate with URL standard. Fixing https://www.w3.org/Bugs/Public/show_ [...]

whatwg at whatwg.org whatwg at whatwg.org
Fri Feb 8 18:07:31 PST 2013


Author: ianh
Date: 2013-02-08 18:07:29 -0800 (Fri, 08 Feb 2013)
New Revision: 7710

Modified:
   complete.html
   index
   source
Log:
[e] (0) Integrate with URL standard.
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=20072
Affected topics: DOM APIs, HTML, HTML Syntax and Parsing, Offline Web Applications, Security, Video and Audio, Workers

Modified: complete.html
===================================================================
--- complete.html	2013-02-08 07:06:47 UTC (rev 7709)
+++ complete.html	2013-02-09 02:07:29 UTC (rev 7710)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 8 February 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 9 February 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -358,12 +358,8 @@
    <li><a href=#urls><span class=secno>2.5 </span>URLs</a>
     <ol>
      <li><a href=#terminology-0><span class=secno>2.5.1 </span>Terminology</a></li>
-     <li><a href=#parsing-urls><span class=secno>2.5.2 </span>Parsing URLs</a></li>
-     <li><a href=#base-urls><span class=secno>2.5.3 </span>Base URLs</a></li>
-     <li><a href=#resolving-urls><span class=secno>2.5.4 </span>Resolving URLs</a></li>
-     <li><a href=#url-manipulation-and-creation><span class=secno>2.5.5 </span>URL manipulation and creation</a></li>
-     <li><a href=#dynamic-changes-to-base-urls><span class=secno>2.5.6 </span>Dynamic changes to base URLs</a></li>
-     <li><a href=#interfaces-for-url-manipulation><span class=secno>2.5.7 </span>Interfaces for URL manipulation</a></ol></li>
+     <li><a href=#resolving-urls><span class=secno>2.5.2 </span>Resolving URLs</a></li>
+     <li><a href=#dynamic-changes-to-base-urls><span class=secno>2.5.3 </span>Dynamic changes to base URLs</a></ol></li>
    <li><a href=#fetching-resources><span class=secno>2.6 </span>Fetching resources</a>
     <ol>
      <li><a href=#terminology-1><span class=secno>2.6.1 </span>Terminology</a></li>
@@ -2000,7 +1996,7 @@
 
   <pre>var a = <a href=#document title=Document>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
 a.<a href=#dom-a-href title=dom-a-href>href</a> = 'sample.html'; // change the destination URL of the link
-a.<a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
+a.<a href=#dom-url-protocol title=dom-url-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
 a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
 
   <p>Since DOM trees are used as the way to represent HTML documents when they are processed and
@@ -2848,8 +2844,8 @@
   compression format used was not supported, even if the implementation could determine the
   dimensions of the movie from the file's metadata.</p>
 
-  <p>What some specifications, in particular the HTTP and URI specifications, refer to as a
-  <i>representation</i> is referred to in this specification as a <dfn title="">resource</dfn>. <a href=#refsHTTP>[HTTP]</a> <a href=#refsRFC3986>[RFC3986]</a></p>
+  <p>What some specifications, in particular the HTTP specification, refer to as a
+  <i>representation</i> is referred to in this specification as a <dfn title="">resource</dfn>. <a href=#refsHTTP>[HTTP]</a></p>
 
   <p>The term <dfn id=mime-type>MIME type</dfn> is used to refer to what is sometimes called an <i>Internet media
   type</i> in protocol literature. The term <i>media type</i> in this specification is used to refer
@@ -3408,15 +3404,40 @@
    </dd>
 
 
-   <dt>URIs, IRIs, IDNA</dt>
+   <dt>URLs</dt>
 
    <dd>
 
-    <p>Implementations must support the semantics of <a href=#url title=URL>URLs</a> defined in the
-    URI and IRI specifications, as well as the semantics of IDNA domain names defined in the
-    <cite>Internationalizing Domain Names in Applications (IDNA)</cite> specification. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a> <a href=#refsRFC3490>[RFC3490]</a>
+    <p>The following terms are defined in the URL standard: <a href=#refsURL>[URL]</a></p>
 
-   </dd>
+    <ul class=brief><li><dfn id=url>URL</dfn>
+     <li><dfn id=absolute-url>Absolute URL</dfn>
+     <li><dfn id=relative-url>Relative URL</dfn>
+     <li><dfn id=concept-url-scheme-relative title=concept-url-scheme-relative>Relative schemes</dfn>
+     <li>The <dfn id=url-parser>URL parser</dfn>
+     <li><dfn id=parsed-url>Parsed URL</dfn>
+     <li>The <dfn id=concept-url-scheme title=concept-url-scheme>scheme</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-scheme-data title="concept-url-scheme data">scheme data</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-username title=concept-url-username>username</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-password title=concept-url-password>password</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-host title=concept-url-host>host</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-port title=concept-url-port>port</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-path title=concept-url-path>path</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-query title=concept-url-query>query</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-fragment title=concept-url-fragment>fragment</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li><dfn id=concept-url-parse-error title=concept-url-parse-error>Parse errors</dfn> from the <a href=#url-parser>URL parser</a>
+     <li>The <dfn id=url-serializer>URL serializer</dfn>
+     <li><dfn id=default-encode-set>Default encode set</dfn>
+     <li><dfn id=percent-encode>Percent encode</dfn>
+     <li><dfn id=utf-8-percent-encode>UTF-8 percent encode</dfn>
+     <li><dfn id=urlutils><code>URLUtils</code></dfn> interface
+     <li><dfn id=urlutilsreadonly><code>URLUtilsReadOnly</code></dfn> interface
+     <li><dfn id=dom-url-protocol title=dom-url-protocol><code>protocol</code> attribute</dfn>
+     <li><dfn id=concept-uu-base title=concept-uu-base>Base</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-input title=concept-uu-input>Input</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-query-encoding title=concept-uu-query-encoding>Query encoding</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-update title=concept-uu-update>Update steps</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+    </ul></dd>
 
 
    <dt>Cookies</dt>
@@ -6411,220 +6432,47 @@
 
   <h3 id=urls><span class=secno>2.5 </span>URLs</h3>
 
-  <p>This specification defines the term <a href=#url>URL</a>, and defines
-  various algorithms for dealing with URLs, because for historical
-  reasons the rules defined by the URI and IRI specifications are not
-  a complete description of what HTML user agents need to implement to
-  be compatible with Web content.</p>
-
-  <p class=note>The term "URL" in this specification is used in a
-  manner distinct from the precise technical meaning it is given in
-  RFC 3986. Readers familiar with that RFC will find it easier to read
-  <em>this</em> specification if they pretend the term "URL" as used
-  herein is really called something else altogether. This is a
-  <a href=#willful-violation>willful violation</a> of RFC 3986. <a href=#refsRFC3986>[RFC3986]</a></p>
-
-
   <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
 
-  <p>A <dfn id=url>URL</dfn> is a string used to identify a resource.</p>
+  <p>A <a href=#url>URL</a> is a <dfn id=valid-url>valid URL</dfn> if it conforms to the authoring conformance
+  requirements in the URL standard. <a href=#refsURL>[URL]</a></p>
 
-  <p>A <a href=#url>URL</a> is a <dfn id=valid-url>valid URL</dfn> if at least one of
-  the following conditions holds:</p>
+  <p>A string is a <dfn id=valid-non-empty-url>valid non-empty URL</dfn> if it is a <a href=#valid-url>valid URL</a> but it is not
+  the empty string.</p>
 
-  <ul><li><p>The <a href=#url>URL</a> is a valid URI reference <a href=#refsRFC3986>[RFC3986]</a>.</li>
+  <p>A string is a <dfn id=valid-url-potentially-surrounded-by-spaces>valid URL potentially surrounded by spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing whitespace">stripping leading and trailing whitespace</a>
+  from it, it is a <a href=#valid-url>valid URL</a>.</p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and it has no
-   query component. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>A string is a <dfn id=valid-non-empty-url-potentially-surrounded-by-spaces>valid non-empty URL potentially surrounded by spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing whitespace">stripping leading and trailing whitespace</a>
+  from it, it is a <a href=#valid-non-empty-url>valid non-empty URL</a>.</p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and its query
-   component contains no unescaped non-ASCII characters. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>This specification defines the URL <dfn id=about:legacy-compat><code>about:legacy-compat</code></dfn> as a reserved,
+  though unresolvable, <code title="">about:</code> URL, for use in <a href=#syntax-doctype title=syntax-doctype>DOCTYPE</a>s in <a href=#html-documents>HTML documents</a> when needed for
+  compatibility with XML tools. <a href=#refsABOUT>[ABOUT]</a></p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and the <a href="#document's-character-encoding" title="document's character encoding">character encoding</a> of
-   the URL's <code><a href=#document>Document</a></code> is UTF-8 or <a href=#a-utf-16-encoding>a UTF-16
-   encoding</a>. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>This specification defines the URL <dfn id=about:srcdoc><code>about:srcdoc</code></dfn> as a reserved, though
+  unresolvable, <code title="">about:</code> URL, that is used as <a href="#the-document's-address">the document's
+  address</a> of <a href=#an-iframe-srcdoc-document title="an iframe srcdoc document"><code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> documents</a>. <a href=#refsABOUT>[ABOUT]</a></p>
 
-  </ul><p>A string is a <dfn id=valid-non-empty-url>valid non-empty URL</dfn> if it is a
-  <a href=#valid-url>valid URL</a> but it is not the empty string.</p>
+  <p>The <dfn id=fallback-base-url>fallback base URL</dfn> of a <code><a href=#document>Document</a></code> object is the <a href=#absolute-url>absolute
+  URL</a> obtained by running these substeps:</p>
 
-  <p>A string is a <dfn id=valid-url-potentially-surrounded-by-spaces>valid URL potentially surrounded by
-  spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</a> from
-  it, it is a <a href=#valid-url>valid URL</a>.</p>
+  <ol><li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>, then return the <a href=#document-base-url>document base
+   URL</a> of the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s <a href=#browsing-context-container>browsing context
+   container</a>'s <code><a href=#document>Document</a></code> and abort these steps.</li>
 
-  <p>A string is a <dfn id=valid-non-empty-url-potentially-surrounded-by-spaces>valid non-empty URL potentially surrounded by
-  spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</a> from
-  it, it is a <a href=#valid-non-empty-url>valid non-empty URL</a>.</p>
-
-  <p>This specification defines the URL
-  <dfn id=about:legacy-compat><code>about:legacy-compat</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, for use in <a href=#syntax-doctype title=syntax-doctype>DOCTYPE</a>s in <a href=#html-documents>HTML
-  documents</a> when needed for compatibility with XML tools. <a href=#refsABOUT>[ABOUT]</a></p>
-
-  <p>This specification defines the URL
-  <dfn id=about:srcdoc><code>about:srcdoc</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, that is used as
-  <a href="#the-document's-address">the document's address</a> of <a href=#an-iframe-srcdoc-document title="an iframe srcdoc
-  document"><code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> documents</a>. <a href=#refsABOUT>[ABOUT]</a></p>
-
-
-  <div class=impl>
-
-  <h4 id=parsing-urls><span class=secno>2.5.2 </span>Parsing URLs</h4>
-
-  <p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
-  component parts, the user agent must use the following steps:</p>
-
-  <ol><li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">url</var>.</li>
-
    <li>
 
-    <p>Parse <var title="">url</var> in the manner defined by RFC
-    3986, with the following exceptions:</p>
-
-    <ul><li>Add all characters with code points less than or equal to
-     U+0020 or greater than or equal to U+007F to the
-     <unreserved> production.</li>
-
-     <li>Add the characters U+0022, U+003C, U+003E, U+005B .. U+005E,
-     U+0060, and U+007B .. U+007D to the <unreserved>
-     production.
-      <!--
-       0022 QUOTATION MARK
-       003C LESS-THAN SIGN
-       003E GREATER-THAN SIGN
-       005B LEFT SQUARE BRACKET
-       005C REVERSE SOLIDUS
-       005D RIGHT SQUARE BRACKET
-       005E CIRCUMFLEX ACCENT
-       0060 GRAVE ACCENT
-       007B LEFT CURLY BRACKET
-       007C VERTICAL LINE
-       007D RIGHT CURLY BRACKET
-      -->
-     </li>
-
-     <li>Add a single U+0025 PERCENT SIGN character as a second
-     alternative way of matching the <pct-encoded> production,
-     except when the <pct-encoded> is used in the
-     <reg-name> production.</li>
-
-     <li>Add the U+0023 NUMBER SIGN character to the characters
-     allowed in the <fragment> production.</li>
-
-     <!-- some browsers also have other differences, e.g. Mozilla
-     seems to treat ";" as if it was not in sub-delims, if the scheem
-     is "ftp". -->
-
-    </ul></li>
-
-   <li>
-
-    <p>If <var title="">url</var> doesn't match the
-    <URI-reference> production, even after the above changes are
-    made to the ABNF definitions, then parsing the URL fails with an
-    error. <a href=#refsRFC3986>[RFC3986]</a></p>
-
-    <p>Otherwise, parsing <var title="">url</var> was successful; the
-    components of the URL are substrings of <var title="">url</var>
-    defined as follows:</p>
-
-    <dl><dt><dfn id=url-scheme title=url-scheme><scheme></dfn></dt>
-
-     <dd><p>The substring matched by the <scheme> production, if any.</dd>
-
-
-     <dt><dfn id=url-host title=url-host><host></dfn></dt>
-
-     <dd><p>The substring matched by the <host> production, if any.</dd>
-
-
-     <dt><dfn id=url-port title=url-port><port></dfn></dt>
-
-     <dd><p>The substring matched by the <port> production, if any.</dd>
-
-
-     <dt><dfn id=url-hostport title=url-hostport><hostport></dfn></dt>
-
-     <dd><p>If there is a <scheme> component and a <port>
-     component and the port given by the <port> component is
-     different than the default port defined for the protocol given by
-     the <scheme> component, then <hostport> is the
-     substring that starts with the substring matched by the
-     <host> production and ends with the substring matched by the
-     <port> production, and includes the colon in between the
-     two. Otherwise, it is the same as the <host> component.</p>
-
-
-     <dt><dfn id=url-path title=url-path><path></dfn></dt>
-
-     <dd>
-
-      <p>The substring matched by one of the following productions, if
-      one of them was matched:</p>
-
-      <ul class=brief><li><path-abempty></li>
-       <li><path-absolute></li>
-       <li><path-noscheme></li>
-       <li><path-rootless></li>
-       <li><path-empty></li>
-      </ul></dd>
-
-
-     <dt><dfn id=url-query title=url-query><query></dfn></dt>
-
-     <dd><p>The substring matched by the <query> production, if any.</dd>
-
-
-     <dt><dfn id=url-fragment title=url-fragment><fragment></dfn></dt>
-
-     <dd><p>The substring matched by the <fragment> production, if any.</dd>
-
-
-     <dt><dfn id=url-host-specific title=url-host-specific><host-specific></dfn></dt>
-
-     <dd><p>The substring that <em>follows</em> the substring matched
-     by the <authority> production, or the whole string if the
-     <authority> production wasn't matched.</dd>
-
-    </dl></li>
-
-  </ol><p class=note>These parsing rules are a <a href=#willful-violation>willful
-  violation</a> of RFC 3986 and RFC 3987 (which do not define error
-  handling), motivated by a desire to handle legacy content. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
-  </div>
-
-
-  <h4 id=base-urls><span class=secno>2.5.3 </span>Base URLs</h4>
-
-  <p>The <dfn id=fallback-base-url>fallback base URL</dfn> of a <code><a href=#document>Document</a></code>
-  object is the <a href=#absolute-url>absolute URL</a> obtained by running these
-  substeps:</p>
-
-  <ol><li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code>
-   <code title=attr-iframe-srcdoc>srcdoc</code> document</a>,
-   then return the <a href=#document-base-url>document base URL</a> of the
-   <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s
-   <a href=#browsing-context-container>browsing context container</a>'s <code><a href=#document>Document</a></code> and
-   abort these steps.</li>
-
-   <li>
-
     <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
 
-    <!-- this should be tested in the case of a browsing context that
-    was navigated to about:blank after having been elsewhere, as
-    opposed to the about:blank used at the time of the browsing
+    <!-- this should be tested in the case of a browsing context that was navigated to about:blank
+    after having been elsewhere, as opposed to the about:blank used at the time of the browsing
     context's creation. -->
 
-    <p>If <a href="#the-document's-address">the document's address</a> is
-    <code><a href=#about:blank>about:blank</a></code>, and the <code><a href=#document>Document</a></code>'s
-    <a href=#browsing-context>browsing context</a> has a <a href=#creator-browsing-context>creator browsing
-    context</a>, then return the <a href=#document-base-url>document base URL</a> of
-    the <a href=#creator-document>creator <code>Document</code></a>, and abort these
-    steps.</p>
+    <p>If <a href="#the-document's-address">the document's address</a> is <code><a href=#about:blank>about:blank</a></code>, and the
+    <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a> has a <a href=#creator-browsing-context>creator browsing
+    context</a>, then return the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
+    <code>Document</code></a>, and abort these steps.</p>
 
    </li>
 
@@ -6632,282 +6480,99 @@
 
    <li><p>Return <a href="#the-document's-address">the document's address</a>.</li>
 
-  </ol><p>The <dfn id=document-base-url>document base URL</dfn> of a <code><a href=#document>Document</a></code>
-  object is the <a href=#absolute-url>absolute URL</a> obtained by running these
-  substeps:</p>
+  </ol><p>The <dfn id=document-base-url>document base URL</dfn> of a <code><a href=#document>Document</a></code> object is the <a href=#absolute-url>absolute
+  URL</a> obtained by running these substeps:</p>
 
-  <ol><li><p>Let <var title="">fallback base url</var> be the
-   <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>.</li>
+  <ol><li><p>Let <var title="">fallback base url</var> be the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback
+   base URL</a>.</li>
 
-   <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the
-   <a href=#document-base-url>document base URL</a> is <var title="">fallback base
-   url</var>; abort these steps. Otherwise, let <var title="">url</var> be the value of the <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute of the first such
+   <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the <a href=#document-base-url>document base URL</a> is <var title="">fallback base url</var>; abort these steps. Otherwise, let <var title="">url</var> be
+   the value of the <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute of the first such
    element.</li>
 
-   <li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> <var title="">url</var> relative to <var title="">fallback base
-   url</var> (thus, the <code><a href=#the-base-element>base</a></code> <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute isn't affected by
-   <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes).</li>
+   <li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> <var title="">url</var> relative to <var title="">fallback base url</var> (thus, the <code><a href=#the-base-element>base</a></code> <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute isn't affected by <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes).</li>
 
-   <li><p>The <a href=#document-base-url>document base URL</a> is the result of the
-   previous step if it was successful; otherwise it is <var title="">fallback base url</var>.</li>
+   <li><p>The <a href=#document-base-url>document base URL</a> is the result of the previous step if it was
+   successful; otherwise it is <var title="">fallback base url</var>.</li>
 
-  </ol><h4 id=resolving-urls><span class=secno>2.5.4 </span>Resolving URLs</h4>
+  </ol><div class=impl>
 
-  <p>Resolving a URL is the process of taking a relative URL and
-  obtaining the absolute URL that it implies.</p>
+  <h4 id=resolving-urls><span class=secno>2.5.2 </span>Resolving URLs</h4>
 
-  <div class=impl>
+  <p>Resolving a URL is the process of taking a <a href=#relative-url>relative URL</a> and obtaining the
+  <a href=#absolute-url>absolute URL</a> that it implies.</p>
 
-  <p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a>
-  relative to either another <a href=#absolute-url>absolute URL</a> or an element,
-  the user agent must use the following steps. Resolving a URL can
-  result in an error, in which case the URL is not resolvable.</p>
+  <p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a> relative to either another
+  <a href=#absolute-url>absolute URL</a> or an element, the user agent must use the following steps. Resolving a
+  URL can result in an error, in which case the URL is not resolvable.</p>
 
-  <ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> being
-   resolved.</li>
+  <ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> being resolved.</li>
 
    <li>
 
     <p>Let <var title="">encoding</var> be determined as follows:</p>
 
-    <dl class=switch><dt>If the URL had a character encoding defined when the URL was
-     created or defined</dt>
+    <dl class=switch><dt>If the URL had a character encoding defined when the URL was created or defined</dt>
 
      <dd>The URL character encoding is as defined.</dd>
 
-     <dt>If the URL came from a script (e.g. as an argument to a
-     method)</dt>
+     <dt>If the URL came from a script (e.g. as an argument to a method)</dt>
 
-     <dd>The URL character encoding is the <a href="#script's-url-character-encoding">script's URL character
-     encoding</a>.</dd>
+     <dd>The URL character encoding is the <a href="#script's-url-character-encoding">script's URL character encoding</a>.</dd>
 
      <dt>If the URL came from a DOM node (e.g. from an element)</dt>
 
-     <dd>The node has a <code><a href=#document>Document</a></code>, and the URL character
-     encoding is the <a href="#document's-character-encoding">document's character encoding</a>.</dd>
+     <dd>The node has a <code><a href=#document>Document</a></code>, and the URL character encoding is the
+     <a href="#document's-character-encoding">document's character encoding</a>.</dd>
 
     </dl></li>
 
-   <li><p>If <var title="">encoding</var> is <a href=#a-utf-16-encoding>a UTF-16
-   encoding</a>, then change the value of <var title="">encoding</var> to UTF-8.</li>
+   <li><p>If <var title="">encoding</var> is <a href=#a-utf-16-encoding>a UTF-16 encoding</a>, then change the value
+   of <var title="">encoding</var> to UTF-8.</li>
 
    <li>
 
-    <p>If the algorithm was invoked with an <a href=#absolute-url>absolute URL</a>
-    to use as the base URL, let <var title="">base</var> be that
-    <a href=#absolute-url>absolute URL</a>.</p>
+    <p>If the algorithm was invoked with an <a href=#absolute-url>absolute URL</a> to use as the base URL, let
+    <var title="">base</var> be that <a href=#absolute-url>absolute URL</a>.</p>
 
-    <p>Otherwise, let <var title="">base</var> be the <i>base URI of
-    the element</i>, as defined by the XML Base specification, with
-    <i>the base URI of the document entity</i> being defined as the
-    <a href=#document-base-url>document base URL</a> of the <code><a href=#document>Document</a></code> that
-    owns the element. <a href=#refsXMLBASE>[XMLBASE]</a></p>
+    <p>Otherwise, let <var title="">base</var> be <a href="#the-element's-base-url">the element's base URL</a>.</p>
 
-    <p>For the purposes of the XML Base specification, user agents
-    must act as if all <code><a href=#document>Document</a></code> objects represented XML
-    documents.</p>
-
-    <p class=note>It is possible for <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes to be present
-    even in HTML fragments, as such attributes can be added
-    dynamically using script. (Such scripts would not be conforming,
-    however, as <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes
-    are not allowed in <a href=#html-documents>HTML documents</a>.)</p>
-
    </li>
 
-   <li><p><a href=#parse-a-url title="parse a URL">Parse</a> <var title="">url</var> into its component parts.</li>
+   <li><p>Apply the <a href=#url-parser>URL parser</a> to <var title="">url</var>, with <var title="">base</var> as the base URL, with <var title="">encoding</var> as the encoding.</li>
 
-   <li>
+   <li><p>If this results in a <a href=#concept-url-parse-error title=concept-url-parse-error>parse error</a>, then abort
+   these steps with an error.</li>
 
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-host title=url-host><host></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from expanding any sequences of percent-encoded octets in
-    that component that are valid UTF-8 sequences into Unicode
-    characters as defined by UTF-8.</p>
+   <li><p>Let <var title="">parsed URL</var> be the result of the <a href=#url-parser>URL parser</a>.</li>
 
-    <p>If any percent-encoded octets in that component are not valid
-    UTF-8 sequences (e.g. sequences of percent-encoded octets that
-    expand to surrogate code points), then return an error and abort
-    these steps.</p>
+   <li><p>Let <var title="">serialized URL</var> be the result of apply the <a href=#url-serializer>URL
+   serializer</a> to <var title="">parsed URL</var>.</li>
 
-    <p>Apply the IDNA ToASCII algorithm to the matching substring,
-    with both the AllowUnassigned and UseSTD3ASCIIRules flags
-    set. Replace the matching substring with the result of the ToASCII
-    algorithm.</p>
+   <li><p>Return <var title="">serialized URL</var> as the <dfn id=resulting-absolute-url>resulting absolute URL</dfn> and
+   <var title="">parsed URL</var> as the <dfn id=resulting-parsed-url>resulting parsed URL</dfn>.</li>
 
-    <p>If ToASCII fails to convert one of the components of the
-    string, e.g. because it is too long or because it contains invalid
-    characters, then return an error and abort these steps. <a href=#refsRFC3490>[RFC3490]</a></p>
+  </ol><p>Given an element, <dfn id="the-element's-base-url">the element's base URL</dfn> is the <i>base URI of the element</i>, as
+  defined by the XML Base specification, with <i>the base URI of the document entity</i> being
+  defined as the <a href=#document-base-url>document base URL</a> of the <code><a href=#document>Document</a></code> that owns the element.
+  <a href=#refsXMLBASE>[XMLBASE]</a></p>
 
-   </li>
+  <p>For the purposes of the XML Base specification, user agents must act as if all
+  <code><a href=#document>Document</a></code> objects represented XML documents.</p>
 
-   <li>
+  <p class=note>It is possible for <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes to be
+  present even in HTML fragments, as such attributes can be added dynamically using script. (Such
+  scripts would not be conforming, however, as <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code>
+  attributes are not allowed in <a href=#html-documents>HTML documents</a>.)</p>
 
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-path title=url-path><path></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <path> production defined in RFC 3986:</p>
-
-    <ol><li>Encode the character into a sequence of octets as defined by the <a href=#utf-8-encoder>utf-8 encoder</a>
-     algorithm. <a href=#refsENCODING>[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href=#refsRFC3986>[RFC3986]</a></li>
-
-    </ol><div class=example>
-
-     <p>For instance if <var title="">url</var> was "<code title="">//example.com/a^b☺c%FFd%z/?e</code>", then the
-     <a href=#url-path title=url-path><path></a> component's substring
-     would be "<code title="">/a^b☺c%FFd%z/</code>" and the two
-     characters that would have to be escaped would be "<code title="">^</code>" and "<code title="">☺</code>". The
-     result after this step was applied would therefore be that <var title="">url</var> now had the value "<code title="">//example.com/a%5Eb%E2%98%BAc%FFd%z/?e</code>".</p>
-
-    </div>
-
-   </li>
-
-   <li>
-
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-query title=url-query><query></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <query> production defined in RFC 3986:</p>
-
-    <ol><li>If the character in question cannot be expressed in the
-     encoding <var title="">encoding</var>, then replace it with a
-     single 0x3F octet (an ASCII question mark) and skip the remaining
-     substeps for this character.</li>
-
-     <li>Encode the character into a sequence of octets as defined by the <a href=#encoder>encoder</a>
-     algorithm for <var title="">encoding</var>. <a href=#refsENCODING>[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href=#refsRFC3986>[RFC3986]</a></li>
-
-    </ol></li>
-
-   <li><p>Apply the algorithm described in RFC 3986 section 5.2
-   Relative Resolution, using <var title="">url</var> as the
-   potentially relative URI reference (<var title="">R</var>), and
-   <var title="">base</var> as the base URI (<var title="">Base</var>). <a href=#refsRFC3986>[RFC3986]</a></li>
-
-   <li>
-
-    <p>Apply any relevant conformance criteria of RFC 3986 and RFC
-    3987, returning an error and aborting these steps if
-    appropriate. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
-    <p class=example>For instance, if an absolute URI that would be
-    returned by the above algorithm violates the restrictions specific
-    to its scheme, e.g. a <code title="">data:</code> URI using the
-    "<code title="">//</code>" server-based naming authority syntax,
-    then user agents are to treat this as an error instead.<!-- RFC
-    3986, 3.1 Scheme --></p>
-
-   </li>
-
-   <li><p>Let <var title="">result</var> be the target URI (<var title="">T</var>) returned by the Relative Resolution
-   algorithm.</li>
-
-   <li><p>If <var title="">result</var> uses a scheme with a
-   server-based naming authority, replace all U+005C REVERSE SOLIDUS
-   (\) characters in <var title="">result</var> with U+002F SOLIDUS
-   (/) characters.</li>
-
-   <li><p>Return <var title="">result</var>.</li>
-
-  </ol><p class=note>Some of the steps in these rules, for example the
-  processing of U+005C REVERSE SOLIDUS (\) characters, are a
-  <a href=#willful-violation>willful violation</a> of RFC 3986 and RFC 3987, motivated
-  by a desire to handle legacy content. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
   </div>
 
-  <p>A <a href=#url>URL</a> is an <dfn id=absolute-url>absolute URL</dfn> if <a href=#resolve-a-url title="resolve a url">resolving</a> it results in the same output
-  regardless of what it is resolved relative to, and that output is
-  not a failure.</p>
 
-  <p>An <a href=#absolute-url>absolute URL</a> is a <dfn id=hierarchical-url>hierarchical URL</dfn> if,
-  when <a href=#resolve-a-url title="resolve a url">resolved</a> and then <a href=#parse-a-url title="parse a url">parsed</a>, there is a character immediately
-  after the <a href=#url-scheme title=url-scheme><scheme></a> component
-  and it is a U+002F SOLIDUS character (/).</p>
 
-  <p>An <a href=#absolute-url>absolute URL</a> is an <dfn id=authority-based-url>authority-based URL</dfn>
-  if, when <a href=#resolve-a-url title="resolve a url">resolved</a> and then <a href=#parse-a-url title="parse a url">parsed</a>, there are two characters
-  immediately after the <a href=#url-scheme title=url-scheme><scheme></a>
-  component and they are both U+002F SOLIDUS characters (//).</p>
-
-
-
   <div class=impl>
 
-  <h4 id=url-manipulation-and-creation><span class=secno>2.5.5 </span>URL manipulation and creation</h4>
+  <h4 id=dynamic-changes-to-base-urls><span class=secno>2.5.3 </span>Dynamic changes to base URLs</h4>
 
-  <p>To <dfn id=fragment-escaped title=fragment-escaped>fragment-escape</dfn> a string
-  <var title="">input</var>, a user agent must run the following
-  steps:</p>
-
-  <ol><li><p>Let <var title="">input</var> be the string to be
-   escaped.</li>
-
-   <li><p>Let <var title="">position</var> point at the first
-   character of <var title="">input</var>.</li>
-
-   <li><p>Let <var title="">output</var> be an empty string.</li>
-
-   <li><p><i>Loop</i>: If <var title="">position</var> is past the end
-   of <var title="">input</var>, then jump to the step labeled
-   <i>end</i>.</li>
-
-   <li>
-
-    <p>If the character in <var title="">input</var> pointed to by
-    <var title="">position</var> is in the range U+0000 to U+0020 or
-    is one of the following characters:</p>
-
-    <ul class=brief><li>U+0022 QUOTATION MARK character (")
-     <li>U+0023 NUMBER SIGN character (#)
-     <li>U+0025 PERCENT SIGN character (%)
-     <li>U+003C LESS-THAN SIGN character (<)
-     <li>U+003E GREATER-THAN SIGN character (>)
-     <li>U+005B LEFT SQUARE BRACKET character ([)
-     <li>U+005C REVERSE SOLIDUS character (\)
-     <li>U+005D RIGHT SQUARE BRACKET character (])
-     <li>U+005E CIRCUMFLEX ACCENT character (^)
-     <li>U+007B LEFT CURLY BRACKET character ({)
-     <li>U+007C VERTICAL LINE character (|)
-     <li>U+007D RIGHT CURLY BRACKET character (})
-    </ul><p>...then append the percent-encoded form of the character to
-    <var title="">output</var>. <a href=#refsRFC3986>[RFC3986]</a></p> <!-- this is the same
-    phrasing that's used elsewhere in the spec, but we really should
-    define 'percent-encoded' or at least ensure we consistently say
-    whether it's upper-case or lower-case. -->
-
-    <p>Otherwise, append the character itself to <var title="">output</var>.</p>
-
-    <p class=note>This escapes any ASCII characters that are not
-    valid in the URI <fragment> production without being
-    escaped.</p>
-
-   </li>
-
-   <li><p>Advance <var title="">position</var> to the next character
-   in <var title="">input</var>.</li>
-
-   <li><p>Return to the step labeled <i>loop</i>.</li>
-
-   <li><p><i>End</i>: Return <var title="">output</var>.</li>
-
-  </ol></div>
-
-
-
-  <div class=impl>
-
-  <h4 id=dynamic-changes-to-base-urls><span class=secno>2.5.6 </span>Dynamic changes to base URLs</h4>
-
   <p>When an <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attribute is set, changed, or removed, the
   attribute's element, and all descendant elements, are <a href=#affected-by-a-base-url-change>affected by a base URL
   change</a>.</p>
@@ -6960,239 +6625,7 @@
   </dl></div>
 
 
-<!--TOPIC:DOM APIs-->
-  <h4 id=interfaces-for-url-manipulation><span class=secno>2.5.7 </span>Interfaces for URL manipulation</h4>
-
-  <p>An interface that has a complement of <dfn id=url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</dfn> has seven attributes with the following
-  definitions:</p>
-
-<pre class="idl extract">           attribute DOMString <a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-uda-host title=dom-uda-host>host</a>;
-           attribute DOMString <a href=#dom-uda-hostname title=dom-uda-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-uda-port title=dom-uda-port>port</a>;
-           attribute DOMString <a href=#dom-uda-pathname title=dom-uda-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-uda-search title=dom-uda-search>search</a>;
-           attribute DOMString <a href=#dom-uda-hash title=dom-uda-hash>hash</a>;</pre>
-
-  <dl class=domintro><dt><var title="">o</var> . <code title=dom-uda-protocol><a href=#dom-uda-protocol>protocol</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current scheme of the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's scheme.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-host><a href=#dom-uda-host>host</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host and port (if it's not the default port) in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host and port.</p>
-    <p>The host and the port are separated by a colon. The port part,
-    if omitted, will be assumed to be the current scheme's default
-    port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-hostname><a href=#dom-uda-hostname>hostname</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-port><a href=#dom-uda-port>port</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current port in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-pathname><a href=#dom-uda-pathname>pathname</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current path in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's path.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current query component in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's query component.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-hash><a href=#dom-uda-hash>hash</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current fragment identifier in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's fragment identifier.</p>
-   </dd>
-
-  </dl><div class=impl>
-
-  <hr><p>The attributes defined to be <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a> must act as described for the attributes with the
-  same corresponding names in this section.</p>
-
-  <p>In addition, an interface with a complement of <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a> defines an <dfn id=concept-uda-input title=concept-uda-input>input</dfn>, which is a <a href=#url>URL</a>
-  that the attributes act on, and a <dfn id=concept-uda-setter title=concept-uda-setter>common setter action</dfn>, which is a
-  set of steps invoked when any of the attributes' setters are
-  invoked.</p>
-
-  <p>The seven <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> have
-  similar requirements.</p>
-
-  <p>On getting, if the <a href=#concept-uda-input title=concept-uda-input>input</a>
-  is an <a href=#absolute-url>absolute URL</a> that fulfills the condition given in
-  the "getter condition" column corresponding to the attribute in the
-  table below, the user agent must return the part of the <a href=#concept-uda-input title=concept-uda-input>input</a> URL given in the "component"
-  column, with any prefixes specified in the "prefix" column
-  appropriately added to the start of the string and any suffixes
-  specified in the "suffix" column appropriately added to the end of
-  the string. Otherwise, the attribute must return the empty
-  string.</p>
-
-  <p>On setting, the new value must first be mutated as described by
-  the "setter preprocessor" column, then mutated by %-escaping any
-  characters in the new value that are not valid in the relevant
-  component as given by the "component" column. Then, if the <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#absolute-url>absolute
-  URL</a> and the resulting new value fulfills the condition given
-  in the "setter condition" column, the user agent must make a new
-  string <var title="">output</var> by replacing the component of the
-  URL given by the "component" column in the <a href=#concept-uda-input title=concept-uda-input>input</a> URL with the new value;
-  otherwise, the user agent must let <var title="">output</var> be
-  equal to the <a href=#concept-uda-input title=concept-uda-input>input</a>. Finally,
-  the user agent must invoke the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> with the
-  value of <var title="">output</var>.</p>
-
-  <p>When replacing a component in the URL, if the component is part
-  of an optional group in the URL syntax consisting of a character
-  followed by the component, the component (including its prefix
-  character) must be included even if the new value is the empty
-  string.</p>
-
-  <p class=note>The previous paragraph applies in particular to the
-  "<code title="">:</code>" before a <port> component, the "<code title="">?</code>" before a <query> component, and the "<code title="">#</code>" before a <fragment> component.</p>
-
-  <p>For the purposes of the above definitions, URLs must be parsed
-  using the <a href=#parse-a-url title="parse a URL">URL parsing rules</a> defined
-  in this specification.</p>
-
-  <table id=table-uda><thead><tr><th>Attribute
-     <th>Component
-     <th>Getter Condition
-     <th>Prefix
-     <th>Suffix
-     <th>Setter Preprocessor
-     <th>Setter Condition
-   <tbody><tr><td><dfn id=dom-uda-protocol title=dom-uda-protocol><code>protocol</code></dfn>
-     <td><a href=#url-scheme title=url-scheme><scheme></a>
-     <td>—
-     <td>—
-     <td>U+003A COLON (:)
-     <td>Remove all trailing U+003A COLON characters (:)
-     <td>The new value is not the empty string
-    <tr><td><dfn id=dom-uda-host title=dom-uda-host><code>host</code></dfn>
-     <td><a href=#url-hostport title=url-hostport><hostport></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-     <td>—
-     <td>—
-     <td>—
-     <td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-    <tr><td><dfn id=dom-uda-hostname title=dom-uda-hostname><code>hostname</code></dfn>
-     <td><a href=#url-host title=url-host><host></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-     <td>—
-     <td>—
-     <td>Remove all leading U+002F SOLIDUS characters (/)
-     <td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-    <tr><td><dfn id=dom-uda-port title=dom-uda-port><code>port</code></dfn>
-     <td><a href=#url-port title=url-port><port></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>, and contained a <a href=#url-port title=url-port><port></a> component (possibly an empty one)
-     <td>—
-     <td>—
-     <td>Remove all characters in the new value from the first that is not an <a href=#ascii-digits title="ASCII digits">ASCII digit</a>, if any.
-         Remove any leading U+0030 DIGIT ZERO characters (0) in the new value.
-         If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character (0).
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>,
-         and the new value, when interpreted as a base-ten integer, is less than or equal to 65535
-    <tr><td><dfn id=dom-uda-pathname title=dom-uda-pathname><code>pathname</code></dfn>
-     <td><a href=#url-path title=url-path><path></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
-     <td>—
-     <td>—
-     <td>If it has no leading U+002F SOLIDUS character (/), prepend a U+002F SOLIDUS character (/) to the new value
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
-    <tr><td><dfn id=dom-uda-search title=dom-uda-search><code>search</code></dfn>
-     <td><a href=#url-query title=url-query><query></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>, and contained a <a href=#url-query title=url-query><query></a> component (possibly an empty one)
-     <td>U+003F QUESTION MARK (?)
-     <td>—
-     <td>Remove one leading U+003F QUESTION MARK character (?), if any
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
-    <tr><td><dfn id=dom-uda-hash title=dom-uda-hash><code>hash</code></dfn>
-     <td><a href=#url-fragment title=url-fragment><fragment></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> contained a non-empty <a href=#url-fragment title=url-fragment><fragment></a> component
-     <td>U+0023 NUMBER SIGN (#)
-     <td>—
-     <td>Remove one leading U+0023 NUMBER SIGN character (#), if any
-     <td>—
-  </table><!--
-  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
-  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
-  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
---></div>
-
-  <div class=example>
-
-   <p>The table below demonstrates how the getter <span class=impl>condition</span> for <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> results in different results
-   depending on the exact original syntax of the URL:</p>
-
-   <table id=table-uda-examples><thead><tr><th> Input URL
-      <th> <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> value
-      <th> Explanation
-    <tbody><tr><td> <code title="">http://example.com/</code>
-      <td> <i>empty string</i>
-      <td> No <a href=#url-query title=url-query><query></a> component in input URL.
-     <tr><td> <code title="">http://example.com/?</code>
-      <td> <code title="">?</code>
-      <td> There is a <a href=#url-query title=url-query><query></a> component, but it is empty.
-           <span class=impl>The question mark in the resulting value is the prefix.</span>
-     <tr><td> <code title="">http://example.com/?test</code>
-      <td> <code title="">?test</code>
-      <td> The <a href=#url-query title=url-query><query></a> component has the value "<code title="">test</code>".
-     <tr><td> <code title="">http://example.com/?test#</code>
-      <td> <code title="">?test</code>
-      <td> The (empty) <a href=#url-fragment title=url-fragment><fragment></a> component is not part of the <a href=#url-query title=url-query><query></a> component.
-   </table></div>
-
-  <div class=example>
-
-   <p>The following table is similar; it provides a list of what each
-   of the <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> returns for a
-   given <var title="">input</var> URL.</p>
-
-   <table><thead><tr><th>Input
-      <th><code title=dom-uda-protocol><a href=#dom-uda-protocol>protocol</a></code>
-      <th><code title=dom-uda-host><a href=#dom-uda-host>host</a></code>
-      <th><code title=dom-uda-hostname><a href=#dom-uda-hostname>hostname</a></code>
-      <th><code title=dom-uda-port><a href=#dom-uda-port>port</a></code>
-      <th><code title=dom-uda-pathname><a href=#dom-uda-pathname>pathname</a></code>
-      <th><code title=dom-uda-search><a href=#dom-uda-search>search</a></code>
-      <th><code title=dom-uda-hash><a href=#dom-uda-hash>hash</a></code>
-    <tbody><tr><td><code title="">http://example.com/carrot#question%3f</code>
-      <td><code title="">http:</code>
-      <td><code title="">example.com</code>
-      <td><code title="">example.com</code>
-      <td>(empty string)
-      <td><code title="">/carrot</code>
-      <td>(empty string)
-      <td><code title="">#question%3f</code>
-     <tr><td><code title="">https://www.example.com:4443?</code>
-      <td><code title="">https:</code>
-      <td><code title="">www.example.com:4443</code>
-      <td><code title="">www.example.com</code>
-      <td><code title="">4443</code>
-      <td><code title="">/</code>
-      <td><code title="">?</code>
-      <td>(empty string)
-   </table></div>
-
-
-<!--TOPIC:HTML-->
+<!--CLEANUP-->
   <div class=impl>
 
   <h3 id=fetching-resources><span class=secno>2.6 </span>Fetching resources</h3>
@@ -7295,14 +6728,20 @@
 
    <li>
 
-    <p><i>Clean referrer</i>: Remove any <a href=#url-fragment title=url-fragment><fragment></a>
-    component from <var title="">referrer</var>.</p> <!-- RFC2616 says "The URI MUST NOT include a
-    fragment." (section 14.36) -->
+    <p>Apply the <a href=#url-parser>URL parser</a> to <var title="">referrer</var> and let <var title="">parsed referrer</var> be <a href=#resulting-parsed-url>resulting parsed URL</a>.</p>
 
    </li>
 
    <li>
 
+    <p><i>Clean referrer</i>: Let <var title="">referrer</var> be the result of applying the
+    <a href=#url-serializer>URL serializer</a> to <var title="">parsed referrer</var>, with the <i>exclude fragment
+    flag</i> set.</p> <!-- RFC2616 says "The URI MUST NOT include a fragment." (section 14.36) -->
+
+   </li>
+
+   <li>
+
     <p>If <var title="">referrer</var> is not the empty string, is not a <a href=#data-protocol title="data
     protocol"><code title="">data:</code> URL</a>, is not a <a href=#javascript-protocol title="javascript
     protocol"><code title="">javascript:</code> URL</a>, and is not the <a href=#url>URL</a>
@@ -8837,6 +8276,10 @@
   document</a>, and the <code><a href=#document>Document</a></code> is both <a href=#ready-for-post-load-tasks>ready for post-load tasks</a> and
   <a href=#completely-loaded>completely loaded</a> immediately.</p>
 
+  <p><dfn id="the-document's-referrer">The document's referrer</dfn> is an <a href=#absolute-url>absolute URL</a> that can be set when the
+  <code><a href=#document>Document</a></code> is created. If it is not explicitly set, then its value is the empty
+  string.</p>
+
   <p>Each <code><a href=#document>Document</a></code> object has a <dfn id=reload-override-flag>reload override flag</dfn> that is originally
   unset. The flag is set by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> and <code title=dom-document-open><a href=#dom-document-open>document.write()</a></code> methods in certain situations. When the flag is
   set, the <code><a href=#document>Document</a></code> also has a <dfn id=reload-override-buffer>reload override buffer</dfn> which is a Unicode
@@ -8938,6 +8381,8 @@
   <dl class=domintro><dt><var title="">document</var> . <code title=dom-document-referrer><a href=#dom-document-referrer>referrer</a></code></dt>
    <dd>
 
+<!--CLEANUP-->
+
     <p>Returns <a href="#the-document's-address" title="the document's address">the address</a>
     of the <code><a href=#document>Document</a></code> from which the user navigated to this
     one, unless it was blocked or there was no such document, in which
@@ -8950,14 +8395,8 @@
 
   </dl><div class=impl>
 
-  <p>The <dfn id=dom-document-referrer title=dom-document-referrer><code>referrer</code></dfn> attribute must return either
-  the <a href="#the-document's-address" title="the document's address">address</a> of the <a href=#active-document>active document</a> of the
-  <a href=#source-browsing-context>source browsing context</a> <em>at the time the navigation was started</em> (that is, the
-  page which <a href=#navigate title=navigate>navigated</a> the <a href=#browsing-context>browsing context</a> to the
-  current document), with any <a href=#url-fragment title=url-fragment><fragment></a> component removed;
-  or the empty string if there is no such originating page, or if the UA has been configured not to
-  report referrers in this case, or if the navigation was initiated for a <a href=#hyperlink>hyperlink</a>
-  with a <code title=rel-noreferrer><a href=#link-type-noreferrer>noreferrer</a></code> keyword.</p>
+  <p>The <dfn id=dom-document-referrer title=dom-document-referrer><code>referrer</code></dfn> attribute must return
+  <a href="#the-document's-referrer">the document's referrer</a>.</p>
 
   </div>
 
@@ -12371,6 +11810,8 @@
    <li><p>Change <a href="#the-document's-address">the document's address</a> to the <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's document">document</a>'s <a href="#the-document's-address" title="the document's
    address">address</a>.</li>
 
+   <!-- <span>the document's referrer</span> stays the same -->
+
    <li><p>Create a new <a href=#html-parser>HTML parser</a> and associate it with the document. This is a
    <dfn id=script-created-parser>script-created parser</dfn> (meaning that it can be closed by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> and <code title=dom-document-close><a href=#dom-document-close>document.close()</a></code> methods, and that the tokenizer will wait for
    an explicit call to <code title=dom-document-close><a href=#dom-document-close>document.close()</a></code> before emitting an
@@ -19387,16 +18828,8 @@
            attribute DOMString <a href=#dom-a-type title=dom-a-type>type</a>;
 
            attribute DOMString <a href=#dom-a-text title=dom-a-text>text</a>;
-
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
-           attribute DOMString <a href=#dom-a-protocol title=dom-a-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-a-host title=dom-a-host>host</a>;
-           attribute DOMString <a href=#dom-a-hostname title=dom-a-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-a-port title=dom-a-port>port</a>;
-           attribute DOMString <a href=#dom-a-pathname title=dom-a-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-a-search title=dom-a-search>search</a>;
-           attribute DOMString <a href=#dom-a-hash title=dom-a-hash>hash</a>;
-};</pre>
+};
+<a href=#htmlanchorelement>HTMLAnchorElement</a> implements <a href=#urlutils>URLUtils</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>If the <code><a href=#the-a-element>a</a></code> element has an <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute,
   then it <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a> (a hypertext anchor) labeled by its
@@ -19492,7 +18925,7 @@
 
    </dd>
 
-  </dl><div class=impl>
+  </dl><!-- CLEANUP --><div class=impl>
 
   <p>The IDL attributes <dfn id=dom-a-href title=dom-a-href><code>href</code></dfn>, <dfn id=dom-a-download title=dom-a-download><code>download</code></dfn>, <dfn id=dom-a-ping title=dom-a-ping><code>ping</code></dfn>, <dfn id=dom-a-target title=dom-a-target><code>target</code></dfn>,
   <dfn id=dom-a-rel title=dom-a-rel><code>rel</code></dfn>, <dfn id=dom-a-hreflang title=dom-a-hreflang><code>hreflang</code></dfn>, and <dfn id=dom-a-type title=dom-a-type><code>type</code></dfn>, must <a href=#reflect>reflect</a> the respective content
@@ -19505,12 +18938,12 @@
   same value as the <code><a href=#textcontent>textContent</a></code> IDL attribute on the element, and on setting, must act
   as if the <code><a href=#textcontent>textContent</a></code> IDL attribute on the element had been set to the new value.</p>
 
-  <p>The <code><a href=#the-a-element>a</a></code> element also supports the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-a-protocol title=dom-a-protocol><code>protocol</code></dfn>, <dfn id=dom-a-host title=dom-a-host><code>host</code></dfn>, <dfn id=dom-a-port title=dom-a-port><code>port</code></dfn>, <dfn id=dom-a-hostname title=dom-a-hostname><code>hostname</code></dfn>, <dfn id=dom-a-pathname title=dom-a-pathname><code>pathname</code></dfn>, <dfn id=dom-a-search title=dom-a-search><code>search</code></dfn>, and <dfn id=dom-a-hash title=dom-a-hash><code>hash</code></dfn>. These must follow the rules given for <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being
-  the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the element's
-  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute to the new output value.</p>
+  <p>The <code><a href=#the-a-element>a</a></code> element also supports the <code><a href=#urlutils>URLUtils</a></code> interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is
+  the value of the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <a href=#concept-uu-base title=concept-uu-base>base</a>
+  is <a href="#the-element's-base-url">the element's base URL</a>; the <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a>
+  being the <a href="#document's-character-encoding">document's character encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> being the same as setting the element's
+  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute to the new output value.</p>
 
   </div>
 <!--TOPIC:HTML-->
@@ -25326,12 +24759,14 @@
     <!-- if we get to this point we know we can successfully parsed the URL, since this algorithm is
     only used after fetching the resource in the steps above -->
 
-    <p>Otherwise, if the <a href=#url-path title=url-path><path></a> component of the
-    <a href=#url>URL</a> of the specified resource (after any redirects) matches a pattern that a
+<!--CLEANUP-->
+    <p>Otherwise, if applying the <a href=#url-parser>URL parser</a> algorithm to the
+    <a href=#url>URL</a> of the specified resource (after any redirects) results in a <a href=#parsed-url>parsed URL</a>
+    whose <a href=#concept-url-path title=concept-url-path>path</a> component matches a pattern that a
     <a href=#plugin>plugin</a> supports, then the <a href=#concept-embed-type title=concept-embed-type>content's type</a> is
     the type that that plugin can handle.</p>
 
-    <p class=example>For example, a plugin might say that it can handle resources with <a href=#url-path title=url-path><path></a> components that end with the four character string "<code title="">.swf</code>".</p>
+    <p class=example>For example, a plugin might say that it can handle resources with <a href=#concept-url-path title=concept-url-path>path</a> components that end with the four character string "<code title="">.swf</code>".</p>
 
     <!-- it's sad that we have to do extension sniffing. sigh. -->
     <!-- see also <object> which has a similar step -->
@@ -25860,12 +25295,14 @@
         <!-- if we get to this point we know we can successfully parsed the URL, since this
         algorithm is only used after fetching the resource in the steps above -->
 
-        <p>If the <a href=#url-path title=url-path><path></a> component of the <a href=#url>URL</a> of
-        the specified resource (after any redirects) matches a pattern that a <a href=#plugin>plugin</a>
+<!--CLEANUP-->
+        <p>If applying the <a href=#url-parser>URL parser</a> algorithm to the
+        <a href=#url>URL</a> of the specified resource (after any redirects) results in a <a href=#parsed-url>parsed URL</a>
+        whose <a href=#concept-url-path title=concept-url-path>path</a> component matches a pattern that a <a href=#plugin>plugin</a>
         supports, then let <var title="">resource type</var> be the type that that plugin can
         handle.</p>
 
-        <p class=example>For example, a plugin might say that it can handle resources with <a href=#url-path title=url-path><path></a> components that end with the four character string
+        <p class=example>For example, a plugin might say that it can handle resources with <a href=#concept-url-path title=concept-url-path>path</a> components that end with the four character string
         "<code title="">.swf</code>".</p>
 
         <!-- it's sad that we have to do extension sniffing. sigh. -->
@@ -29934,7 +29371,7 @@
   should play, but it is also possible to select specific tracks declaratively, by specifying
   particular tracks in the fragment identifier of the <a href=#url>URL</a> of the <a href=#media-resource>media
   resource</a>. The format of the fragment identifier depends on the <a href=#mime-type>MIME type</a> of
-  the <a href=#media-resource>media resource</a>. <a href=#refsRFC2046>[RFC2046]</a> <a href=#refsRFC3986>[RFC3986]</a></p>
+  the <a href=#media-resource>media resource</a>. <a href=#refsRFC2046>[RFC2046]</a> <a href=#refsURL>[URL]</a></p>
 
   <div class=example>
 
@@ -39553,16 +38990,8 @@
   readonly attribute <a href=#domtokenlist>DOMTokenList</a> <a href=#dom-area-rellist title=dom-area-relList>relList</a>;
            attribute DOMString <a href=#dom-area-hreflang title=dom-area-hreflang>hreflang</a>;
            attribute DOMString <a href=#dom-area-type title=dom-area-type>type</a>;
-
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
-           attribute DOMString <a href=#dom-area-protocol title=dom-area-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-area-host title=dom-area-host>host</a>;
-           attribute DOMString <a href=#dom-area-hostname title=dom-area-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-area-port title=dom-area-port>port</a>;
-           attribute DOMString <a href=#dom-area-pathname title=dom-area-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-area-search title=dom-area-search>search</a>;
-           attribute DOMString <a href=#dom-area-hash title=dom-area-hash>hash</a>;
-};</pre>
+};
+<a href=#htmlareaelement>HTMLAreaElement</a> implements <a href=#urlutils>URLUtils</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-area-element>area</a></code> element <a href=#represents>represents</a> either a
   hyperlink with some text and a corresponding area on an <a href=#image-map>image
@@ -39704,7 +39133,7 @@
    the <code><a href=#the-area-element>area</a></code> element, if any, and as determined by the <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute and any expressed user
    preference.</li>
 
-  </ol><p>The IDL attributes <dfn id=dom-area-alt title=dom-area-alt><code>alt</code></dfn>, <dfn id=dom-area-coords title=dom-area-coords><code>coords</code></dfn>, <dfn id=dom-area-href title=dom-area-href><code>href</code></dfn>, <dfn id=dom-area-target title=dom-area-target><code>target</code></dfn>, <dfn id=dom-area-download title=dom-area-download><code>download</code></dfn>, <dfn id=dom-area-ping title=dom-area-ping><code>ping</code></dfn>, <dfn id=dom-area-rel title=dom-area-rel><code>rel</code></dfn>,
+  </ol><p>The IDL attributes <dfn id=dom-area-alt title=dom-area-alt><code>alt</code></dfn>, <dfn id=dom-area-coords title=dom-area-coords><code>coords</code></dfn>, <dfn id=dom-area-target title=dom-area-target><code>target</code></dfn>, <dfn id=dom-area-download title=dom-area-download><code>download</code></dfn>, <dfn id=dom-area-href title=dom-area-href><code>href</code></dfn>, <dfn id=dom-area-ping title=dom-area-ping><code>ping</code></dfn>, <dfn id=dom-area-rel title=dom-area-rel><code>rel</code></dfn>,
   <dfn id=dom-area-hreflang title=dom-area-hreflang><code>hreflang</code></dfn>, and <dfn id=dom-area-type title=dom-area-type><code>type</code></dfn>, each must <a href=#reflect>reflect</a> the respective
   content attributes of the same name.</p>
 
@@ -39714,13 +39143,12 @@
   <p>The IDL attribute <dfn id=dom-area-rellist title=dom-area-rellist><code>relList</code></dfn> must
   <a href=#reflect>reflect</a> the <code title=attr-hyperlink-rel><a href=#attr-hyperlink-rel>rel</a></code> content attribute.</p>
 
-  <p>The <code><a href=#the-area-element>area</a></code> element also supports the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-area-protocol title=dom-area-protocol><code>protocol</code></dfn>, <dfn id=dom-area-host title=dom-area-host><code>host</code></dfn>, <dfn id=dom-area-port title=dom-area-port><code>port</code></dfn>,
-  <dfn id=dom-area-hostname title=dom-area-hostname><code>hostname</code></dfn>, <dfn id=dom-area-pathname title=dom-area-pathname><code>pathname</code></dfn>, <dfn id=dom-area-search title=dom-area-search><code>search</code></dfn>, and <dfn id=dom-area-hash title=dom-area-hash><code>hash</code></dfn>. These must follow the rules given for <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being
-  the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the element's
-  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute to the new output value.</p>
+  <p>The <code><a href=#the-area-element>area</a></code> element also supports the <code><a href=#urlutils>URLUtils</a></code> interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is
+  the value of the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <a href=#concept-uu-base title=concept-uu-base>base</a>
+  is <a href="#the-element's-base-url">the element's base URL</a>; the <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a>
+  being the <a href="#document's-character-encoding">document's character encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> being the same as setting the element's
+  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute to the new output value.</p>
 
   </div>
 
@@ -55545,6 +54973,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class=impl>
 
@@ -55596,11 +55025,6 @@
     <p>If <var title="">action</var> is the empty string, let <var title="">action</var> be <a href="#the-document's-address">the document's address</a> of
     the <var title="">form document</var>.</p>
 
-    <p class=note>This step is a <a href=#willful-violation>willful violation</a> of
-    RFC 3986, which would require base URL processing here. This
-    violation is motivated by a desire for compatibility with legacy
-    content. <a href=#refsRFC3986>[RFC3986]</a></p>
-
     <!-- Don't ask me why. But that's what IE does. It even treats
     action="" differently from action=" " or action="#" (the latter
     two resolve to the base URL, the first one resolves to the doc
@@ -55613,12 +55037,17 @@
 
    <li><p><a href=#resolve-a-url title="resolve a url">Resolve</a> the
    <a href=#url>URL</a> <var title="">action</var>, relative to the <var title="">submitter</var> element. If this fails, abort these
-   steps. Otherwise, let <var title="">action</var> be the resulting
-   <a href=#absolute-url>absolute URL</a>.</li>
+   steps.</li>
 
-   <li><p>Let <var title="">scheme</var> be the <a href=#url-scheme title=url-scheme><scheme></a> of the resulting
+   <li><p>Let <var title="">action</var> be the resulting
    <a href=#absolute-url>absolute URL</a>.</li>
 
+   <li><p>Let <var title="">action components</var> be the resulting <a href=#parsed-url>parsed
+   URL</a>.</li>
+
+   <li><p>Let <var title="">scheme</var> be the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> of the resulting
+   <a href=#parsed-url>parsed URL</a>.</li>
+
    <li><p>Let <var title="">enctype</var> be the <var title="">submitter</var> element's <a href=#concept-fs-enctype title=concept-fs-enctype>enctype</a>.</li>
 
    <li><p>Let <var title="">method</var> be the <var title="">submitter</var> element's <a href=#concept-fs-method title=concept-fs-method>method</a>.</li>
@@ -55689,11 +55118,11 @@
       <!-- by this point we've already tried to resolve the URL, so we
       know we can parse it -->
 
+      <p>Set <var title="">parsed action</var>'s <a href=#concept-url-query title=concept-url-query>query</a>
+      component to <var title="">query</var>.</p>
+
       <p>Let <var title="">destination</var> be a new <a href=#url>URL</a>
-      that is equal to the <var title="">action</var> except that its
-      <a href=#url-query title=url-query><query></a> component is
-      replaced by <var title="">query</var> (adding a U+003F QUESTION
-      MARK character (?) if appropriate).</p>
+      formed by applying the <a href=#url-serializer>URL serializer</a> algorithm to <var title="">parsed action</var>.</p>
 
       <p><a href=#navigate>Navigate</a><!--DONAV form--> <var title="">target
       browsing context</var> to <var title="">destination</var>. If
@@ -55750,6 +55179,8 @@
       browsing context</var> must be navigated with <a href=#replacement-enabled>replacement
       enabled</a>.</p>
 
+      <p class=note>The <var title="">form data set</var> is discarded.</p>
+
      </dd>
 
      <dt><dfn id=submit-data-post title=submit-data-post>Post to data:</dfn>
@@ -55760,20 +55191,19 @@
       form encoding algorithm</a>.</p>
 
       <p>If <var title="">action</var> contains the string "<code title="">%%%%</code>" (four U+0025 PERCENT SIGN characters),
-      then %-escape all bytes in <var title="">data</var> that, if
-      interpreted as US-ASCII, do not match the <code title="">unreserved</code> production in the URI Generic Syntax,
-      and then, treating the result as a US-ASCII string, further
-      %-escape all the U+0025 PERCENT SIGN characters in the resulting
+      then <a href=#percent-encode>percent encode</a> all bytes in <var title="">data</var> that, if
+      interpreted as US-ASCII, are not characters in the URL <a href=#default-encode-set>default encode set</a>,
+      and then, treating the result as a US-ASCII string, 
+      <a href=#utf-8-percent-encode>UTF-8 percent encode</a> all the U+0025 PERCENT SIGN characters in the resulting
       string and replace the first occurrence of "<code title="">%%%%</code>" in <var title="">action</var> with the
-      resulting double-escaped string. <a href=#refsRFC3986>[RFC3986]</a></p>
+      resulting doubly-escaped string. <a href=#refsURL>[URL]</a></p>
 
       <p>Otherwise, if <var title="">action</var> contains the string
       "<code title="">%%</code>" (two U+0025 PERCENT SIGN characters
-      in a row, but not four), then %-escape all characters in <var title="">data</var> that, if interpreted as US-ASCII, do not
-      match the <code title="">unreserved</code> production in the URI
-      Generic Syntax, and then, treating the result as a US-ASCII
+      in a row, but not four), then <a href=#utf-8-percent-encode>UTF-8 percent encode</a> all characters in <var title="">data</var> that, if interpreted as US-ASCII, 
+      are not characters in the URL <a href=#default-encode-set>default encode set</a>, and then, treating the result as a US-ASCII
       string, replace the first occurrence of "<code title="">%%</code>" in <var title="">action</var> with the
-      resulting escaped string. <a href=#refsRFC3986>[RFC3986]</a></p>
+      resulting escaped string. <a href=#refsURL>[URL]</a></p>
 
       <p><a href=#navigate>Navigate</a><!--DONAV form--> <var title="">target
       browsing context</var> to the potentially modified <var title="">action</var> (which will be a <a href=#data-protocol title="data
@@ -55813,12 +55243,11 @@
      <dt><dfn id=submit-mailto-body title=submit-mailto-body>Mail as body</dfn>
      <dd>
 
-      <p>Let <var title="">body</var> be the resulting encoding the
+      <p>Let <var title="">body</var> be the resulting of encoding the
       <var title="">form data set</var> using the <a href=#appropriate-form-encoding-algorithm>appropriate
-      form encoding algorithm</a> and then %-escaping all the bytes
+      form encoding algorithm</a> and then <a href=#percent-encode title="percent encode">percent encoding</a> all the bytes
       in the resulting byte string that, when interpreted as US-ASCII,
-      do not match the <code title="">unreserved</code> production in
-      the URI Generic Syntax. <a href=#refsRFC3986>[RFC3986]</a></p>
+      are not characters in the URL <a href=#default-encode-set>default encode set</a>. <a href=#refsURL>[URL]</a></p>
 
       <p>Let <var title="">destination</var> have the same value as
       <var title="">action</var>.</p>
@@ -64849,7 +64278,11 @@
   <a href=#completely-loaded>completely loaded</a> immediately. The <code><a href=#document>Document</a></code> must have a single child
   <code><a href=#the-html-element>html</a></code> node, which itself has a single child <code><a href=#the-body-element>body</a></code> node. As soon as this
   <code><a href=#document>Document</a></code> is created, the user agent must <a href=#implement-the-sandboxing>implement the sandboxing</a> for
-  it.</p>
+  it. If the <a href=#browsing-context>browsing context</a> has a <a href=#creator-document>creator <code>Document</code></a>, then
+  the <a href=#browsing-context>browsing context</a>'s <code><a href=#document>Document</a></code>'s <a href="#the-document's-referrer" title="the document's
+  referrer">referrer</a> must be set to <a href="#the-document's-address" title="the document's address">the address</a>
+  of that <a href=#creator-document>creator <code>Document</code></a> at the time of the <a href=#browsing-context>browsing
+  context</a>'s creation.</p>
 
   <p class=note>If the <a href=#browsing-context>browsing context</a> is created specifically to be immediately
   navigated, then that initial navigation will have <a href=#replacement-enabled>replacement enabled</a>.</p>
@@ -66489,10 +65922,11 @@
 
   </dl><div class=impl>
 
+<!--CLEANUP-->
   <p>The <dfn id=dom-document-domain title=dom-document-domain><code>domain</code></dfn> attribute on
   <code><a href=#document>Document</a></code> objects must be initialized to <a href="#the-document's-domain">the document's domain</a>, if it has
   one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
-  from the host portion of the <a href=#url-host title=url-host><host></a> component must be omitted
+  from the <a href=#concept-url-host title=concept-url-host>host</a> component must be omitted
   from the attribute's value.</p>
 
   <p>On getting, the attribute must return its current value, unless the <code><a href=#document>Document</a></code> has
@@ -67210,22 +66644,22 @@
 
      <li>If that fails, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort these steps.</li>
 
-     <li>Compare the resulting <a href=#absolute-url>absolute URL</a> to <a href="#the-document's-address">the document's address</a>. If
-     any part of these two <a href=#url title=URL>URLs</a> differ other than the <a href=#url-path title=url-path><path></a>, <a href=#url-query title=url-query><query></a>, and <a href=#url-fragment title=url-fragment><fragment></a> components, then throw a
+<!--CLEANUP-->
+     <li>Compare the resulting <a href=#parsed-url>parsed URL</a> to the result of applying the <a href=#url-parser>URL parser</a> algorithm to <a href="#the-document's-address">the document's address</a>. If
+     any component of these two <a href=#url title=URL>URLs</a> differ other than the <a href=#concept-url-path title=concept-url-path>path</a>, <a href=#concept-url-query title=concept-url-query>query</a>, and <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> components, then throw a
      <code><a href=#securityerror>SecurityError</a></code> exception and abort these steps.</li>
 
      <li>If the <a href=#origin>origin</a> of the resulting <a href=#absolute-url>absolute URL</a> is not the same as
      the <a href=#origin>origin</a> of the <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's
-     document">document</a>, and either the <a href=#url-path title=url-path><path></a> or <a href=#url-query title=url-query><query></a> components of the two <a href=#url title=URL>URLs</a>
+     document">document</a>, and either the <a href=#concept-url-path title=concept-url-path>path</a> or <a href=#concept-url-query title=concept-url-query>query</a> components of the two <a href=#parsed-url title="parsed URL">parsed URLs</a>
      compared in the previous step differ, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort
      these steps. (This prevents sandboxed content from spoofing other pages on the same
      origin.)</li>
 
      <li><p>Let <var title="">new URL</var> be the resulting <a href=#absolute-url>absolute URL</a>.</li>
 
-    </ol><p>For the purposes of the comparisons in the above substeps, the <a href=#url-path title=url-path><path></a> and <a href=#url-query title=url-query><query></a> components
-    can only be the same if the URLs are both <a href=#hierarchical-url title="hierarchical URL">hierarchical
-    URLs</a>.</p>
+    </ol><p>For the purposes of the comparisons in the above substeps, the <a href=#concept-url-path title=concept-url-path>path</a> and <a href=#concept-url-query title=concept-url-query>query</a> components
+    can only be the same if the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of both <a href=#parsed-url title="parsed URL">parsed URLs</a> are <a href=#concept-url-scheme-relative title=concept-url-scheme-relative>relative schemes</a>.</p>
 
    </li>
 
@@ -67452,17 +66886,9 @@
   void <a href=#dom-location-assign title=dom-location-assign>assign</a>(DOMString url);
   void <a href=#dom-location-replace title=dom-location-replace>replace</a>(DOMString url);
   void <a href=#dom-location-reload title=dom-location-reload>reload</a>();
+};
+<a href=#location>Location</a> implements <a href=#urlutils>URLUtils</a>;</pre>
 
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> <!-- blame brendan for these "innovative" names -->
-           attribute DOMString <a href=#dom-location-protocol title=dom-location-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-location-host title=dom-location-host>host</a>;
-           attribute DOMString <a href=#dom-location-hostname title=dom-location-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-location-port title=dom-location-port>port</a>;
-           attribute DOMString <a href=#dom-location-pathname title=dom-location-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-location-search title=dom-location-search>search</a>;
-           attribute DOMString <a href=#dom-location-hash title=dom-location-hash>hash</a>;
-};</pre>
-
   <dl class=domintro><dt><var title="">location</var> . <code title=dom-location-href><a href=#dom-location-href>href</a></code> [ = <var title="">value</var> ]</dt>
 
    <dd>
@@ -67579,16 +67005,18 @@
   user agent may instead perform <a href=#an-overridden-reload>an overridden reload</a> rather than the navigation
   described in this paragraph.</p>
 
+  <p>The <code><a href=#location>Location</a></code> interface also supports the <code><a href=#urlutils>URLUtils</a></code> interface. <span class=impl>The <a href=#concept-uu-input title=concept-uu-input>input</a> is <a href="#the-document's-address" title="the document's
+  address">the address</a> of the <i>relevant <code><a href=#document>Document</a></code></i> (same as the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute), as an <a href=#absolute-url>absolute URL</a>; the <a href=#concept-uu-base title=concept-uu-base>base</a> is the <a href=#entry-script>entry script</a>'s <a href="#script's-base-url" title="script's base
+  URL">base URL</a> (which can be different each time members on the interface are invoked); the
+  <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a> is the <a href="#document's-character-encoding">document's character
+  encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> are the same as
+  setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute to the new output
+  value.</span></p>
+
   </div>
 
-  <p>The <code><a href=#location>Location</a></code> interface also has the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-location-protocol title=dom-location-protocol><code>protocol</code></dfn>, <dfn id=dom-location-host title=dom-location-host><code>host</code></dfn>, <dfn id=dom-location-port title=dom-location-port><code>port</code></dfn>, <dfn id=dom-location-hostname title=dom-location-hostname><code>hostname</code></dfn>, <dfn id=dom-location-pathname title=dom-location-pathname><code>pathname</code></dfn>, <dfn id=dom-location-search title=dom-location-search><code>search</code></dfn>, and <dfn id=dom-location-hash title=dom-location-hash><code>hash</code></dfn>. <span class=impl>These must follow the rules
-  given for <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being <a href="#the-document's-address" title="the document's address">the
-  address</a> of the <i>relevant <code><a href=#document>Document</a></code></i>, as an <a href=#absolute-url>absolute URL</a> (same
-  as the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute), and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute to the new output value.</span></p>
 
 
-
 <!--ADD-TOPIC:Security-->
   <div class=impl>
 
@@ -67763,11 +67191,12 @@
 
    <li><p>Let <var title="">gone async</var> be false.</li>
 
-   <li id=navigate-fragid-step><p><i>Fragment identifiers</i>: If the <a href=#absolute-url>absolute URL</a> of
-   the new resource is the same as the <a href="#the-document's-address" title="the document's address">address</a> of the
-   <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, ignoring any
-   <a href=#url-fragment title=url-fragment><fragment></a> components of those <a href=#url title=URL>URLs</a>, and the new resource is to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and the <a href=#absolute-url>absolute URL</a> of
-   the new resource has a <a href=#url-fragment title=url-fragment><fragment></a> component (even if it
+<!--CLEANUP-->
+   <li id=navigate-fragid-step><p><i>Fragment identifiers</i>: Apply the <a href=#url-parser>URL parser</a> algorithm to the <a href=#absolute-url>absolute URL</a> of
+   the new resource and the <a href="#the-document's-address" title="the document's address">address</a> of the
+   <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated. If all the components of the resulting <a href=#parsed-url title="parsed URL">parsed URLs</a> , ignoring any
+   <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> components, are identical, and the new resource is to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and the <a href=#parsed-url>parsed URL</a> of
+   the new resource has a <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component that is not null (even if it
    is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment identifier</a> and
    abort these steps.</li>
 
@@ -68231,12 +67660,14 @@
   encoding is established, the <a href="#document's-character-encoding">document's character encoding</a> must be set to that
   character encoding.</p>
 
+<!--CLEANUP-->
   <p>If the root element, as parsed according to the XML specifications cited above, is found to be
   an <code><a href=#the-html-element>html</a></code> element with an attribute <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></code>
   whose value is not the empty string, then, as soon as the element is <a href=#insert-an-element-into-a-document title="insert an
   element into a document">inserted into the document</a>, the user agent must <a href=#resolve-a-url title="resolve a url">resolve</a> the value of that attribute relative to that element, and if
-  that is successful, must run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
-  algorithm</a> with the resulting <a href=#absolute-url>absolute URL</a> with any <a href=#url-fragment title=url-fragment><fragment></a> component removed as the manifest URL, and passing in
+  that is successful, must apply the <a href=#url-serializer>URL serializer</a> algorithm to the resulting <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set to obtain <var title="">manifest URL</var>, and then run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
+  algorithm</a> with <var title="">manifest URL</var>
+  as the manifest URL, passing in
   the newly-created <code><a href=#document>Document</a></code>. Otherwise, if the attribute is absent, its value is the
   empty string, or resolving its value fails, then as soon as the root element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into the document</a>, the user agent must
   run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection algorithm</a> with no
@@ -68478,8 +67909,8 @@
   processing model must be followed to determine what <a href=#the-indicated-part-of-the-document>the indicated part of the
   document</a> is.</p>
 
-  <ol><li><p><a href=#parse-a-url title="parse a url">Parse</a> the <a href=#url>URL</a>, and let <var title="">fragid</var> be the <a href=#url-fragment title=url-fragment><fragment></a> component of the
-   URL.</li><!-- parsing can't fail, since we checked earlier on when navigating -->
+  <ol><!--CLEANUP--><li><p>Apply the <a href=#url-parser>URL parser</a> algorithm to the <a href=#url>URL</a>, and let <var title="">fragid</var> be the <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component of the
+   resulting <a href=#parsed-url>parsed URL</a>.</li><!-- parsing can't fail, since we checked earlier on when navigating -->
 
    <li><p>If <var title="">fragid</var> is the empty string, then <a href=#the-indicated-part-of-the-document>the indicated part of the
    document</a> is the top of the document; stop the algorithm here.</li>
@@ -69611,7 +69042,7 @@
   </div>
 
 
-
+<!--CLEANUP-->
   <h5 id=writing-cache-manifests><span class=secno>6.7.3.2 </span>Writing cache manifests</h5>
 
   <p>Manifests must be served using the
@@ -69771,10 +69202,10 @@
   which another namespace in the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a> is
   a <a href=#prefix-match>prefix match</a>.</p>
 
-  <p>Relative URLs must be given relative to the manifest's own
-  URL. All URLs in the manifest must have the same <a href=#url-scheme title=url-scheme><scheme></a> as the manifest itself
-  (either explicitly or implicitly, through the use of relative
-  URLs).</p>
+  <p><a href=#relative-url title="relative URL">Relative URLs</a> must be given relative to the manifest's own
+  URL. All URLs in the manifest must have the same <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> as the manifest itself
+  (either explicitly or implicitly, through the use of <a href=#relative-url title="relative url">relative
+  URLs</a>). <a href=#refsURL>[URL]</a></p>
 
   <p>URLs in manifests must not have fragment identifiers (i.e. the
   U+0023 NUMBER SIGN character isn't allowed in URLs in
@@ -69785,6 +69216,7 @@
   matched by <a href=#prefix-match>prefix match</a>.</p>
 
 
+<!--CLEANUP-->
   <div class=impl>
 
   <h5 id=parsing-cache-manifests><span class=secno>6.7.3.3 </span>Parsing cache manifests</h5>
@@ -69792,7 +69224,7 @@
   <p>When a user agent is to <dfn id=parse-a-manifest>parse a manifest</dfn>, it means
   that the user agent must run the following steps:</p>
 
-  <ol><li><p>The user agent must decode the byte stream corresponding
+  <ol><li><p>Decode the byte stream corresponding
    with the manifest to be parsed <a href=#decoded-as-utf-8,-with-error-handling title="decoded as UTF-8, with
    error handling">as UTF-8, with error handling</a>. <!--All
    U+0000 NULL characters must be replaced by U+FFFD REPLACEMENT
@@ -69803,6 +69235,10 @@
    <li><p>Let <var title="">base URL</var> be the <a href=#absolute-url>absolute
    URL</a> representing the manifest.</li>
 
+   <li><p>Apply the <a href=#url-parser>URL parser</a> steps to the <var title="">base URL</var>, so that the
+   components from its <a href=#parsed-url>parsed URL</a> can be used by the subseqent steps of this
+   algorithm.</li>
+
    <li><p>Let <var title="">explicit URLs</var> be an initially empty
    list of <a href=#absolute-url title="absolute URL">absolute URLs</a> for <a href=#concept-appcache-explicit title=concept-appcache-explicit>explicit entries</a>.</li>
 
@@ -69942,17 +69378,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <a href=#absolute-url>absolute URL</a> has a different
-      <a href=#url-scheme title=url-scheme><scheme></a> component than
-      the manifest's URL (compared in an <a href=#ascii-case-insensitive>ASCII
-      case-insensitive</a> manner), then jump back to the step
+      <p>If the resulting <a href=#parsed-url>parsed URL</a> has a different
+      <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <a href=#url-fragment title=url-fragment><fragment></a>
-      component of the resulting <a href=#absolute-url>absolute URL</a>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <a href=#absolute-url>absolute URL</a> to the <var title="">explicit URLs</var>.</p>
+      <p>Add <var title="">new URL</var> to the <var title="">explicit URLs</var>.</p>
 
      </dd>
 
@@ -69974,18 +69408,22 @@
       jump back to the step labeled "start of line".</p> <!-- SECURITY
       -->
 
-      <p>Drop any <a href=#url-fragment title=url-fragment><fragment></a>
-      components of the resulting <a href=#absolute-url title="absolute URL">absolute
-      URLs</a>.</p>
+      <p>Let <var title="">part one</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the first resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment
+      flag</i> set.</p>
 
-      <p>If the <a href=#absolute-url>absolute URL</a> corresponding to <var title="">part one</var> is already in the <var title="">fallback
+      <p>Let <var title="">part two</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the second resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment
+      flag</i> set.</p>
+
+      <p>If <var title="">part one</var> is already in the <var title="">fallback
       URLs</var> mapping as a <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespace</a>,
       then jump back to the step labeled "start of line".</p>
 
-      <p>Otherwise, add the <a href=#absolute-url>absolute URL</a> corresponding to
+      <p>Otherwise, add 
       <var title="">part one</var> to the <var title="">fallback
       URLs</var> mapping as a <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespace</a>,
-      mapped to the <a href=#absolute-url>absolute URL</a> corresponding to <var title="">part two</var> as the <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entry</a>.</p>
+      mapped to <var title="">part two</var> as the <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entry</a>.</p>
 
      </dd>
 
@@ -70004,17 +69442,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <a href=#absolute-url>absolute URL</a> has a different
-      <a href=#url-scheme title=url-scheme><scheme></a> component than
-      the manifest's URL (compared in an <a href=#ascii-case-insensitive>ASCII
-      case-insensitive</a> manner), then jump back to the step
+      <p>If the resulting <a href=#parsed-url>parsed URL</a> has a different
+      <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <a href=#url-fragment title=url-fragment><fragment></a>
-      component of the resulting <a href=#absolute-url>absolute URL</a>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <a href=#absolute-url>absolute URL</a> to the <var title="">online whitelist namespaces</var>.</p>
+      <p>Add <var title="">new URL</var> to the <var title="">online whitelist namespaces</var>.</p>
 
      </dd>
 
@@ -70299,10 +69735,11 @@
       <a href=#shows-caching-progress>shows caching progress</a>, the display of some sort of user interface indicating to
       the user that the user agent failed to save the application for offline use.</p>
 
+<!--CLEANUP-->
       <p>Otherwise, associate the <code><a href=#document>Document</a></code> for this entry with <var title="">cache</var>; store the resource for this entry in <var title="">cache</var>, if it
-      isn't already there, and categorize its entry as a <a href=#concept-appcache-master title=concept-appcache-master>master entry</a>. If the resource's <a href=#url>URL</a> has a
-      <a href=#url-fragment title=url-fragment><fragment></a> component, it must be removed from the
-      entry in <var title="">cache</var> (application caches never include fragment
+      isn't already there, and categorize its entry as a <a href=#concept-appcache-master title=concept-appcache-master>master entry</a>. If applying the <a href=#url-parser>URL parser</a> algorithm to the resource's <a href=#url>URL</a> results in a <a href=#parsed-url>parsed URL</a> that has a non-null
+      <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component, the <a href=#url>URL</a> used for the
+      entry in <var title="">cache</var> must instead be the <a href=#absolute-url>absolute URL</a> obtained from applying the <a href=#url-serializer>URL serializer</a> algorith, to the <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set (application caches never include fragment
       identifiers).</p>
 
      </li>
@@ -70823,8 +70260,8 @@
 
   <ol><!--FETCH--><li><p>If the resource is not to be fetched using the HTTP GET
    mechanism <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or
-   equivalent</a>, or if its <a href=#url>URL</a> has a different <a href=#url-scheme title=url-scheme><scheme></a> component than the
-   <a href=#application-cache>application cache</a>'s <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>, then
+   equivalent</a>, or if applying the <a href=#url-parser>URL parser</a> algorithm to both its <a href=#url>URL</a> and the
+   <a href=#application-cache>application cache</a>'s <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>'s URL results in two <a href=#parsed-url title="parsed URL">parsed URLs</a> with different <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> components, then
    <a href=#fetch>fetch</a> the resource normally and abort these
    steps.</li>
 
@@ -71323,6 +70760,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class=impl>
 
@@ -71469,7 +70907,7 @@
    <dd>
 
     <p>A <a href=#url>URL</a>, set when the script is created, used to
-    resolve relative URLs. <span id=sbu-not-copy title="">If the
+    resolve <a href=#relative-url title="relative url">relative URLs</a>. <span id=sbu-not-copy title="">If the
     base URL is set from another source, e.g. a <a href=#document-base-url>document base
     URL</a>, then the <a href="#script's-base-url">script's base URL</a> must follow
     the source, so that if the source's changes, so does the
@@ -73949,6 +73387,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <h5 id=custom-handlers><span class=secno>7.5.1.3 </span>Custom scheme and content handlers</h5>
 
@@ -74171,11 +73610,10 @@
     resulting URL using the GET method (<a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a> for
     non-HTTP URLs).</p>
 
-    <p>To get the escaped version of the <a href=#absolute-url>absolute URL</a> of
-    the content in question, the user agent must replace every
-    character in that <a href=#absolute-url>absolute URL</a> that doesn't match the
-    <query> production defined in RFC 3986 by the
-    percent-encoded form of that character. <a href=#refsRFC3986>[RFC3986]</a></p>
+    <p>To get the escaped version of the <a href=#absolute-url>absolute URL</a> of the content in question, the
+    user agent must replace every character in that <a href=#absolute-url>absolute URL</a> that is not a
+    character in the URL <a href=#default-encode-set>default encode set</a> with the result of <a href=#utf-8-percent-encode title="UTF-8 percent
+    encode">UTF-8 percent encoding</a> that character.</p>
 
     <div class=example>
 
@@ -74695,8 +74133,8 @@
 
     <li><p>If this fails, return 0 and abort these steps.</li>
 
-    <li><p>Let <var title="">host2</var> be be the <a href=#url-host title=url-host><host></a> component of the resulting
-    <a href=#absolute-url>absolute URL</a>.</li>
+    <li><p>Let <var title="">host2</var> be be the <a href=#concept-url-host title=concept-url-host>host</a> component of the resulting
+    <a href=#parsed-url>parsed URL</a>.</li>
 
     <li>
 
@@ -74710,10 +74148,8 @@
      <var title="">host2</var> after their common suffix are not the
      same, then return 0 and abort these steps.</p>
 
-     <p>Domain labels must be compared after applying the IDNA ToASCII
-     algorithm to them, with both the AllowUnassigned and
-     UseSTD3ASCIIRules flags set, in an <a href=#ascii-case-insensitive>ASCII
-     case-insensitive</a> manner. <a href=#refsRFC3490>[RFC3490]</a></p>
+     <!-- host1 is ascii here because origins are ascii. host2 is ascii because resolve urls
+     punycodes idna. -->
 
     </li>
 
@@ -78762,6 +78198,7 @@
   </div>
 -->
 
+<!--CLEANUP-->
 
 <!--ADD-TOPIC:Security-->
   <div class=impl>
@@ -78791,7 +78228,7 @@
 
   <p>User agents should filter potentially active (scripted) content
   (e.g. HTML) when it is dragged and when it is dropped, using a
-  whitelist of known-safe features. Similarly, relative URLs should be
+  whitelist of known-safe features. Similarly, <a href=#relative-url title="relative url">relative URLs</a> should be
   turned into absolute URLs to avoid references changing in unexpected
   ways. This specification does not specify how this is performed.</p>
 
@@ -80412,7 +79849,7 @@
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-abstractworker-onerror title=handler-AbstractWorker-onerror><code>onerror</code></dfn> <td> <code title=event-error>error</code>
 <!-- v2-onclose    <tr><td><dfn title="handler-AbstractWorker-onclose"><code>onclose</code></dfn> <td> <code title="event-worker-close">close</code> -->
-  </table><h5 id=dedicated-workers-and-the-worker-interface><span class=secno>9.2.6.2 </span>Dedicated workers and the <code><a href=#worker>Worker</a></code> interface</h5>
+  </table><!--CLEANUP--><h5 id=dedicated-workers-and-the-worker-interface><span class=secno>9.2.6.2 </span>Dedicated workers and the <code><a href=#worker>Worker</a></code> interface</h5>
 
   <pre class=idl>[<a href=#dom-worker title=dom-Worker>Constructor</a>(DOMString scriptURL)]
 interface <dfn id=worker>Worker</dfn> : <a href=#eventtarget>EventTarget</a> {
@@ -80481,8 +79918,8 @@
 
    <li>
 
-    <p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of
-    the resulting <a href=#absolute-url>absolute URL</a> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
+    <p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of
+    the resulting <a href=#parsed-url>parsed URL</a> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
     the resulting <a href=#absolute-url>absolute URL</a> is not the <a href=#same-origin title="same origin">same</a> as the origin of the <a href=#entry-script>entry
     script</a>, then throw a <code><a href=#securityerror>SecurityError</a></code> exception
     and abort these steps.</p>
@@ -80605,7 +80042,8 @@
    exception.</li>
 
    <li><p>Otherwise, let <var title="">scriptURL</var> be the
-   resulting <a href=#absolute-url>absolute URL</a>.</li>
+   resulting <a href=#absolute-url>absolute URL</a> and <var title="">parsed scriptURL</var> be the
+   resulting <a href=#parsed-url>parsed URL</a>.</li>
 
    <li><p>Let <var title="">name</var> be the value of the second
    argument, or the empty string if the second argument was
@@ -80613,8 +80051,8 @@
 
    <li>
 
-    <p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of
-    <var title="">scriptURL</var> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
+    <p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of
+    <var title="">parsed scriptURL</var> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
     <var title="">scriptURL</var> is not the <a href=#same-origin title="same
     origin">same</a> as the origin of the <a href=#entry-script>entry
     script</a>, then throw a <code><a href=#securityerror>SecurityError</a></code> exception
@@ -80966,16 +80404,9 @@
   <h4 id=worker-locations><span class=secno>9.3.4 </span>Worker locations</h4>
 
   <pre class=idl>interface <dfn id=workerlocation>WorkerLocation</dfn> {
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
   stringifier readonly attribute DOMString <a href=#dom-workerlocation-href title=dom-WorkerLocation-href>href</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-protocol title=dom-WorkerLocation-protocol>protocol</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-host title=dom-WorkerLocation-host>host</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-hostname title=dom-WorkerLocation-hostname>hostname</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-port title=dom-WorkerLocation-port>port</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-pathname title=dom-WorkerLocation-pathname>pathname</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-search title=dom-WorkerLocation-search>search</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-hash title=dom-WorkerLocation-hash>hash</a>;
-};</pre>
+};
+<a href=#workerlocation>WorkerLocation</a> implements <a href=#urlutilsreadonly>URLUtilsReadOnly</a>;</pre>
 
   <p>A <code><a href=#workerlocation>WorkerLocation</a></code> object represents an <a href=#absolute-url>absolute URL</a> set at its
   creation.</p>
@@ -80983,13 +80414,10 @@
   <p>The <dfn id=dom-workerlocation-href title=dom-WorkerLocation-href><code>href</code></dfn> attribute must return the
   <a href=#absolute-url>absolute URL</a> that the object represents.</p>
 
-  <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface also has the complement of <a href=#url-decomposition-idl-attributes>URL decomposition
-  IDL attributes</a>, <dfn id=dom-workerlocation-protocol title=dom-WorkerLocation-protocol><code>protocol</code></dfn>, <dfn id=dom-workerlocation-host title=dom-WorkerLocation-host><code>host</code></dfn>, <dfn id=dom-workerlocation-port title=dom-WorkerLocation-port><code>port</code></dfn>, <dfn id=dom-workerlocation-hostname title=dom-WorkerLocation-hostname><code>hostname</code></dfn>, <dfn id=dom-workerlocation-pathname title=dom-WorkerLocation-pathname><code>pathname</code></dfn>, <dfn id=dom-workerlocation-search title=dom-WorkerLocation-search><code>search</code></dfn>, and <dfn id=dom-workerlocation-hash title=dom-WorkerLocation-hash><code>hash</code></dfn>. These must follow the rules given for
-  <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being the <a href=#absolute-url>absolute URL</a> that the object
-  represents (same as the <code title=dom-WorkerLocation-href><a href=#dom-workerlocation-href>href</a></code> attribute), and the
-  <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being a no-op, since the attributes
-  are defined to be readonly.
-  </p>
+  <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface also supports the <code><a href=#urlutilsreadonly>URLUtilsReadOnly</a></code>
+  interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is the <a href=#absolute-url>absolute URL</a> that
+  the object represents (same as the <code title=dom-WorkerLocation-href><a href=#dom-workerlocation-href>href</a></code>
+  attribute). <a href=#refsURL>[URL]</a></p>
 
   <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface must only be <a href=#expose title=expose>exposed</a> if
   the <a href=#javascript-global-environment>JavaScript global environment</a> is a <a href=#worker-environment>worker environment</a>.</p>
@@ -82602,6 +82030,7 @@
   https://www.w3.org/Bugs/Public/show_bug.cgi?id=17264 -->
 
 
+<!--CLEANUP-->
   <h4 id=parsing-websocket-urls><span class=secno>10.3.5 </span>Parsing WebSocket URLs</h4>
 
   <p>The steps to <dfn id="parse-a-websocket-url's-components">parse a WebSocket URL's components</dfn> from a string <var title="">url</var> are as follows. These steps return either a <var title="">host</var>, a <var title="">port</var>, a <var title="">resource name</var>, and a <var title="">secure</var> flag,
@@ -82621,34 +82050,34 @@
 
    </li>
 
-   <li><p>If <var title="">url</var> does not have a <a href=#url-scheme title=url-scheme><scheme></a>
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> does not have a <a href=#concept-url-scheme title=concept-url-scheme>scheme</a>
    component whose value, when <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is either "<code title="">ws</code>" or "<code title="">wss</code>", then fail this algorithm.</li>
 
-   <li><p>If <var title="">url</var> has a <a href=#url-fragment title=url-fragment><fragment></a>
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a non-null <a href=#concept-url-fragment title=concept-url-fragment>fragment</a>
    component, then fail this algorithm.</li>
 
-   <li><p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of <var title="">url</var>
-   is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <a href=#url-scheme title=url-scheme><scheme></a> component is "<code title="">wss</code>", set <var title="">secure</var> to true.</li>
+   <li><p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of the resulting <a href=#parsed-url>parsed URL</a>
+   is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component is "<code title="">wss</code>", set <var title="">secure</var> to true.</li>
 
-   <li><p>Let <var title="">host</var> be the value of the <a href=#url-host title=url-host><host></a> component of <var title="">url</var>, <a href=#converted-to-ascii-lowercase>converted to
+   <li><p>Let <var title="">host</var> be the value of the resulting <a href=#parsed-url>parsed URL</a>'s <a href=#concept-url-host title=concept-url-host>host</a> component, <a href=#converted-to-ascii-lowercase>converted to
    ASCII lowercase</a>.</li> <!-- at this point this is Punycode-encoded already -->
 
-   <li><p>If <var title="">url</var> has a <a href=#url-port title=url-port><port></a> component,
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a <a href=#concept-url-port title=concept-url-port>port</a> component that is not the empty string,
    then let <var title="">port</var> be that component's value; otherwise, there is no explicit <var title="">port</var>.</li>
 
    <li><p>If there is no explicit <var title="">port</var>, then: if <var title="">secure</var> is
    false, let <var title="">port</var> be 80, otherwise let <var title="">port</var> be
    443.</li>
 
-   <li><p>Let <var title="">resource name</var> be the value of the <a href=#url-path title=url-path><path></a> component (which might be empty) of <var title="">url</var>.</li> <!-- at this point this is UTF-8 encoded and %-escaped -->
+   <li><p>Let <var title="">resource name</var> be the value of the resulting <a href=#parsed-url>parsed URL</a>'s <a href=#concept-url-path title=concept-url-path>path</a> component (which might be empty).</li> <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>If <var title="">resource name</var> is the empty string, set it to a single character
    U+002F SOLIDUS (/).</li>
 
-   <li><p>If <var title="">url</var> has a <a href=#url-query title=url-query><query></a> component,
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a non-null <a href=#concept-url-query title=concept-url-query>query</a> component,
    then append a single U+003F QUESTION MARK character (?) to <var title="">resource name</var>,
-   followed by the value of the <a href=#url-query title=url-query><query></a> component.</li>
-   <!-- at this point this is UTF-8 encoded and %-escaped -->
+   followed by the value of the <a href=#concept-url-query title=concept-url-query>query</a> component.</li>
+   <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
    name</var>, and <var title="">secure</var>.</li>
@@ -85045,7 +84474,7 @@
   <p class=note>Whether the attributes in the table above are
   conforming or not is defined by other specifications (e.g. the SVG
   and MathML specifications); this section only describes the syntax
-  rules if the attributes are serialised using the HTML syntax.</p>
+  rules if the attributes are serialized using the HTML syntax.</p>
 
 
   <h5 id=optional-tags><span class=secno>12.1.2.4 </span>Optional tags</h5>
@@ -89430,9 +88859,8 @@
     url">resolve</a> the value of that attribute to an
     <a href=#absolute-url>absolute URL</a>, relative to the newly created element,
     and if that is successful, run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
-    algorithm</a> with the resulting <a href=#absolute-url>absolute URL</a> with
-    any <a href=#url-fragment title=url-fragment><fragment></a> component
-    removed; otherwise, if there is no such attribute, or its value is
+    algorithm</a> with the result of applying the <a href=#url-serializer>URL serializer</a> algorithm to
+    the resulting <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set; otherwise, if there is no such attribute, or its value is
     the empty string, or resolving its value fails, run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
     algorithm</a> with no manifest. The algorithm must be passed
     the <code><a href=#document>Document</a></code> object.</p>
@@ -102411,12 +101839,6 @@
    <dt id=refsRFC3864>[RFC3864]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc3864>Registration Procedures for Message Header Fields</a></cite>, G. Klyne, M. Nottingham, J. Mogul. IETF.</dd>
 
-   <dt id=refsRFC3986>[RFC3986]</dt>
-   <dd><cite><a href=http://tools.ietf.org/html/rfc3986>Uniform Resource Identifier (URI): Generic Syntax</a></cite>, T. Berners-Lee, R. Fielding, L. Masinter. IETF.</dd>
-
-   <dt id=refsRFC3987>[RFC3987]</dt>
-   <dd><cite><a href=http://tools.ietf.org/html/rfc3987>Internationalized Resource Identifiers (IRIs)</a></cite>, M. Dürst, M. Suignard. IETF.</dd>
-
    <dt id=refsRFC4281>[RFC4281]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc4281>The Codecs Parameter for "Bucket" Media Types</a></cite>, R. Gellens, D. Singer, P. Frojdh. IETF.</dd>
 
@@ -102471,6 +101893,9 @@
    <dt id=refsUNIVCHARDET>[UNIVCHARDET]</dt>
    <dd>(Non-normative) <cite><a href=http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html>A composite approach to language/encoding detection</a></cite>, S. Li, K. Momoi. Netscape. In <cite>Proceedings of the 19th International Unicode Conference</cite>.</dd>
 
+   <dt id=refsURL>[URL]</dt>
+   <dd><cite><a href=http://url.spec.whatwg.org/>URL</a></cite>, A. van Kestern. WHATWG.</dd>
+
    <dt id=refsUTF7>[UTF7]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc2152>UTF-7: A Mail-Safe Transformation Format of Unicode</a></cite>, D. Goldsmith, M. Davis. IETF.</dd>
 

Modified: index
===================================================================
--- index	2013-02-08 07:06:47 UTC (rev 7709)
+++ index	2013-02-09 02:07:29 UTC (rev 7710)
@@ -248,7 +248,7 @@
 
   <header class=head id=head><p><a class=logo href=http://www.whatwg.org/><img alt=WHATWG height=101 src=/images/logo width=101></a></p>
    <hgroup><h1 class=allcaps>HTML</h1>
-    <h2 class="no-num no-toc">Living Standard — Last Updated 8 February 2013</h2>
+    <h2 class="no-num no-toc">Living Standard — Last Updated 9 February 2013</h2>
    </hgroup><dl><dt><strong>Web developer edition:</strong></dt>
     <dd><strong><a href=http://developers.whatwg.org/>http://developers.whatwg.org/</a></strong></dd>
     <dt>Multiple-page version:</dt>
@@ -358,12 +358,8 @@
    <li><a href=#urls><span class=secno>2.5 </span>URLs</a>
     <ol>
      <li><a href=#terminology-0><span class=secno>2.5.1 </span>Terminology</a></li>
-     <li><a href=#parsing-urls><span class=secno>2.5.2 </span>Parsing URLs</a></li>
-     <li><a href=#base-urls><span class=secno>2.5.3 </span>Base URLs</a></li>
-     <li><a href=#resolving-urls><span class=secno>2.5.4 </span>Resolving URLs</a></li>
-     <li><a href=#url-manipulation-and-creation><span class=secno>2.5.5 </span>URL manipulation and creation</a></li>
-     <li><a href=#dynamic-changes-to-base-urls><span class=secno>2.5.6 </span>Dynamic changes to base URLs</a></li>
-     <li><a href=#interfaces-for-url-manipulation><span class=secno>2.5.7 </span>Interfaces for URL manipulation</a></ol></li>
+     <li><a href=#resolving-urls><span class=secno>2.5.2 </span>Resolving URLs</a></li>
+     <li><a href=#dynamic-changes-to-base-urls><span class=secno>2.5.3 </span>Dynamic changes to base URLs</a></ol></li>
    <li><a href=#fetching-resources><span class=secno>2.6 </span>Fetching resources</a>
     <ol>
      <li><a href=#terminology-1><span class=secno>2.6.1 </span>Terminology</a></li>
@@ -2000,7 +1996,7 @@
 
   <pre>var a = <a href=#document title=Document>document</a>.<a href=#dom-document-links title=dom-document-links>links</a>[0]; // obtain the first link in the document
 a.<a href=#dom-a-href title=dom-a-href>href</a> = 'sample.html'; // change the destination URL of the link
-a.<a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
+a.<a href=#dom-url-protocol title=dom-url-protocol>protocol</a> = 'https'; // change just the scheme part of the URL
 a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
 
   <p>Since DOM trees are used as the way to represent HTML documents when they are processed and
@@ -2848,8 +2844,8 @@
   compression format used was not supported, even if the implementation could determine the
   dimensions of the movie from the file's metadata.</p>
 
-  <p>What some specifications, in particular the HTTP and URI specifications, refer to as a
-  <i>representation</i> is referred to in this specification as a <dfn title="">resource</dfn>. <a href=#refsHTTP>[HTTP]</a> <a href=#refsRFC3986>[RFC3986]</a></p>
+  <p>What some specifications, in particular the HTTP specification, refer to as a
+  <i>representation</i> is referred to in this specification as a <dfn title="">resource</dfn>. <a href=#refsHTTP>[HTTP]</a></p>
 
   <p>The term <dfn id=mime-type>MIME type</dfn> is used to refer to what is sometimes called an <i>Internet media
   type</i> in protocol literature. The term <i>media type</i> in this specification is used to refer
@@ -3408,15 +3404,40 @@
    </dd>
 
 
-   <dt>URIs, IRIs, IDNA</dt>
+   <dt>URLs</dt>
 
    <dd>
 
-    <p>Implementations must support the semantics of <a href=#url title=URL>URLs</a> defined in the
-    URI and IRI specifications, as well as the semantics of IDNA domain names defined in the
-    <cite>Internationalizing Domain Names in Applications (IDNA)</cite> specification. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a> <a href=#refsRFC3490>[RFC3490]</a>
+    <p>The following terms are defined in the URL standard: <a href=#refsURL>[URL]</a></p>
 
-   </dd>
+    <ul class=brief><li><dfn id=url>URL</dfn>
+     <li><dfn id=absolute-url>Absolute URL</dfn>
+     <li><dfn id=relative-url>Relative URL</dfn>
+     <li><dfn id=concept-url-scheme-relative title=concept-url-scheme-relative>Relative schemes</dfn>
+     <li>The <dfn id=url-parser>URL parser</dfn>
+     <li><dfn id=parsed-url>Parsed URL</dfn>
+     <li>The <dfn id=concept-url-scheme title=concept-url-scheme>scheme</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-scheme-data title="concept-url-scheme data">scheme data</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-username title=concept-url-username>username</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-password title=concept-url-password>password</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-host title=concept-url-host>host</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-port title=concept-url-port>port</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-path title=concept-url-path>path</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-query title=concept-url-query>query</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li>The <dfn id=concept-url-fragment title=concept-url-fragment>fragment</dfn> component of a <a href=#parsed-url>parsed URL</a>
+     <li><dfn id=concept-url-parse-error title=concept-url-parse-error>Parse errors</dfn> from the <a href=#url-parser>URL parser</a>
+     <li>The <dfn id=url-serializer>URL serializer</dfn>
+     <li><dfn id=default-encode-set>Default encode set</dfn>
+     <li><dfn id=percent-encode>Percent encode</dfn>
+     <li><dfn id=utf-8-percent-encode>UTF-8 percent encode</dfn>
+     <li><dfn id=urlutils><code>URLUtils</code></dfn> interface
+     <li><dfn id=urlutilsreadonly><code>URLUtilsReadOnly</code></dfn> interface
+     <li><dfn id=dom-url-protocol title=dom-url-protocol><code>protocol</code> attribute</dfn>
+     <li><dfn id=concept-uu-base title=concept-uu-base>Base</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-input title=concept-uu-input>Input</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-query-encoding title=concept-uu-query-encoding>Query encoding</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+     <li><dfn id=concept-uu-update title=concept-uu-update>Update steps</dfn> for <code><a href=#urlutils>URLUtils</a></code>
+    </ul></dd>
 
 
    <dt>Cookies</dt>
@@ -6411,220 +6432,47 @@
 
   <h3 id=urls><span class=secno>2.5 </span>URLs</h3>
 
-  <p>This specification defines the term <a href=#url>URL</a>, and defines
-  various algorithms for dealing with URLs, because for historical
-  reasons the rules defined by the URI and IRI specifications are not
-  a complete description of what HTML user agents need to implement to
-  be compatible with Web content.</p>
-
-  <p class=note>The term "URL" in this specification is used in a
-  manner distinct from the precise technical meaning it is given in
-  RFC 3986. Readers familiar with that RFC will find it easier to read
-  <em>this</em> specification if they pretend the term "URL" as used
-  herein is really called something else altogether. This is a
-  <a href=#willful-violation>willful violation</a> of RFC 3986. <a href=#refsRFC3986>[RFC3986]</a></p>
-
-
   <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
 
-  <p>A <dfn id=url>URL</dfn> is a string used to identify a resource.</p>
+  <p>A <a href=#url>URL</a> is a <dfn id=valid-url>valid URL</dfn> if it conforms to the authoring conformance
+  requirements in the URL standard. <a href=#refsURL>[URL]</a></p>
 
-  <p>A <a href=#url>URL</a> is a <dfn id=valid-url>valid URL</dfn> if at least one of
-  the following conditions holds:</p>
+  <p>A string is a <dfn id=valid-non-empty-url>valid non-empty URL</dfn> if it is a <a href=#valid-url>valid URL</a> but it is not
+  the empty string.</p>
 
-  <ul><li><p>The <a href=#url>URL</a> is a valid URI reference <a href=#refsRFC3986>[RFC3986]</a>.</li>
+  <p>A string is a <dfn id=valid-url-potentially-surrounded-by-spaces>valid URL potentially surrounded by spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing whitespace">stripping leading and trailing whitespace</a>
+  from it, it is a <a href=#valid-url>valid URL</a>.</p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and it has no
-   query component. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>A string is a <dfn id=valid-non-empty-url-potentially-surrounded-by-spaces>valid non-empty URL potentially surrounded by spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing whitespace">stripping leading and trailing whitespace</a>
+  from it, it is a <a href=#valid-non-empty-url>valid non-empty URL</a>.</p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and its query
-   component contains no unescaped non-ASCII characters. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>This specification defines the URL <dfn id=about:legacy-compat><code>about:legacy-compat</code></dfn> as a reserved,
+  though unresolvable, <code title="">about:</code> URL, for use in <a href=#syntax-doctype title=syntax-doctype>DOCTYPE</a>s in <a href=#html-documents>HTML documents</a> when needed for
+  compatibility with XML tools. <a href=#refsABOUT>[ABOUT]</a></p>
 
-   <li><p>The <a href=#url>URL</a> is a valid IRI reference and the <a href="#document's-character-encoding" title="document's character encoding">character encoding</a> of
-   the URL's <code><a href=#document>Document</a></code> is UTF-8 or <a href=#a-utf-16-encoding>a UTF-16
-   encoding</a>. <a href=#refsRFC3987>[RFC3987]</a></li>
+  <p>This specification defines the URL <dfn id=about:srcdoc><code>about:srcdoc</code></dfn> as a reserved, though
+  unresolvable, <code title="">about:</code> URL, that is used as <a href="#the-document's-address">the document's
+  address</a> of <a href=#an-iframe-srcdoc-document title="an iframe srcdoc document"><code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> documents</a>. <a href=#refsABOUT>[ABOUT]</a></p>
 
-  </ul><p>A string is a <dfn id=valid-non-empty-url>valid non-empty URL</dfn> if it is a
-  <a href=#valid-url>valid URL</a> but it is not the empty string.</p>
+  <p>The <dfn id=fallback-base-url>fallback base URL</dfn> of a <code><a href=#document>Document</a></code> object is the <a href=#absolute-url>absolute
+  URL</a> obtained by running these substeps:</p>
 
-  <p>A string is a <dfn id=valid-url-potentially-surrounded-by-spaces>valid URL potentially surrounded by
-  spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</a> from
-  it, it is a <a href=#valid-url>valid URL</a>.</p>
+  <ol><li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> document</a>, then return the <a href=#document-base-url>document base
+   URL</a> of the <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s <a href=#browsing-context-container>browsing context
+   container</a>'s <code><a href=#document>Document</a></code> and abort these steps.</li>
 
-  <p>A string is a <dfn id=valid-non-empty-url-potentially-surrounded-by-spaces>valid non-empty URL potentially surrounded by
-  spaces</dfn> if, after <a href=#strip-leading-and-trailing-whitespace title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</a> from
-  it, it is a <a href=#valid-non-empty-url>valid non-empty URL</a>.</p>
-
-  <p>This specification defines the URL
-  <dfn id=about:legacy-compat><code>about:legacy-compat</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, for use in <a href=#syntax-doctype title=syntax-doctype>DOCTYPE</a>s in <a href=#html-documents>HTML
-  documents</a> when needed for compatibility with XML tools. <a href=#refsABOUT>[ABOUT]</a></p>
-
-  <p>This specification defines the URL
-  <dfn id=about:srcdoc><code>about:srcdoc</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, that is used as
-  <a href="#the-document's-address">the document's address</a> of <a href=#an-iframe-srcdoc-document title="an iframe srcdoc
-  document"><code>iframe</code> <code title=attr-iframe-srcdoc>srcdoc</code> documents</a>. <a href=#refsABOUT>[ABOUT]</a></p>
-
-
-  <div class=impl>
-
-  <h4 id=parsing-urls><span class=secno>2.5.2 </span>Parsing URLs</h4>
-
-  <p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
-  component parts, the user agent must use the following steps:</p>
-
-  <ol><li><p><a href=#strip-leading-and-trailing-whitespace>Strip leading and trailing whitespace</a> from <var title="">url</var>.</li>
-
    <li>
 
-    <p>Parse <var title="">url</var> in the manner defined by RFC
-    3986, with the following exceptions:</p>
-
-    <ul><li>Add all characters with code points less than or equal to
-     U+0020 or greater than or equal to U+007F to the
-     <unreserved> production.</li>
-
-     <li>Add the characters U+0022, U+003C, U+003E, U+005B .. U+005E,
-     U+0060, and U+007B .. U+007D to the <unreserved>
-     production.
-      <!--
-       0022 QUOTATION MARK
-       003C LESS-THAN SIGN
-       003E GREATER-THAN SIGN
-       005B LEFT SQUARE BRACKET
-       005C REVERSE SOLIDUS
-       005D RIGHT SQUARE BRACKET
-       005E CIRCUMFLEX ACCENT
-       0060 GRAVE ACCENT
-       007B LEFT CURLY BRACKET
-       007C VERTICAL LINE
-       007D RIGHT CURLY BRACKET
-      -->
-     </li>
-
-     <li>Add a single U+0025 PERCENT SIGN character as a second
-     alternative way of matching the <pct-encoded> production,
-     except when the <pct-encoded> is used in the
-     <reg-name> production.</li>
-
-     <li>Add the U+0023 NUMBER SIGN character to the characters
-     allowed in the <fragment> production.</li>
-
-     <!-- some browsers also have other differences, e.g. Mozilla
-     seems to treat ";" as if it was not in sub-delims, if the scheem
-     is "ftp". -->
-
-    </ul></li>
-
-   <li>
-
-    <p>If <var title="">url</var> doesn't match the
-    <URI-reference> production, even after the above changes are
-    made to the ABNF definitions, then parsing the URL fails with an
-    error. <a href=#refsRFC3986>[RFC3986]</a></p>
-
-    <p>Otherwise, parsing <var title="">url</var> was successful; the
-    components of the URL are substrings of <var title="">url</var>
-    defined as follows:</p>
-
-    <dl><dt><dfn id=url-scheme title=url-scheme><scheme></dfn></dt>
-
-     <dd><p>The substring matched by the <scheme> production, if any.</dd>
-
-
-     <dt><dfn id=url-host title=url-host><host></dfn></dt>
-
-     <dd><p>The substring matched by the <host> production, if any.</dd>
-
-
-     <dt><dfn id=url-port title=url-port><port></dfn></dt>
-
-     <dd><p>The substring matched by the <port> production, if any.</dd>
-
-
-     <dt><dfn id=url-hostport title=url-hostport><hostport></dfn></dt>
-
-     <dd><p>If there is a <scheme> component and a <port>
-     component and the port given by the <port> component is
-     different than the default port defined for the protocol given by
-     the <scheme> component, then <hostport> is the
-     substring that starts with the substring matched by the
-     <host> production and ends with the substring matched by the
-     <port> production, and includes the colon in between the
-     two. Otherwise, it is the same as the <host> component.</p>
-
-
-     <dt><dfn id=url-path title=url-path><path></dfn></dt>
-
-     <dd>
-
-      <p>The substring matched by one of the following productions, if
-      one of them was matched:</p>
-
-      <ul class=brief><li><path-abempty></li>
-       <li><path-absolute></li>
-       <li><path-noscheme></li>
-       <li><path-rootless></li>
-       <li><path-empty></li>
-      </ul></dd>
-
-
-     <dt><dfn id=url-query title=url-query><query></dfn></dt>
-
-     <dd><p>The substring matched by the <query> production, if any.</dd>
-
-
-     <dt><dfn id=url-fragment title=url-fragment><fragment></dfn></dt>
-
-     <dd><p>The substring matched by the <fragment> production, if any.</dd>
-
-
-     <dt><dfn id=url-host-specific title=url-host-specific><host-specific></dfn></dt>
-
-     <dd><p>The substring that <em>follows</em> the substring matched
-     by the <authority> production, or the whole string if the
-     <authority> production wasn't matched.</dd>
-
-    </dl></li>
-
-  </ol><p class=note>These parsing rules are a <a href=#willful-violation>willful
-  violation</a> of RFC 3986 and RFC 3987 (which do not define error
-  handling), motivated by a desire to handle legacy content. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
-  </div>
-
-
-  <h4 id=base-urls><span class=secno>2.5.3 </span>Base URLs</h4>
-
-  <p>The <dfn id=fallback-base-url>fallback base URL</dfn> of a <code><a href=#document>Document</a></code>
-  object is the <a href=#absolute-url>absolute URL</a> obtained by running these
-  substeps:</p>
-
-  <ol><li><p>If the <code><a href=#document>Document</a></code> is <a href=#an-iframe-srcdoc-document>an <code>iframe</code>
-   <code title=attr-iframe-srcdoc>srcdoc</code> document</a>,
-   then return the <a href=#document-base-url>document base URL</a> of the
-   <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a>'s
-   <a href=#browsing-context-container>browsing context container</a>'s <code><a href=#document>Document</a></code> and
-   abort these steps.</li>
-
-   <li>
-
     <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
 
-    <!-- this should be tested in the case of a browsing context that
-    was navigated to about:blank after having been elsewhere, as
-    opposed to the about:blank used at the time of the browsing
+    <!-- this should be tested in the case of a browsing context that was navigated to about:blank
+    after having been elsewhere, as opposed to the about:blank used at the time of the browsing
     context's creation. -->
 
-    <p>If <a href="#the-document's-address">the document's address</a> is
-    <code><a href=#about:blank>about:blank</a></code>, and the <code><a href=#document>Document</a></code>'s
-    <a href=#browsing-context>browsing context</a> has a <a href=#creator-browsing-context>creator browsing
-    context</a>, then return the <a href=#document-base-url>document base URL</a> of
-    the <a href=#creator-document>creator <code>Document</code></a>, and abort these
-    steps.</p>
+    <p>If <a href="#the-document's-address">the document's address</a> is <code><a href=#about:blank>about:blank</a></code>, and the
+    <code><a href=#document>Document</a></code>'s <a href=#browsing-context>browsing context</a> has a <a href=#creator-browsing-context>creator browsing
+    context</a>, then return the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
+    <code>Document</code></a>, and abort these steps.</p>
 
    </li>
 
@@ -6632,282 +6480,99 @@
 
    <li><p>Return <a href="#the-document's-address">the document's address</a>.</li>
 
-  </ol><p>The <dfn id=document-base-url>document base URL</dfn> of a <code><a href=#document>Document</a></code>
-  object is the <a href=#absolute-url>absolute URL</a> obtained by running these
-  substeps:</p>
+  </ol><p>The <dfn id=document-base-url>document base URL</dfn> of a <code><a href=#document>Document</a></code> object is the <a href=#absolute-url>absolute
+  URL</a> obtained by running these substeps:</p>
 
-  <ol><li><p>Let <var title="">fallback base url</var> be the
-   <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>.</li>
+  <ol><li><p>Let <var title="">fallback base url</var> be the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback
+   base URL</a>.</li>
 
-   <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the
-   <a href=#document-base-url>document base URL</a> is <var title="">fallback base
-   url</var>; abort these steps. Otherwise, let <var title="">url</var> be the value of the <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute of the first such
+   <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, then the <a href=#document-base-url>document base URL</a> is <var title="">fallback base url</var>; abort these steps. Otherwise, let <var title="">url</var> be
+   the value of the <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute of the first such
    element.</li>
 
-   <li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> <var title="">url</var> relative to <var title="">fallback base
-   url</var> (thus, the <code><a href=#the-base-element>base</a></code> <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute isn't affected by
-   <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes).</li>
+   <li><p><a href=#resolve-a-url title="resolve a URL">Resolve</a> <var title="">url</var> relative to <var title="">fallback base url</var> (thus, the <code><a href=#the-base-element>base</a></code> <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute isn't affected by <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes).</li>
 
-   <li><p>The <a href=#document-base-url>document base URL</a> is the result of the
-   previous step if it was successful; otherwise it is <var title="">fallback base url</var>.</li>
+   <li><p>The <a href=#document-base-url>document base URL</a> is the result of the previous step if it was
+   successful; otherwise it is <var title="">fallback base url</var>.</li>
 
-  </ol><h4 id=resolving-urls><span class=secno>2.5.4 </span>Resolving URLs</h4>
+  </ol><div class=impl>
 
-  <p>Resolving a URL is the process of taking a relative URL and
-  obtaining the absolute URL that it implies.</p>
+  <h4 id=resolving-urls><span class=secno>2.5.2 </span>Resolving URLs</h4>
 
-  <div class=impl>
+  <p>Resolving a URL is the process of taking a <a href=#relative-url>relative URL</a> and obtaining the
+  <a href=#absolute-url>absolute URL</a> that it implies.</p>
 
-  <p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a>
-  relative to either another <a href=#absolute-url>absolute URL</a> or an element,
-  the user agent must use the following steps. Resolving a URL can
-  result in an error, in which case the URL is not resolvable.</p>
+  <p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a> relative to either another
+  <a href=#absolute-url>absolute URL</a> or an element, the user agent must use the following steps. Resolving a
+  URL can result in an error, in which case the URL is not resolvable.</p>
 
-  <ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> being
-   resolved.</li>
+  <ol><li><p>Let <var title="">url</var> be the <a href=#url>URL</a> being resolved.</li>
 
    <li>
 
     <p>Let <var title="">encoding</var> be determined as follows:</p>
 
-    <dl class=switch><dt>If the URL had a character encoding defined when the URL was
-     created or defined</dt>
+    <dl class=switch><dt>If the URL had a character encoding defined when the URL was created or defined</dt>
 
      <dd>The URL character encoding is as defined.</dd>
 
-     <dt>If the URL came from a script (e.g. as an argument to a
-     method)</dt>
+     <dt>If the URL came from a script (e.g. as an argument to a method)</dt>
 
-     <dd>The URL character encoding is the <a href="#script's-url-character-encoding">script's URL character
-     encoding</a>.</dd>
+     <dd>The URL character encoding is the <a href="#script's-url-character-encoding">script's URL character encoding</a>.</dd>
 
      <dt>If the URL came from a DOM node (e.g. from an element)</dt>
 
-     <dd>The node has a <code><a href=#document>Document</a></code>, and the URL character
-     encoding is the <a href="#document's-character-encoding">document's character encoding</a>.</dd>
+     <dd>The node has a <code><a href=#document>Document</a></code>, and the URL character encoding is the
+     <a href="#document's-character-encoding">document's character encoding</a>.</dd>
 
     </dl></li>
 
-   <li><p>If <var title="">encoding</var> is <a href=#a-utf-16-encoding>a UTF-16
-   encoding</a>, then change the value of <var title="">encoding</var> to UTF-8.</li>
+   <li><p>If <var title="">encoding</var> is <a href=#a-utf-16-encoding>a UTF-16 encoding</a>, then change the value
+   of <var title="">encoding</var> to UTF-8.</li>
 
    <li>
 
-    <p>If the algorithm was invoked with an <a href=#absolute-url>absolute URL</a>
-    to use as the base URL, let <var title="">base</var> be that
-    <a href=#absolute-url>absolute URL</a>.</p>
+    <p>If the algorithm was invoked with an <a href=#absolute-url>absolute URL</a> to use as the base URL, let
+    <var title="">base</var> be that <a href=#absolute-url>absolute URL</a>.</p>
 
-    <p>Otherwise, let <var title="">base</var> be the <i>base URI of
-    the element</i>, as defined by the XML Base specification, with
-    <i>the base URI of the document entity</i> being defined as the
-    <a href=#document-base-url>document base URL</a> of the <code><a href=#document>Document</a></code> that
-    owns the element. <a href=#refsXMLBASE>[XMLBASE]</a></p>
+    <p>Otherwise, let <var title="">base</var> be <a href="#the-element's-base-url">the element's base URL</a>.</p>
 
-    <p>For the purposes of the XML Base specification, user agents
-    must act as if all <code><a href=#document>Document</a></code> objects represented XML
-    documents.</p>
-
-    <p class=note>It is possible for <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes to be present
-    even in HTML fragments, as such attributes can be added
-    dynamically using script. (Such scripts would not be conforming,
-    however, as <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes
-    are not allowed in <a href=#html-documents>HTML documents</a>.)</p>
-
    </li>
 
-   <li><p><a href=#parse-a-url title="parse a URL">Parse</a> <var title="">url</var> into its component parts.</li>
+   <li><p>Apply the <a href=#url-parser>URL parser</a> to <var title="">url</var>, with <var title="">base</var> as the base URL, with <var title="">encoding</var> as the encoding.</li>
 
-   <li>
+   <li><p>If this results in a <a href=#concept-url-parse-error title=concept-url-parse-error>parse error</a>, then abort
+   these steps with an error.</li>
 
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-host title=url-host><host></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from expanding any sequences of percent-encoded octets in
-    that component that are valid UTF-8 sequences into Unicode
-    characters as defined by UTF-8.</p>
+   <li><p>Let <var title="">parsed URL</var> be the result of the <a href=#url-parser>URL parser</a>.</li>
 
-    <p>If any percent-encoded octets in that component are not valid
-    UTF-8 sequences (e.g. sequences of percent-encoded octets that
-    expand to surrogate code points), then return an error and abort
-    these steps.</p>
+   <li><p>Let <var title="">serialized URL</var> be the result of apply the <a href=#url-serializer>URL
+   serializer</a> to <var title="">parsed URL</var>.</li>
 
-    <p>Apply the IDNA ToASCII algorithm to the matching substring,
-    with both the AllowUnassigned and UseSTD3ASCIIRules flags
-    set. Replace the matching substring with the result of the ToASCII
-    algorithm.</p>
+   <li><p>Return <var title="">serialized URL</var> as the <dfn id=resulting-absolute-url>resulting absolute URL</dfn> and
+   <var title="">parsed URL</var> as the <dfn id=resulting-parsed-url>resulting parsed URL</dfn>.</li>
 
-    <p>If ToASCII fails to convert one of the components of the
-    string, e.g. because it is too long or because it contains invalid
-    characters, then return an error and abort these steps. <a href=#refsRFC3490>[RFC3490]</a></p>
+  </ol><p>Given an element, <dfn id="the-element's-base-url">the element's base URL</dfn> is the <i>base URI of the element</i>, as
+  defined by the XML Base specification, with <i>the base URI of the document entity</i> being
+  defined as the <a href=#document-base-url>document base URL</a> of the <code><a href=#document>Document</a></code> that owns the element.
+  <a href=#refsXMLBASE>[XMLBASE]</a></p>
 
-   </li>
+  <p>For the purposes of the XML Base specification, user agents must act as if all
+  <code><a href=#document>Document</a></code> objects represented XML documents.</p>
 
-   <li>
+  <p class=note>It is possible for <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attributes to be
+  present even in HTML fragments, as such attributes can be added dynamically using script. (Such
+  scripts would not be conforming, however, as <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code>
+  attributes are not allowed in <a href=#html-documents>HTML documents</a>.)</p>
 
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-path title=url-path><path></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <path> production defined in RFC 3986:</p>
-
-    <ol><li>Encode the character into a sequence of octets as defined by the <a href=#utf-8-encoder>utf-8 encoder</a>
-     algorithm. <a href=#refsENCODING>[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href=#refsRFC3986>[RFC3986]</a></li>
-
-    </ol><div class=example>
-
-     <p>For instance if <var title="">url</var> was "<code title="">//example.com/a^b☺c%FFd%z/?e</code>", then the
-     <a href=#url-path title=url-path><path></a> component's substring
-     would be "<code title="">/a^b☺c%FFd%z/</code>" and the two
-     characters that would have to be escaped would be "<code title="">^</code>" and "<code title="">☺</code>". The
-     result after this step was applied would therefore be that <var title="">url</var> now had the value "<code title="">//example.com/a%5Eb%E2%98%BAc%FFd%z/?e</code>".</p>
-
-    </div>
-
-   </li>
-
-   <li>
-
-    <p>If parsing <var title="">url</var> resulted in a <a href=#url-query title=url-query><query></a> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <query> production defined in RFC 3986:</p>
-
-    <ol><li>If the character in question cannot be expressed in the
-     encoding <var title="">encoding</var>, then replace it with a
-     single 0x3F octet (an ASCII question mark) and skip the remaining
-     substeps for this character.</li>
-
-     <li>Encode the character into a sequence of octets as defined by the <a href=#encoder>encoder</a>
-     algorithm for <var title="">encoding</var>. <a href=#refsENCODING>[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href=#refsRFC3986>[RFC3986]</a></li>
-
-    </ol></li>
-
-   <li><p>Apply the algorithm described in RFC 3986 section 5.2
-   Relative Resolution, using <var title="">url</var> as the
-   potentially relative URI reference (<var title="">R</var>), and
-   <var title="">base</var> as the base URI (<var title="">Base</var>). <a href=#refsRFC3986>[RFC3986]</a></li>
-
-   <li>
-
-    <p>Apply any relevant conformance criteria of RFC 3986 and RFC
-    3987, returning an error and aborting these steps if
-    appropriate. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
-    <p class=example>For instance, if an absolute URI that would be
-    returned by the above algorithm violates the restrictions specific
-    to its scheme, e.g. a <code title="">data:</code> URI using the
-    "<code title="">//</code>" server-based naming authority syntax,
-    then user agents are to treat this as an error instead.<!-- RFC
-    3986, 3.1 Scheme --></p>
-
-   </li>
-
-   <li><p>Let <var title="">result</var> be the target URI (<var title="">T</var>) returned by the Relative Resolution
-   algorithm.</li>
-
-   <li><p>If <var title="">result</var> uses a scheme with a
-   server-based naming authority, replace all U+005C REVERSE SOLIDUS
-   (\) characters in <var title="">result</var> with U+002F SOLIDUS
-   (/) characters.</li>
-
-   <li><p>Return <var title="">result</var>.</li>
-
-  </ol><p class=note>Some of the steps in these rules, for example the
-  processing of U+005C REVERSE SOLIDUS (\) characters, are a
-  <a href=#willful-violation>willful violation</a> of RFC 3986 and RFC 3987, motivated
-  by a desire to handle legacy content. <a href=#refsRFC3986>[RFC3986]</a> <a href=#refsRFC3987>[RFC3987]</a></p>
-
   </div>
 
-  <p>A <a href=#url>URL</a> is an <dfn id=absolute-url>absolute URL</dfn> if <a href=#resolve-a-url title="resolve a url">resolving</a> it results in the same output
-  regardless of what it is resolved relative to, and that output is
-  not a failure.</p>
 
-  <p>An <a href=#absolute-url>absolute URL</a> is a <dfn id=hierarchical-url>hierarchical URL</dfn> if,
-  when <a href=#resolve-a-url title="resolve a url">resolved</a> and then <a href=#parse-a-url title="parse a url">parsed</a>, there is a character immediately
-  after the <a href=#url-scheme title=url-scheme><scheme></a> component
-  and it is a U+002F SOLIDUS character (/).</p>
 
-  <p>An <a href=#absolute-url>absolute URL</a> is an <dfn id=authority-based-url>authority-based URL</dfn>
-  if, when <a href=#resolve-a-url title="resolve a url">resolved</a> and then <a href=#parse-a-url title="parse a url">parsed</a>, there are two characters
-  immediately after the <a href=#url-scheme title=url-scheme><scheme></a>
-  component and they are both U+002F SOLIDUS characters (//).</p>
-
-
-
   <div class=impl>
 
-  <h4 id=url-manipulation-and-creation><span class=secno>2.5.5 </span>URL manipulation and creation</h4>
+  <h4 id=dynamic-changes-to-base-urls><span class=secno>2.5.3 </span>Dynamic changes to base URLs</h4>
 
-  <p>To <dfn id=fragment-escaped title=fragment-escaped>fragment-escape</dfn> a string
-  <var title="">input</var>, a user agent must run the following
-  steps:</p>
-
-  <ol><li><p>Let <var title="">input</var> be the string to be
-   escaped.</li>
-
-   <li><p>Let <var title="">position</var> point at the first
-   character of <var title="">input</var>.</li>
-
-   <li><p>Let <var title="">output</var> be an empty string.</li>
-
-   <li><p><i>Loop</i>: If <var title="">position</var> is past the end
-   of <var title="">input</var>, then jump to the step labeled
-   <i>end</i>.</li>
-
-   <li>
-
-    <p>If the character in <var title="">input</var> pointed to by
-    <var title="">position</var> is in the range U+0000 to U+0020 or
-    is one of the following characters:</p>
-
-    <ul class=brief><li>U+0022 QUOTATION MARK character (")
-     <li>U+0023 NUMBER SIGN character (#)
-     <li>U+0025 PERCENT SIGN character (%)
-     <li>U+003C LESS-THAN SIGN character (<)
-     <li>U+003E GREATER-THAN SIGN character (>)
-     <li>U+005B LEFT SQUARE BRACKET character ([)
-     <li>U+005C REVERSE SOLIDUS character (\)
-     <li>U+005D RIGHT SQUARE BRACKET character (])
-     <li>U+005E CIRCUMFLEX ACCENT character (^)
-     <li>U+007B LEFT CURLY BRACKET character ({)
-     <li>U+007C VERTICAL LINE character (|)
-     <li>U+007D RIGHT CURLY BRACKET character (})
-    </ul><p>...then append the percent-encoded form of the character to
-    <var title="">output</var>. <a href=#refsRFC3986>[RFC3986]</a></p> <!-- this is the same
-    phrasing that's used elsewhere in the spec, but we really should
-    define 'percent-encoded' or at least ensure we consistently say
-    whether it's upper-case or lower-case. -->
-
-    <p>Otherwise, append the character itself to <var title="">output</var>.</p>
-
-    <p class=note>This escapes any ASCII characters that are not
-    valid in the URI <fragment> production without being
-    escaped.</p>
-
-   </li>
-
-   <li><p>Advance <var title="">position</var> to the next character
-   in <var title="">input</var>.</li>
-
-   <li><p>Return to the step labeled <i>loop</i>.</li>
-
-   <li><p><i>End</i>: Return <var title="">output</var>.</li>
-
-  </ol></div>
-
-
-
-  <div class=impl>
-
-  <h4 id=dynamic-changes-to-base-urls><span class=secno>2.5.6 </span>Dynamic changes to base URLs</h4>
-
   <p>When an <code title=attr-xml-base><a href=#the-xml:base-attribute-(xml-only)>xml:base</a></code> attribute is set, changed, or removed, the
   attribute's element, and all descendant elements, are <a href=#affected-by-a-base-url-change>affected by a base URL
   change</a>.</p>
@@ -6960,239 +6625,7 @@
   </dl></div>
 
 
-<!--TOPIC:DOM APIs-->
-  <h4 id=interfaces-for-url-manipulation><span class=secno>2.5.7 </span>Interfaces for URL manipulation</h4>
-
-  <p>An interface that has a complement of <dfn id=url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</dfn> has seven attributes with the following
-  definitions:</p>
-
-<pre class="idl extract">           attribute DOMString <a href=#dom-uda-protocol title=dom-uda-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-uda-host title=dom-uda-host>host</a>;
-           attribute DOMString <a href=#dom-uda-hostname title=dom-uda-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-uda-port title=dom-uda-port>port</a>;
-           attribute DOMString <a href=#dom-uda-pathname title=dom-uda-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-uda-search title=dom-uda-search>search</a>;
-           attribute DOMString <a href=#dom-uda-hash title=dom-uda-hash>hash</a>;</pre>
-
-  <dl class=domintro><dt><var title="">o</var> . <code title=dom-uda-protocol><a href=#dom-uda-protocol>protocol</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current scheme of the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's scheme.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-host><a href=#dom-uda-host>host</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host and port (if it's not the default port) in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host and port.</p>
-    <p>The host and the port are separated by a colon. The port part,
-    if omitted, will be assumed to be the current scheme's default
-    port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-hostname><a href=#dom-uda-hostname>hostname</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-port><a href=#dom-uda-port>port</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current port in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-pathname><a href=#dom-uda-pathname>pathname</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current path in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's path.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current query component in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's query component.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title=dom-uda-hash><a href=#dom-uda-hash>hash</a></code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current fragment identifier in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's fragment identifier.</p>
-   </dd>
-
-  </dl><div class=impl>
-
-  <hr><p>The attributes defined to be <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a> must act as described for the attributes with the
-  same corresponding names in this section.</p>
-
-  <p>In addition, an interface with a complement of <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a> defines an <dfn id=concept-uda-input title=concept-uda-input>input</dfn>, which is a <a href=#url>URL</a>
-  that the attributes act on, and a <dfn id=concept-uda-setter title=concept-uda-setter>common setter action</dfn>, which is a
-  set of steps invoked when any of the attributes' setters are
-  invoked.</p>
-
-  <p>The seven <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> have
-  similar requirements.</p>
-
-  <p>On getting, if the <a href=#concept-uda-input title=concept-uda-input>input</a>
-  is an <a href=#absolute-url>absolute URL</a> that fulfills the condition given in
-  the "getter condition" column corresponding to the attribute in the
-  table below, the user agent must return the part of the <a href=#concept-uda-input title=concept-uda-input>input</a> URL given in the "component"
-  column, with any prefixes specified in the "prefix" column
-  appropriately added to the start of the string and any suffixes
-  specified in the "suffix" column appropriately added to the end of
-  the string. Otherwise, the attribute must return the empty
-  string.</p>
-
-  <p>On setting, the new value must first be mutated as described by
-  the "setter preprocessor" column, then mutated by %-escaping any
-  characters in the new value that are not valid in the relevant
-  component as given by the "component" column. Then, if the <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#absolute-url>absolute
-  URL</a> and the resulting new value fulfills the condition given
-  in the "setter condition" column, the user agent must make a new
-  string <var title="">output</var> by replacing the component of the
-  URL given by the "component" column in the <a href=#concept-uda-input title=concept-uda-input>input</a> URL with the new value;
-  otherwise, the user agent must let <var title="">output</var> be
-  equal to the <a href=#concept-uda-input title=concept-uda-input>input</a>. Finally,
-  the user agent must invoke the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> with the
-  value of <var title="">output</var>.</p>
-
-  <p>When replacing a component in the URL, if the component is part
-  of an optional group in the URL syntax consisting of a character
-  followed by the component, the component (including its prefix
-  character) must be included even if the new value is the empty
-  string.</p>
-
-  <p class=note>The previous paragraph applies in particular to the
-  "<code title="">:</code>" before a <port> component, the "<code title="">?</code>" before a <query> component, and the "<code title="">#</code>" before a <fragment> component.</p>
-
-  <p>For the purposes of the above definitions, URLs must be parsed
-  using the <a href=#parse-a-url title="parse a URL">URL parsing rules</a> defined
-  in this specification.</p>
-
-  <table id=table-uda><thead><tr><th>Attribute
-     <th>Component
-     <th>Getter Condition
-     <th>Prefix
-     <th>Suffix
-     <th>Setter Preprocessor
-     <th>Setter Condition
-   <tbody><tr><td><dfn id=dom-uda-protocol title=dom-uda-protocol><code>protocol</code></dfn>
-     <td><a href=#url-scheme title=url-scheme><scheme></a>
-     <td>—
-     <td>—
-     <td>U+003A COLON (:)
-     <td>Remove all trailing U+003A COLON characters (:)
-     <td>The new value is not the empty string
-    <tr><td><dfn id=dom-uda-host title=dom-uda-host><code>host</code></dfn>
-     <td><a href=#url-hostport title=url-hostport><hostport></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-     <td>—
-     <td>—
-     <td>—
-     <td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-    <tr><td><dfn id=dom-uda-hostname title=dom-uda-hostname><code>hostname</code></dfn>
-     <td><a href=#url-host title=url-host><host></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-     <td>—
-     <td>—
-     <td>Remove all leading U+002F SOLIDUS characters (/)
-     <td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
-    <tr><td><dfn id=dom-uda-port title=dom-uda-port><code>port</code></dfn>
-     <td><a href=#url-port title=url-port><port></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>, and contained a <a href=#url-port title=url-port><port></a> component (possibly an empty one)
-     <td>—
-     <td>—
-     <td>Remove all characters in the new value from the first that is not an <a href=#ascii-digits title="ASCII digits">ASCII digit</a>, if any.
-         Remove any leading U+0030 DIGIT ZERO characters (0) in the new value.
-         If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character (0).
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>,
-         and the new value, when interpreted as a base-ten integer, is less than or equal to 65535
-    <tr><td><dfn id=dom-uda-pathname title=dom-uda-pathname><code>pathname</code></dfn>
-     <td><a href=#url-path title=url-path><path></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
-     <td>—
-     <td>—
-     <td>If it has no leading U+002F SOLIDUS character (/), prepend a U+002F SOLIDUS character (/) to the new value
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
-    <tr><td><dfn id=dom-uda-search title=dom-uda-search><code>search</code></dfn>
-     <td><a href=#url-query title=url-query><query></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>, and contained a <a href=#url-query title=url-query><query></a> component (possibly an empty one)
-     <td>U+003F QUESTION MARK (?)
-     <td>—
-     <td>Remove one leading U+003F QUESTION MARK character (?), if any
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
-    <tr><td><dfn id=dom-uda-hash title=dom-uda-hash><code>hash</code></dfn>
-     <td><a href=#url-fragment title=url-fragment><fragment></a>
-     <td><a href=#concept-uda-input title=concept-uda-input>input</a> contained a non-empty <a href=#url-fragment title=url-fragment><fragment></a> component
-     <td>U+0023 NUMBER SIGN (#)
-     <td>—
-     <td>Remove one leading U+0023 NUMBER SIGN character (#), if any
-     <td>—
-  </table><!--
-  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
-  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
-  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
---></div>
-
-  <div class=example>
-
-   <p>The table below demonstrates how the getter <span class=impl>condition</span> for <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> results in different results
-   depending on the exact original syntax of the URL:</p>
-
-   <table id=table-uda-examples><thead><tr><th> Input URL
-      <th> <code title=dom-uda-search><a href=#dom-uda-search>search</a></code> value
-      <th> Explanation
-    <tbody><tr><td> <code title="">http://example.com/</code>
-      <td> <i>empty string</i>
-      <td> No <a href=#url-query title=url-query><query></a> component in input URL.
-     <tr><td> <code title="">http://example.com/?</code>
-      <td> <code title="">?</code>
-      <td> There is a <a href=#url-query title=url-query><query></a> component, but it is empty.
-           <span class=impl>The question mark in the resulting value is the prefix.</span>
-     <tr><td> <code title="">http://example.com/?test</code>
-      <td> <code title="">?test</code>
-      <td> The <a href=#url-query title=url-query><query></a> component has the value "<code title="">test</code>".
-     <tr><td> <code title="">http://example.com/?test#</code>
-      <td> <code title="">?test</code>
-      <td> The (empty) <a href=#url-fragment title=url-fragment><fragment></a> component is not part of the <a href=#url-query title=url-query><query></a> component.
-   </table></div>
-
-  <div class=example>
-
-   <p>The following table is similar; it provides a list of what each
-   of the <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> returns for a
-   given <var title="">input</var> URL.</p>
-
-   <table><thead><tr><th>Input
-      <th><code title=dom-uda-protocol><a href=#dom-uda-protocol>protocol</a></code>
-      <th><code title=dom-uda-host><a href=#dom-uda-host>host</a></code>
-      <th><code title=dom-uda-hostname><a href=#dom-uda-hostname>hostname</a></code>
-      <th><code title=dom-uda-port><a href=#dom-uda-port>port</a></code>
-      <th><code title=dom-uda-pathname><a href=#dom-uda-pathname>pathname</a></code>
-      <th><code title=dom-uda-search><a href=#dom-uda-search>search</a></code>
-      <th><code title=dom-uda-hash><a href=#dom-uda-hash>hash</a></code>
-    <tbody><tr><td><code title="">http://example.com/carrot#question%3f</code>
-      <td><code title="">http:</code>
-      <td><code title="">example.com</code>
-      <td><code title="">example.com</code>
-      <td>(empty string)
-      <td><code title="">/carrot</code>
-      <td>(empty string)
-      <td><code title="">#question%3f</code>
-     <tr><td><code title="">https://www.example.com:4443?</code>
-      <td><code title="">https:</code>
-      <td><code title="">www.example.com:4443</code>
-      <td><code title="">www.example.com</code>
-      <td><code title="">4443</code>
-      <td><code title="">/</code>
-      <td><code title="">?</code>
-      <td>(empty string)
-   </table></div>
-
-
-<!--TOPIC:HTML-->
+<!--CLEANUP-->
   <div class=impl>
 
   <h3 id=fetching-resources><span class=secno>2.6 </span>Fetching resources</h3>
@@ -7295,14 +6728,20 @@
 
    <li>
 
-    <p><i>Clean referrer</i>: Remove any <a href=#url-fragment title=url-fragment><fragment></a>
-    component from <var title="">referrer</var>.</p> <!-- RFC2616 says "The URI MUST NOT include a
-    fragment." (section 14.36) -->
+    <p>Apply the <a href=#url-parser>URL parser</a> to <var title="">referrer</var> and let <var title="">parsed referrer</var> be <a href=#resulting-parsed-url>resulting parsed URL</a>.</p>
 
    </li>
 
    <li>
 
+    <p><i>Clean referrer</i>: Let <var title="">referrer</var> be the result of applying the
+    <a href=#url-serializer>URL serializer</a> to <var title="">parsed referrer</var>, with the <i>exclude fragment
+    flag</i> set.</p> <!-- RFC2616 says "The URI MUST NOT include a fragment." (section 14.36) -->
+
+   </li>
+
+   <li>
+
     <p>If <var title="">referrer</var> is not the empty string, is not a <a href=#data-protocol title="data
     protocol"><code title="">data:</code> URL</a>, is not a <a href=#javascript-protocol title="javascript
     protocol"><code title="">javascript:</code> URL</a>, and is not the <a href=#url>URL</a>
@@ -8837,6 +8276,10 @@
   document</a>, and the <code><a href=#document>Document</a></code> is both <a href=#ready-for-post-load-tasks>ready for post-load tasks</a> and
   <a href=#completely-loaded>completely loaded</a> immediately.</p>
 
+  <p><dfn id="the-document's-referrer">The document's referrer</dfn> is an <a href=#absolute-url>absolute URL</a> that can be set when the
+  <code><a href=#document>Document</a></code> is created. If it is not explicitly set, then its value is the empty
+  string.</p>
+
   <p>Each <code><a href=#document>Document</a></code> object has a <dfn id=reload-override-flag>reload override flag</dfn> that is originally
   unset. The flag is set by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> and <code title=dom-document-open><a href=#dom-document-open>document.write()</a></code> methods in certain situations. When the flag is
   set, the <code><a href=#document>Document</a></code> also has a <dfn id=reload-override-buffer>reload override buffer</dfn> which is a Unicode
@@ -8938,6 +8381,8 @@
   <dl class=domintro><dt><var title="">document</var> . <code title=dom-document-referrer><a href=#dom-document-referrer>referrer</a></code></dt>
    <dd>
 
+<!--CLEANUP-->
+
     <p>Returns <a href="#the-document's-address" title="the document's address">the address</a>
     of the <code><a href=#document>Document</a></code> from which the user navigated to this
     one, unless it was blocked or there was no such document, in which
@@ -8950,14 +8395,8 @@
 
   </dl><div class=impl>
 
-  <p>The <dfn id=dom-document-referrer title=dom-document-referrer><code>referrer</code></dfn> attribute must return either
-  the <a href="#the-document's-address" title="the document's address">address</a> of the <a href=#active-document>active document</a> of the
-  <a href=#source-browsing-context>source browsing context</a> <em>at the time the navigation was started</em> (that is, the
-  page which <a href=#navigate title=navigate>navigated</a> the <a href=#browsing-context>browsing context</a> to the
-  current document), with any <a href=#url-fragment title=url-fragment><fragment></a> component removed;
-  or the empty string if there is no such originating page, or if the UA has been configured not to
-  report referrers in this case, or if the navigation was initiated for a <a href=#hyperlink>hyperlink</a>
-  with a <code title=rel-noreferrer><a href=#link-type-noreferrer>noreferrer</a></code> keyword.</p>
+  <p>The <dfn id=dom-document-referrer title=dom-document-referrer><code>referrer</code></dfn> attribute must return
+  <a href="#the-document's-referrer">the document's referrer</a>.</p>
 
   </div>
 
@@ -12371,6 +11810,8 @@
    <li><p>Change <a href="#the-document's-address">the document's address</a> to the <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's document">document</a>'s <a href="#the-document's-address" title="the document's
    address">address</a>.</li>
 
+   <!-- <span>the document's referrer</span> stays the same -->
+
    <li><p>Create a new <a href=#html-parser>HTML parser</a> and associate it with the document. This is a
    <dfn id=script-created-parser>script-created parser</dfn> (meaning that it can be closed by the <code title=dom-document-open><a href=#dom-document-open>document.open()</a></code> and <code title=dom-document-close><a href=#dom-document-close>document.close()</a></code> methods, and that the tokenizer will wait for
    an explicit call to <code title=dom-document-close><a href=#dom-document-close>document.close()</a></code> before emitting an
@@ -19387,16 +18828,8 @@
            attribute DOMString <a href=#dom-a-type title=dom-a-type>type</a>;
 
            attribute DOMString <a href=#dom-a-text title=dom-a-text>text</a>;
-
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
-           attribute DOMString <a href=#dom-a-protocol title=dom-a-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-a-host title=dom-a-host>host</a>;
-           attribute DOMString <a href=#dom-a-hostname title=dom-a-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-a-port title=dom-a-port>port</a>;
-           attribute DOMString <a href=#dom-a-pathname title=dom-a-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-a-search title=dom-a-search>search</a>;
-           attribute DOMString <a href=#dom-a-hash title=dom-a-hash>hash</a>;
-};</pre>
+};
+<a href=#htmlanchorelement>HTMLAnchorElement</a> implements <a href=#urlutils>URLUtils</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>If the <code><a href=#the-a-element>a</a></code> element has an <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute,
   then it <a href=#represents>represents</a> a <a href=#hyperlink>hyperlink</a> (a hypertext anchor) labeled by its
@@ -19492,7 +18925,7 @@
 
    </dd>
 
-  </dl><div class=impl>
+  </dl><!-- CLEANUP --><div class=impl>
 
   <p>The IDL attributes <dfn id=dom-a-href title=dom-a-href><code>href</code></dfn>, <dfn id=dom-a-download title=dom-a-download><code>download</code></dfn>, <dfn id=dom-a-ping title=dom-a-ping><code>ping</code></dfn>, <dfn id=dom-a-target title=dom-a-target><code>target</code></dfn>,
   <dfn id=dom-a-rel title=dom-a-rel><code>rel</code></dfn>, <dfn id=dom-a-hreflang title=dom-a-hreflang><code>hreflang</code></dfn>, and <dfn id=dom-a-type title=dom-a-type><code>type</code></dfn>, must <a href=#reflect>reflect</a> the respective content
@@ -19505,12 +18938,12 @@
   same value as the <code><a href=#textcontent>textContent</a></code> IDL attribute on the element, and on setting, must act
   as if the <code><a href=#textcontent>textContent</a></code> IDL attribute on the element had been set to the new value.</p>
 
-  <p>The <code><a href=#the-a-element>a</a></code> element also supports the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-a-protocol title=dom-a-protocol><code>protocol</code></dfn>, <dfn id=dom-a-host title=dom-a-host><code>host</code></dfn>, <dfn id=dom-a-port title=dom-a-port><code>port</code></dfn>, <dfn id=dom-a-hostname title=dom-a-hostname><code>hostname</code></dfn>, <dfn id=dom-a-pathname title=dom-a-pathname><code>pathname</code></dfn>, <dfn id=dom-a-search title=dom-a-search><code>search</code></dfn>, and <dfn id=dom-a-hash title=dom-a-hash><code>hash</code></dfn>. These must follow the rules given for <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being
-  the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the element's
-  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute to the new output value.</p>
+  <p>The <code><a href=#the-a-element>a</a></code> element also supports the <code><a href=#urlutils>URLUtils</a></code> interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is
+  the value of the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <a href=#concept-uu-base title=concept-uu-base>base</a>
+  is <a href="#the-element's-base-url">the element's base URL</a>; the <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a>
+  being the <a href="#document's-character-encoding">document's character encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> being the same as setting the element's
+  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute to the new output value.</p>
 
   </div>
 <!--TOPIC:HTML-->
@@ -25326,12 +24759,14 @@
     <!-- if we get to this point we know we can successfully parsed the URL, since this algorithm is
     only used after fetching the resource in the steps above -->
 
-    <p>Otherwise, if the <a href=#url-path title=url-path><path></a> component of the
-    <a href=#url>URL</a> of the specified resource (after any redirects) matches a pattern that a
+<!--CLEANUP-->
+    <p>Otherwise, if applying the <a href=#url-parser>URL parser</a> algorithm to the
+    <a href=#url>URL</a> of the specified resource (after any redirects) results in a <a href=#parsed-url>parsed URL</a>
+    whose <a href=#concept-url-path title=concept-url-path>path</a> component matches a pattern that a
     <a href=#plugin>plugin</a> supports, then the <a href=#concept-embed-type title=concept-embed-type>content's type</a> is
     the type that that plugin can handle.</p>
 
-    <p class=example>For example, a plugin might say that it can handle resources with <a href=#url-path title=url-path><path></a> components that end with the four character string "<code title="">.swf</code>".</p>
+    <p class=example>For example, a plugin might say that it can handle resources with <a href=#concept-url-path title=concept-url-path>path</a> components that end with the four character string "<code title="">.swf</code>".</p>
 
     <!-- it's sad that we have to do extension sniffing. sigh. -->
     <!-- see also <object> which has a similar step -->
@@ -25860,12 +25295,14 @@
         <!-- if we get to this point we know we can successfully parsed the URL, since this
         algorithm is only used after fetching the resource in the steps above -->
 
-        <p>If the <a href=#url-path title=url-path><path></a> component of the <a href=#url>URL</a> of
-        the specified resource (after any redirects) matches a pattern that a <a href=#plugin>plugin</a>
+<!--CLEANUP-->
+        <p>If applying the <a href=#url-parser>URL parser</a> algorithm to the
+        <a href=#url>URL</a> of the specified resource (after any redirects) results in a <a href=#parsed-url>parsed URL</a>
+        whose <a href=#concept-url-path title=concept-url-path>path</a> component matches a pattern that a <a href=#plugin>plugin</a>
         supports, then let <var title="">resource type</var> be the type that that plugin can
         handle.</p>
 
-        <p class=example>For example, a plugin might say that it can handle resources with <a href=#url-path title=url-path><path></a> components that end with the four character string
+        <p class=example>For example, a plugin might say that it can handle resources with <a href=#concept-url-path title=concept-url-path>path</a> components that end with the four character string
         "<code title="">.swf</code>".</p>
 
         <!-- it's sad that we have to do extension sniffing. sigh. -->
@@ -29934,7 +29371,7 @@
   should play, but it is also possible to select specific tracks declaratively, by specifying
   particular tracks in the fragment identifier of the <a href=#url>URL</a> of the <a href=#media-resource>media
   resource</a>. The format of the fragment identifier depends on the <a href=#mime-type>MIME type</a> of
-  the <a href=#media-resource>media resource</a>. <a href=#refsRFC2046>[RFC2046]</a> <a href=#refsRFC3986>[RFC3986]</a></p>
+  the <a href=#media-resource>media resource</a>. <a href=#refsRFC2046>[RFC2046]</a> <a href=#refsURL>[URL]</a></p>
 
   <div class=example>
 
@@ -39553,16 +38990,8 @@
   readonly attribute <a href=#domtokenlist>DOMTokenList</a> <a href=#dom-area-rellist title=dom-area-relList>relList</a>;
            attribute DOMString <a href=#dom-area-hreflang title=dom-area-hreflang>hreflang</a>;
            attribute DOMString <a href=#dom-area-type title=dom-area-type>type</a>;
-
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
-           attribute DOMString <a href=#dom-area-protocol title=dom-area-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-area-host title=dom-area-host>host</a>;
-           attribute DOMString <a href=#dom-area-hostname title=dom-area-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-area-port title=dom-area-port>port</a>;
-           attribute DOMString <a href=#dom-area-pathname title=dom-area-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-area-search title=dom-area-search>search</a>;
-           attribute DOMString <a href=#dom-area-hash title=dom-area-hash>hash</a>;
-};</pre>
+};
+<a href=#htmlareaelement>HTMLAreaElement</a> implements <a href=#urlutils>URLUtils</a>;</pre>
    </dd>
   </dl><!--TOPIC:HTML--><p>The <code><a href=#the-area-element>area</a></code> element <a href=#represents>represents</a> either a
   hyperlink with some text and a corresponding area on an <a href=#image-map>image
@@ -39704,7 +39133,7 @@
    the <code><a href=#the-area-element>area</a></code> element, if any, and as determined by the <code title=attr-hyperlink-download><a href=#attr-hyperlink-download>download</a></code> attribute and any expressed user
    preference.</li>
 
-  </ol><p>The IDL attributes <dfn id=dom-area-alt title=dom-area-alt><code>alt</code></dfn>, <dfn id=dom-area-coords title=dom-area-coords><code>coords</code></dfn>, <dfn id=dom-area-href title=dom-area-href><code>href</code></dfn>, <dfn id=dom-area-target title=dom-area-target><code>target</code></dfn>, <dfn id=dom-area-download title=dom-area-download><code>download</code></dfn>, <dfn id=dom-area-ping title=dom-area-ping><code>ping</code></dfn>, <dfn id=dom-area-rel title=dom-area-rel><code>rel</code></dfn>,
+  </ol><p>The IDL attributes <dfn id=dom-area-alt title=dom-area-alt><code>alt</code></dfn>, <dfn id=dom-area-coords title=dom-area-coords><code>coords</code></dfn>, <dfn id=dom-area-target title=dom-area-target><code>target</code></dfn>, <dfn id=dom-area-download title=dom-area-download><code>download</code></dfn>, <dfn id=dom-area-href title=dom-area-href><code>href</code></dfn>, <dfn id=dom-area-ping title=dom-area-ping><code>ping</code></dfn>, <dfn id=dom-area-rel title=dom-area-rel><code>rel</code></dfn>,
   <dfn id=dom-area-hreflang title=dom-area-hreflang><code>hreflang</code></dfn>, and <dfn id=dom-area-type title=dom-area-type><code>type</code></dfn>, each must <a href=#reflect>reflect</a> the respective
   content attributes of the same name.</p>
 
@@ -39714,13 +39143,12 @@
   <p>The IDL attribute <dfn id=dom-area-rellist title=dom-area-rellist><code>relList</code></dfn> must
   <a href=#reflect>reflect</a> the <code title=attr-hyperlink-rel><a href=#attr-hyperlink-rel>rel</a></code> content attribute.</p>
 
-  <p>The <code><a href=#the-area-element>area</a></code> element also supports the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-area-protocol title=dom-area-protocol><code>protocol</code></dfn>, <dfn id=dom-area-host title=dom-area-host><code>host</code></dfn>, <dfn id=dom-area-port title=dom-area-port><code>port</code></dfn>,
-  <dfn id=dom-area-hostname title=dom-area-hostname><code>hostname</code></dfn>, <dfn id=dom-area-pathname title=dom-area-pathname><code>pathname</code></dfn>, <dfn id=dom-area-search title=dom-area-search><code>search</code></dfn>, and <dfn id=dom-area-hash title=dom-area-hash><code>hash</code></dfn>. These must follow the rules given for <a href=#url-decomposition-idl-attributes>URL
-  decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being
-  the result of <a href=#resolve-a-url title="resolve a url">resolving</a> the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the element's
-  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> attribute to the new output value.</p>
+  <p>The <code><a href=#the-area-element>area</a></code> element also supports the <code><a href=#urlutils>URLUtils</a></code> interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is
+  the value of the element's <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <a href=#concept-uu-base title=concept-uu-base>base</a>
+  is <a href="#the-element's-base-url">the element's base URL</a>; the <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a>
+  being the <a href="#document's-character-encoding">document's character encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> being the same as setting the element's
+  <code title=attr-hyperlink-href><a href=#attr-hyperlink-href>href</a></code> content attribute to the new output value.</p>
 
   </div>
 
@@ -55545,6 +54973,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class=impl>
 
@@ -55596,11 +55025,6 @@
     <p>If <var title="">action</var> is the empty string, let <var title="">action</var> be <a href="#the-document's-address">the document's address</a> of
     the <var title="">form document</var>.</p>
 
-    <p class=note>This step is a <a href=#willful-violation>willful violation</a> of
-    RFC 3986, which would require base URL processing here. This
-    violation is motivated by a desire for compatibility with legacy
-    content. <a href=#refsRFC3986>[RFC3986]</a></p>
-
     <!-- Don't ask me why. But that's what IE does. It even treats
     action="" differently from action=" " or action="#" (the latter
     two resolve to the base URL, the first one resolves to the doc
@@ -55613,12 +55037,17 @@
 
    <li><p><a href=#resolve-a-url title="resolve a url">Resolve</a> the
    <a href=#url>URL</a> <var title="">action</var>, relative to the <var title="">submitter</var> element. If this fails, abort these
-   steps. Otherwise, let <var title="">action</var> be the resulting
-   <a href=#absolute-url>absolute URL</a>.</li>
+   steps.</li>
 
-   <li><p>Let <var title="">scheme</var> be the <a href=#url-scheme title=url-scheme><scheme></a> of the resulting
+   <li><p>Let <var title="">action</var> be the resulting
    <a href=#absolute-url>absolute URL</a>.</li>
 
+   <li><p>Let <var title="">action components</var> be the resulting <a href=#parsed-url>parsed
+   URL</a>.</li>
+
+   <li><p>Let <var title="">scheme</var> be the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> of the resulting
+   <a href=#parsed-url>parsed URL</a>.</li>
+
    <li><p>Let <var title="">enctype</var> be the <var title="">submitter</var> element's <a href=#concept-fs-enctype title=concept-fs-enctype>enctype</a>.</li>
 
    <li><p>Let <var title="">method</var> be the <var title="">submitter</var> element's <a href=#concept-fs-method title=concept-fs-method>method</a>.</li>
@@ -55689,11 +55118,11 @@
       <!-- by this point we've already tried to resolve the URL, so we
       know we can parse it -->
 
+      <p>Set <var title="">parsed action</var>'s <a href=#concept-url-query title=concept-url-query>query</a>
+      component to <var title="">query</var>.</p>
+
       <p>Let <var title="">destination</var> be a new <a href=#url>URL</a>
-      that is equal to the <var title="">action</var> except that its
-      <a href=#url-query title=url-query><query></a> component is
-      replaced by <var title="">query</var> (adding a U+003F QUESTION
-      MARK character (?) if appropriate).</p>
+      formed by applying the <a href=#url-serializer>URL serializer</a> algorithm to <var title="">parsed action</var>.</p>
 
       <p><a href=#navigate>Navigate</a><!--DONAV form--> <var title="">target
       browsing context</var> to <var title="">destination</var>. If
@@ -55750,6 +55179,8 @@
       browsing context</var> must be navigated with <a href=#replacement-enabled>replacement
       enabled</a>.</p>
 
+      <p class=note>The <var title="">form data set</var> is discarded.</p>
+
      </dd>
 
      <dt><dfn id=submit-data-post title=submit-data-post>Post to data:</dfn>
@@ -55760,20 +55191,19 @@
       form encoding algorithm</a>.</p>
 
       <p>If <var title="">action</var> contains the string "<code title="">%%%%</code>" (four U+0025 PERCENT SIGN characters),
-      then %-escape all bytes in <var title="">data</var> that, if
-      interpreted as US-ASCII, do not match the <code title="">unreserved</code> production in the URI Generic Syntax,
-      and then, treating the result as a US-ASCII string, further
-      %-escape all the U+0025 PERCENT SIGN characters in the resulting
+      then <a href=#percent-encode>percent encode</a> all bytes in <var title="">data</var> that, if
+      interpreted as US-ASCII, are not characters in the URL <a href=#default-encode-set>default encode set</a>,
+      and then, treating the result as a US-ASCII string, 
+      <a href=#utf-8-percent-encode>UTF-8 percent encode</a> all the U+0025 PERCENT SIGN characters in the resulting
       string and replace the first occurrence of "<code title="">%%%%</code>" in <var title="">action</var> with the
-      resulting double-escaped string. <a href=#refsRFC3986>[RFC3986]</a></p>
+      resulting doubly-escaped string. <a href=#refsURL>[URL]</a></p>
 
       <p>Otherwise, if <var title="">action</var> contains the string
       "<code title="">%%</code>" (two U+0025 PERCENT SIGN characters
-      in a row, but not four), then %-escape all characters in <var title="">data</var> that, if interpreted as US-ASCII, do not
-      match the <code title="">unreserved</code> production in the URI
-      Generic Syntax, and then, treating the result as a US-ASCII
+      in a row, but not four), then <a href=#utf-8-percent-encode>UTF-8 percent encode</a> all characters in <var title="">data</var> that, if interpreted as US-ASCII, 
+      are not characters in the URL <a href=#default-encode-set>default encode set</a>, and then, treating the result as a US-ASCII
       string, replace the first occurrence of "<code title="">%%</code>" in <var title="">action</var> with the
-      resulting escaped string. <a href=#refsRFC3986>[RFC3986]</a></p>
+      resulting escaped string. <a href=#refsURL>[URL]</a></p>
 
       <p><a href=#navigate>Navigate</a><!--DONAV form--> <var title="">target
       browsing context</var> to the potentially modified <var title="">action</var> (which will be a <a href=#data-protocol title="data
@@ -55813,12 +55243,11 @@
      <dt><dfn id=submit-mailto-body title=submit-mailto-body>Mail as body</dfn>
      <dd>
 
-      <p>Let <var title="">body</var> be the resulting encoding the
+      <p>Let <var title="">body</var> be the resulting of encoding the
       <var title="">form data set</var> using the <a href=#appropriate-form-encoding-algorithm>appropriate
-      form encoding algorithm</a> and then %-escaping all the bytes
+      form encoding algorithm</a> and then <a href=#percent-encode title="percent encode">percent encoding</a> all the bytes
       in the resulting byte string that, when interpreted as US-ASCII,
-      do not match the <code title="">unreserved</code> production in
-      the URI Generic Syntax. <a href=#refsRFC3986>[RFC3986]</a></p>
+      are not characters in the URL <a href=#default-encode-set>default encode set</a>. <a href=#refsURL>[URL]</a></p>
 
       <p>Let <var title="">destination</var> have the same value as
       <var title="">action</var>.</p>
@@ -64849,7 +64278,11 @@
   <a href=#completely-loaded>completely loaded</a> immediately. The <code><a href=#document>Document</a></code> must have a single child
   <code><a href=#the-html-element>html</a></code> node, which itself has a single child <code><a href=#the-body-element>body</a></code> node. As soon as this
   <code><a href=#document>Document</a></code> is created, the user agent must <a href=#implement-the-sandboxing>implement the sandboxing</a> for
-  it.</p>
+  it. If the <a href=#browsing-context>browsing context</a> has a <a href=#creator-document>creator <code>Document</code></a>, then
+  the <a href=#browsing-context>browsing context</a>'s <code><a href=#document>Document</a></code>'s <a href="#the-document's-referrer" title="the document's
+  referrer">referrer</a> must be set to <a href="#the-document's-address" title="the document's address">the address</a>
+  of that <a href=#creator-document>creator <code>Document</code></a> at the time of the <a href=#browsing-context>browsing
+  context</a>'s creation.</p>
 
   <p class=note>If the <a href=#browsing-context>browsing context</a> is created specifically to be immediately
   navigated, then that initial navigation will have <a href=#replacement-enabled>replacement enabled</a>.</p>
@@ -66489,10 +65922,11 @@
 
   </dl><div class=impl>
 
+<!--CLEANUP-->
   <p>The <dfn id=dom-document-domain title=dom-document-domain><code>domain</code></dfn> attribute on
   <code><a href=#document>Document</a></code> objects must be initialized to <a href="#the-document's-domain">the document's domain</a>, if it has
   one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
-  from the host portion of the <a href=#url-host title=url-host><host></a> component must be omitted
+  from the <a href=#concept-url-host title=concept-url-host>host</a> component must be omitted
   from the attribute's value.</p>
 
   <p>On getting, the attribute must return its current value, unless the <code><a href=#document>Document</a></code> has
@@ -67210,22 +66644,22 @@
 
      <li>If that fails, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort these steps.</li>
 
-     <li>Compare the resulting <a href=#absolute-url>absolute URL</a> to <a href="#the-document's-address">the document's address</a>. If
-     any part of these two <a href=#url title=URL>URLs</a> differ other than the <a href=#url-path title=url-path><path></a>, <a href=#url-query title=url-query><query></a>, and <a href=#url-fragment title=url-fragment><fragment></a> components, then throw a
+<!--CLEANUP-->
+     <li>Compare the resulting <a href=#parsed-url>parsed URL</a> to the result of applying the <a href=#url-parser>URL parser</a> algorithm to <a href="#the-document's-address">the document's address</a>. If
+     any component of these two <a href=#url title=URL>URLs</a> differ other than the <a href=#concept-url-path title=concept-url-path>path</a>, <a href=#concept-url-query title=concept-url-query>query</a>, and <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> components, then throw a
      <code><a href=#securityerror>SecurityError</a></code> exception and abort these steps.</li>
 
      <li>If the <a href=#origin>origin</a> of the resulting <a href=#absolute-url>absolute URL</a> is not the same as
      the <a href=#origin>origin</a> of the <a href=#entry-script>entry script</a>'s <a href="#script's-document" title="script's
-     document">document</a>, and either the <a href=#url-path title=url-path><path></a> or <a href=#url-query title=url-query><query></a> components of the two <a href=#url title=URL>URLs</a>
+     document">document</a>, and either the <a href=#concept-url-path title=concept-url-path>path</a> or <a href=#concept-url-query title=concept-url-query>query</a> components of the two <a href=#parsed-url title="parsed URL">parsed URLs</a>
      compared in the previous step differ, throw a <code><a href=#securityerror>SecurityError</a></code> exception and abort
      these steps. (This prevents sandboxed content from spoofing other pages on the same
      origin.)</li>
 
      <li><p>Let <var title="">new URL</var> be the resulting <a href=#absolute-url>absolute URL</a>.</li>
 
-    </ol><p>For the purposes of the comparisons in the above substeps, the <a href=#url-path title=url-path><path></a> and <a href=#url-query title=url-query><query></a> components
-    can only be the same if the URLs are both <a href=#hierarchical-url title="hierarchical URL">hierarchical
-    URLs</a>.</p>
+    </ol><p>For the purposes of the comparisons in the above substeps, the <a href=#concept-url-path title=concept-url-path>path</a> and <a href=#concept-url-query title=concept-url-query>query</a> components
+    can only be the same if the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of both <a href=#parsed-url title="parsed URL">parsed URLs</a> are <a href=#concept-url-scheme-relative title=concept-url-scheme-relative>relative schemes</a>.</p>
 
    </li>
 
@@ -67452,17 +66886,9 @@
   void <a href=#dom-location-assign title=dom-location-assign>assign</a>(DOMString url);
   void <a href=#dom-location-replace title=dom-location-replace>replace</a>(DOMString url);
   void <a href=#dom-location-reload title=dom-location-reload>reload</a>();
+};
+<a href=#location>Location</a> implements <a href=#urlutils>URLUtils</a>;</pre>
 
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a> <!-- blame brendan for these "innovative" names -->
-           attribute DOMString <a href=#dom-location-protocol title=dom-location-protocol>protocol</a>;
-           attribute DOMString <a href=#dom-location-host title=dom-location-host>host</a>;
-           attribute DOMString <a href=#dom-location-hostname title=dom-location-hostname>hostname</a>;
-           attribute DOMString <a href=#dom-location-port title=dom-location-port>port</a>;
-           attribute DOMString <a href=#dom-location-pathname title=dom-location-pathname>pathname</a>;
-           attribute DOMString <a href=#dom-location-search title=dom-location-search>search</a>;
-           attribute DOMString <a href=#dom-location-hash title=dom-location-hash>hash</a>;
-};</pre>
-
   <dl class=domintro><dt><var title="">location</var> . <code title=dom-location-href><a href=#dom-location-href>href</a></code> [ = <var title="">value</var> ]</dt>
 
    <dd>
@@ -67579,16 +67005,18 @@
   user agent may instead perform <a href=#an-overridden-reload>an overridden reload</a> rather than the navigation
   described in this paragraph.</p>
 
+  <p>The <code><a href=#location>Location</a></code> interface also supports the <code><a href=#urlutils>URLUtils</a></code> interface. <span class=impl>The <a href=#concept-uu-input title=concept-uu-input>input</a> is <a href="#the-document's-address" title="the document's
+  address">the address</a> of the <i>relevant <code><a href=#document>Document</a></code></i> (same as the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute), as an <a href=#absolute-url>absolute URL</a>; the <a href=#concept-uu-base title=concept-uu-base>base</a> is the <a href=#entry-script>entry script</a>'s <a href="#script's-base-url" title="script's base
+  URL">base URL</a> (which can be different each time members on the interface are invoked); the
+  <a href=#concept-uu-query-encoding title=concept-uu-query-encoding>query encoding</a> is the <a href="#document's-character-encoding">document's character
+  encoding</a>; and the <a href=#concept-uu-update title=concept-uu-update>update steps</a> are the same as
+  setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute to the new output
+  value.</span></p>
+
   </div>
 
-  <p>The <code><a href=#location>Location</a></code> interface also has the complement of <a href=#url-decomposition-idl-attributes>URL decomposition IDL
-  attributes</a>, <dfn id=dom-location-protocol title=dom-location-protocol><code>protocol</code></dfn>, <dfn id=dom-location-host title=dom-location-host><code>host</code></dfn>, <dfn id=dom-location-port title=dom-location-port><code>port</code></dfn>, <dfn id=dom-location-hostname title=dom-location-hostname><code>hostname</code></dfn>, <dfn id=dom-location-pathname title=dom-location-pathname><code>pathname</code></dfn>, <dfn id=dom-location-search title=dom-location-search><code>search</code></dfn>, and <dfn id=dom-location-hash title=dom-location-hash><code>hash</code></dfn>. <span class=impl>These must follow the rules
-  given for <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being <a href="#the-document's-address" title="the document's address">the
-  address</a> of the <i>relevant <code><a href=#document>Document</a></code></i>, as an <a href=#absolute-url>absolute URL</a> (same
-  as the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute), and the <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being the same as setting the <code title=dom-location-href><a href=#dom-location-href>href</a></code> attribute to the new output value.</span></p>
 
 
-
 <!--ADD-TOPIC:Security-->
   <div class=impl>
 
@@ -67763,11 +67191,12 @@
 
    <li><p>Let <var title="">gone async</var> be false.</li>
 
-   <li id=navigate-fragid-step><p><i>Fragment identifiers</i>: If the <a href=#absolute-url>absolute URL</a> of
-   the new resource is the same as the <a href="#the-document's-address" title="the document's address">address</a> of the
-   <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated, ignoring any
-   <a href=#url-fragment title=url-fragment><fragment></a> components of those <a href=#url title=URL>URLs</a>, and the new resource is to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and the <a href=#absolute-url>absolute URL</a> of
-   the new resource has a <a href=#url-fragment title=url-fragment><fragment></a> component (even if it
+<!--CLEANUP-->
+   <li id=navigate-fragid-step><p><i>Fragment identifiers</i>: Apply the <a href=#url-parser>URL parser</a> algorithm to the <a href=#absolute-url>absolute URL</a> of
+   the new resource and the <a href="#the-document's-address" title="the document's address">address</a> of the
+   <a href=#active-document>active document</a> of the <a href=#browsing-context>browsing context</a> being navigated. If all the components of the resulting <a href=#parsed-url title="parsed URL">parsed URLs</a> , ignoring any
+   <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> components, are identical, and the new resource is to be fetched using HTTP GET <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a>, and the <a href=#parsed-url>parsed URL</a> of
+   the new resource has a <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component that is not null (even if it
    is empty), then <a href=#scroll-to-fragid title=navigate-fragid>navigate to that fragment identifier</a> and
    abort these steps.</li>
 
@@ -68231,12 +67660,14 @@
   encoding is established, the <a href="#document's-character-encoding">document's character encoding</a> must be set to that
   character encoding.</p>
 
+<!--CLEANUP-->
   <p>If the root element, as parsed according to the XML specifications cited above, is found to be
   an <code><a href=#the-html-element>html</a></code> element with an attribute <code title=attr-html-manifest><a href=#attr-html-manifest>manifest</a></code>
   whose value is not the empty string, then, as soon as the element is <a href=#insert-an-element-into-a-document title="insert an
   element into a document">inserted into the document</a>, the user agent must <a href=#resolve-a-url title="resolve a url">resolve</a> the value of that attribute relative to that element, and if
-  that is successful, must run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
-  algorithm</a> with the resulting <a href=#absolute-url>absolute URL</a> with any <a href=#url-fragment title=url-fragment><fragment></a> component removed as the manifest URL, and passing in
+  that is successful, must apply the <a href=#url-serializer>URL serializer</a> algorithm to the resulting <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set to obtain <var title="">manifest URL</var>, and then run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
+  algorithm</a> with <var title="">manifest URL</var>
+  as the manifest URL, passing in
   the newly-created <code><a href=#document>Document</a></code>. Otherwise, if the attribute is absent, its value is the
   empty string, or resolving its value fails, then as soon as the root element is <a href=#insert-an-element-into-a-document title="insert an element into a document">inserted into the document</a>, the user agent must
   run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection algorithm</a> with no
@@ -68478,8 +67909,8 @@
   processing model must be followed to determine what <a href=#the-indicated-part-of-the-document>the indicated part of the
   document</a> is.</p>
 
-  <ol><li><p><a href=#parse-a-url title="parse a url">Parse</a> the <a href=#url>URL</a>, and let <var title="">fragid</var> be the <a href=#url-fragment title=url-fragment><fragment></a> component of the
-   URL.</li><!-- parsing can't fail, since we checked earlier on when navigating -->
+  <ol><!--CLEANUP--><li><p>Apply the <a href=#url-parser>URL parser</a> algorithm to the <a href=#url>URL</a>, and let <var title="">fragid</var> be the <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component of the
+   resulting <a href=#parsed-url>parsed URL</a>.</li><!-- parsing can't fail, since we checked earlier on when navigating -->
 
    <li><p>If <var title="">fragid</var> is the empty string, then <a href=#the-indicated-part-of-the-document>the indicated part of the
    document</a> is the top of the document; stop the algorithm here.</li>
@@ -69611,7 +69042,7 @@
   </div>
 
 
-
+<!--CLEANUP-->
   <h5 id=writing-cache-manifests><span class=secno>6.7.3.2 </span>Writing cache manifests</h5>
 
   <p>Manifests must be served using the
@@ -69771,10 +69202,10 @@
   which another namespace in the <a href=#concept-appcache-onlinewhitelist title=concept-appcache-onlinewhitelist>online whitelist</a> is
   a <a href=#prefix-match>prefix match</a>.</p>
 
-  <p>Relative URLs must be given relative to the manifest's own
-  URL. All URLs in the manifest must have the same <a href=#url-scheme title=url-scheme><scheme></a> as the manifest itself
-  (either explicitly or implicitly, through the use of relative
-  URLs).</p>
+  <p><a href=#relative-url title="relative URL">Relative URLs</a> must be given relative to the manifest's own
+  URL. All URLs in the manifest must have the same <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> as the manifest itself
+  (either explicitly or implicitly, through the use of <a href=#relative-url title="relative url">relative
+  URLs</a>). <a href=#refsURL>[URL]</a></p>
 
   <p>URLs in manifests must not have fragment identifiers (i.e. the
   U+0023 NUMBER SIGN character isn't allowed in URLs in
@@ -69785,6 +69216,7 @@
   matched by <a href=#prefix-match>prefix match</a>.</p>
 
 
+<!--CLEANUP-->
   <div class=impl>
 
   <h5 id=parsing-cache-manifests><span class=secno>6.7.3.3 </span>Parsing cache manifests</h5>
@@ -69792,7 +69224,7 @@
   <p>When a user agent is to <dfn id=parse-a-manifest>parse a manifest</dfn>, it means
   that the user agent must run the following steps:</p>
 
-  <ol><li><p>The user agent must decode the byte stream corresponding
+  <ol><li><p>Decode the byte stream corresponding
    with the manifest to be parsed <a href=#decoded-as-utf-8,-with-error-handling title="decoded as UTF-8, with
    error handling">as UTF-8, with error handling</a>. <!--All
    U+0000 NULL characters must be replaced by U+FFFD REPLACEMENT
@@ -69803,6 +69235,10 @@
    <li><p>Let <var title="">base URL</var> be the <a href=#absolute-url>absolute
    URL</a> representing the manifest.</li>
 
+   <li><p>Apply the <a href=#url-parser>URL parser</a> steps to the <var title="">base URL</var>, so that the
+   components from its <a href=#parsed-url>parsed URL</a> can be used by the subseqent steps of this
+   algorithm.</li>
+
    <li><p>Let <var title="">explicit URLs</var> be an initially empty
    list of <a href=#absolute-url title="absolute URL">absolute URLs</a> for <a href=#concept-appcache-explicit title=concept-appcache-explicit>explicit entries</a>.</li>
 
@@ -69942,17 +69378,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <a href=#absolute-url>absolute URL</a> has a different
-      <a href=#url-scheme title=url-scheme><scheme></a> component than
-      the manifest's URL (compared in an <a href=#ascii-case-insensitive>ASCII
-      case-insensitive</a> manner), then jump back to the step
+      <p>If the resulting <a href=#parsed-url>parsed URL</a> has a different
+      <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <a href=#url-fragment title=url-fragment><fragment></a>
-      component of the resulting <a href=#absolute-url>absolute URL</a>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <a href=#absolute-url>absolute URL</a> to the <var title="">explicit URLs</var>.</p>
+      <p>Add <var title="">new URL</var> to the <var title="">explicit URLs</var>.</p>
 
      </dd>
 
@@ -69974,18 +69408,22 @@
       jump back to the step labeled "start of line".</p> <!-- SECURITY
       -->
 
-      <p>Drop any <a href=#url-fragment title=url-fragment><fragment></a>
-      components of the resulting <a href=#absolute-url title="absolute URL">absolute
-      URLs</a>.</p>
+      <p>Let <var title="">part one</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the first resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment
+      flag</i> set.</p>
 
-      <p>If the <a href=#absolute-url>absolute URL</a> corresponding to <var title="">part one</var> is already in the <var title="">fallback
+      <p>Let <var title="">part two</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the second resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment
+      flag</i> set.</p>
+
+      <p>If <var title="">part one</var> is already in the <var title="">fallback
       URLs</var> mapping as a <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespace</a>,
       then jump back to the step labeled "start of line".</p>
 
-      <p>Otherwise, add the <a href=#absolute-url>absolute URL</a> corresponding to
+      <p>Otherwise, add 
       <var title="">part one</var> to the <var title="">fallback
       URLs</var> mapping as a <a href=#concept-appcache-fallback-ns title=concept-appcache-fallback-ns>fallback namespace</a>,
-      mapped to the <a href=#absolute-url>absolute URL</a> corresponding to <var title="">part two</var> as the <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entry</a>.</p>
+      mapped to <var title="">part two</var> as the <a href=#concept-appcache-fallback title=concept-appcache-fallback>fallback entry</a>.</p>
 
      </dd>
 
@@ -70004,17 +69442,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <a href=#absolute-url>absolute URL</a> has a different
-      <a href=#url-scheme title=url-scheme><scheme></a> component than
-      the manifest's URL (compared in an <a href=#ascii-case-insensitive>ASCII
-      case-insensitive</a> manner), then jump back to the step
+      <p>If the resulting <a href=#parsed-url>parsed URL</a> has a different
+      <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <a href=#url-fragment title=url-fragment><fragment></a>
-      component of the resulting <a href=#absolute-url>absolute URL</a>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <a href=#url-serializer>URL serializer</a>
+      algorithm to the resulting <a href=#parsed-url>parsed URL</a>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <a href=#absolute-url>absolute URL</a> to the <var title="">online whitelist namespaces</var>.</p>
+      <p>Add <var title="">new URL</var> to the <var title="">online whitelist namespaces</var>.</p>
 
      </dd>
 
@@ -70299,10 +69735,11 @@
       <a href=#shows-caching-progress>shows caching progress</a>, the display of some sort of user interface indicating to
       the user that the user agent failed to save the application for offline use.</p>
 
+<!--CLEANUP-->
       <p>Otherwise, associate the <code><a href=#document>Document</a></code> for this entry with <var title="">cache</var>; store the resource for this entry in <var title="">cache</var>, if it
-      isn't already there, and categorize its entry as a <a href=#concept-appcache-master title=concept-appcache-master>master entry</a>. If the resource's <a href=#url>URL</a> has a
-      <a href=#url-fragment title=url-fragment><fragment></a> component, it must be removed from the
-      entry in <var title="">cache</var> (application caches never include fragment
+      isn't already there, and categorize its entry as a <a href=#concept-appcache-master title=concept-appcache-master>master entry</a>. If applying the <a href=#url-parser>URL parser</a> algorithm to the resource's <a href=#url>URL</a> results in a <a href=#parsed-url>parsed URL</a> that has a non-null
+      <a href=#concept-url-fragment title=concept-url-fragment>fragment</a> component, the <a href=#url>URL</a> used for the
+      entry in <var title="">cache</var> must instead be the <a href=#absolute-url>absolute URL</a> obtained from applying the <a href=#url-serializer>URL serializer</a> algorith, to the <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set (application caches never include fragment
       identifiers).</p>
 
      </li>
@@ -70823,8 +70260,8 @@
 
   <ol><!--FETCH--><li><p>If the resource is not to be fetched using the HTTP GET
    mechanism <a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or
-   equivalent</a>, or if its <a href=#url>URL</a> has a different <a href=#url-scheme title=url-scheme><scheme></a> component than the
-   <a href=#application-cache>application cache</a>'s <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>, then
+   equivalent</a>, or if applying the <a href=#url-parser>URL parser</a> algorithm to both its <a href=#url>URL</a> and the
+   <a href=#application-cache>application cache</a>'s <a href=#concept-appcache-manifest title=concept-appcache-manifest>manifest</a>'s URL results in two <a href=#parsed-url title="parsed URL">parsed URLs</a> with different <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> components, then
    <a href=#fetch>fetch</a> the resource normally and abort these
    steps.</li>
 
@@ -71323,6 +70760,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class=impl>
 
@@ -71469,7 +70907,7 @@
    <dd>
 
     <p>A <a href=#url>URL</a>, set when the script is created, used to
-    resolve relative URLs. <span id=sbu-not-copy title="">If the
+    resolve <a href=#relative-url title="relative url">relative URLs</a>. <span id=sbu-not-copy title="">If the
     base URL is set from another source, e.g. a <a href=#document-base-url>document base
     URL</a>, then the <a href="#script's-base-url">script's base URL</a> must follow
     the source, so that if the source's changes, so does the
@@ -73949,6 +73387,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <h5 id=custom-handlers><span class=secno>7.5.1.3 </span>Custom scheme and content handlers</h5>
 
@@ -74171,11 +73610,10 @@
     resulting URL using the GET method (<a href=#concept-http-equivalent-get title=concept-http-equivalent-get>or equivalent</a> for
     non-HTTP URLs).</p>
 
-    <p>To get the escaped version of the <a href=#absolute-url>absolute URL</a> of
-    the content in question, the user agent must replace every
-    character in that <a href=#absolute-url>absolute URL</a> that doesn't match the
-    <query> production defined in RFC 3986 by the
-    percent-encoded form of that character. <a href=#refsRFC3986>[RFC3986]</a></p>
+    <p>To get the escaped version of the <a href=#absolute-url>absolute URL</a> of the content in question, the
+    user agent must replace every character in that <a href=#absolute-url>absolute URL</a> that is not a
+    character in the URL <a href=#default-encode-set>default encode set</a> with the result of <a href=#utf-8-percent-encode title="UTF-8 percent
+    encode">UTF-8 percent encoding</a> that character.</p>
 
     <div class=example>
 
@@ -74695,8 +74133,8 @@
 
     <li><p>If this fails, return 0 and abort these steps.</li>
 
-    <li><p>Let <var title="">host2</var> be be the <a href=#url-host title=url-host><host></a> component of the resulting
-    <a href=#absolute-url>absolute URL</a>.</li>
+    <li><p>Let <var title="">host2</var> be be the <a href=#concept-url-host title=concept-url-host>host</a> component of the resulting
+    <a href=#parsed-url>parsed URL</a>.</li>
 
     <li>
 
@@ -74710,10 +74148,8 @@
      <var title="">host2</var> after their common suffix are not the
      same, then return 0 and abort these steps.</p>
 
-     <p>Domain labels must be compared after applying the IDNA ToASCII
-     algorithm to them, with both the AllowUnassigned and
-     UseSTD3ASCIIRules flags set, in an <a href=#ascii-case-insensitive>ASCII
-     case-insensitive</a> manner. <a href=#refsRFC3490>[RFC3490]</a></p>
+     <!-- host1 is ascii here because origins are ascii. host2 is ascii because resolve urls
+     punycodes idna. -->
 
     </li>
 
@@ -78762,6 +78198,7 @@
   </div>
 -->
 
+<!--CLEANUP-->
 
 <!--ADD-TOPIC:Security-->
   <div class=impl>
@@ -78791,7 +78228,7 @@
 
   <p>User agents should filter potentially active (scripted) content
   (e.g. HTML) when it is dragged and when it is dropped, using a
-  whitelist of known-safe features. Similarly, relative URLs should be
+  whitelist of known-safe features. Similarly, <a href=#relative-url title="relative url">relative URLs</a> should be
   turned into absolute URLs to avoid references changing in unexpected
   ways. This specification does not specify how this is performed.</p>
 
@@ -80412,7 +79849,7 @@
   <table><thead><tr><th><a href=#event-handlers title="event handlers">Event handler</a> <th><a href=#event-handler-event-type>Event handler event type</a>
    <tbody><tr><td><dfn id=handler-abstractworker-onerror title=handler-AbstractWorker-onerror><code>onerror</code></dfn> <td> <code title=event-error>error</code>
 <!-- v2-onclose    <tr><td><dfn title="handler-AbstractWorker-onclose"><code>onclose</code></dfn> <td> <code title="event-worker-close">close</code> -->
-  </table><h5 id=dedicated-workers-and-the-worker-interface><span class=secno>9.2.6.2 </span>Dedicated workers and the <code><a href=#worker>Worker</a></code> interface</h5>
+  </table><!--CLEANUP--><h5 id=dedicated-workers-and-the-worker-interface><span class=secno>9.2.6.2 </span>Dedicated workers and the <code><a href=#worker>Worker</a></code> interface</h5>
 
   <pre class=idl>[<a href=#dom-worker title=dom-Worker>Constructor</a>(DOMString scriptURL)]
 interface <dfn id=worker>Worker</dfn> : <a href=#eventtarget>EventTarget</a> {
@@ -80481,8 +79918,8 @@
 
    <li>
 
-    <p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of
-    the resulting <a href=#absolute-url>absolute URL</a> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
+    <p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of
+    the resulting <a href=#parsed-url>parsed URL</a> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
     the resulting <a href=#absolute-url>absolute URL</a> is not the <a href=#same-origin title="same origin">same</a> as the origin of the <a href=#entry-script>entry
     script</a>, then throw a <code><a href=#securityerror>SecurityError</a></code> exception
     and abort these steps.</p>
@@ -80605,7 +80042,8 @@
    exception.</li>
 
    <li><p>Otherwise, let <var title="">scriptURL</var> be the
-   resulting <a href=#absolute-url>absolute URL</a>.</li>
+   resulting <a href=#absolute-url>absolute URL</a> and <var title="">parsed scriptURL</var> be the
+   resulting <a href=#parsed-url>parsed URL</a>.</li>
 
    <li><p>Let <var title="">name</var> be the value of the second
    argument, or the empty string if the second argument was
@@ -80613,8 +80051,8 @@
 
    <li>
 
-    <p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of
-    <var title="">scriptURL</var> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
+    <p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of
+    <var title="">parsed scriptURL</var> is not "<code title=data-protocol>data</code>", and the <a href=#origin>origin</a> of
     <var title="">scriptURL</var> is not the <a href=#same-origin title="same
     origin">same</a> as the origin of the <a href=#entry-script>entry
     script</a>, then throw a <code><a href=#securityerror>SecurityError</a></code> exception
@@ -80966,16 +80404,9 @@
   <h4 id=worker-locations><span class=secno>9.3.4 </span>Worker locations</h4>
 
   <pre class=idl>interface <dfn id=workerlocation>WorkerLocation</dfn> {
-  // <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>
   stringifier readonly attribute DOMString <a href=#dom-workerlocation-href title=dom-WorkerLocation-href>href</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-protocol title=dom-WorkerLocation-protocol>protocol</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-host title=dom-WorkerLocation-host>host</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-hostname title=dom-WorkerLocation-hostname>hostname</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-port title=dom-WorkerLocation-port>port</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-pathname title=dom-WorkerLocation-pathname>pathname</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-search title=dom-WorkerLocation-search>search</a>;
-  readonly attribute DOMString <a href=#dom-workerlocation-hash title=dom-WorkerLocation-hash>hash</a>;
-};</pre>
+};
+<a href=#workerlocation>WorkerLocation</a> implements <a href=#urlutilsreadonly>URLUtilsReadOnly</a>;</pre>
 
   <p>A <code><a href=#workerlocation>WorkerLocation</a></code> object represents an <a href=#absolute-url>absolute URL</a> set at its
   creation.</p>
@@ -80983,13 +80414,10 @@
   <p>The <dfn id=dom-workerlocation-href title=dom-WorkerLocation-href><code>href</code></dfn> attribute must return the
   <a href=#absolute-url>absolute URL</a> that the object represents.</p>
 
-  <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface also has the complement of <a href=#url-decomposition-idl-attributes>URL decomposition
-  IDL attributes</a>, <dfn id=dom-workerlocation-protocol title=dom-WorkerLocation-protocol><code>protocol</code></dfn>, <dfn id=dom-workerlocation-host title=dom-WorkerLocation-host><code>host</code></dfn>, <dfn id=dom-workerlocation-port title=dom-WorkerLocation-port><code>port</code></dfn>, <dfn id=dom-workerlocation-hostname title=dom-WorkerLocation-hostname><code>hostname</code></dfn>, <dfn id=dom-workerlocation-pathname title=dom-WorkerLocation-pathname><code>pathname</code></dfn>, <dfn id=dom-workerlocation-search title=dom-WorkerLocation-search><code>search</code></dfn>, and <dfn id=dom-workerlocation-hash title=dom-WorkerLocation-hash><code>hash</code></dfn>. These must follow the rules given for
-  <a href=#url-decomposition-idl-attributes>URL decomposition IDL attributes</a>, with the <a href=#concept-uda-input title=concept-uda-input>input</a> being the <a href=#absolute-url>absolute URL</a> that the object
-  represents (same as the <code title=dom-WorkerLocation-href><a href=#dom-workerlocation-href>href</a></code> attribute), and the
-  <a href=#concept-uda-setter title=concept-uda-setter>common setter action</a> being a no-op, since the attributes
-  are defined to be readonly.
-  </p>
+  <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface also supports the <code><a href=#urlutilsreadonly>URLUtilsReadOnly</a></code>
+  interface. The <a href=#concept-uu-input title=concept-uu-input>input</a> is the <a href=#absolute-url>absolute URL</a> that
+  the object represents (same as the <code title=dom-WorkerLocation-href><a href=#dom-workerlocation-href>href</a></code>
+  attribute). <a href=#refsURL>[URL]</a></p>
 
   <p>The <code><a href=#workerlocation>WorkerLocation</a></code> interface must only be <a href=#expose title=expose>exposed</a> if
   the <a href=#javascript-global-environment>JavaScript global environment</a> is a <a href=#worker-environment>worker environment</a>.</p>
@@ -82602,6 +82030,7 @@
   https://www.w3.org/Bugs/Public/show_bug.cgi?id=17264 -->
 
 
+<!--CLEANUP-->
   <h4 id=parsing-websocket-urls><span class=secno>10.3.5 </span>Parsing WebSocket URLs</h4>
 
   <p>The steps to <dfn id="parse-a-websocket-url's-components">parse a WebSocket URL's components</dfn> from a string <var title="">url</var> are as follows. These steps return either a <var title="">host</var>, a <var title="">port</var>, a <var title="">resource name</var>, and a <var title="">secure</var> flag,
@@ -82621,34 +82050,34 @@
 
    </li>
 
-   <li><p>If <var title="">url</var> does not have a <a href=#url-scheme title=url-scheme><scheme></a>
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> does not have a <a href=#concept-url-scheme title=concept-url-scheme>scheme</a>
    component whose value, when <a href=#converted-to-ascii-lowercase>converted to ASCII lowercase</a>, is either "<code title="">ws</code>" or "<code title="">wss</code>", then fail this algorithm.</li>
 
-   <li><p>If <var title="">url</var> has a <a href=#url-fragment title=url-fragment><fragment></a>
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a non-null <a href=#concept-url-fragment title=concept-url-fragment>fragment</a>
    component, then fail this algorithm.</li>
 
-   <li><p>If the <a href=#url-scheme title=url-scheme><scheme></a> component of <var title="">url</var>
-   is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <a href=#url-scheme title=url-scheme><scheme></a> component is "<code title="">wss</code>", set <var title="">secure</var> to true.</li>
+   <li><p>If the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component of the resulting <a href=#parsed-url>parsed URL</a>
+   is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <a href=#concept-url-scheme title=concept-url-scheme>scheme</a> component is "<code title="">wss</code>", set <var title="">secure</var> to true.</li>
 
-   <li><p>Let <var title="">host</var> be the value of the <a href=#url-host title=url-host><host></a> component of <var title="">url</var>, <a href=#converted-to-ascii-lowercase>converted to
+   <li><p>Let <var title="">host</var> be the value of the resulting <a href=#parsed-url>parsed URL</a>'s <a href=#concept-url-host title=concept-url-host>host</a> component, <a href=#converted-to-ascii-lowercase>converted to
    ASCII lowercase</a>.</li> <!-- at this point this is Punycode-encoded already -->
 
-   <li><p>If <var title="">url</var> has a <a href=#url-port title=url-port><port></a> component,
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a <a href=#concept-url-port title=concept-url-port>port</a> component that is not the empty string,
    then let <var title="">port</var> be that component's value; otherwise, there is no explicit <var title="">port</var>.</li>
 
    <li><p>If there is no explicit <var title="">port</var>, then: if <var title="">secure</var> is
    false, let <var title="">port</var> be 80, otherwise let <var title="">port</var> be
    443.</li>
 
-   <li><p>Let <var title="">resource name</var> be the value of the <a href=#url-path title=url-path><path></a> component (which might be empty) of <var title="">url</var>.</li> <!-- at this point this is UTF-8 encoded and %-escaped -->
+   <li><p>Let <var title="">resource name</var> be the value of the resulting <a href=#parsed-url>parsed URL</a>'s <a href=#concept-url-path title=concept-url-path>path</a> component (which might be empty).</li> <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>If <var title="">resource name</var> is the empty string, set it to a single character
    U+002F SOLIDUS (/).</li>
 
-   <li><p>If <var title="">url</var> has a <a href=#url-query title=url-query><query></a> component,
+   <li><p>If the resulting <a href=#parsed-url>parsed URL</a> has a non-null <a href=#concept-url-query title=concept-url-query>query</a> component,
    then append a single U+003F QUESTION MARK character (?) to <var title="">resource name</var>,
-   followed by the value of the <a href=#url-query title=url-query><query></a> component.</li>
-   <!-- at this point this is UTF-8 encoded and %-escaped -->
+   followed by the value of the <a href=#concept-url-query title=concept-url-query>query</a> component.</li>
+   <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
    name</var>, and <var title="">secure</var>.</li>
@@ -85045,7 +84474,7 @@
   <p class=note>Whether the attributes in the table above are
   conforming or not is defined by other specifications (e.g. the SVG
   and MathML specifications); this section only describes the syntax
-  rules if the attributes are serialised using the HTML syntax.</p>
+  rules if the attributes are serialized using the HTML syntax.</p>
 
 
   <h5 id=optional-tags><span class=secno>12.1.2.4 </span>Optional tags</h5>
@@ -89430,9 +88859,8 @@
     url">resolve</a> the value of that attribute to an
     <a href=#absolute-url>absolute URL</a>, relative to the newly created element,
     and if that is successful, run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
-    algorithm</a> with the resulting <a href=#absolute-url>absolute URL</a> with
-    any <a href=#url-fragment title=url-fragment><fragment></a> component
-    removed; otherwise, if there is no such attribute, or its value is
+    algorithm</a> with the result of applying the <a href=#url-serializer>URL serializer</a> algorithm to
+    the resulting <a href=#parsed-url>parsed URL</a> with the <i>exclude fragment flag</i> set; otherwise, if there is no such attribute, or its value is
     the empty string, or resolving its value fails, run the <a href=#concept-appcache-init title=concept-appcache-init>application cache selection
     algorithm</a> with no manifest. The algorithm must be passed
     the <code><a href=#document>Document</a></code> object.</p>
@@ -102411,12 +101839,6 @@
    <dt id=refsRFC3864>[RFC3864]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc3864>Registration Procedures for Message Header Fields</a></cite>, G. Klyne, M. Nottingham, J. Mogul. IETF.</dd>
 
-   <dt id=refsRFC3986>[RFC3986]</dt>
-   <dd><cite><a href=http://tools.ietf.org/html/rfc3986>Uniform Resource Identifier (URI): Generic Syntax</a></cite>, T. Berners-Lee, R. Fielding, L. Masinter. IETF.</dd>
-
-   <dt id=refsRFC3987>[RFC3987]</dt>
-   <dd><cite><a href=http://tools.ietf.org/html/rfc3987>Internationalized Resource Identifiers (IRIs)</a></cite>, M. Dürst, M. Suignard. IETF.</dd>
-
    <dt id=refsRFC4281>[RFC4281]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc4281>The Codecs Parameter for "Bucket" Media Types</a></cite>, R. Gellens, D. Singer, P. Frojdh. IETF.</dd>
 
@@ -102471,6 +101893,9 @@
    <dt id=refsUNIVCHARDET>[UNIVCHARDET]</dt>
    <dd>(Non-normative) <cite><a href=http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html>A composite approach to language/encoding detection</a></cite>, S. Li, K. Momoi. Netscape. In <cite>Proceedings of the 19th International Unicode Conference</cite>.</dd>
 
+   <dt id=refsURL>[URL]</dt>
+   <dd><cite><a href=http://url.spec.whatwg.org/>URL</a></cite>, A. van Kestern. WHATWG.</dd>
+
    <dt id=refsUTF7>[UTF7]</dt>
    <dd><cite><a href=http://tools.ietf.org/html/rfc2152>UTF-7: A Mail-Safe Transformation Format of Unicode</a></cite>, D. Goldsmith, M. Davis. IETF.</dd>
 

Modified: source
===================================================================
--- source	2013-02-08 07:06:47 UTC (rev 7709)
+++ source	2013-02-09 02:07:29 UTC (rev 7710)
@@ -710,7 +710,7 @@
 
   <pre>var a = <span title="Document">document</span>.<span title="dom-document-links">links</span>[0]; // obtain the first link in the document
 a.<span title="dom-a-href">href</span> = 'sample.html'; // change the destination URL of the link
-a.<span title="dom-uda-protocol">protocol</span> = 'https'; // change just the scheme part of the URL
+a.<span title="dom-url-protocol">protocol</span> = 'https'; // change just the scheme part of the URL
 a.setAttribute('href', 'http://example.com/'); // change the content attribute directly</pre>
 
   <p>Since DOM trees are used as the way to represent HTML documents when they are processed and
@@ -1615,9 +1615,9 @@
   compression format used was not supported, even if the implementation could determine the
   dimensions of the movie from the file's metadata.</p>
 
-  <p>What some specifications, in particular the HTTP and URI specifications, refer to as a
+  <p>What some specifications, in particular the HTTP specification, refer to as a
   <i>representation</i> is referred to in this specification as a <dfn title="">resource</dfn>. <a
-  href="#refsHTTP">[HTTP]</a> <a href="#refsRFC3986">[RFC3986]</a></p>
+  href="#refsHTTP">[HTTP]</a></p>
 
   <p>The term <dfn>MIME type</dfn> is used to refer to what is sometimes called an <i>Internet media
   type</i> in protocol literature. The term <i>media type</i> in this specification is used to refer
@@ -2210,16 +2210,42 @@
    </dd>
 
 
-   <dt>URIs, IRIs, IDNA</dt>
+   <dt>URLs</dt>
 
    <dd>
 
-    <p>Implementations must support the semantics of <span title="URL">URLs</span> defined in the
-    URI and IRI specifications, as well as the semantics of IDNA domain names defined in the
-    <cite>Internationalizing Domain Names in Applications (IDNA)</cite> specification. <a
-    href="#refsRFC3986">[RFC3986]</a> <a href="#refsRFC3987">[RFC3987]</a> <a
-    href="#refsRFC3490">[RFC3490]</a>
+    <p>The following terms are defined in the URL standard: <a href="#refsURL">[URL]</a></p>
 
+    <ul class="brief">
+     <li><dfn>URL</dfn>
+     <li><dfn>Absolute URL</dfn>
+     <li><dfn>Relative URL</dfn>
+     <li><dfn title="concept-url-scheme-relative">Relative schemes</dfn>
+     <li>The <dfn>URL parser</dfn>
+     <li><dfn>Parsed URL</dfn>
+     <li>The <dfn title="concept-url-scheme">scheme</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-scheme data">scheme data</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-username">username</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-password">password</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-host">host</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-port">port</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-path">path</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-query">query</dfn> component of a <span>parsed URL</span>
+     <li>The <dfn title="concept-url-fragment">fragment</dfn> component of a <span>parsed URL</span>
+     <li><dfn title="concept-url-parse-error">Parse errors</dfn> from the <span>URL parser</span>
+     <li>The <dfn>URL serializer</dfn>
+     <li><dfn>Default encode set</dfn>
+     <li><dfn>Percent encode</dfn>
+     <li><dfn>UTF-8 percent encode</dfn>
+     <li><dfn><code>URLUtils</code></dfn> interface
+     <li><dfn><code>URLUtilsReadOnly</code></dfn> interface
+     <li><dfn title="dom-url-protocol"><code>protocol</code> attribute</dfn>
+     <li><dfn title="concept-uu-base">Base</dfn> for <code>URLUtils</code>
+     <li><dfn title="concept-uu-input">Input</dfn> for <code>URLUtils</code>
+     <li><dfn title="concept-uu-query-encoding">Query encoding</dfn> for <code>URLUtils</code>
+     <li><dfn title="concept-uu-update">Update steps</dfn> for <code>URLUtils</code>
+    </ul>
+
    </dd>
 
 
@@ -5824,252 +5850,54 @@
 
   <h3>URLs</h3>
 
-  <p>This specification defines the term <span>URL</span>, and defines
-  various algorithms for dealing with URLs, because for historical
-  reasons the rules defined by the URI and IRI specifications are not
-  a complete description of what HTML user agents need to implement to
-  be compatible with Web content.</p>
-
-  <p class="note">The term "URL" in this specification is used in a
-  manner distinct from the precise technical meaning it is given in
-  RFC 3986. Readers familiar with that RFC will find it easier to read
-  <em>this</em> specification if they pretend the term "URL" as used
-  herein is really called something else altogether. This is a
-  <span>willful violation</span> of RFC 3986. <a
-  href="#refsRFC3986">[RFC3986]</a></p>
-
-
   <h4>Terminology</h4>
 
-  <p>A <dfn>URL</dfn> is a string used to identify a resource.</p>
+  <p>A <span>URL</span> is a <dfn>valid URL</dfn> if it conforms to the authoring conformance
+  requirements in the URL standard. <a href="#refsURL">[URL]</a></p>
 
-  <p>A <span>URL</span> is a <dfn>valid URL</dfn> if at least one of
-  the following conditions holds:</p>
+  <p>A string is a <dfn>valid non-empty URL</dfn> if it is a <span>valid URL</span> but it is not
+  the empty string.</p>
 
-  <ul>
+  <p>A string is a <dfn>valid URL potentially surrounded by spaces</dfn> if, after <span
+  title="strip leading and trailing whitespace">stripping leading and trailing whitespace</span>
+  from it, it is a <span>valid URL</span>.</p>
 
-   <li><p>The <span>URL</span> is a valid URI reference <a
-   href="#refsRFC3986">[RFC3986]</a>.</p></li>
+  <p>A string is a <dfn>valid non-empty URL potentially surrounded by spaces</dfn> if, after <span
+  title="strip leading and trailing whitespace">stripping leading and trailing whitespace</span>
+  from it, it is a <span>valid non-empty URL</span>.</p>
 
-   <li><p>The <span>URL</span> is a valid IRI reference and it has no
-   query component. <a href="#refsRFC3987">[RFC3987]</a></p></li>
+  <p>This specification defines the URL <dfn><code>about:legacy-compat</code></dfn> as a reserved,
+  though unresolvable, <code title="">about:</code> URL, for use in <span
+  title="syntax-doctype">DOCTYPE</span>s in <span>HTML documents</span> when needed for
+  compatibility with XML tools. <a href="#refsABOUT">[ABOUT]</a></p>
 
-   <li><p>The <span>URL</span> is a valid IRI reference and its query
-   component contains no unescaped non-ASCII characters. <a
-   href="#refsRFC3987">[RFC3987]</a></p></li>
+  <p>This specification defines the URL <dfn><code>about:srcdoc</code></dfn> as a reserved, though
+  unresolvable, <code title="">about:</code> URL, that is used as <span>the document's
+  address</span> of <span title="an iframe srcdoc document"><code>iframe</code> <code
+  title="attr-iframe-srcdoc">srcdoc</code> documents</span>. <a href="#refsABOUT">[ABOUT]</a></p>
 
-   <li><p>The <span>URL</span> is a valid IRI reference and the <span
-   title="document's character encoding">character encoding</span> of
-   the URL's <code>Document</code> is UTF-8 or <span>a UTF-16
-   encoding</span>. <a href="#refsRFC3987">[RFC3987]</a></p></li>
+  <p>The <dfn>fallback base URL</dfn> of a <code>Document</code> object is the <span>absolute
+  URL</span> obtained by running these substeps:</p>
 
-  </ul>
-
-  <p>A string is a <dfn>valid non-empty URL</dfn> if it is a
-  <span>valid URL</span> but it is not the empty string.</p>
-
-  <p>A string is a <dfn>valid URL potentially surrounded by
-  spaces</dfn> if, after <span title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</span> from
-  it, it is a <span>valid URL</span>.</p>
-
-  <p>A string is a <dfn>valid non-empty URL potentially surrounded by
-  spaces</dfn> if, after <span title="strip leading and trailing
-  whitespace">stripping leading and trailing whitespace</span> from
-  it, it is a <span>valid non-empty URL</span>.</p>
-
-  <p>This specification defines the URL
-  <dfn><code>about:legacy-compat</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, for use in <span
-  title="syntax-doctype">DOCTYPE</span>s in <span>HTML
-  documents</span> when needed for compatibility with XML tools. <a
-  href="#refsABOUT">[ABOUT]</a></p>
-
-  <p>This specification defines the URL
-  <dfn><code>about:srcdoc</code></dfn> as a reserved, though
-  unresolvable, <code title="">about:</code> URI, that is used as
-  <span>the document's address</span> of <span title="an iframe srcdoc
-  document"><code>iframe</code> <code
-  title="attr-iframe-srcdoc">srcdoc</code> documents</span>. <a
-  href="#refsABOUT">[ABOUT]</a></p>
-
-
-  <div class="impl">
-
-  <h4>Parsing URLs</h4>
-
-  <p>To <dfn>parse a URL</dfn> <var title="">url</var> into its
-  component parts, the user agent must use the following steps:</p>
-
   <ol>
 
-   <li><p><span>Strip leading and trailing whitespace</span> from <var
-   title="">url</var>.</p></li>
+   <li><p>If the <code>Document</code> is <span>an <code>iframe</code> <code
+   title="attr-iframe-srcdoc">srcdoc</code> document</span>, then return the <span>document base
+   URL</span> of the <code>Document</code>'s <span>browsing context</span>'s <span>browsing context
+   container</span>'s <code>Document</code> and abort these steps.</p></li>
 
    <li>
 
-    <p>Parse <var title="">url</var> in the manner defined by RFC
-    3986, with the following exceptions:</p>
-
-    <ul>
-
-     <li>Add all characters with code points less than or equal to
-     U+0020 or greater than or equal to U+007F to the
-     <unreserved> production.</li>
-
-     <li>Add the characters U+0022, U+003C, U+003E, U+005B .. U+005E,
-     U+0060, and U+007B .. U+007D to the <unreserved>
-     production.
-      <!--
-       0022 QUOTATION MARK
-       003C LESS-THAN SIGN
-       003E GREATER-THAN SIGN
-       005B LEFT SQUARE BRACKET
-       005C REVERSE SOLIDUS
-       005D RIGHT SQUARE BRACKET
-       005E CIRCUMFLEX ACCENT
-       0060 GRAVE ACCENT
-       007B LEFT CURLY BRACKET
-       007C VERTICAL LINE
-       007D RIGHT CURLY BRACKET
-      -->
-     </li>
-
-     <li>Add a single U+0025 PERCENT SIGN character as a second
-     alternative way of matching the <pct-encoded> production,
-     except when the <pct-encoded> is used in the
-     <reg-name> production.</li>
-
-     <li>Add the U+0023 NUMBER SIGN character to the characters
-     allowed in the <fragment> production.</li>
-
-     <!-- some browsers also have other differences, e.g. Mozilla
-     seems to treat ";" as if it was not in sub-delims, if the scheem
-     is "ftp". -->
-
-    </ul>
-
-   </li>
-
-   <li>
-
-    <p>If <var title="">url</var> doesn't match the
-    <URI-reference> production, even after the above changes are
-    made to the ABNF definitions, then parsing the URL fails with an
-    error. <a href="#refsRFC3986">[RFC3986]</a></p>
-
-    <p>Otherwise, parsing <var title="">url</var> was successful; the
-    components of the URL are substrings of <var title="">url</var>
-    defined as follows:</p>
-
-    <dl>
-
-     <dt><dfn title="url-scheme"><scheme></dfn></dt>
-
-     <dd><p>The substring matched by the <scheme> production, if any.</p></dd>
-
-
-     <dt><dfn title="url-host"><host></dfn></dt>
-
-     <dd><p>The substring matched by the <host> production, if any.</p></dd>
-
-
-     <dt><dfn title="url-port"><port></dfn></dt>
-
-     <dd><p>The substring matched by the <port> production, if any.</p></dd>
-
-
-     <dt><dfn title="url-hostport"><hostport></dfn></dt>
-
-     <dd><p>If there is a <scheme> component and a <port>
-     component and the port given by the <port> component is
-     different than the default port defined for the protocol given by
-     the <scheme> component, then <hostport> is the
-     substring that starts with the substring matched by the
-     <host> production and ends with the substring matched by the
-     <port> production, and includes the colon in between the
-     two. Otherwise, it is the same as the <host> component.</p>
-
-
-     <dt><dfn title="url-path"><path></dfn></dt>
-
-     <dd>
-
-      <p>The substring matched by one of the following productions, if
-      one of them was matched:</p>
-
-      <ul class="brief">
-       <li><path-abempty></li>
-       <li><path-absolute></li>
-       <li><path-noscheme></li>
-       <li><path-rootless></li>
-       <li><path-empty></li>
-      </ul>
-
-     </dd>
-
-
-     <dt><dfn title="url-query"><query></dfn></dt>
-
-     <dd><p>The substring matched by the <query> production, if any.</p></dd>
-
-
-     <dt><dfn title="url-fragment"><fragment></dfn></dt>
-
-     <dd><p>The substring matched by the <fragment> production, if any.</p></dd>
-
-
-     <dt><dfn title="url-host-specific"><host-specific></dfn></dt>
-
-     <dd><p>The substring that <em>follows</em> the substring matched
-     by the <authority> production, or the whole string if the
-     <authority> production wasn't matched.</p></dd>
-
-    </dl>
-
-   </li>
-
-  </ol>
-
-  <p class="note">These parsing rules are a <span>willful
-  violation</span> of RFC 3986 and RFC 3987 (which do not define error
-  handling), motivated by a desire to handle legacy content. <a
-  href="#refsRFC3986">[RFC3986]</a> <a
-  href="#refsRFC3987">[RFC3987]</a></p>
-
-  </div>
-
-
-  <h4>Base URLs</h4>
-
-  <p>The <dfn>fallback base URL</dfn> of a <code>Document</code>
-  object is the <span>absolute URL</span> obtained by running these
-  substeps:</p>
-
-  <ol>
-
-   <li><p>If the <code>Document</code> is <span>an <code>iframe</code>
-   <code title="attr-iframe-srcdoc">srcdoc</code> document</span>,
-   then return the <span>document base URL</span> of the
-   <code>Document</code>'s <span>browsing context</span>'s
-   <span>browsing context container</span>'s <code>Document</code> and
-   abort these steps.</p></li>
-
-   <li>
-
     <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
 
-    <!-- this should be tested in the case of a browsing context that
-    was navigated to about:blank after having been elsewhere, as
-    opposed to the about:blank used at the time of the browsing
+    <!-- this should be tested in the case of a browsing context that was navigated to about:blank
+    after having been elsewhere, as opposed to the about:blank used at the time of the browsing
     context's creation. -->
 
-    <p>If <span>the document's address</span> is
-    <code>about:blank</code>, and the <code>Document</code>'s
-    <span>browsing context</span> has a <span>creator browsing
-    context</span>, then return the <span>document base URL</span> of
-    the <span>creator <code>Document</code></span>, and abort these
-    steps.</p>
+    <p>If <span>the document's address</span> is <code>about:blank</code>, and the
+    <code>Document</code>'s <span>browsing context</span> has a <span>creator browsing
+    context</span>, then return the <span>document base URL</span> of the <span>creator
+    <code>Document</code></span>, and abort these steps.</p>
 
    </li>
 
@@ -6079,52 +5907,45 @@
 
   </ol>
 
-  <p>The <dfn>document base URL</dfn> of a <code>Document</code>
-  object is the <span>absolute URL</span> obtained by running these
-  substeps:</p>
+  <p>The <dfn>document base URL</dfn> of a <code>Document</code> object is the <span>absolute
+  URL</span> obtained by running these substeps:</p>
 
   <ol>
 
-   <li><p>Let <var title="">fallback base url</var> be the
-   <code>Document</code>'s <span>fallback base URL</span>.</p></li>
+   <li><p>Let <var title="">fallback base url</var> be the <code>Document</code>'s <span>fallback
+   base URL</span>.</p></li>
 
    <li><p>If there is no <code>base</code> element that has an <code
-   title="attr-base-href">href</code> attribute, then the
-   <span>document base URL</span> is <var title="">fallback base
-   url</var>; abort these steps. Otherwise, let <var
-   title="">url</var> be the value of the <code
-   title="attr-base-href">href</code> attribute of the first such
+   title="attr-base-href">href</code> attribute, then the <span>document base URL</span> is <var
+   title="">fallback base url</var>; abort these steps. Otherwise, let <var title="">url</var> be
+   the value of the <code title="attr-base-href">href</code> attribute of the first such
    element.</p></li>
 
-   <li><p><span title="resolve a URL">Resolve</span> <var
-   title="">url</var> relative to <var title="">fallback base
-   url</var> (thus, the <code>base</code> <code
-   title="attr-base-href">href</code> attribute isn't affected by
-   <code title="attr-xml-base">xml:base</code> attributes).</p></li>
+   <li><p><span title="resolve a URL">Resolve</span> <var title="">url</var> relative to <var
+   title="">fallback base url</var> (thus, the <code>base</code> <code
+   title="attr-base-href">href</code> attribute isn't affected by <code
+   title="attr-xml-base">xml:base</code> attributes).</p></li>
 
-   <li><p>The <span>document base URL</span> is the result of the
-   previous step if it was successful; otherwise it is <var
-   title="">fallback base url</var>.</p></li>
+   <li><p>The <span>document base URL</span> is the result of the previous step if it was
+   successful; otherwise it is <var title="">fallback base url</var>.</p></li>
 
   </ol>
 
 
+  <div class="impl">
+
   <h4>Resolving URLs</h4>
 
-  <p>Resolving a URL is the process of taking a relative URL and
-  obtaining the absolute URL that it implies.</p>
+  <p>Resolving a URL is the process of taking a <span>relative URL</span> and obtaining the
+  <span>absolute URL</span> that it implies.</p>
 
-  <div class="impl">
+  <p>To <dfn>resolve a URL</dfn> to an <span>absolute URL</span> relative to either another
+  <span>absolute URL</span> or an element, the user agent must use the following steps. Resolving a
+  URL can result in an error, in which case the URL is not resolvable.</p>
 
-  <p>To <dfn>resolve a URL</dfn> to an <span>absolute URL</span>
-  relative to either another <span>absolute URL</span> or an element,
-  the user agent must use the following steps. Resolving a URL can
-  result in an error, in which case the URL is not resolvable.</p>
-
   <ol>
 
-   <li><p>Let <var title="">url</var> be the <span>URL</span> being
-   resolved.</p></li>
+   <li><p>Let <var title="">url</var> be the <span>URL</span> being resolved.</p></li>
 
    <li>
 
@@ -6132,276 +5953,64 @@
 
     <dl class="switch">
 
-     <dt>If the URL had a character encoding defined when the URL was
-     created or defined</dt>
+     <dt>If the URL had a character encoding defined when the URL was created or defined</dt>
 
      <dd>The URL character encoding is as defined.</dd>
 
-     <dt>If the URL came from a script (e.g. as an argument to a
-     method)</dt>
+     <dt>If the URL came from a script (e.g. as an argument to a method)</dt>
 
-     <dd>The URL character encoding is the <span>script's URL character
-     encoding</span>.</dd>
+     <dd>The URL character encoding is the <span>script's URL character encoding</span>.</dd>
 
      <dt>If the URL came from a DOM node (e.g. from an element)</dt>
 
-     <dd>The node has a <code>Document</code>, and the URL character
-     encoding is the <span>document's character encoding</span>.</dd>
+     <dd>The node has a <code>Document</code>, and the URL character encoding is the
+     <span>document's character encoding</span>.</dd>
 
     </dl>
 
    </li>
 
-   <li><p>If <var title="">encoding</var> is <span>a UTF-16
-   encoding</span>, then change the value of <var
-   title="">encoding</var> to UTF-8.</p></li>
+   <li><p>If <var title="">encoding</var> is <span>a UTF-16 encoding</span>, then change the value
+   of <var title="">encoding</var> to UTF-8.</p></li>
 
    <li>
 
-    <p>If the algorithm was invoked with an <span>absolute URL</span>
-    to use as the base URL, let <var title="">base</var> be that
-    <span>absolute URL</span>.</p>
+    <p>If the algorithm was invoked with an <span>absolute URL</span> to use as the base URL, let
+    <var title="">base</var> be that <span>absolute URL</span>.</p>
 
-    <p>Otherwise, let <var title="">base</var> be the <i>base URI of
-    the element</i>, as defined by the XML Base specification, with
-    <i>the base URI of the document entity</i> being defined as the
-    <span>document base URL</span> of the <code>Document</code> that
-    owns the element. <a href="#refsXMLBASE">[XMLBASE]</a></p>
+    <p>Otherwise, let <var title="">base</var> be <span>the element's base URL</span>.</p>
 
-    <p>For the purposes of the XML Base specification, user agents
-    must act as if all <code>Document</code> objects represented XML
-    documents.</p>
-
-    <p class="note">It is possible for <code
-    title="attr-xml-base">xml:base</code> attributes to be present
-    even in HTML fragments, as such attributes can be added
-    dynamically using script. (Such scripts would not be conforming,
-    however, as <code title="attr-xml-base">xml:base</code> attributes
-    are not allowed in <span>HTML documents</span>.)</p>
-
    </li>
 
-   <li><p><span title="parse a URL">Parse</span> <var
-   title="">url</var> into its component parts.</p></li>
+   <li><p>Apply the <span>URL parser</span> to <var title="">url</var>, with <var
+   title="">base</var> as the base URL, with <var title="">encoding</var> as the encoding.</p></li>
 
-   <li>
+   <li><p>If this results in a <span title="concept-url-parse-error">parse error</span>, then abort
+   these steps with an error.</p></li>
 
-    <p>If parsing <var title="">url</var> resulted in a <span
-    title="url-host"><host></span> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from expanding any sequences of percent-encoded octets in
-    that component that are valid UTF-8 sequences into Unicode
-    characters as defined by UTF-8.</p>
+   <li><p>Let <var title="">parsed URL</var> be the result of the <span>URL parser</span>.</p></li>
 
-    <p>If any percent-encoded octets in that component are not valid
-    UTF-8 sequences (e.g. sequences of percent-encoded octets that
-    expand to surrogate code points), then return an error and abort
-    these steps.</p>
+   <li><p>Let <var title="">serialized URL</var> be the result of apply the <span>URL
+   serializer</span> to <var title="">parsed URL</var>.</p></li>
 
-    <p>Apply the IDNA ToASCII algorithm to the matching substring,
-    with both the AllowUnassigned and UseSTD3ASCIIRules flags
-    set. Replace the matching substring with the result of the ToASCII
-    algorithm.</p>
+   <li><p>Return <var title="">serialized URL</var> as the <dfn>resulting absolute URL</dfn> and
+   <var title="">parsed URL</var> as the <dfn>resulting parsed URL</dfn>.</p></li>
 
-    <p>If ToASCII fails to convert one of the components of the
-    string, e.g. because it is too long or because it contains invalid
-    characters, then return an error and abort these steps. <a
-    href="#refsRFC3490">[RFC3490]</a></p>
-
-   </li>
-
-   <li>
-
-    <p>If parsing <var title="">url</var> resulted in a <span
-    title="url-path"><path></span> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <path> production defined in RFC 3986:</p>
-
-    <ol>
-
-     <li>Encode the character into a sequence of octets as defined by the <span>utf-8 encoder</span>
-     algorithm. <a href="#refsENCODING">[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href="#refsRFC3986">[RFC3986]</a></li>
-
-    </ol>
-
-    <div class="example">
-
-     <p>For instance if <var title="">url</var> was "<code
-     title="">//example.com/a^b&#x263a;c%FFd%z/?e</code>", then the
-     <span title="url-path"><path></span> component's substring
-     would be "<code title="">/a^b&#x263a;c%FFd%z/</code>" and the two
-     characters that would have to be escaped would be "<code
-     title="">^</code>" and "<code title="">&#x263a;</code>". The
-     result after this step was applied would therefore be that <var
-     title="">url</var> now had the value "<code
-     title="">//example.com/a%5Eb%E2%98%BAc%FFd%z/?e</code>".</p>
-
-    </div>
-
-   </li>
-
-   <li>
-
-    <p>If parsing <var title="">url</var> resulted in a <span
-    title="url-query"><query></span> component, then replace the
-    matching substring of <var title="">url</var> with the string that
-    results from applying the following steps to each character other
-    than U+0025 PERCENT SIGN (%) that doesn't match the original
-    <query> production defined in RFC 3986:</p>
-
-    <ol>
-
-     <li>If the character in question cannot be expressed in the
-     encoding <var title="">encoding</var>, then replace it with a
-     single 0x3F octet (an ASCII question mark) and skip the remaining
-     substeps for this character.</li>
-
-     <li>Encode the character into a sequence of octets as defined by the <span>encoder</span>
-     algorithm for <var title="">encoding</var>. <a href="#refsENCODING">[ENCODING]</a></li>
-
-     <li>Replace the character with the percent-encoded form of those
-     octets. <a href="#refsRFC3986">[RFC3986]</a></li>
-
-    </ol>
-
-   </li>
-
-   <li><p>Apply the algorithm described in RFC 3986 section 5.2
-   Relative Resolution, using <var title="">url</var> as the
-   potentially relative URI reference (<var title="">R</var>), and
-   <var title="">base</var> as the base URI (<var
-   title="">Base</var>). <a href="#refsRFC3986">[RFC3986]</a></p></li>
-
-   <li>
-
-    <p>Apply any relevant conformance criteria of RFC 3986 and RFC
-    3987, returning an error and aborting these steps if
-    appropriate. <a href="#refsRFC3986">[RFC3986]</a> <a
-    href="#refsRFC3987">[RFC3987]</a></p>
-
-    <p class="example">For instance, if an absolute URI that would be
-    returned by the above algorithm violates the restrictions specific
-    to its scheme, e.g. a <code title="">data:</code> URI using the
-    "<code title="">//</code>" server-based naming authority syntax,
-    then user agents are to treat this as an error instead.<!-- RFC
-    3986, 3.1 Scheme --></p>
-
-   </li>
-
-   <li><p>Let <var title="">result</var> be the target URI (<var
-   title="">T</var>) returned by the Relative Resolution
-   algorithm.</p></li>
-
-   <li><p>If <var title="">result</var> uses a scheme with a
-   server-based naming authority, replace all U+005C REVERSE SOLIDUS
-   (\) characters in <var title="">result</var> with U+002F SOLIDUS
-   (/) characters.</p></li>
-
-   <li><p>Return <var title="">result</var>.</p></li>
-
   </ol>
 
-  <p class="note">Some of the steps in these rules, for example the
-  processing of U+005C REVERSE SOLIDUS (\) characters, are a
-  <span>willful violation</span> of RFC 3986 and RFC 3987, motivated
-  by a desire to handle legacy content. <a
-  href="#refsRFC3986">[RFC3986]</a> <a
-  href="#refsRFC3987">[RFC3987]</a></p>
+  <p>Given an element, <dfn>the element's base URL</dfn> is the <i>base URI of the element</i>, as
+  defined by the XML Base specification, with <i>the base URI of the document entity</i> being
+  defined as the <span>document base URL</span> of the <code>Document</code> that owns the element.
+  <a href="#refsXMLBASE">[XMLBASE]</a></p>
 
-  </div>
+  <p>For the purposes of the XML Base specification, user agents must act as if all
+  <code>Document</code> objects represented XML documents.</p>
 
-  <p>A <span>URL</span> is an <dfn>absolute URL</dfn> if <span
-  title="resolve a url">resolving</span> it results in the same output
-  regardless of what it is resolved relative to, and that output is
-  not a failure.</p>
+  <p class="note">It is possible for <code title="attr-xml-base">xml:base</code> attributes to be
+  present even in HTML fragments, as such attributes can be added dynamically using script. (Such
+  scripts would not be conforming, however, as <code title="attr-xml-base">xml:base</code>
+  attributes are not allowed in <span>HTML documents</span>.)</p>
 
-  <p>An <span>absolute URL</span> is a <dfn>hierarchical URL</dfn> if,
-  when <span title="resolve a url">resolved</span> and then <span
-  title="parse a url">parsed</span>, there is a character immediately
-  after the <span title="url-scheme"><scheme></span> component
-  and it is a U+002F SOLIDUS character (/).</p>
-
-  <p>An <span>absolute URL</span> is an <dfn>authority-based URL</dfn>
-  if, when <span title="resolve a url">resolved</span> and then <span
-  title="parse a url">parsed</span>, there are two characters
-  immediately after the <span title="url-scheme"><scheme></span>
-  component and they are both U+002F SOLIDUS characters (//).</p>
-
-
-
-  <div class="impl">
-
-  <h4>URL manipulation and creation</h4>
-
-  <p>To <dfn title="fragment-escaped">fragment-escape</dfn> a string
-  <var title="">input</var>, a user agent must run the following
-  steps:</p>
-
-  <ol>
-
-   <li><p>Let <var title="">input</var> be the string to be
-   escaped.</p></li>
-
-   <li><p>Let <var title="">position</var> point at the first
-   character of <var title="">input</var>.</p></li>
-
-   <li><p>Let <var title="">output</var> be an empty string.</p></li>
-
-   <li><p><i>Loop</i>: If <var title="">position</var> is past the end
-   of <var title="">input</var>, then jump to the step labeled
-   <i>end</i>.</p></li>
-
-   <li>
-
-    <p>If the character in <var title="">input</var> pointed to by
-    <var title="">position</var> is in the range U+0000 to U+0020 or
-    is one of the following characters:</p>
-
-    <ul class="brief">
-     <li>U+0022 QUOTATION MARK character (")
-     <li>U+0023 NUMBER SIGN character (#)
-     <li>U+0025 PERCENT SIGN character (%)
-     <li>U+003C LESS-THAN SIGN character (<)
-     <li>U+003E GREATER-THAN SIGN character (>)
-     <li>U+005B LEFT SQUARE BRACKET character ([)
-     <li>U+005C REVERSE SOLIDUS character (\)
-     <li>U+005D RIGHT SQUARE BRACKET character (])
-     <li>U+005E CIRCUMFLEX ACCENT character (^)
-     <li>U+007B LEFT CURLY BRACKET character ({)
-     <li>U+007C VERTICAL LINE character (|)
-     <li>U+007D RIGHT CURLY BRACKET character (})
-    </ul>
-
-    <p>...then append the percent-encoded form of the character to
-    <var title="">output</var>. <a
-    href="#refsRFC3986">[RFC3986]</a></p> <!-- this is the same
-    phrasing that's used elsewhere in the spec, but we really should
-    define 'percent-encoded' or at least ensure we consistently say
-    whether it's upper-case or lower-case. -->
-
-    <p>Otherwise, append the character itself to <var
-    title="">output</var>.</p>
-
-    <p class="note">This escapes any ASCII characters that are not
-    valid in the URI <fragment> production without being
-    escaped.</p>
-
-   </li>
-
-   <li><p>Advance <var title="">position</var> to the next character
-   in <var title="">input</var>.</p></li>
-
-   <li><p>Return to the step labeled <i>loop</i>.</p></li>
-
-   <li><p><i>End</i>: Return <var title="">output</var>.</p></li>
-
-  </ol>
-
   </div>
 
 
@@ -6471,290 +6080,9 @@
   </div>
 
 
-<!--TOPIC:DOM APIs-->
-  <h4>Interfaces for URL manipulation</h4>
-
-  <p>An interface that has a complement of <dfn>URL decomposition IDL
-  attributes</dfn> has seven attributes with the following
-  definitions:</p>
-
-<pre class="idl extract">           attribute DOMString <span title="dom-uda-protocol">protocol</span>;
-           attribute DOMString <span title="dom-uda-host">host</span>;
-           attribute DOMString <span title="dom-uda-hostname">hostname</span>;
-           attribute DOMString <span title="dom-uda-port">port</span>;
-           attribute DOMString <span title="dom-uda-pathname">pathname</span>;
-           attribute DOMString <span title="dom-uda-search">search</span>;
-           attribute DOMString <span title="dom-uda-hash">hash</span>;</pre>
-
-  <dl class="domintro">
-
-   <dt><var title="">o</var> . <code title="dom-uda-protocol">protocol</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current scheme of the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's scheme.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-host">host</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host and port (if it's not the default port) in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host and port.</p>
-    <p>The host and the port are separated by a colon. The port part,
-    if omitted, will be assumed to be the current scheme's default
-    port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-hostname">hostname</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current host in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's host.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-port">port</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current port in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's port.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-pathname">pathname</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current path in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's path.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-search">search</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current query component in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's query component.</p>
-   </dd>
-
-   <dt><var title="">o</var> . <code title="dom-uda-hash">hash</code> [ = <var title="">value</var> ]</dt>
-   <dd>
-    <p>Returns the current fragment identifier in the underlying URL.</p>
-    <p>Can be set, to change the underlying URL's fragment identifier.</p>
-   </dd>
-
-  </dl>
-
+<!--CLEANUP-->
   <div class="impl">
 
-  <hr>
-
-  <p>The attributes defined to be <span>URL decomposition IDL
-  attributes</span> must act as described for the attributes with the
-  same corresponding names in this section.</p>
-
-  <p>In addition, an interface with a complement of <span>URL
-  decomposition IDL attributes</span> defines an <dfn
-  title="concept-uda-input">input</dfn>, which is a <span>URL</span>
-  that the attributes act on, and a <dfn
-  title="concept-uda-setter">common setter action</dfn>, which is a
-  set of steps invoked when any of the attributes' setters are
-  invoked.</p>
-
-  <p>The seven <span>URL decomposition IDL attributes</span> have
-  similar requirements.</p>
-
-  <p>On getting, if the <span title="concept-uda-input">input</span>
-  is an <span>absolute URL</span> that fulfills the condition given in
-  the "getter condition" column corresponding to the attribute in the
-  table below, the user agent must return the part of the <span
-  title="concept-uda-input">input</span> URL given in the "component"
-  column, with any prefixes specified in the "prefix" column
-  appropriately added to the start of the string and any suffixes
-  specified in the "suffix" column appropriately added to the end of
-  the string. Otherwise, the attribute must return the empty
-  string.</p>
-
-  <p>On setting, the new value must first be mutated as described by
-  the "setter preprocessor" column, then mutated by %-escaping any
-  characters in the new value that are not valid in the relevant
-  component as given by the "component" column. Then, if the <span
-  title="concept-uda-input">input</span> is an <span>absolute
-  URL</span> and the resulting new value fulfills the condition given
-  in the "setter condition" column, the user agent must make a new
-  string <var title="">output</var> by replacing the component of the
-  URL given by the "component" column in the <span
-  title="concept-uda-input">input</span> URL with the new value;
-  otherwise, the user agent must let <var title="">output</var> be
-  equal to the <span title="concept-uda-input">input</span>. Finally,
-  the user agent must invoke the <span
-  title="concept-uda-setter">common setter action</span> with the
-  value of <var title="">output</var>.</p>
-
-  <p>When replacing a component in the URL, if the component is part
-  of an optional group in the URL syntax consisting of a character
-  followed by the component, the component (including its prefix
-  character) must be included even if the new value is the empty
-  string.</p>
-
-  <p class="note">The previous paragraph applies in particular to the
-  "<code title="">:</code>" before a <port> component, the "<code
-  title="">?</code>" before a <query> component, and the "<code
-  title="">#</code>" before a <fragment> component.</p>
-
-  <p>For the purposes of the above definitions, URLs must be parsed
-  using the <span title="parse a URL">URL parsing rules</span> defined
-  in this specification.</p>
-
-  <table id="table-uda">
-   <thead>
-    <tr>
-     <th>Attribute
-     <th>Component
-     <th>Getter Condition
-     <th>Prefix
-     <th>Suffix
-     <th>Setter Preprocessor
-     <th>Setter Condition
-   <tbody>
-    <tr>
-     <td><dfn title="dom-uda-protocol"><code>protocol</code></dfn>
-     <td><span title="url-scheme"><scheme></span>
-     <td>—
-     <td>—
-     <td>U+003A COLON (:)
-     <td>Remove all trailing U+003A COLON characters (:)
-     <td>The new value is not the empty string
-    <tr>
-     <td><dfn title="dom-uda-host"><code>host</code></dfn>
-     <td><span title="url-hostport"><hostport></span>
-     <td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
-     <td>—
-     <td>—
-     <td>—
-     <td>The new value is not the empty string and <span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
-    <tr>
-     <td><dfn title="dom-uda-hostname"><code>hostname</code></dfn>
-     <td><span title="url-host"><host></span>
-     <td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
-     <td>—
-     <td>—
-     <td>Remove all leading U+002F SOLIDUS characters (/)
-     <td>The new value is not the empty string and <span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
-    <tr>
-     <td><dfn title="dom-uda-port"><code>port</code></dfn>
-     <td><span title="url-port"><port></span>
-     <td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>, and contained a <span title="url-port"><port></span> component (possibly an empty one)
-     <td>—
-     <td>—
-     <td>Remove all characters in the new value from the first that is not an <span title="ASCII digits">ASCII digit</span>, if any.
-         Remove any leading U+0030 DIGIT ZERO characters (0) in the new value.
-         If the resulting string is empty, set it to a single U+0030 DIGIT ZERO character (0).
-     <td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>,
-         and the new value, when interpreted as a base-ten integer, is less than or equal to 65535
-    <tr>
-     <td><dfn title="dom-uda-pathname"><code>pathname</code></dfn>
-     <td><span title="url-path"><path></span>
-     <td><span title="concept-uda-input">input</span> is a <span>hierarchical URL</span>
-     <td>—
-     <td>—
-     <td>If it has no leading U+002F SOLIDUS character (/), prepend a U+002F SOLIDUS character (/) to the new value
-     <td><span title="concept-uda-input">input</span> is hierarchical
-    <tr>
-     <td><dfn title="dom-uda-search"><code>search</code></dfn>
-     <td><span title="url-query"><query></span>
-     <td><span title="concept-uda-input">input</span> is a <span>hierarchical URL</span>, and contained a <span title="url-query"><query></span> component (possibly an empty one)
-     <td>U+003F QUESTION MARK (?)
-     <td>—
-     <td>Remove one leading U+003F QUESTION MARK character (?), if any
-     <td><span title="concept-uda-input">input</span> is a <span>hierarchical URL</span>
-    <tr>
-     <td><dfn title="dom-uda-hash"><code>hash</code></dfn>
-     <td><span title="url-fragment"><fragment></span>
-     <td><span title="concept-uda-input">input</span> contained a non-empty <span title="url-fragment"><fragment></span> component
-     <td>U+0023 NUMBER SIGN (#)
-     <td>—
-     <td>Remove one leading U+0023 NUMBER SIGN character (#), if any
-     <td>—
-  </table>
-
-<!--
-  http://www.hixie.ch/tests/adhoc/dom/level0/location/components/
-  http://lxr.mozilla.org/seamonkey/source/dom/src/base/nsLocation.cpp
-  http://wp.netscape.com/eng/mozilla/3.0/handbook/javascript/ref_h-l.htm#84722
--->
-
-  </div>
-
-  <div class="example">
-
-   <p>The table below demonstrates how the getter <span
-   class="impl">condition</span> for <code
-   title="dom-uda-search">search</code> results in different results
-   depending on the exact original syntax of the URL:</p>
-
-   <table id="table-uda-examples">
-    <thead>
-     <tr>
-      <th> Input URL
-      <th> <code title="dom-uda-search">search</code> value
-      <th> Explanation
-    <tbody>
-     <tr>
-      <td> <code title="">http://example.com/</code>
-      <td> <i>empty string</i>
-      <td> No <span title="url-query"><query></span> component in input URL.
-     <tr>
-      <td> <code title="">http://example.com/?</code>
-      <td> <code title="">?</code>
-      <td> There is a <span title="url-query"><query></span> component, but it is empty.
-           <span class="impl">The question mark in the resulting value is the prefix.</span>
-     <tr>
-      <td> <code title="">http://example.com/?test</code>
-      <td> <code title="">?test</code>
-      <td> The <span title="url-query"><query></span> component has the value "<code title="">test</code>".
-     <tr>
-      <td> <code title="">http://example.com/?test#</code>
-      <td> <code title="">?test</code>
-      <td> The (empty) <span title="url-fragment"><fragment></span> component is not part of the <span title="url-query"><query></span> component.
-   </table>
-
-  </div>
-
-  <div class="example">
-
-   <p>The following table is similar; it provides a list of what each
-   of the <span>URL decomposition IDL attributes</span> returns for a
-   given <var title="">input</var> URL.</p>
-
-   <table>
-    <thead>
-     <tr>
-      <th>Input
-      <th><code title="dom-uda-protocol">protocol</code>
-      <th><code title="dom-uda-host">host</code>
-      <th><code title="dom-uda-hostname">hostname</code>
-      <th><code title="dom-uda-port">port</code>
-      <th><code title="dom-uda-pathname">pathname</code>
-      <th><code title="dom-uda-search">search</code>
-      <th><code title="dom-uda-hash">hash</code>
-    <tbody>
-     <tr>
-      <td><code title="">http://example.com/carrot#question%3f</code>
-      <td><code title="">http:</code>
-      <td><code title="">example.com</code>
-      <td><code title="">example.com</code>
-      <td>(empty string)
-      <td><code title="">/carrot</code>
-      <td>(empty string)
-      <td><code title="">#question%3f</code>
-     <tr>
-      <td><code title="">https://www.example.com:4443?</code>
-      <td><code title="">https:</code>
-      <td><code title="">www.example.com:4443</code>
-      <td><code title="">www.example.com</code>
-      <td><code title="">4443</code>
-      <td><code title="">/</code>
-      <td><code title="">?</code>
-      <td>(empty string)
-   </table>
-
-  </div>
-
-
-<!--TOPIC:HTML-->
-  <div class="impl">
-
   <h3>Fetching resources</h3>
 
   <h4>Terminology</h4>
@@ -6866,14 +6194,21 @@
 
    <li>
 
-    <p><i>Clean referrer</i>: Remove any <span title="url-fragment"><fragment></span>
-    component from <var title="">referrer</var>.</p> <!-- RFC2616 says "The URI MUST NOT include a
-    fragment." (section 14.36) -->
+    <p>Apply the <span>URL parser</span> to <var title="">referrer</var> and let <var
+    title="">parsed referrer</var> be <span>resulting parsed URL</span>.</p>
 
    </li>
 
    <li>
 
+    <p><i>Clean referrer</i>: Let <var title="">referrer</var> be the result of applying the
+    <span>URL serializer</span> to <var title="">parsed referrer</var>, with the <i>exclude fragment
+    flag</i> set.</p> <!-- RFC2616 says "The URI MUST NOT include a fragment." (section 14.36) -->
+
+   </li>
+
+   <li>
+
     <p>If <var title="">referrer</var> is not the empty string, is not a <span title="data
     protocol"><code title="">data:</code> URL</span>, is not a <span title="javascript
     protocol"><code title="">javascript:</code> URL</span>, and is not the <span>URL</span>
@@ -8642,6 +7977,10 @@
   document</span>, and the <code>Document</code> is both <span>ready for post-load tasks</span> and
   <span>completely loaded</span> immediately.</p>
 
+  <p><dfn>The document's referrer</dfn> is an <span>absolute URL</span> that can be set when the
+  <code>Document</code> is created. If it is not explicitly set, then its value is the empty
+  string.</p>
+
   <p>Each <code>Document</code> object has a <dfn>reload override flag</dfn> that is originally
   unset. The flag is set by the <code title="dom-document-open">document.open()</code> and <code
   title="dom-document-open">document.write()</code> methods in certain situations. When the flag is
@@ -8753,6 +8092,8 @@
    <dt><var title="">document</var> . <code title="dom-document-referrer">referrer</code></dt>
    <dd>
 
+<!--CLEANUP-->
+
     <p>Returns <span title="the document's address">the address</span>
     of the <code>Document</code> from which the user navigated to this
     one, unless it was blocked or there was no such document, in which
@@ -8767,14 +8108,8 @@
 
   <div class="impl">
 
-  <p>The <dfn title="dom-document-referrer"><code>referrer</code></dfn> attribute must return either
-  the <span title="the document's address">address</span> of the <span>active document</span> of the
-  <span>source browsing context</span> <em>at the time the navigation was started</em> (that is, the
-  page which <span title="navigate">navigated</span> the <span>browsing context</span> to the
-  current document), with any <span title="url-fragment"><fragment></span> component removed;
-  or the empty string if there is no such originating page, or if the UA has been configured not to
-  report referrers in this case, or if the navigation was initiated for a <span>hyperlink</span>
-  with a <code title="rel-noreferrer">noreferrer</code> keyword.</p>
+  <p>The <dfn title="dom-document-referrer"><code>referrer</code></dfn> attribute must return
+  <span>the document's referrer</span>.</p>
 
   </div>
 
@@ -12688,6 +12023,8 @@
    title="script's document">document</span>'s <span title="the document's
    address">address</span>.</p></li>
 
+   <!-- <span>the document's referrer</span> stays the same -->
+
    <li><p>Create a new <span>HTML parser</span> and associate it with the document. This is a
    <dfn>script-created parser</dfn> (meaning that it can be closed by the <code
    title="dom-document-open">document.open()</code> and <code
@@ -20428,16 +19765,8 @@
            attribute DOMString <span title="dom-a-type">type</span>;
 
            attribute DOMString <span title="dom-a-text">text</span>;
-
-  // <span>URL decomposition IDL attributes</span>
-           attribute DOMString <span title="dom-a-protocol">protocol</span>;
-           attribute DOMString <span title="dom-a-host">host</span>;
-           attribute DOMString <span title="dom-a-hostname">hostname</span>;
-           attribute DOMString <span title="dom-a-port">port</span>;
-           attribute DOMString <span title="dom-a-pathname">pathname</span>;
-           attribute DOMString <span title="dom-a-search">search</span>;
-           attribute DOMString <span title="dom-a-hash">hash</span>;
-};</pre>
+};
+<span>HTMLAnchorElement</span> implements <span>URLUtils</span>;</pre>
    </dd>
   </dl><!--TOPIC:HTML-->
 
@@ -20559,6 +19888,7 @@
 
   </dl>
 
+<!-- CLEANUP -->
   <div class="impl">
 
   <p>The IDL attributes <dfn title="dom-a-href"><code>href</code></dfn>, <dfn
@@ -20576,19 +19906,14 @@
   same value as the <code>textContent</code> IDL attribute on the element, and on setting, must act
   as if the <code>textContent</code> IDL attribute on the element had been set to the new value.</p>
 
-  <p>The <code>a</code> element also supports the complement of <span>URL decomposition IDL
-  attributes</span>, <dfn title="dom-a-protocol"><code>protocol</code></dfn>, <dfn
-  title="dom-a-host"><code>host</code></dfn>, <dfn title="dom-a-port"><code>port</code></dfn>, <dfn
-  title="dom-a-hostname"><code>hostname</code></dfn>, <dfn
-  title="dom-a-pathname"><code>pathname</code></dfn>, <dfn
-  title="dom-a-search"><code>search</code></dfn>, and <dfn
-  title="dom-a-hash"><code>hash</code></dfn>. These must follow the rules given for <span>URL
-  decomposition IDL attributes</span>, with the <span title="concept-uda-input">input</span> being
-  the result of <span title="resolve a url">resolving</span> the element's <code
-  title="attr-hyperlink-href">href</code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <span
-  title="concept-uda-setter">common setter action</span> being the same as setting the element's
-  <code title="attr-hyperlink-href">href</code> attribute to the new output value.</p>
+  <p>The <code>a</code> element also supports the <code>URLUtils</code> interface. The <span title="concept-uu-input">input</span> is
+  the value of the element's <code
+  title="attr-hyperlink-href">href</code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <span title="concept-uu-base">base</span>
+  is <span>the element's base URL</span>; the <span title="concept-uu-query-encoding">query encoding</span>
+  being the <span>document's character encoding</span>; and the <span
+  title="concept-uu-update">update steps</span> being the same as setting the element's
+  <code title="attr-hyperlink-href">href</code> content attribute to the new output value.</p>
 
   </div>
 <!--TOPIC:HTML-->
@@ -26984,13 +26309,15 @@
     <!-- if we get to this point we know we can successfully parsed the URL, since this algorithm is
     only used after fetching the resource in the steps above -->
 
-    <p>Otherwise, if the <span title="url-path"><path></span> component of the
-    <span>URL</span> of the specified resource (after any redirects) matches a pattern that a
+<!--CLEANUP-->
+    <p>Otherwise, if applying the <span>URL parser</span> algorithm to the
+    <span>URL</span> of the specified resource (after any redirects) results in a <span>parsed URL</span>
+    whose <span title="concept-url-path">path</span> component matches a pattern that a
     <span>plugin</span> supports, then the <span title="concept-embed-type">content's type</span> is
     the type that that plugin can handle.</p>
 
     <p class="example">For example, a plugin might say that it can handle resources with <span
-    title="url-path"><path></span> components that end with the four character string "<code
+    title="concept-url-path">path</span> components that end with the four character string "<code
     title="">.swf</code>".</p>
 
     <!-- it's sad that we have to do extension sniffing. sigh. -->
@@ -27573,13 +26900,15 @@
         <!-- if we get to this point we know we can successfully parsed the URL, since this
         algorithm is only used after fetching the resource in the steps above -->
 
-        <p>If the <span title="url-path"><path></span> component of the <span>URL</span> of
-        the specified resource (after any redirects) matches a pattern that a <span>plugin</span>
+<!--CLEANUP-->
+        <p>If applying the <span>URL parser</span> algorithm to the
+        <span>URL</span> of the specified resource (after any redirects) results in a <span>parsed URL</span>
+        whose <span title="concept-url-path">path</span> component matches a pattern that a <span>plugin</span>
         supports, then let <var title="">resource type</var> be the type that that plugin can
         handle.</p>
 
         <p class="example">For example, a plugin might say that it can handle resources with <span
-        title="url-path"><path></span> components that end with the four character string
+        title="concept-url-path">path</span> components that end with the four character string
         "<code title="">.swf</code>".</p>
 
         <!-- it's sad that we have to do extension sniffing. sigh. -->
@@ -32330,7 +31659,7 @@
   particular tracks in the fragment identifier of the <span>URL</span> of the <span>media
   resource</span>. The format of the fragment identifier depends on the <span>MIME type</span> of
   the <span>media resource</span>. <a href="#refsRFC2046">[RFC2046]</a> <a
-  href="#refsRFC3986">[RFC3986]</a></p>
+  href="#refsURL">[URL]</a></p>
 
   <div class="example">
 
@@ -46277,16 +45606,8 @@
   readonly attribute <span>DOMTokenList</span> <span title="dom-area-relList">relList</span>;
            attribute DOMString <span title="dom-area-hreflang">hreflang</span>;
            attribute DOMString <span title="dom-area-type">type</span>;
-
-  // <span>URL decomposition IDL attributes</span>
-           attribute DOMString <span title="dom-area-protocol">protocol</span>;
-           attribute DOMString <span title="dom-area-host">host</span>;
-           attribute DOMString <span title="dom-area-hostname">hostname</span>;
-           attribute DOMString <span title="dom-area-port">port</span>;
-           attribute DOMString <span title="dom-area-pathname">pathname</span>;
-           attribute DOMString <span title="dom-area-search">search</span>;
-           attribute DOMString <span title="dom-area-hash">hash</span>;
-};</pre>
+};
+<span>HTMLAreaElement</span> implements <span>URLUtils</span>;</pre>
    </dd>
   </dl><!--TOPIC:HTML-->
 
@@ -46465,9 +45786,9 @@
 
   <p>The IDL attributes <dfn title="dom-area-alt"><code>alt</code></dfn>, <dfn
   title="dom-area-coords"><code>coords</code></dfn>, <dfn
-  title="dom-area-href"><code>href</code></dfn>, <dfn
   title="dom-area-target"><code>target</code></dfn>, <dfn
   title="dom-area-download"><code>download</code></dfn>, <dfn
+  title="dom-area-href"><code>href</code></dfn>, <dfn
   title="dom-area-ping"><code>ping</code></dfn>, <dfn title="dom-area-rel"><code>rel</code></dfn>,
   <dfn title="dom-area-hreflang"><code>hreflang</code></dfn>, and <dfn
   title="dom-area-type"><code>type</code></dfn>, each must <span>reflect</span> the respective
@@ -46479,19 +45800,14 @@
   <p>The IDL attribute <dfn title="dom-area-rellist"><code>relList</code></dfn> must
   <span>reflect</span> the <code title="attr-hyperlink-rel">rel</code> content attribute.</p>
 
-  <p>The <code>area</code> element also supports the complement of <span>URL decomposition IDL
-  attributes</span>, <dfn title="dom-area-protocol"><code>protocol</code></dfn>, <dfn
-  title="dom-area-host"><code>host</code></dfn>, <dfn title="dom-area-port"><code>port</code></dfn>,
-  <dfn title="dom-area-hostname"><code>hostname</code></dfn>, <dfn
-  title="dom-area-pathname"><code>pathname</code></dfn>, <dfn
-  title="dom-area-search"><code>search</code></dfn>, and <dfn
-  title="dom-area-hash"><code>hash</code></dfn>. These must follow the rules given for <span>URL
-  decomposition IDL attributes</span>, with the <span title="concept-uda-input">input</span> being
-  the result of <span title="resolve a url">resolving</span> the element's <code
-  title="attr-hyperlink-href">href</code> attribute relative to the element, if there is such an
-  attribute and resolving it is successful, or the empty string otherwise; and the <span
-  title="concept-uda-setter">common setter action</span> being the same as setting the element's
-  <code title="attr-hyperlink-href">href</code> attribute to the new output value.</p>
+  <p>The <code>area</code> element also supports the <code>URLUtils</code> interface. The <span title="concept-uu-input">input</span> is
+  the value of the element's <code
+  title="attr-hyperlink-href">href</code> content attribute, if there is such an
+  attribute, or the empty string otherwise; the <span title="concept-uu-base">base</span>
+  is <span>the element's base URL</span>; the <span title="concept-uu-query-encoding">query encoding</span>
+  being the <span>document's character encoding</span>; and the <span
+  title="concept-uu-update">update steps</span> being the same as setting the element's
+  <code title="attr-hyperlink-href">href</code> content attribute to the new output value.</p>
 
   </div>
 
@@ -64928,6 +64244,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class="impl">
 
@@ -64993,11 +64310,6 @@
     title="">action</var> be <span>the document's address</span> of
     the <var title="">form document</var>.</p>
 
-    <p class="note">This step is a <span>willful violation</span> of
-    RFC 3986, which would require base URL processing here. This
-    violation is motivated by a desire for compatibility with legacy
-    content. <a href="#refsRFC3986">[RFC3986]</a></p>
-
     <!-- Don't ask me why. But that's what IE does. It even treats
     action="" differently from action=" " or action="#" (the latter
     two resolve to the base URL, the first one resolves to the doc
@@ -65011,12 +64323,17 @@
    <li><p><span title="resolve a url">Resolve</span> the
    <span>URL</span> <var title="">action</var>, relative to the <var
    title="">submitter</var> element. If this fails, abort these
-   steps. Otherwise, let <var title="">action</var> be the resulting
+   steps.</p></li>
+
+   <li><p>Let <var title="">action</var> be the resulting
    <span>absolute URL</span>.</p></li>
 
+   <li><p>Let <var title="">action components</var> be the resulting <span>parsed
+   URL</span>.</p></li>
+
    <li><p>Let <var title="">scheme</var> be the <span
-   title="url-scheme"><scheme></span> of the resulting
-   <span>absolute URL</span>.</p></li>
+   title="concept-url-scheme">scheme</span> of the resulting
+   <span>parsed URL</span>.</p></li>
 
    <li><p>Let <var title="">enctype</var> be the <var
    title="">submitter</var> element's <span
@@ -65113,11 +64430,11 @@
       <!-- by this point we've already tried to resolve the URL, so we
       know we can parse it -->
 
+      <p>Set <var title="">parsed action</var>'s <span title="concept-url-query">query</span>
+      component to <var title="">query</var>.</p>
+
       <p>Let <var title="">destination</var> be a new <span>URL</span>
-      that is equal to the <var title="">action</var> except that its
-      <span title="url-query"><query></span> component is
-      replaced by <var title="">query</var> (adding a U+003F QUESTION
-      MARK character (?) if appropriate).</p>
+      formed by applying the <span>URL serializer</span> algorithm to <var title="">parsed action</var>.</p>
 
       <p><span>Navigate</span><!--DONAV form--> <var title="">target
       browsing context</var> to <var title="">destination</var>. If
@@ -65188,6 +64505,8 @@
       browsing context</var> must be navigated with <span>replacement
       enabled</span>.</p>
 
+      <p class="note">The <var title="">form data set</var> is discarded.</p>
+
      </dd>
 
      <dt><dfn title="submit-data-post">Post to data:</dfn>
@@ -65199,26 +64518,24 @@
 
       <p>If <var title="">action</var> contains the string "<code
       title="">%%%%</code>" (four U+0025 PERCENT SIGN characters),
-      then %-escape all bytes in <var title="">data</var> that, if
-      interpreted as US-ASCII, do not match the <code
-      title="">unreserved</code> production in the URI Generic Syntax,
-      and then, treating the result as a US-ASCII string, further
-      %-escape all the U+0025 PERCENT SIGN characters in the resulting
+      then <span>percent encode</span> all bytes in <var title="">data</var> that, if
+      interpreted as US-ASCII, are not characters in the URL <span>default encode set</span>,
+      and then, treating the result as a US-ASCII string, 
+      <span>UTF-8 percent encode</span> all the U+0025 PERCENT SIGN characters in the resulting
       string and replace the first occurrence of "<code
       title="">%%%%</code>" in <var title="">action</var> with the
-      resulting double-escaped string. <a
-      href="#refsRFC3986">[RFC3986]</a></p>
+      resulting doubly-escaped string. <a
+      href="#refsURL">[URL]</a></p>
 
       <p>Otherwise, if <var title="">action</var> contains the string
       "<code title="">%%</code>" (two U+0025 PERCENT SIGN characters
-      in a row, but not four), then %-escape all characters in <var
-      title="">data</var> that, if interpreted as US-ASCII, do not
-      match the <code title="">unreserved</code> production in the URI
-      Generic Syntax, and then, treating the result as a US-ASCII
+      in a row, but not four), then <span>UTF-8 percent encode</span> all characters in <var
+      title="">data</var> that, if interpreted as US-ASCII, 
+      are not characters in the URL <span>default encode set</span>, and then, treating the result as a US-ASCII
       string, replace the first occurrence of "<code
       title="">%%</code>" in <var title="">action</var> with the
       resulting escaped string. <a
-      href="#refsRFC3986">[RFC3986]</a></p>
+      href="#refsURL">[URL]</a></p>
 
       <p><span>Navigate</span><!--DONAV form--> <var title="">target
       browsing context</var> to the potentially modified <var
@@ -65265,12 +64582,11 @@
      <dt><dfn title="submit-mailto-body">Mail as body</dfn>
      <dd>
 
-      <p>Let <var title="">body</var> be the resulting encoding the
+      <p>Let <var title="">body</var> be the resulting of encoding the
       <var title="">form data set</var> using the <span>appropriate
-      form encoding algorithm</span> and then %-escaping all the bytes
+      form encoding algorithm</span> and then <span title="percent encode">percent encoding</span> all the bytes
       in the resulting byte string that, when interpreted as US-ASCII,
-      do not match the <code title="">unreserved</code> production in
-      the URI Generic Syntax. <a href="#refsRFC3986">[RFC3986]</a></p>
+      are not characters in the URL <span>default encode set</span>. <a href="#refsURL">[URL]</a></p>
 
       <p>Let <var title="">destination</var> have the same value as
       <var title="">action</var>.</p>
@@ -75974,7 +75290,11 @@
   <span>completely loaded</span> immediately. The <code>Document</code> must have a single child
   <code>html</code> node, which itself has a single child <code>body</code> node. As soon as this
   <code>Document</code> is created, the user agent must <span>implement the sandboxing</span> for
-  it.</p>
+  it. If the <span>browsing context</span> has a <span>creator <code>Document</code></span>, then
+  the <span>browsing context</span>'s <code>Document</code>'s <span title="the document's
+  referrer">referrer</span> must be set to <span title="the document's address">the address</span>
+  of that <span>creator <code>Document</code></span> at the time of the <span>browsing
+  context</span>'s creation.</p>
 
   <p class="note">If the <span>browsing context</span> is created specifically to be immediately
   navigated, then that initial navigation will have <span>replacement enabled</span>.</p>
@@ -77873,10 +77193,11 @@
 
   <div class="impl">
 
+<!--CLEANUP-->
   <p>The <dfn title="dom-document-domain"><code>domain</code></dfn> attribute on
   <code>Document</code> objects must be initialized to <span>the document's domain</span>, if it has
   one, and the empty string otherwise. If the value is an IPv6 address, then the square brackets
-  from the host portion of the <span title="url-host"><host></span> component must be omitted
+  from the <span title="concept-url-host">host</span> component must be omitted
   from the attribute's value.</p>
 
   <p>On getting, the attribute must return its current value, unless the <code>Document</code> has
@@ -78695,16 +78016,17 @@
 
      <li>If that fails, throw a <code>SecurityError</code> exception and abort these steps.</li>
 
-     <li>Compare the resulting <span>absolute URL</span> to <span>the document's address</span>. If
-     any part of these two <span title="URL">URLs</span> differ other than the <span
-     title="url-path"><path></span>, <span title="url-query"><query></span>, and <span
-     title="url-fragment"><fragment></span> components, then throw a
+<!--CLEANUP-->
+     <li>Compare the resulting <span>parsed URL</span> to the result of applying the <span>URL parser</span> algorithm to <span>the document's address</span>. If
+     any component of these two <span title="URL">URLs</span> differ other than the <span
+     title="concept-url-path">path</span>, <span title="concept-url-query">query</span>, and <span
+     title="concept-url-fragment">fragment</span> components, then throw a
      <code>SecurityError</code> exception and abort these steps.</li>
 
      <li>If the <span>origin</span> of the resulting <span>absolute URL</span> is not the same as
      the <span>origin</span> of the <span>entry script</span>'s <span title="script's
-     document">document</span>, and either the <span title="url-path"><path></span> or <span
-     title="url-query"><query></span> components of the two <span title="URL">URLs</span>
+     document">document</span>, and either the <span title="concept-url-path">path</span> or <span
+     title="concept-url-query">query</span> components of the two <span title="parsed URL">parsed URLs</span>
      compared in the previous step differ, throw a <code>SecurityError</code> exception and abort
      these steps. (This prevents sandboxed content from spoofing other pages on the same
      origin.)</li>
@@ -78714,9 +78036,8 @@
     </ol>
 
     <p>For the purposes of the comparisons in the above substeps, the <span
-    title="url-path"><path></span> and <span title="url-query"><query></span> components
-    can only be the same if the URLs are both <span title="hierarchical URL">hierarchical
-    URLs</span>.</p>
+    title="concept-url-path">path</span> and <span title="concept-url-query">query</span> components
+    can only be the same if the <span title="concept-url-scheme">scheme</span> component of both <span title="parsed URL">parsed URLs</span> are <span title="concept-url-scheme-relative">relative schemes</span>.</p>
 
    </li>
 
@@ -78961,17 +78282,9 @@
   void <span title="dom-location-assign">assign</span>(DOMString url);
   void <span title="dom-location-replace">replace</span>(DOMString url);
   void <span title="dom-location-reload">reload</span>();
+};
+<span>Location</span> implements <span>URLUtils</span>;</pre>
 
-  // <span>URL decomposition IDL attributes</span> <!-- blame brendan for these "innovative" names -->
-           attribute DOMString <span title="dom-location-protocol">protocol</span>;
-           attribute DOMString <span title="dom-location-host">host</span>;
-           attribute DOMString <span title="dom-location-hostname">hostname</span>;
-           attribute DOMString <span title="dom-location-port">port</span>;
-           attribute DOMString <span title="dom-location-pathname">pathname</span>;
-           attribute DOMString <span title="dom-location-search">search</span>;
-           attribute DOMString <span title="dom-location-hash">hash</span>;
-};</pre>
-
   <dl class="domintro">
 
    <dt><var title="">location</var> . <code title="dom-location-href">href</code> [ = <var title="">value</var> ]</dt>
@@ -79103,25 +78416,21 @@
   user agent may instead perform <span>an overridden reload</span> rather than the navigation
   described in this paragraph.</p>
 
+  <p>The <code>Location</code> interface also supports the <code>URLUtils</code> interface. <span
+  class="impl">The <span title="concept-uu-input">input</span> is <span title="the document's
+  address">the address</span> of the <i>relevant <code>Document</code></i> (same as the <code
+  title="dom-location-href">href</code> attribute), as an <span>absolute URL</span>; the <span
+  title="concept-uu-base">base</span> is the <span>entry script</span>'s <span title="script's base
+  URL">base URL</span> (which can be different each time members on the interface are invoked); the
+  <span title="concept-uu-query-encoding">query encoding</span> is the <span>document's character
+  encoding</span>; and the <span title="concept-uu-update">update steps</span> are the same as
+  setting the <code title="dom-location-href">href</code> attribute to the new output
+  value.</span></p>
+
   </div>
 
-  <p>The <code>Location</code> interface also has the complement of <span>URL decomposition IDL
-  attributes</span>, <dfn title="dom-location-protocol"><code>protocol</code></dfn>, <dfn
-  title="dom-location-host"><code>host</code></dfn>, <dfn
-  title="dom-location-port"><code>port</code></dfn>, <dfn
-  title="dom-location-hostname"><code>hostname</code></dfn>, <dfn
-  title="dom-location-pathname"><code>pathname</code></dfn>, <dfn
-  title="dom-location-search"><code>search</code></dfn>, and <dfn
-  title="dom-location-hash"><code>hash</code></dfn>. <span class="impl">These must follow the rules
-  given for <span>URL decomposition IDL attributes</span>, with the <span
-  title="concept-uda-input">input</span> being <span title="the document's address">the
-  address</span> of the <i>relevant <code>Document</code></i>, as an <span>absolute URL</span> (same
-  as the <code title="dom-location-href">href</code> attribute), and the <span
-  title="concept-uda-setter">common setter action</span> being the same as setting the <code
-  title="dom-location-href">href</code> attribute to the new output value.</span></p>
 
 
-
 <!--ADD-TOPIC:Security-->
   <div class="impl">
 
@@ -79306,13 +78615,13 @@
 
    <li><p>Let <var title="">gone async</var> be false.</p></li>
 
-   <li id="navigate-fragid-step"><p><i>Fragment identifiers</i>: If the <span>absolute URL</span> of
-   the new resource is the same as the <span title="the document's address">address</span> of the
-   <span>active document</span> of the <span>browsing context</span> being navigated, ignoring any
-   <span title="url-fragment"><fragment></span> components of those <span
-   title="URL">URLs</span>, and the new resource is to be fetched using HTTP GET <span
-   title="concept-http-equivalent-get">or equivalent</span>, and the <span>absolute URL</span> of
-   the new resource has a <span title="url-fragment"><fragment></span> component (even if it
+<!--CLEANUP-->
+   <li id="navigate-fragid-step"><p><i>Fragment identifiers</i>: Apply the <span>URL parser</span> algorithm to the <span>absolute URL</span> of
+   the new resource and the <span title="the document's address">address</span> of the
+   <span>active document</span> of the <span>browsing context</span> being navigated. If all the components of the resulting <span title="parsed URL">parsed URLs</span> , ignoring any
+   <span title="concept-url-fragment">fragment</span> components, are identical, and the new resource is to be fetched using HTTP GET <span
+   title="concept-http-equivalent-get">or equivalent</span>, and the <span>parsed URL</span> of
+   the new resource has a <span title="concept-url-fragment">fragment</span> component that is not null (even if it
    is empty), then <span title="navigate-fragid">navigate to that fragment identifier</span> and
    abort these steps.</p></li>
 
@@ -79836,14 +79145,15 @@
   encoding is established, the <span>document's character encoding</span> must be set to that
   character encoding.</p>
 
+<!--CLEANUP-->
   <p>If the root element, as parsed according to the XML specifications cited above, is found to be
   an <code>html</code> element with an attribute <code title="attr-html-manifest">manifest</code>
   whose value is not the empty string, then, as soon as the element is <span title="insert an
   element into a document">inserted into the document</span>, the user agent must <span
   title="resolve a url">resolve</span> the value of that attribute relative to that element, and if
-  that is successful, must run the <span title="concept-appcache-init">application cache selection
-  algorithm</span> with the resulting <span>absolute URL</span> with any <span
-  title="url-fragment"><fragment></span> component removed as the manifest URL, and passing in
+  that is successful, must apply the <span>URL serializer</span> algorithm to the resulting <span>parsed URL</span> with the <i>exclude fragment flag</i> set to obtain <var title="">manifest URL</var>, and then run the <span title="concept-appcache-init">application cache selection
+  algorithm</span> with <var title="">manifest URL</var>
+  as the manifest URL, passing in
   the newly-created <code>Document</code>. Otherwise, if the attribute is absent, its value is the
   empty string, or resolving its value fails, then as soon as the root element is <span
   title="insert an element into a document">inserted into the document</span>, the user agent must
@@ -80115,10 +79425,12 @@
 
   <ol>
 
-   <li><p><span title="parse a url">Parse</span> the <span>URL</span>, and let <var
-   title="">fragid</var> be the <span title="url-fragment"><fragment></span> component of the
-   URL.</p></li><!-- parsing can't fail, since we checked earlier on when navigating -->
+<!--CLEANUP-->
 
+   <li><p>Apply the <span>URL parser</span> algorithm to the <span>URL</span>, and let <var
+   title="">fragid</var> be the <span title="concept-url-fragment">fragment</span> component of the
+   resulting <span>parsed URL</span>.</p></li><!-- parsing can't fail, since we checked earlier on when navigating -->
+
    <li><p>If <var title="">fragid</var> is the empty string, then <span>the indicated part of the
    document</span> is the top of the document; stop the algorithm here.</p></li>
 
@@ -81430,7 +80742,7 @@
   </div>
 
 
-
+<!--CLEANUP-->
   <h5>Writing cache manifests</h5>
 
   <p>Manifests must be served using the
@@ -81622,11 +80934,11 @@
   title="concept-appcache-onlinewhitelist">online whitelist</span> is
   a <span>prefix match</span>.</p>
 
-  <p>Relative URLs must be given relative to the manifest's own
+  <p><span title="relative URL">Relative URLs</span> must be given relative to the manifest's own
   URL. All URLs in the manifest must have the same <span
-  title="url-scheme"><scheme></span> as the manifest itself
-  (either explicitly or implicitly, through the use of relative
-  URLs).</p>
+  title="concept-url-scheme">scheme</span> as the manifest itself
+  (either explicitly or implicitly, through the use of <span title="relative url">relative
+  URLs</span>). <a href="#refsURL">[URL]</a></p>
 
   <p>URLs in manifests must not have fragment identifiers (i.e. the
   U+0023 NUMBER SIGN character isn't allowed in URLs in
@@ -81638,6 +80950,7 @@
   matched by <span>prefix match</span>.</p>
 
 
+<!--CLEANUP-->
   <div class="impl">
 
   <h5>Parsing cache manifests</h5>
@@ -81647,7 +80960,7 @@
 
   <ol>
 
-   <li><p>The user agent must decode the byte stream corresponding
+   <li><p>Decode the byte stream corresponding
    with the manifest to be parsed <span title="decoded as UTF-8, with
    error handling">as UTF-8, with error handling</span>. <!--All
    U+0000 NULL characters must be replaced by U+FFFD REPLACEMENT
@@ -81658,6 +80971,10 @@
    <li><p>Let <var title="">base URL</var> be the <span>absolute
    URL</span> representing the manifest.</p></li>
 
+   <li><p>Apply the <span>URL parser</span> steps to the <var title="">base URL</var>, so that the
+   components from its <span>parsed URL</span> can be used by the subseqent steps of this
+   algorithm.</p></li>
+
    <li><p>Let <var title="">explicit URLs</var> be an initially empty
    list of <span title="absolute URL">absolute URLs</span> for <span
    title="concept-appcache-explicit">explicit entries</span>.</p></li>
@@ -81822,17 +81139,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <span>absolute URL</span> has a different
-      <span title="url-scheme"><scheme></span> component than
-      the manifest's URL (compared in an <span>ASCII
-      case-insensitive</span> manner), then jump back to the step
+      <p>If the resulting <span>parsed URL</span> has a different
+      <span title="concept-url-scheme">scheme</span> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <span title="url-fragment"><fragment></span>
-      component of the resulting <span>absolute URL</span>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <span>URL serializer</span>
+      algorithm to the resulting <span>parsed URL</span>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <span>absolute URL</span> to the <var
+      <p>Add <var title="">new URL</var> to the <var
       title="">explicit URLs</var>.</p>
 
      </dd>
@@ -81858,21 +81173,25 @@
       jump back to the step labeled "start of line".</p> <!-- SECURITY
       -->
 
-      <p>Drop any <span title="url-fragment"><fragment></span>
-      components of the resulting <span title="absolute URL">absolute
-      URLs</span>.</p>
+      <p>Let <var title="">part one</var> be the result of applying the <span>URL serializer</span>
+      algorithm to the first resulting <span>parsed URL</span>, with the <i>exclude fragment
+      flag</i> set.</p>
 
-      <p>If the <span>absolute URL</span> corresponding to <var
+      <p>Let <var title="">part two</var> be the result of applying the <span>URL serializer</span>
+      algorithm to the second resulting <span>parsed URL</span>, with the <i>exclude fragment
+      flag</i> set.</p>
+
+      <p>If <var
       title="">part one</var> is already in the <var title="">fallback
       URLs</var> mapping as a <span
       title="concept-appcache-fallback-ns">fallback namespace</span>,
       then jump back to the step labeled "start of line".</p>
 
-      <p>Otherwise, add the <span>absolute URL</span> corresponding to
+      <p>Otherwise, add 
       <var title="">part one</var> to the <var title="">fallback
       URLs</var> mapping as a <span
       title="concept-appcache-fallback-ns">fallback namespace</span>,
-      mapped to the <span>absolute URL</span> corresponding to <var
+      mapped to <var
       title="">part two</var> as the <span
       title="concept-appcache-fallback">fallback entry</span>.</p>
 
@@ -81894,17 +81213,15 @@
       <p>If this fails, then jump back to the step labeled "start of
       line".</p>
 
-      <p>If the resulting <span>absolute URL</span> has a different
-      <span title="url-scheme"><scheme></span> component than
-      the manifest's URL (compared in an <span>ASCII
-      case-insensitive</span> manner), then jump back to the step
+      <p>If the resulting <span>parsed URL</span> has a different
+      <span title="concept-url-scheme">scheme</span> component than
+      <var title="">base URL</var> (the manifest's URL), then jump back to the step
       labeled "start of line".</p>
 
-      <p>Drop the <span title="url-fragment"><fragment></span>
-      component of the resulting <span>absolute URL</span>, if it has
-      one.</p>
+      <p>Let <var title="">new URL</var> be the result of applying the <span>URL serializer</span>
+      algorithm to the resulting <span>parsed URL</span>, with the <i>exclude fragment flag</i> set.</p>
 
-      <p>Add the resulting <span>absolute URL</span> to the <var
+      <p>Add <var title="">new URL</var> to the <var
       title="">online whitelist namespaces</var>.</p>
 
      </dd>
@@ -82247,12 +81564,13 @@
       <span>shows caching progress</span>, the display of some sort of user interface indicating to
       the user that the user agent failed to save the application for offline use.</p>
 
+<!--CLEANUP-->
       <p>Otherwise, associate the <code>Document</code> for this entry with <var
       title="">cache</var>; store the resource for this entry in <var title="">cache</var>, if it
       isn't already there, and categorize its entry as a <span
-      title="concept-appcache-master">master entry</span>. If the resource's <span>URL</span> has a
-      <span title="url-fragment"><fragment></span> component, it must be removed from the
-      entry in <var title="">cache</var> (application caches never include fragment
+      title="concept-appcache-master">master entry</span>. If applying the <span>URL parser</span> algorithm to the resource's <span>URL</span> results in a <span>parsed URL</span> that has a non-null
+      <span title="concept-url-fragment">fragment</span> component, the <span>URL</span> used for the
+      entry in <var title="">cache</var> must instead be the <span>absolute URL</span> obtained from applying the <span>URL serializer</span> algorith, to the <span>parsed URL</span> with the <i>exclude fragment flag</i> set (application caches never include fragment
       identifiers).</p>
 
      </li>
@@ -82867,10 +82185,10 @@
 
    <li><p>If the resource is not to be fetched using the HTTP GET
    mechanism <span title="concept-http-equivalent-get">or
-   equivalent</span>, or if its <span>URL</span> has a different <span
-   title="url-scheme"><scheme></span> component than the
+   equivalent</span>, or if applying the <span>URL parser</span> algorithm to both its <span>URL</span> and the
    <span>application cache</span>'s <span
-   title="concept-appcache-manifest">manifest</span>, then
+   title="concept-appcache-manifest">manifest</span>'s URL results in two <span title="parsed URL">parsed URLs</span> with different <span
+   title="concept-url-scheme">scheme</span> components, then
    <span>fetch</span> the resource normally and abort these
    steps.</p></li>
 
@@ -83450,6 +82768,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <div class="impl">
 
@@ -83606,7 +82925,7 @@
    <dd>
 
     <p>A <span>URL</span>, set when the script is created, used to
-    resolve relative URLs. <span id="sbu-not-copy" title="">If the
+    resolve <span title="relative url">relative URLs</span>. <span id="sbu-not-copy" title="">If the
     base URL is set from another source, e.g. a <span>document base
     URL</span>, then the <span>script's base URL</span> must follow
     the source, so that if the source's changes, so does the
@@ -86499,6 +85818,7 @@
 
   </div>
 
+<!--CLEANUP-->
 
   <h5 id="custom-handlers">Custom scheme and content handlers</h5>
 
@@ -86745,12 +86065,10 @@
     title="concept-http-equivalent-get">or equivalent</span> for
     non-HTTP URLs).</p>
 
-    <p>To get the escaped version of the <span>absolute URL</span> of
-    the content in question, the user agent must replace every
-    character in that <span>absolute URL</span> that doesn't match the
-    <query> production defined in RFC 3986 by the
-    percent-encoded form of that character. <a
-    href="#refsRFC3986">[RFC3986]</a></p>
+    <p>To get the escaped version of the <span>absolute URL</span> of the content in question, the
+    user agent must replace every character in that <span>absolute URL</span> that is not a
+    character in the URL <span>default encode set</span> with the result of <span title="UTF-8 percent
+    encode">UTF-8 percent encoding</span> that character.</p>
 
     <div class="example">
 
@@ -87352,8 +86670,8 @@
     <li><p>If this fails, return 0 and abort these steps.</p></li>
 
     <li><p>Let <var title="">host2</var> be be the <span
-    title="url-host"><host></span> component of the resulting
-    <span>absolute URL</span>.</p></li>
+    title="concept-url-host">host</span> component of the resulting
+    <span>parsed URL</span>.</p></li>
 
     <li>
 
@@ -87367,11 +86685,8 @@
      <var title="">host2</var> after their common suffix are not the
      same, then return 0 and abort these steps.</p>
 
-     <p>Domain labels must be compared after applying the IDNA ToASCII
-     algorithm to them, with both the AllowUnassigned and
-     UseSTD3ASCIIRules flags set, in an <span>ASCII
-     case-insensitive</span> manner. <a
-     href="#refsRFC3490">[RFC3490]</a></p>
+     <!-- host1 is ascii here because origins are ascii. host2 is ascii because resolve urls
+     punycodes idna. -->
 
     </li>
 
@@ -92128,6 +91443,7 @@
   </div>
 -->
 
+<!--CLEANUP-->
 
 <!--ADD-TOPIC:Security-->
   <div class="impl">
@@ -92158,7 +91474,7 @@
 
   <p>User agents should filter potentially active (scripted) content
   (e.g. HTML) when it is dragged and when it is dropped, using a
-  whitelist of known-safe features. Similarly, relative URLs should be
+  whitelist of known-safe features. Similarly, <span title="relative url">relative URLs</span> should be
   turned into absolute URLs to avoid references changing in unexpected
   ways. This specification does not specify how this is performed.</p>
 
@@ -93284,6 +92600,7 @@
 
 
 
+<!--CLEANUP-->
   <h5>Dedicated workers and the <code>Worker</code> interface</h5>
 
   <pre class="idl">[<span title="dom-Worker">Constructor</span>(DOMString scriptURL)]
@@ -93366,8 +92683,8 @@
 
    <li>
 
-    <p>If the <span title="url-scheme"><scheme></span> component of
-    the resulting <span>absolute URL</span> is not "<code
+    <p>If the <span title="concept-url-scheme">scheme</span> component of
+    the resulting <span>parsed URL</span> is not "<code
     title="data-protocol">data</code>", and the <span>origin</span> of
     the resulting <span>absolute URL</span> is not the <span
     title="same origin">same</span> as the origin of the <span>entry
@@ -93507,7 +92824,8 @@
    exception.</p></li>
 
    <li><p>Otherwise, let <var title="">scriptURL</var> be the
-   resulting <span>absolute URL</span>.</p></li>
+   resulting <span>absolute URL</span> and <var title="">parsed scriptURL</var> be the
+   resulting <span>parsed URL</span>.</p></li>
 
    <li><p>Let <var title="">name</var> be the value of the second
    argument, or the empty string if the second argument was
@@ -93515,8 +92833,8 @@
 
    <li>
 
-    <p>If the <span title="url-scheme"><scheme></span> component of
-    <var title="">scriptURL</var> is not "<code
+    <p>If the <span title="concept-url-scheme">scheme</span> component of
+    <var title="">parsed scriptURL</var> is not "<code
     title="data-protocol">data</code>", and the <span>origin</span> of
     <var title="">scriptURL</var> is not the <span title="same
     origin">same</span> as the origin of the <span>entry
@@ -93937,16 +93255,9 @@
   <h4>Worker locations</h4>
 
   <pre class="idl">interface <dfn>WorkerLocation</dfn> {
-  // <span>URL decomposition IDL attributes</span>
   stringifier readonly attribute DOMString <span title="dom-WorkerLocation-href">href</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-protocol">protocol</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-host">host</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-hostname">hostname</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-port">port</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-pathname">pathname</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-search">search</span>;
-  readonly attribute DOMString <span title="dom-WorkerLocation-hash">hash</span>;
-};</pre>
+};
+<span>WorkerLocation</span> implements <span>URLUtilsReadOnly</span>;</pre>
 
   <p>A <code>WorkerLocation</code> object represents an <span>absolute URL</span> set at its
   creation.</p>
@@ -93954,23 +93265,10 @@
   <p>The <dfn title="dom-WorkerLocation-href"><code>href</code></dfn> attribute must return the
   <span>absolute URL</span> that the object represents.</p>
 
-  <p>The <code>WorkerLocation</code> interface also has the complement of <span>URL decomposition
-  IDL attributes</span>, <dfn title="dom-WorkerLocation-protocol"><code>protocol</code></dfn>, <dfn
-  title="dom-WorkerLocation-host"><code>host</code></dfn>, <dfn
-  title="dom-WorkerLocation-port"><code>port</code></dfn>, <dfn
-  title="dom-WorkerLocation-hostname"><code>hostname</code></dfn>, <dfn
-  title="dom-WorkerLocation-pathname"><code>pathname</code></dfn>, <dfn
-  title="dom-WorkerLocation-search"><code>search</code></dfn>, and <dfn
-  title="dom-WorkerLocation-hash"><code>hash</code></dfn>. These must follow the rules given for
-  <span>URL decomposition IDL attributes</span>, with the <span
-  title="concept-uda-input">input</span> being the <span>absolute URL</span> that the object
-  represents (same as the <code title="dom-WorkerLocation-href">href</code> attribute), and the
-  <span title="concept-uda-setter">common setter action</span> being a no-op, since the attributes
-  are defined to be readonly.
-  <!--END complete-->
-  <a href="#refsHTML">[HTML]</a>
-  <!--START complete-->
-  </p>
+  <p>The <code>WorkerLocation</code> interface also supports the <code>URLUtilsReadOnly</code>
+  interface. The <span title="concept-uu-input">input</span> is the <span>absolute URL</span> that
+  the object represents (same as the <code title="dom-WorkerLocation-href">href</code>
+  attribute). <a href="#refsURL">[URL]</a></p>
 
   <p>The <code>WorkerLocation</code> interface must only be <span title="expose">exposed</span> if
   the <span>JavaScript global environment</span> is a <span>worker environment</span>.</p>
@@ -95880,6 +95178,7 @@
   https://www.w3.org/Bugs/Public/show_bug.cgi?id=17264 -->
 
 
+<!--CLEANUP-->
   <h4>Parsing WebSocket URLs</h4>
 
   <p>The steps to <dfn>parse a WebSocket URL's components</dfn> from a string <var
@@ -95903,23 +95202,23 @@
 
    </li>
 
-   <li><p>If <var title="">url</var> does not have a <span title="url-scheme"><scheme></span>
+   <li><p>If the resulting <span>parsed URL</span> does not have a <span title="concept-url-scheme">scheme</span>
    component whose value, when <span>converted to ASCII lowercase</span>, is either "<code
    title="">ws</code>" or "<code title="">wss</code>", then fail this algorithm.</p></li>
 
-   <li><p>If <var title="">url</var> has a <span title="url-fragment"><fragment></span>
+   <li><p>If the resulting <span>parsed URL</span> has a non-null <span title="concept-url-fragment">fragment</span>
    component, then fail this algorithm.</p></li>
 
-   <li><p>If the <span title="url-scheme"><scheme></span> component of <var title="">url</var>
+   <li><p>If the <span title="concept-url-scheme">scheme</span> component of the resulting <span>parsed URL</span>
    is "<code title="">ws</code>", set <var title="">secure</var> to false; otherwise, the <span
-   title="url-scheme"><scheme></span> component is "<code title="">wss</code>", set <var
+   title="concept-url-scheme">scheme</span> component is "<code title="">wss</code>", set <var
    title="">secure</var> to true.</p></li>
 
-   <li><p>Let <var title="">host</var> be the value of the <span
-   title="url-host"><host></span> component of <var title="">url</var>, <span>converted to
+   <li><p>Let <var title="">host</var> be the value of the resulting <span>parsed URL</span>'s <span
+   title="concept-url-host">host</span> component, <span>converted to
    ASCII lowercase</span>.</p></li> <!-- at this point this is Punycode-encoded already -->
 
-   <li><p>If <var title="">url</var> has a <span title="url-port"><port></span> component,
+   <li><p>If the resulting <span>parsed URL</span> has a <span title="concept-url-port">port</span> component that is not the empty string,
    then let <var title="">port</var> be that component's value; otherwise, there is no explicit <var
    title="">port</var>.</p></li>
 
@@ -95927,17 +95226,16 @@
    false, let <var title="">port</var> be 80, otherwise let <var title="">port</var> be
    443.</p></li>
 
-   <li><p>Let <var title="">resource name</var> be the value of the <span
-   title="url-path"><path></span> component (which might be empty) of <var
-   title="">url</var>.</p></li> <!-- at this point this is UTF-8 encoded and %-escaped -->
+   <li><p>Let <var title="">resource name</var> be the value of the resulting <span>parsed URL</span>'s <span
+   title="concept-url-path">path</span> component (which might be empty).</p></li> <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>If <var title="">resource name</var> is the empty string, set it to a single character
    U+002F SOLIDUS (/).</p></li>
 
-   <li><p>If <var title="">url</var> has a <span title="url-query"><query></span> component,
+   <li><p>If the resulting <span>parsed URL</span> has a non-null <span title="concept-url-query">query</span> component,
    then append a single U+003F QUESTION MARK character (?) to <var title="">resource name</var>,
-   followed by the value of the <span title="url-query"><query></span> component.</p></li>
-   <!-- at this point this is UTF-8 encoded and %-escaped -->
+   followed by the value of the <span title="concept-url-query">query</span> component.</p></li>
+   <!-- at this point this is UTF-8 encoded and percent encoded -->
 
    <li><p>Return <var title="">host</var>, <var title="">port</var>, <var title="">resource
    name</var>, and <var title="">secure</var>.</p></li>
@@ -98680,7 +97978,7 @@
   <p class="note">Whether the attributes in the table above are
   conforming or not is defined by other specifications (e.g. the SVG
   and MathML specifications); this section only describes the syntax
-  rules if the attributes are serialised using the HTML syntax.</p>
+  rules if the attributes are serialized using the HTML syntax.</p>
 
 
   <h5>Optional tags</h5>
@@ -103726,9 +103024,8 @@
     <span>absolute URL</span>, relative to the newly created element,
     and if that is successful, run the <span
     title="concept-appcache-init">application cache selection
-    algorithm</span> with the resulting <span>absolute URL</span> with
-    any <span title="url-fragment"><fragment></span> component
-    removed; otherwise, if there is no such attribute, or its value is
+    algorithm</span> with the result of applying the <span>URL serializer</span> algorithm to
+    the resulting <span>parsed URL</span> with the <i>exclude fragment flag</i> set; otherwise, if there is no such attribute, or its value is
     the empty string, or resolving its value fails, run the <span
     title="concept-appcache-init">application cache selection
     algorithm</span> with no manifest. The algorithm must be passed
@@ -119862,12 +119159,6 @@
    <dd><cite><a
    href="http://tools.ietf.org/html/rfc3864">Registration Procedures for Message Header Fields</a></cite>, G. Klyne, M. Nottingham, J. Mogul. IETF.</dd>
 
-   <dt id="refsRFC3986">[RFC3986]</dt>
-   <dd><cite><a href="http://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a></cite>, T. Berners-Lee, R. Fielding, L. Masinter. IETF.</dd>
-
-   <dt id="refsRFC3987">[RFC3987]</dt>
-   <dd><cite><a href="http://tools.ietf.org/html/rfc3987">Internationalized Resource Identifiers (IRIs)</a></cite>, M. Dürst, M. Suignard. IETF.</dd>
-
    <dt id="refsRFC4281">[RFC4281]</dt>
    <dd><cite><a href="http://tools.ietf.org/html/rfc4281">The Codecs Parameter for "Bucket" Media Types</a></cite>, R. Gellens, D. Singer, P. Frojdh. IETF.</dd>
 
@@ -119951,6 +119242,9 @@
    <dt id="refsUNIVCHARDET">[UNIVCHARDET]</dt>
    <dd>(Non-normative) <cite><a href="http://www.mozilla.org/projects/intl/UniversalCharsetDetection.html">A composite approach to language/encoding detection</a></cite>, S. Li, K. Momoi. Netscape. In <cite>Proceedings of the 19th International Unicode Conference</cite>.</dd>
 
+   <dt id="refsURL">[URL]</dt>
+   <dd><cite><a href="http://url.spec.whatwg.org/">URL</a></cite>, A. van Kestern. WHATWG.</dd>
+
    <dt id="refsUTF7">[UTF7]</dt>
    <dd><cite><a href="http://tools.ietf.org/html/rfc2152">UTF-7: A Mail-Safe Transformation Format of Unicode</a></cite>, D. Goldsmith, M. Davis. IETF.</dd>
 




More information about the Commit-Watchers mailing list