Skip to content
Permalink
Browse files

[e] (0) Shift the definition of 'document base URL' back into HTML5.

Fixing http://www.w3.org/Bugs/Public/show_bug.cgi?id=7971

git-svn-id: http://svn.whatwg.org/webapps@4258 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Oct 21, 2009
1 parent 8c281c0 commit c81bcf103e05ad9db6b34b06bd2506f1d9563768
Showing with 129 additions and 9 deletions.
  1. +41 −3 complete.html
  2. +41 −3 index
  3. +47 −3 source
@@ -4869,10 +4869,48 @@ <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
algorithm defined by the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>

<p>The <dfn id=document-base-url>document base URL</dfn> of a <code>Document</code>
object is the <span>document base Web address</span> as defined by
the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
object is the <a href=#absolute-url>absolute URL</a> obtained by running these
substeps:</p>

<p>This specification defines the URL
<ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
document's address</a>.</li>

<li>

<!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->

<!-- XXX 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>Document</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><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. <a href=#refsABOUT>[ABOUT]</a></p>

44 index
@@ -4699,10 +4699,48 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
algorithm defined by the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>

<p>The <dfn id=document-base-url>document base URL</dfn> of a <code>Document</code>
object is the <span>document base Web address</span> as defined by
the Web addresses specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>
object is the <a href=#absolute-url>absolute URL</a> obtained by running these
substeps:</p>

<p>This specification defines the URL
<ol><li><p>Let <var title="">fallback base url</var> be <a href="#the-document's-address">the
document's address</a>.</li>

<li>

<!-- http://www.hixie.ch/tests/adhoc/html/navigation/javascript-url/ -->

<!-- XXX 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>Document</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><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. <a href=#refsABOUT>[ABOUT]</a></p>

50 source
@@ -4280,9 +4280,53 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
href="#refsWEBADDRESSES">[WEBADDRESSES]</a></p>

<p>The <dfn>document base URL</dfn> of a <code>Document</code>
object is the <span>document base Web address</span> as defined by
the Web addresses specification. <a
href="#refsWEBADDRESSES">[WEBADDRESSES]</a></p>
object is the <span>absolute URL</span> obtained by running these
substeps:</p>

<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/ -->

<!-- XXX 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>

<p>This specification defines the URL
<dfn><code>about:legacy-compat</code></dfn> as a reserved, though

0 comments on commit c81bcf1

Please sign in to comment.
You can’t perform that action at this time.