Skip to content

Commit

Permalink
Take another stab at defining relative/absolute/base URL.
Browse files Browse the repository at this point in the history
  • Loading branch information
annevk committed Feb 14, 2013
1 parent 4253baf commit 1d5e2bf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 30 deletions.
25 changes: 10 additions & 15 deletions url.html
Original file line number Diff line number Diff line change
Expand Up @@ -587,16 +587,15 @@ <h2 id="urls"><span class="secno">5 </span>URLs</h2>
followed by a <a href="#concept-url-fragment" title="concept-url-fragment">fragment</a>.

<p>A <dfn id="concept-relative-url" title="concept-relative-url">relative URL</dfn> is a
<a href="#concept-url" title="concept-url">URL</a> that is relative to a
<a href="#concept-parsed-url" title="concept-parsed-url">parsed URL</a>. Such a
<a href="#concept-parsed-url" title="concept-parsed-url">parsed URL</a> is a
<dfn id="concept-base-url" title="concept-base-url">base URL</dfn>. If the
<a href="#concept-base-url" title="concept-base-url">base URL</a> has no
<a href="#relative-scheme">relative scheme</a>, <a href="#concept-url-parser" title="concept-url-parser">parsing</a>
the <a href="#concept-relative-url" title="concept-relative-url">relative URL</a> results in failure.
<a href="#concept-url" title="concept-url">URL</a> without a <a href="#concept-url-scheme" title="concept-url-scheme">scheme</a>.
A <a href="#concept-relative-url" title="concept-relative-url">relative URL</a> must be relative
to a <a href="#concept-base-url" title="concept-base-url">base URL</a>.

<p>An <dfn id="concept-absolute-url" title="concept-absolute-url">absolute URL</dfn> stands on its own
and is therefore a potential <a href="#concept-base-url" title="concept-base-url">base URL</a>.
<p>An <dfn id="concept-absolute-url" title="concept-absolute-url">absolute URL</dfn> is a
<a href="#concept-url" title="concept-url">URL</a> with a <a href="#concept-url-scheme" title="concept-url-scheme">scheme</a>.

<p>A <dfn id="concept-base-url" title="concept-base-url">base URL</dfn> is an
<a href="#concept-absolute-url" title="concept-absolute-url">absolute URL</a> with a <a href="#relative-scheme">relative scheme</a>.

<p><a href="#concept-url-parser" title="concept-url-parser">Parsing</a> (provided it does not
return failure) and <a href="#concept-url-serializer" title="concept-url-serializer">serializing</a> a
Expand Down Expand Up @@ -682,10 +681,6 @@ <h3 id="writing"><span class="secno">5.1 </span>Writing</h3>
"<code title="">:</code>", optionally followed by a "<code title="">?</code>" and
a <a href="#concept-url-query" title="concept-url-query">query</a>.

<p>A <a href="#concept-relative-url" title="concept-relative-url">relative URL</a> must be relative
to a <a href="#concept-base-url" title="concept-base-url">base URL</a> with a
<a href="#relative-scheme">relative scheme</a>.

<p>A <dfn id="concept-scheme-relative-url" title="concept-scheme-relative-url">scheme-relative URL</dfn> must be
"<code title="">//</code>", optionally followed by
<a href="#concept-url-userinfo" title="concept-url-userinfo">userinfo</a> and "<code title="">@</code>",
Expand Down Expand Up @@ -1819,7 +1814,7 @@ <h2 id="api"><span class="secno">7 </span>API</h2>
<dfn id="concept-uu-set-the-input" title="concept-UU-set-the-input">set the input</dfn> run these steps:

<ol>
<li><p>Set <a href="#concept-uu-url" title="concept-UU-url">url</a> null.
<li><p>Set <a href="#concept-uu-url" title="concept-UU-url">url</a> to null.

<li><p>Set <a href="#concept-uu-input" title="concept-UU-input">input</a> to the given value.

Expand Down Expand Up @@ -1872,7 +1867,7 @@ <h3 id="constructors"><span class="secno">7.1 </span>Constructors</h3> <!-- "con
<a class="external" data-anolis-spec="dom" href="http://dom.spec.whatwg.org/#concept-throw" title="concept-throw">throw</a> an
"<a href="http://dom.spec.whatwg.org/#syntaxerror"><code class="external" data-anolis-spec="dom">SyntaxError</code></a>" exception.

<li><p>Let <var title="">result</var> be a new <code>URL object</code>.
<li><p>Let <var title="">result</var> be a new <a href="#url"><code>URL</code></a> object.

<li><p>Let <var title="">result</var>'s
<a href="#concept-uu-get-the-base" title="concept-UU-get-the-base">get the base</a> return <var title="">base</var>.
Expand Down
25 changes: 10 additions & 15 deletions url.src.html
Original file line number Diff line number Diff line change
Expand Up @@ -564,16 +564,15 @@ <h2>URLs</h2>
followed by a <span title=concept-url-fragment>fragment</span>.

<p>A <dfn title=concept-relative-url>relative URL</dfn> is a
<span title=concept-url>URL</span> that is relative to a
<span title=concept-parsed-url>parsed URL</span>. Such a
<span title=concept-parsed-url>parsed URL</span> is a
<dfn title=concept-base-url>base URL</dfn>. If the
<span title=concept-base-url>base URL</span> has no
<span>relative scheme</span>, <span title=concept-url-parser>parsing</span>
the <span title=concept-relative-url>relative URL</span> results in failure.
<span title=concept-url>URL</span> without a <span title=concept-url-scheme>scheme</span>.
A <span title=concept-relative-url>relative URL</span> must be relative
to a <span title=concept-base-url>base URL</span>.

<p>An <dfn title=concept-absolute-url>absolute URL</dfn> stands on its own
and is therefore a potential <span title=concept-base-url>base URL</span>.
<p>An <dfn title=concept-absolute-url>absolute URL</dfn> is a
<span title=concept-url>URL</span> with a <span title=concept-url-scheme>scheme</span>.

<p>A <dfn title=concept-base-url>base URL</dfn> is an
<span title=concept-absolute-url>absolute URL</span> with a <span>relative scheme</span>.

<p><span title=concept-url-parser>Parsing</span> (provided it does not
return failure) and <span title=concept-url-serializer>serializing</span> a
Expand Down Expand Up @@ -659,10 +658,6 @@ <h3>Writing</h3>
"<code title>:</code>", optionally followed by a "<code title>?</code>" and
a <span title=concept-url-query>query</span>.

<p>A <span title=concept-relative-url>relative URL</span> must be relative
to a <span title=concept-base-url>base URL</span> with a
<span>relative scheme</span>.

<p>A <dfn title=concept-scheme-relative-url>scheme-relative URL</dfn> must be
"<code title>//</code>", optionally followed by
<span title=concept-url-userinfo>userinfo</span> and "<code title>@</code>",
Expand Down Expand Up @@ -1796,7 +1791,7 @@ <h2>API</h2>
<dfn title=concept-UU-set-the-input>set the input</dfn> run these steps:

<ol>
<li><p>Set <span title=concept-UU-url>url</span> null.
<li><p>Set <span title=concept-UU-url>url</span> to null.

<li><p>Set <span title=concept-UU-input>input</span> to the given value.

Expand Down Expand Up @@ -1849,7 +1844,7 @@ <h3>Constructors</h3> <!-- "constructor" causes dfn.js to fail -->
<span data-anolis-spec=dom title=concept-throw>throw</span> an
"<code data-anolis-spec=dom>SyntaxError</code>" exception.

<li><p>Let <var title>result</var> be a new <code>URL object</code>.
<li><p>Let <var title>result</var> be a new <code>URL</code> object.

<li><p>Let <var title>result</var>'s
<span title=concept-UU-get-the-base>get the base</span> return <var title>base</var>.
Expand Down

0 comments on commit 1d5e2bf

Please sign in to comment.