Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[giowt] (2) Define how a URL is established as being 'hierarchical' o…
…r 'authority-based'.

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

git-svn-id: http://svn.whatwg.org/webapps@4965 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Apr 4, 2010
1 parent 78fd827 commit 7cacbc9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 31 deletions.
31 changes: 21 additions & 10 deletions complete.html
Expand Up @@ -5557,6 +5557,16 @@ <h4 id=terminology-0><span class=secno>2.5.1 </span>Terminology</h4>
<span>absolute Web address</span> as defined by the Web addresses
specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>

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

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

<div class=impl>

<p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
Expand Down Expand Up @@ -5845,42 +5855,42 @@ <h4 id=interfaces-for-url-manipulation><span class=secno>2.5.3 </span>Interfaces
<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>&lt;hostport&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
<td>&mdash;
<td>&mdash;
<td>&mdash;
<td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<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>&lt;host&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
<td>&mdash;
<td>&mdash;
<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 hierarchical and uses a server-based naming authority
<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>&lt;port&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical, uses a server-based naming authority, and contained a <a href=#url-port title=url-port>&lt;port&gt;</a> component (possibly an empty one)
<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>&lt;port&gt;</a> component (possibly an empty one)
<td>&mdash;
<td>&mdash;
<td>Remove all characters in the new value from the first that is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), 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 hierarchical and uses a server-based naming authority,
<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 interpretted 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>&lt;path&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
<td>&mdash;
<td>&mdash;
<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>&lt;query&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical, and contained a <a href=#url-query title=url-query>&lt;query&gt;</a> component (possibly an empty one)
<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>&lt;query&gt;</a> component (possibly an empty one)
<td>U+003F QUESTION MARK (?)
<td>&mdash;
<td>Remove one leading U+003F QUESTION MARK character (?), if any
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
<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>&lt;fragment&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> contained a non-empty <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a> component
Expand Down Expand Up @@ -55095,7 +55105,8 @@ <h4 id=the-history-interface><span class=secno>6.4.2 </span>The <code><a href=#h

</ol><p>For the purposes of the comparisons in the above substeps, the
<a href=#url-path title=url-path>&lt;path&gt;</a> and <a href=#url-query title=url-query>&lt;query&gt;</a> components can only be the
same if the URLs use a hierarchical <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a>.</p>
same if the URLs are both <a href=#hierarchical-url title="hierarchical
URL">hierarchical URLs</a>.</p>

</li>

Expand Down
31 changes: 21 additions & 10 deletions index
Expand Up @@ -5455,6 +5455,16 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<span>absolute Web address</span> as defined by the Web addresses
specification. <a href=#refsWEBADDRESSES>[WEBADDRESSES]</a></p>

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

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

<div class=impl>

<p>To <dfn id=parse-a-url>parse a URL</dfn> <var title="">url</var> into its
Expand Down Expand Up @@ -5743,42 +5753,42 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<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>&lt;hostport&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
<td>&mdash;
<td>&mdash;
<td>&mdash;
<td>The new value is not the empty string and <a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<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>&lt;host&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical and uses a server-based naming authority
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is an <a href=#authority-based-url>authority-based URL</a>
<td>&mdash;
<td>&mdash;
<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 hierarchical and uses a server-based naming authority
<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>&lt;port&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical, uses a server-based naming authority, and contained a <a href=#url-port title=url-port>&lt;port&gt;</a> component (possibly an empty one)
<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>&lt;port&gt;</a> component (possibly an empty one)
<td>&mdash;
<td>&mdash;
<td>Remove all characters in the new value from the first that is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), 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 hierarchical and uses a server-based naming authority,
<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 interpretted 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>&lt;path&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is a <a href=#hierarchical-url>hierarchical URL</a>
<td>&mdash;
<td>&mdash;
<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>&lt;query&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical, and contained a <a href=#url-query title=url-query>&lt;query&gt;</a> component (possibly an empty one)
<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>&lt;query&gt;</a> component (possibly an empty one)
<td>U+003F QUESTION MARK (?)
<td>&mdash;
<td>Remove one leading U+003F QUESTION MARK character (?), if any
<td><a href=#concept-uda-input title=concept-uda-input>input</a> is hierarchical
<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>&lt;fragment&gt;</a>
<td><a href=#concept-uda-input title=concept-uda-input>input</a> contained a non-empty <a href=#url-fragment title=url-fragment>&lt;fragment&gt;</a> component
Expand Down Expand Up @@ -54996,7 +55006,8 @@ x === this; // true</pre>

</ol><p>For the purposes of the comparisons in the above substeps, the
<a href=#url-path title=url-path>&lt;path&gt;</a> and <a href=#url-query title=url-query>&lt;query&gt;</a> components can only be the
same if the URLs use a hierarchical <a href=#url-scheme title=url-scheme>&lt;scheme&gt;</a>.</p>
same if the URLs are both <a href=#hierarchical-url title="hierarchical
URL">hierarchical URLs</a>.</p>

</li>

Expand Down
33 changes: 22 additions & 11 deletions source
Expand Up @@ -5020,6 +5020,17 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<span>absolute Web address</span> as defined by the Web addresses
specification. <a href="#refsWEBADDRESSES">[WEBADDRESSES]</a></p>

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

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

<div class="impl">

<p>To <dfn>parse a URL</dfn> <var title="">url</var> into its
Expand Down Expand Up @@ -5355,46 +5366,46 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<tr>
<td><dfn title="dom-uda-host"><code>host</code></dfn>
<td><span title="url-hostport">&lt;hostport&gt;</span>
<td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
<td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
<td>&mdash;
<td>&mdash;
<td>&mdash;
<td>The new value is not the empty string and <span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
<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">&lt;host&gt;</span>
<td><span title="concept-uda-input">input</span> is hierarchical and uses a server-based naming authority
<td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>
<td>&mdash;
<td>&mdash;
<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 hierarchical and uses a server-based naming authority
<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">&lt;port&gt;</span>
<td><span title="concept-uda-input">input</span> is hierarchical, uses a server-based naming authority, and contained a <span title="url-port">&lt;port&gt;</span> component (possibly an empty one)
<td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>, and contained a <span title="url-port">&lt;port&gt;</span> component (possibly an empty one)
<td>&mdash;
<td>&mdash;
<td>Remove all characters in the new value from the first that is not in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT NINE (9), 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 hierarchical and uses a server-based naming authority,
<td><span title="concept-uda-input">input</span> is an <span>authority-based URL</span>,
and the new value, when interpretted 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">&lt;path&gt;</span>
<td><span title="concept-uda-input">input</span> is hierarchical
<td><span title="concept-uda-input">input</span> is a <span>hierarchical URL</span>
<td>&mdash;
<td>&mdash;
<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">&lt;query&gt;</span>
<td><span title="concept-uda-input">input</span> is hierarchical, and contained a <span title="url-query">&lt;query&gt;</span> component (possibly an empty one)
<td><span title="concept-uda-input">input</span> is a <span>hierarchical URL</span>, and contained a <span title="url-query">&lt;query&gt;</span> component (possibly an empty one)
<td>U+003F QUESTION MARK (?)
<td>&mdash;
<td>Remove one leading U+003F QUESTION MARK character (?), if any
<td><span title="concept-uda-input">input</span> is hierarchical
<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">&lt;fragment&gt;</span>
Expand Down Expand Up @@ -62012,8 +62023,8 @@ x === this; // true</pre>
<p>For the purposes of the comparisons in the above substeps, the
<span title="url-path">&lt;path&gt;</span> and <span
title="url-query">&lt;query&gt;</span> components can only be the
same if the URLs use a hierarchical <span
title="url-scheme">&lt;scheme&gt;</span>.</p>
same if the URLs are both <span title="hierarchical
URL">hierarchical URLs</span>.</p>

</li>

Expand Down

0 comments on commit 7cacbc9

Please sign in to comment.