Skip to content
Permalink
Browse files

[giow] (0) Update handling of the <base>.href IDL attribute and clari…

…fy how 'document's base URL' is defined.

Affected topics: HTML, WebSocket API

git-svn-id: http://svn.whatwg.org/webapps@7266 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Aug 24, 2012
1 parent fe059f1 commit cc28556bffe0add7ce4353c8e6b2af0e1b4a5641
Showing with 292 additions and 171 deletions.
  1. +93 −56 complete.html
  2. +93 −56 index
  3. +106 −59 source
<ol>
<li><a href=#terminology-0><span class=secno>2.6.1 </span>Terminology</a></li>
<li><a href=#parsing-urls><span class=secno>2.6.2 </span>Parsing URLs</a></li>
<li><a href=#resolving-urls><span class=secno>2.6.3 </span>Resolving URLs</a></li>
<li><a href=#url-manipulation-and-creation><span class=secno>2.6.4 </span>URL manipulation and creation</a></li>
<li><a href=#dynamic-changes-to-base-urls><span class=secno>2.6.5 </span>Dynamic changes to base URLs</a></li>
<li><a href=#interfaces-for-url-manipulation><span class=secno>2.6.6 </span>Interfaces for URL manipulation</a></ol></li>
<li><a href=#base-urls><span class=secno>2.6.3 </span>Base URLs</a></li>
<li><a href=#resolving-urls><span class=secno>2.6.4 </span>Resolving URLs</a></li>
<li><a href=#url-manipulation-and-creation><span class=secno>2.6.5 </span>URL manipulation and creation</a></li>
<li><a href=#dynamic-changes-to-base-urls><span class=secno>2.6.6 </span>Dynamic changes to base URLs</a></li>
<li><a href=#interfaces-for-url-manipulation><span class=secno>2.6.7 </span>Interfaces for URL manipulation</a></ol></li>
<li><a href=#fetching-resources><span class=secno>2.7 </span>Fetching resources</a>
<ol>
<li><a href=#concept-http-equivalent><span class=secno>2.7.1 </span>Protocol concepts</a></li>
</div>


<h4 id=resolving-urls><span class=secno>2.6.3 </span>Resolving URLs</h4>
<h4 id=base-urls><span class=secno>2.6.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
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>

</li>

<!-- http://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/001/ -->

<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><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
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><h4 id=resolving-urls><span class=secno>2.6.4 </span>Resolving URLs</h4>

<p>Resolving a URL is the process of taking a relative URL and
obtaining the absolute URL that it implies.</p>
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>
<!-- http://www.hixie.ch/tests/adhoc/dom/level0/history/pushState/001/ -->

<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 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
let <var title="">fallback base url</var> be 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> instead.</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
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>

<li><p><a href=#parse-a-url title="parse a URL">Parse</a> <var title="">url</var> into its component parts.</li>


<div class=impl>

<h4 id=url-manipulation-and-creation><span class=secno>2.6.4 </span>URL manipulation and creation</h4>
<h4 id=url-manipulation-and-creation><span class=secno>2.6.5 </span>URL manipulation and creation</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

<div class=impl>

<h4 id=dynamic-changes-to-base-urls><span class=secno>2.6.5 </span>Dynamic changes to base URLs</h4>
<h4 id=dynamic-changes-to-base-urls><span class=secno>2.6.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


<!--TOPIC:DOM APIs-->
<h4 id=interfaces-for-url-manipulation><span class=secno>2.6.6 </span>Interfaces for URL manipulation</h4>
<h4 id=interfaces-for-url-manipulation><span class=secno>2.6.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
with <code title=attr-base-target><a href=#attr-base-target>target</a></code> attributes, all but
the first are ignored.</p>

<p>The <dfn id=dom-base-href title=dom-base-href><code>href</code></dfn> and <dfn id=dom-base-target title=dom-base-target><code>target</code></dfn> IDL attributes
must <a href=#reflect>reflect</a> the respective content attributes of the
<p>The <dfn id=dom-base-href title=dom-base-href><code>href</code></dfn> IDL
attribute, on getting, must return the result of running the
following algorithm:

<ol><!-- http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1715 --><li><p>If the <code><a href=#the-base-element>base</a></code> element has no <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute, then return
the <a href=#document-base-url>document base URL</a> and abort these steps.</li>

<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>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
<code><a href=#the-base-element>base</a></code> 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 or
<code><a href=#the-base-element>base</a></code> elements).</li>

<li><p>If the previous step was successful, return the resulting
<a href=#absolute-url>absolute URL</a> and abort these steps.</li>

<li><p>Otherwise, return the empty string.</li>

</ol><p>The <code title=dom-base-href><a href=#dom-base-href>href</a></code> IDL attribute, on
setting, must set the <code title=attr-base-href><a href=#attr-base-href>href</a></code>
content attribute to the given new value.</p>

<p>The <dfn id=dom-base-target title=dom-base-target><code>target</code></dfn> IDL
attribute must <a href=#reflect>reflect</a> the content attribute of the
same name.</p>

</div>

0 comments on commit cc28556

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