Skip to content

Commit

Permalink
[giow] (3) Make <base> elements not be affected by changes by to the …
Browse files Browse the repository at this point in the history
…document's address

Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=18459
Affected topics: HTML

git-svn-id: http://svn.whatwg.org/webapps@7962 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jun 12, 2013
1 parent b3886e1 commit b82ddde
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 34 deletions.
34 changes: 24 additions & 10 deletions complete.html
Expand Up @@ -6527,17 +6527,12 @@ <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
</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>
<ol><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 in the <code><a href=#document>Document</a></code>, then the
<a href=#document-base-url>document base URL</a> is the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>;
abort these steps.</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>Otherwise, the <a href=#document-base-url>document base URL</a> is the <a href=#frozen-base-url>frozen base URL</a> of the
first <code><a href=#the-base-element>base</a></code> element in the <code><a href=#document>Document</a></code> that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, in <a href=#tree-order>tree order</a>.</li>

</ol><div class=impl>

Expand Down Expand Up @@ -12468,6 +12463,25 @@ <h4 id=the-base-element><span class=secno>4.2.3 </span>The <dfn><code>base</code
with <code title=attr-base-target><a href=#attr-base-target>target</a></code> attributes, all but
the first are ignored.</p>

<p>A <code><a href=#the-base-element>base</a></code> element that is the first <code><a href=#the-base-element>base</a></code> element with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in a particular <code><a href=#document>Document</a></code> has a
<dfn id=frozen-base-url>frozen base URL</dfn>. The <a href=#frozen-base-url>frozen base URL</a> must be <a href=#set-the-frozen-base-url title="set the frozen
base URL">set</a>, synchronously, whenever any of the following situations occur:</p>

<ul class=brief><li>The <code><a href=#the-base-element>base</a></code> element becomes the first <code><a href=#the-base-element>base</a></code> element in <a href=#tree-order>tree
order</a> with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in its
<code><a href=#document>Document</a></code>.</li>

<li>The <code><a href=#the-base-element>base</a></code> element is the first <code><a href=#the-base-element>base</a></code> element in <a href=#tree-order>tree
order</a> with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in its
<code><a href=#document>Document</a></code>, and its <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute is
changed.</li>

</ul><p>To <dfn id=set-the-frozen-base-url>set the <span>frozen base URL</span></dfn>, <a href=#resolve-a-url title="resolve a URL">resolve</a>
the value of the element's <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute relative to
the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>; if this is successful, set the
<a href=#frozen-base-url>frozen base URL</a> to the <a href=#resulting-absolute-url>resulting absolute URL</a>, otherwise, set the
<a href=#frozen-base-url>frozen base URL</a> to the <a href=#fallback-base-url>fallback base URL</a>.</p>

<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:
Expand Down
34 changes: 24 additions & 10 deletions index
Expand Up @@ -6527,17 +6527,12 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
</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>
<ol><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 in the <code><a href=#document>Document</a></code>, then the
<a href=#document-base-url>document base URL</a> is the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>;
abort these steps.</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>Otherwise, the <a href=#document-base-url>document base URL</a> is the <a href=#frozen-base-url>frozen base URL</a> of the
first <code><a href=#the-base-element>base</a></code> element in the <code><a href=#document>Document</a></code> that has an <code title=attr-base-href><a href=#attr-base-href>href</a></code> attribute, in <a href=#tree-order>tree order</a>.</li>

</ol><div class=impl>

Expand Down Expand Up @@ -12468,6 +12463,25 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p&gt;
with <code title=attr-base-target><a href=#attr-base-target>target</a></code> attributes, all but
the first are ignored.</p>

<p>A <code><a href=#the-base-element>base</a></code> element that is the first <code><a href=#the-base-element>base</a></code> element with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in a particular <code><a href=#document>Document</a></code> has a
<dfn id=frozen-base-url>frozen base URL</dfn>. The <a href=#frozen-base-url>frozen base URL</a> must be <a href=#set-the-frozen-base-url title="set the frozen
base URL">set</a>, synchronously, whenever any of the following situations occur:</p>

<ul class=brief><li>The <code><a href=#the-base-element>base</a></code> element becomes the first <code><a href=#the-base-element>base</a></code> element in <a href=#tree-order>tree
order</a> with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in its
<code><a href=#document>Document</a></code>.</li>

<li>The <code><a href=#the-base-element>base</a></code> element is the first <code><a href=#the-base-element>base</a></code> element in <a href=#tree-order>tree
order</a> with an <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute in its
<code><a href=#document>Document</a></code>, and its <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute is
changed.</li>

</ul><p>To <dfn id=set-the-frozen-base-url>set the <span>frozen base URL</span></dfn>, <a href=#resolve-a-url title="resolve a URL">resolve</a>
the value of the element's <code title=attr-base-href><a href=#attr-base-href>href</a></code> content attribute relative to
the <code><a href=#document>Document</a></code>'s <a href=#fallback-base-url>fallback base URL</a>; if this is successful, set the
<a href=#frozen-base-url>frozen base URL</a> to the <a href=#resulting-absolute-url>resulting absolute URL</a>, otherwise, set the
<a href=#frozen-base-url>frozen base URL</a> to the <a href=#fallback-base-url>fallback base URL</a>.</p>

<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:
Expand Down
44 changes: 30 additions & 14 deletions source
Expand Up @@ -5934,22 +5934,14 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d

<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>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
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>
title="attr-base-href">href</code> attribute in the <code>Document</code>, then the
<span>document base URL</span> is the <code>Document</code>'s <span>fallback base URL</span>;
abort these steps.</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>Otherwise, the <span>document base URL</span> is the <span>frozen base URL</span> of the
first <code>base</code> element in the <code>Document</code> that has an <code
title="attr-base-href">href</code> attribute, in <span>tree order</span>.</p></li>

</ol>

Expand Down Expand Up @@ -12717,6 +12709,30 @@ gave me some of the songs they wrote. I love sharing my music.&lt;/p>
with <code title="attr-base-target">target</code> attributes, all but
the first are ignored.</p>

<p>A <code>base</code> element that is the first <code>base</code> element with an <code
title="attr-base-href">href</code> content attribute in a particular <code>Document</code> has a
<dfn>frozen base URL</dfn>. The <span>frozen base URL</span> must be <span title="set the frozen
base URL">set</span>, synchronously, whenever any of the following situations occur:</p>

<ul class="brief">

<li>The <code>base</code> element becomes the first <code>base</code> element in <span>tree
order</span> with an <code title="attr-base-href">href</code> content attribute in its
<code>Document</code>.</li>

<li>The <code>base</code> element is the first <code>base</code> element in <span>tree
order</span> with an <code title="attr-base-href">href</code> content attribute in its
<code>Document</code>, and its <code title="attr-base-href">href</code> content attribute is
changed.</li>

</ul>

<p>To <dfn>set the <span>frozen base URL</span></dfn>, <span title="resolve a URL">resolve</span>
the value of the element's <code title="attr-base-href">href</code> content attribute relative to
the <code>Document</code>'s <span>fallback base URL</span>; if this is successful, set the
<span>frozen base URL</span> to the <span>resulting absolute URL</span>, otherwise, set the
<span>frozen base URL</span> to the <span>fallback base URL</span>.</p>

<p>The <dfn title="dom-base-href"><code>href</code></dfn> IDL
attribute, on getting, must return the result of running the
following algorithm:
Expand Down

0 comments on commit b82ddde

Please sign in to comment.