Permalink
Browse files

[e] (0) Move things more towards what people want (details to be sort…

…ed out later by change proposal, I expect).

git-svn-id: http://svn.whatwg.org/webapps@4974 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
1 parent 464870f commit befc98ca674669d9daf5ed0d61e61e166450eb5a @Hixie Hixie committed Apr 6, 2010
Showing with 403 additions and 182 deletions.
  1. +125 −58 complete.html
  2. +125 −63 index
  3. +153 −61 source
View
183 complete.html
@@ -181,7 +181,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<hgroup><h1>Web Applications 1.0</h1>
- <h2 class="no-num no-toc">Draft Standard &mdash; 5 April 2010</h2>
+ <h2 class="no-num no-toc">Draft Standard &mdash; 6 April 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -5609,38 +5609,35 @@ <h3 id=urls><span class=secno>2.5 </span>URLs</h3>
<h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
+ <!-- see also: svn diff -r3244:3245 source -->
+
<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 is a
- <span>valid Web address</span> as defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</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 <a href=#url>URL</a> 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 <a href=#url>URL</a> is an <dfn id=absolute-url>absolute URL</dfn> if it is an
- <span>absolute Web address</span> as defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</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>An <a href=#absolute-url>absolute URL</a> is a <dfn id=hierarchical-url>hierarchical URL</dfn> if,
- when <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>&lt;scheme&gt;</a>
- component and it is a U+002F SOLIDUS character (/).</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>An <a href=#absolute-url>absolute URL</a> is an <dfn id=authority-based-url>authority-based URL</dfn>
- if, when <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>&lt;scheme&gt;</a> component and they are both
- U+002F SOLIDUS characters (//).</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 UTF-16. <a href=#refsRFC3987>[RFC3987]</a></li>
+
+ </ul><p>A <a href=#url>URL</a> 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>
<div class=impl>
<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 <span>parse a Web
- address</span> algorithm defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
+ component parts, the user agent must use the <span class=XXX>parse
+ an address</span> algorithm defined by the IRI specification. <a href=#refsRFC3987>[RFC3987]</a></p>
- <p>Parsing a URL results in the following components, again as
- defined by the Web addresses specification:</p>
+ <p>Parsing a URL can fail. If it does not, then results in the
+ following components, again as defined by the IRI specification:</p>
<ul class=brief><li><dfn id=url-scheme title=url-scheme>&lt;scheme&gt;</dfn></li>
<li><dfn id=url-host title=url-host>&lt;host&gt;</dfn></li>
@@ -5650,54 +5647,126 @@ <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
<li><dfn id=url-query title=url-query>&lt;query&gt;</dfn></li>
<li><dfn id=url-fragment title=url-fragment>&lt;fragment&gt;</dfn></li>
<li><dfn id=url-host-specific title=url-host-specific>&lt;host-specific&gt;</dfn></li>
- </ul><p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a>
+ </ul><hr><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 <span>resolve a Web address</span>
- algorithm defined by the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
+ 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>
+
+ <li>
+
+ <p>Let <var title="">encoding</var> be determined as follows:</p>
- <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>
+ <dl class=switch><dt>If the URL had a character encoding defined when the URL was
+ created or defined</dt>
- <ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
- document's address</a>.</li>
+ <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>
+
+ <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>
+
+ </dl></li>
+
+ <li><p>If <var title="">encoding</var> is a UTF-16 encoding, then
+ change the value of <var title="">encoding</var> to UTF-8.</li>
<li>
- <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
+ <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>
- <!-- 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>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>If <var title="">fallback base url</var> 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 let <var title="">fallback base url</var>
- be the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
- <code>Document</code></a> instead.</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>
- </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>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 <a href="#the-document's-address">the
+ document's address</a>.</li>
- <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
- child of <a href=#the-head-element>the <code>head</code> element</a> and 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>.</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
+ context's creation. -->
+
+ <p>If <var title="">fallback base url</var> 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 let <var title="">fallback base url</var>
+ be the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
+ <code>Document</code></a> instead.</p>
+
+ </li>
+
+ <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
+ child of <a href=#the-head-element>the <code>head</code> element</a> and 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>.</li>
+
+ <li><p>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>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>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><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>
+ </ol></li>
+
+ <li><p>Return the result of applying the <span class=XXX>resolve
+ an address</span> algorithm defined by the IRI specification to
+ resolve <var title="">url</var> relative to <var title="">base</var> using encoding <var title="">encoding</var>. <a href=#refsRFC3987>[RFC3987]</a></li>
+
+ </ol></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>
- <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>
+ <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>&lt;scheme&gt;</a> component
+ and it is a U+002F SOLIDUS character (/).</p>
- </ol><p>This specification defines the URL
+ <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>&lt;scheme&gt;</a>
+ component and they are both U+002F SOLIDUS characters (//).</p>
+
+ <hr><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>
@@ -5708,8 +5777,6 @@ <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
<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>
-
<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
View
188 index
@@ -185,7 +185,7 @@
<header class=head id=head><p><a class=logo href=http://www.whatwg.org/ rel=home><img alt=WHATWG src=/images/logo></a></p>
<hgroup><h1>HTML5 (including next generation additions still in development)</h1>
- <h2 class="no-num no-toc">Draft Standard &mdash; 5 April 2010</h2>
+ <h2 class="no-num no-toc">Draft Standard &mdash; 6 April 2010</h2>
</hgroup><p>You can take part in this work. <a href=http://www.whatwg.org/mailing-list>Join the working group's discussion list.</a></p>
<p><strong>Web designers!</strong> We have a <a href=http://blog.whatwg.org/faq/>FAQ</a>, a <a href=http://forums.whatwg.org/>forum</a>, and a <a href=http://www.whatwg.org/mailing-list#help>help mailing list</a> for you!</p>
<!--<p class="impl"><strong>Implementors!</strong> We have a <a href="http://www.whatwg.org/mailing-list#implementors">mailing list</a> for you too!</p>-->
@@ -5507,38 +5507,35 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
+ <!-- see also: svn diff -r3244:3245 source -->
+
<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 is a
- <span>valid Web address</span> as defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</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 <a href=#url>URL</a> 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 <a href=#url>URL</a> is an <dfn id=absolute-url>absolute URL</dfn> if it is an
- <span>absolute Web address</span> as defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</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>An <a href=#absolute-url>absolute URL</a> is a <dfn id=hierarchical-url>hierarchical URL</dfn> if,
- when <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>&lt;scheme&gt;</a>
- component and it is a U+002F SOLIDUS character (/).</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>An <a href=#absolute-url>absolute URL</a> is an <dfn id=authority-based-url>authority-based URL</dfn>
- if, when <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>&lt;scheme&gt;</a> component and they are both
- U+002F SOLIDUS characters (//).</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 UTF-16. <a href=#refsRFC3987>[RFC3987]</a></li>
+
+ </ul><p>A <a href=#url>URL</a> 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>
<div class=impl>
<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 <span>parse a Web
- address</span> algorithm defined by the Web addresses
- specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
+ component parts, the user agent must use the <span class=XXX>parse
+ an address</span> algorithm defined by the IRI specification. <a href=#refsRFC3987>[RFC3987]</a></p>
- <p>Parsing a URL results in the following components, again as
- defined by the Web addresses specification:</p>
+ <p>Parsing a URL can fail. If it does not, then results in the
+ following components, again as defined by the IRI specification:</p>
<ul class=brief><li><dfn id=url-scheme title=url-scheme>&lt;scheme&gt;</dfn></li>
<li><dfn id=url-host title=url-host>&lt;host&gt;</dfn></li>
@@ -5548,54 +5545,126 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn id=url-query title=url-query>&lt;query&gt;</dfn></li>
<li><dfn id=url-fragment title=url-fragment>&lt;fragment&gt;</dfn></li>
<li><dfn id=url-host-specific title=url-host-specific>&lt;host-specific&gt;</dfn></li>
- </ul><p>To <dfn id=resolve-a-url>resolve a URL</dfn> to an <a href=#absolute-url>absolute URL</a>
+ </ul><hr><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 <span>resolve a Web address</span>
- algorithm defined by the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
+ 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>
+
+ <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>
- <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>
+ <dd>The URL character encoding is as defined.</dd>
- <ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
- document's address</a>.</li>
+ <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>
+
+ <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>
+
+ </dl></li>
+
+ <li><p>If <var title="">encoding</var> is a UTF-16 encoding, then
+ change the value of <var title="">encoding</var> to UTF-8.</li>
<li>
- <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
+ <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>
- <!-- 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>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>If <var title="">fallback base url</var> 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 let <var title="">fallback base url</var>
- be the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
- <code>Document</code></a> instead.</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>
- </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>
- <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
- child of <a href=#the-head-element>the <code>head</code> element</a> and 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>.</li>
+ <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>
- <li><p>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>
+ <ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
+ document's address</a>.</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>
+
+ <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
- <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>
+ <!-- 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. -->
- </ol><p>This specification defines the URL
+ <p>If <var title="">fallback base url</var> 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 let <var title="">fallback base url</var>
+ be the <a href=#document-base-url>document base URL</a> of the <a href=#creator-document>creator
+ <code>Document</code></a> instead.</p>
+
+ </li>
+
+ <li><p>If there is no <code><a href=#the-base-element>base</a></code> element that is both a
+ child of <a href=#the-head-element>the <code>head</code> element</a> and 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>.</li>
+
+ <li><p>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>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></li>
+
+ <li><p>Return the result of applying the <span class=XXX>resolve
+ an address</span> algorithm defined by the IRI specification to
+ resolve <var title="">url</var> relative to <var title="">base</var> using encoding <var title="">encoding</var>. <a href=#refsRFC3987>[RFC3987]</a></li>
+
+ </ol></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>&lt;scheme&gt;</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>&lt;scheme&gt;</a>
+ component and they are both U+002F SOLIDUS characters (//).</p>
+
+ <hr><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>
@@ -5606,8 +5675,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<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>
-
<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
@@ -83012,11 +83079,6 @@ interface <a href=#htmldocument>HTMLDocument</a> {
Guidelines (WCAG) 2.0</a></cite>, B. Caldwell, M. Cooper, L. Reid,
G. Vanderheiden. W3C.</dd>
- <dt id=refsWEBADDRESSES>[WEBADDRESSES]</dt>
- <dd><cite><a href=http://www.w3.org/html/wg/href/draft>Web
- addresses in HTML5</a></cite>, D. Connolly,
- C. Sperberg-McQueen.</dd>
-
<dt id=refsWEBIDL>[WEBIDL]</dt>
<!--
<dd><cite><a href="http://www.w3.org/TR/WebIDL/">Web
View
214 source
@@ -5072,39 +5072,44 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<h4>Terminology</h4>
+ <!-- see also: svn diff -r3244:3245 source -->
+
<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 is a
- <span>valid Web address</span> as defined by the Web addresses
- specification. <a href="#refsWEBADDRESSES">[WEBADDRESSES]</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 <span>URL</span> 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 <span>URL</span> is an <dfn>absolute URL</dfn> if it is an
- <span>absolute Web address</span> as defined by the Web addresses
- specification. <a href="#refsWEBADDRESSES">[WEBADDRESSES]</a></p>
+ <li><p>The <span>URL</span> is a valid URI reference <a
+ href="#refsRFC3986">[RFC3986]</a>.</p></li>
- <p>An <span>absolute URL</span> is a <dfn>hierarchical URL</dfn> if,
- when <span title="parse a url">parsed</span>, there is a character
- immediately after the <span title="url-scheme">&lt;scheme&gt;</span>
- component and it is a U+002F SOLIDUS character (/).</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>An <span>absolute URL</span> is an <dfn>authority-based URL</dfn>
- if, when <span title="parse a url">parsed</span>, there are two
- characters immediately after the <span
- title="url-scheme">&lt;scheme&gt;</span> component and they are both
- U+002F SOLIDUS characters (//).</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>
+
+ <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 UTF-16. <a
+ href="#refsRFC3987">[RFC3987]</a></p></li>
+
+ </ul>
+
+ <p>A <span>URL</span> is a <dfn>valid non-empty URL</dfn> if it is a
+ <span>valid URL</span> but it is not the empty string.</p>
<div class="impl">
<p>To <dfn>parse a URL</dfn> <var title="">url</var> into its
- component parts, the user agent must use the <span>parse a Web
- address</span> algorithm defined by the Web addresses
- specification. <a href="#refsWEBADDRESSES">[WEBADDRESSES]</a></p>
+ component parts, the user agent must use the <span class="XXX">parse
+ an address</span> algorithm defined by the IRI specification. <a
+ href="#refsRFC3987">[RFC3987]</a></p>
- <p>Parsing a URL results in the following components, again as
- defined by the Web addresses specification:</p>
+ <p>Parsing a URL can fail. If it does not, then results in the
+ following components, again as defined by the IRI specification:</p>
<ul class="brief">
<li><dfn title="url-scheme">&lt;scheme&gt;</dfn></li>
@@ -5115,63 +5120,152 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn title="url-query">&lt;query&gt;</dfn></li>
<li><dfn title="url-fragment">&lt;fragment&gt;</dfn></li>
<li><dfn title="url-host-specific">&lt;host-specific&gt;</dfn></li>
- </ul>
+ </ul>
+
+ <hr>
<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 <span>resolve a Web address</span>
- algorithm defined by the Web addresses specification. <a
- href="#refsWEBADDRESSES">[WEBADDRESSES]</a></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>
+ 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="">fallback base url</var> be <span>the
- document's address</span>.</p></li>
+ <li><p>Let <var title="">url</var> be the <span>URL</span> being
+ resolved.</p></li>
<li>
- <!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->
+ <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>
+
+ <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>
+
+ <dd>The URL character encoding is the <span>script's URL character
+ encoding</span>.</dd>
- <!-- 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. -->
+ <dt>If the URL came from a DOM node (e.g. from an element)</dt>
- <p>If <var title="">fallback base url</var> is
- <code>about:blank</code>, and the <code>Document</code>'s
- <span>browsing context</span> has a <span>creator browsing
- context</span>, then let <var title="">fallback base url</var>
- be the <span>document base URL</span> of the <span>creator
- <code>Document</code></span> instead.</p>
+ <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 there is no <code>base</code> element that is both a
- child of <span>the <code>head</code> element</span> and has an
- <code title="attr-base-href">href</code> attribute, then the
- <span>document base URL</span> is <var title="">fallback base
- url</var>.</p></li>
+ <li><p>If <var title="">encoding</var> is a UTF-16 encoding, then
+ change the value of <var title="">encoding</var> to UTF-8.</p></li>
- <li><p>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>
- <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>
+ <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>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>
+
+ <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>
- <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>
+
+ <li><p>Let <var title="">fallback base url</var> be <span>the
+ document's address</span>.</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
+ context's creation. -->
+
+ <p>If <var title="">fallback base url</var> is
+ <code>about:blank</code>, and the <code>Document</code>'s
+ <span>browsing context</span> has a <span>creator browsing
+ context</span>, then let <var title="">fallback base url</var>
+ be the <span>document base URL</span> of the <span>creator
+ <code>Document</code></span> instead.</p>
+
+ </li>
+
+ <li><p>If there is no <code>base</code> element that is both a
+ child of <span>the <code>head</code> element</span> and has an
+ <code title="attr-base-href">href</code> attribute, then the
+ <span>document base URL</span> is <var title="">fallback base
+ url</var>.</p></li>
+
+ <li><p>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>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>
+
+ </li>
+
+ <li><p>Return the result of applying the <span class="XXX">resolve
+ an address</span> algorithm defined by the IRI specification to
+ resolve <var title="">url</var> relative to <var
+ title="">base</var> using encoding <var title="">encoding</var>. <a
+ href="#refsRFC3987">[RFC3987]</a></p></li>
</ol>
+ </div>
+
+ <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>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">&lt;scheme&gt;</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">&lt;scheme&gt;</span>
+ component and they are both U+002F SOLIDUS characters (//).</p>
+
+ <hr>
+
<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
@@ -5187,8 +5281,6 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
title="attr-iframe-srcdoc">srcdoc</code> documents</span>. <a
href="#refsABOUT">[ABOUT]</a></p>
- </div>
-
<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

0 comments on commit befc98c

Please sign in to comment.