Skip to content

Commit

Permalink
Remove incorrect note (URLs with scheme data also have query/fragment…
Browse files Browse the repository at this point in the history
…). Rename relative scheme to special scheme.

The renaming is in preparation for
https://lists.w3.org/Archives/Public/public-whatwg-archive/2015Jun/0028.
html as that will give all URLs the ability to be relative.
  • Loading branch information
annevk committed Jun 16, 2015
1 parent 5d4f57c commit d5470b8
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 70 deletions.
61 changes: 25 additions & 36 deletions url.bs
Expand Up @@ -632,10 +632,6 @@ dispatch a <a>URL</a> for further processing after
<dfn id=concept-url-scheme-data lt='URL scheme data'>scheme data</dfn> is a string holding the contents of a
<a>URL</a>. It is initially the empty string.

<p class="note no-backref">A <a>URL</a>'s <a lt="URL scheme data">scheme data</a> will be
its initial value if its <a lt="URL scheme">scheme</a> is a <a>relative scheme</a>, and
will be the only component without an initial value otherwise.

<p>A <a>URL</a>'s <dfn id=concept-url-username lt='URL username'>username</dfn>
is a string identifying a user. It is initially the empty string.

Expand Down Expand Up @@ -665,7 +661,7 @@ It is initially unset.

<p class="note no-backref">The <a>relative flag</a> exists as checking if a
<a>URL</a>'s <a lt='URL scheme'>scheme</a> is a
<a>relative scheme</a> can give incorrect results due to the
<a>special scheme</a> can give incorrect results due to the
<code><a attribute for=URLUtils>protocol</a></code> attribute.
<!-- XXX maybe disallow setting protocol to non-sensical values -->

Expand All @@ -678,16 +674,14 @@ It is initially unset.
URLs, but others can be added going forward, hence "object".


<p>A <dfn>relative scheme</dfn> is a
<a lt='URL scheme'>scheme</a> listed in the first column of
the following table. A <dfn>default port</dfn> is a
<a>relative scheme</a>'s optional corresponding
<a lt='URL port'>port</a> and is listed in the second column
on the same row.
<p>A <dfn>special scheme</dfn> is a <a lt="URL scheme">scheme</a> listed in the first
column of the following table. A <dfn>default port</dfn> is a <a>special scheme</a>'s
optional corresponding <a lt="URL port">port</a> and is listed in the second column on the
same row.

<table>
<tr><th><a lt='URL scheme'>scheme</a>
<th><a lt='URL port'>port</a>
<tr><th><a lt="URL scheme">scheme</a>
<th><a lt="URL port">port</a>
<tr><td>"<code>ftp</code>"<td>"<code>21</code>"
<tr><td>"<code>file</code>"<td>
<tr><td>"<code>gopher</code>"<td>"<code>70</code>"
Expand All @@ -697,7 +691,8 @@ on the same row.
<tr><td>"<code>wss</code>"<td>"<code>443</code>"
</table>

<!-- The best reason I have for listing "gopher" is Google does it too:
<!-- The best reason I have for listing "gopher" is Apple/Google:
https://github.com/WebKit/webkit/blob/master/Source/WebCore/platform/URL.cpp#L72
https://code.google.com/p/google-url/source/browse/trunk/src/url_canon_stdurl.cc#120

It seems fine to remain compatible on that front, no need to support it
Expand Down Expand Up @@ -734,19 +729,15 @@ the <a>URL parser</a> when the input is potentially a
"<code>#</code>" and a
<a lt='URL fragment'>fragment</a>.

<p>An <dfn id=concept-absolute-url lt='absolute URL'>absolute URL</dfn> must be a
<a lt='URL scheme'>scheme</a>, followed by
"<code>:</code>", followed by either a
<a>scheme-relative URL</a>, if
<a lt='URL scheme'>scheme</a> is a <a>relative scheme</a>, or
<a lt='URL scheme data'>scheme data</a> otherwise, optionally followed
by "<code>?</code>" and a <a lt='URL query'>query</a>.

<p>A <a lt='URL scheme'>scheme</a> must be one
<a>ASCII alpha</a>, followed by zero or more of
<a>ASCII alphanumeric</a>, "<code>+</code>",
"<code>-</code>", and "<code>.</code>". A
<a lt='URL scheme'>scheme</a> must be registered
<p>An <dfn id=concept-absolute-url lt="absolute URL">absolute URL</dfn> must be a
<a lt="URL scheme">scheme</a>, followed by "<code>:</code>", followed by either a
<a>scheme-relative URL</a>, if <a lt="URL scheme">scheme</a> is a <a>special scheme</a>,
or <a lt="URL scheme data">scheme data</a> otherwise, optionally followed by
"<code>?</code>" and a <a lt="URL query">query</a>.

<p>A <a lt="URL scheme">scheme</a> must be one <a>ASCII alpha</a>, followed by zero or
more of <a>ASCII alphanumeric</a>, "<code>+</code>", "<code>-</code>", and
"<code>.</code>". A <a lt="URL scheme">scheme</a> must be registered
<span class=XXX>...</span>.

<p>The syntax of <a lt='URL scheme data'>scheme data</a>
Expand Down Expand Up @@ -972,10 +963,8 @@ optionally with an <a>encoding</a>
<li><p>If <var>state override</var> is given,
terminate this algorithm.

<li><p>If <var>url</var>'s
<a lt='URL scheme'>scheme</a> is
a <a>relative scheme</a>, set <var>url</var>'s
<a>relative flag</a>.
<li><p>If <var>url</var>'s <a lt="URL scheme">scheme</a> is a
<a>special scheme</a>, set <var>url</var>'s <a>relative flag</a>.

<li><p>If <var>url</var>'s
<a lt='URL scheme'>scheme</a> is
Expand Down Expand Up @@ -1045,16 +1034,16 @@ optionally with an <a>encoding</a>

<dt><dfn>no scheme state</dfn>
<dd>
<p>If <var>base</var> is null, or <var>base</var>'s
<a lt='URL scheme'>scheme</a> is not a <a>relative scheme</a> and <a>c</a> is not
"<code>#</code>", <a>parse error</a>, return failure.
<p>If <var>base</var> is null, or <var>base</var>'s <a lt="URL scheme">scheme</a> is
not a <a>special scheme</a> and <a>c</a> is not "<code>#</code>", <a>parse error</a>,
return failure.

<p class=note>Due to the <code><a attribute for=URLUtils>protocol</a></code>
attribute's setter ability to change <var>base</var>'s <a lt="URL scheme">scheme</a>,
<var>base</var>'s <a>relative flag</a> is not used here.

<p>Otherwise, if <var>base</var>'s <a lt="URL scheme">scheme</a> is not a
<a>relative scheme</a> and <a>c</a> is "<code>#</code>", set
<a>special scheme</a> and <a>c</a> is "<code>#</code>", set
<var>url</var>'s <a lt="URL scheme">scheme</a> to
<var>base</var>'s <a lt="URL scheme">scheme</a>
<var>url</var>'s <a lt="URL scheme data">scheme data</a> to
Expand Down Expand Up @@ -1630,7 +1619,7 @@ optionally with an <a>encoding</a>

<p class=note>Unfortunately not using <a lt="percent encode">percent-encoding</a> is intentional as
implementations with majority market share exhibit this behavior.
<!-- Chrome does percent-encoding if the scheme is not a relative scheme,
<!-- Chrome does percent-encoding if the scheme is not a special scheme,
hopefully that can be aligned since flip-flopping is not great. -->
</ol>
</dl>
Expand Down
55 changes: 21 additions & 34 deletions url.html
Expand Up @@ -1008,11 +1008,6 @@ <h2 class="heading settled" data-level="4" id="urls"><span class="secno">4. </sp
<dfn data-dfn-type="dfn" data-lt="URL scheme data" data-noexport="" id="concept-url-scheme-data">scheme data<a class="self-link" href="#concept-url-scheme-data"></a></dfn> is a string holding the contents of a
<a data-link-type="dfn" href="#concept-url">URL</a>. It is initially the empty string.

</p>
<p class="note no-backref" role="note">A <a data-link-type="dfn" href="#concept-url">URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme-data">scheme data</a> will be
its initial value if its <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is a <a data-link-type="dfn" href="#relative-scheme">relative scheme</a>, and
will be the only component without an initial value otherwise.

</p>
<p>A <a data-link-type="dfn" href="#concept-url">URL</a>’s <dfn data-dfn-type="dfn" data-lt="URL username" data-noexport="" id="concept-url-username">username<a class="self-link" href="#concept-url-username"></a></dfn>
is a string identifying a user. It is initially the empty string.
Expand Down Expand Up @@ -1051,7 +1046,7 @@ <h2 class="heading settled" data-level="4" id="urls"><span class="secno">4. </sp
</p>
<p class="note no-backref" role="note">The <a data-link-type="dfn" href="#relative-flag">relative flag</a> exists as checking if a
<a data-link-type="dfn" href="#concept-url">URL</a>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is a
<a data-link-type="dfn" href="#relative-scheme">relative scheme</a> can give incorrect results due to the
<a data-link-type="dfn" href="#special-scheme">special scheme</a> can give incorrect results due to the
<code><a class="idl-code" data-link-type="attribute" href="#dom-urlutils-protocol">protocol</a></code> attribute.


Expand All @@ -1067,12 +1062,10 @@ <h2 class="heading settled" data-level="4" id="urls"><span class="secno">4. </sp


</p>
<p>A <dfn data-dfn-type="dfn" data-noexport="" id="relative-scheme">relative scheme<a class="self-link" href="#relative-scheme"></a></dfn> is a
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a> listed in the first column of
the following table. A <dfn data-dfn-type="dfn" data-noexport="" id="default-port">default port<a class="self-link" href="#default-port"></a></dfn> is a
<a data-link-type="dfn" href="#relative-scheme">relative scheme</a>’s optional corresponding
<a data-link-type="dfn" href="#concept-url-port">port</a> and is listed in the second column
on the same row.
<p>A <dfn data-dfn-type="dfn" data-noexport="" id="special-scheme">special scheme<a class="self-link" href="#special-scheme"></a></dfn> is a <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> listed in the first
column of the following table. A <dfn data-dfn-type="dfn" data-noexport="" id="default-port">default port<a class="self-link" href="#default-port"></a></dfn> is a <a data-link-type="dfn" href="#special-scheme">special scheme</a>’s
optional corresponding <a data-link-type="dfn" href="#concept-url-port">port</a> and is listed in the second column on the
same row.

</p>
<table>
Expand Down Expand Up @@ -1155,19 +1148,15 @@ <h3 class="heading settled" data-level="4.1" id="url-writing"><span class="secno

</p>
<p>An <dfn data-dfn-type="dfn" data-noexport="" id="concept-absolute-url">absolute URL<a class="self-link" href="#concept-absolute-url"></a></dfn> must be a
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a>, followed by
"<code>:</code>", followed by either a
<a data-link-type="dfn" href="#concept-scheme-relative-url">scheme-relative URL</a>, if
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is a <a data-link-type="dfn" href="#relative-scheme">relative scheme</a>, or
<a data-link-type="dfn" href="#concept-url-scheme-data">scheme data</a> otherwise, optionally followed
by "<code>?</code>" and a <a data-link-type="dfn" href="#concept-url-query">query</a>.

</p>
<p>A <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> must be one
<a data-link-type="dfn" href="#ascii-alpha">ASCII alpha</a>, followed by zero or more of
<a data-link-type="dfn" href="#ascii-alphanumeric">ASCII alphanumeric</a>, "<code>+</code>",
"<code>-</code>", and "<code>.</code>". A
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a> must be registered
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a>, followed by "<code>:</code>", followed by either a
<a data-link-type="dfn" href="#concept-scheme-relative-url">scheme-relative URL</a>, if <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is a <a data-link-type="dfn" href="#special-scheme">special scheme</a>,
or <a data-link-type="dfn" href="#concept-url-scheme-data">scheme data</a> otherwise, optionally followed by
"<code>?</code>" and a <a data-link-type="dfn" href="#concept-url-query">query</a>.

</p>
<p>A <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> must be one <a data-link-type="dfn" href="#ascii-alpha">ASCII alpha</a>, followed by zero or
more of <a data-link-type="dfn" href="#ascii-alphanumeric">ASCII alphanumeric</a>, "<code>+</code>", "<code>-</code>", and
"<code>.</code>". A <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> must be registered
<span class="XXX">...</span>.

</p>
Expand Down Expand Up @@ -1476,10 +1465,8 @@ <h3 class="heading settled" data-level="4.2" id="url-parsing"><span class="secno

</p>
<li>
<p>If <var>url</var>’s
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is
a <a data-link-type="dfn" href="#relative-scheme">relative scheme</a>, set <var>url</var>’s
<a data-link-type="dfn" href="#relative-flag">relative flag</a>.
<p>If <var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is a
<a data-link-type="dfn" href="#special-scheme">special scheme</a>, set <var>url</var>’s <a data-link-type="dfn" href="#relative-flag">relative flag</a>.

</p>
<li>
Expand Down Expand Up @@ -1590,9 +1577,9 @@ <h3 class="heading settled" data-level="4.2" id="url-parsing"><span class="secno

<dd>

<p>If <var>base</var> is null, or <var>base</var>’s
<a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is not a <a data-link-type="dfn" href="#relative-scheme">relative scheme</a> and <a data-link-type="dfn" href="#c">c</a> is not
"<code>#</code>", <a data-link-type="dfn" href="#parse-error">parse error</a>, return failure.
<p>If <var>base</var> is null, or <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is
not a <a data-link-type="dfn" href="#special-scheme">special scheme</a> and <a data-link-type="dfn" href="#c">c</a> is not "<code>#</code>", <a data-link-type="dfn" href="#parse-error">parse error</a>,
return failure.

</p>
<p class="note" role="note">Due to the <code><a class="idl-code" data-link-type="attribute" href="#dom-urlutils-protocol">protocol</a></code>
Expand All @@ -1601,7 +1588,7 @@ <h3 class="heading settled" data-level="4.2" id="url-parsing"><span class="secno

</p>
<p>Otherwise, if <var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> is not a
<a data-link-type="dfn" href="#relative-scheme">relative scheme</a> and <a data-link-type="dfn" href="#c">c</a> is "<code>#</code>", set
<a data-link-type="dfn" href="#special-scheme">special scheme</a> and <a data-link-type="dfn" href="#c">c</a> is "<code>#</code>", set
<var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a> to
<var>base</var>’s <a data-link-type="dfn" href="#concept-url-scheme">scheme</a>
<var>url</var>’s <a data-link-type="dfn" href="#concept-url-scheme-data">scheme data</a> to
Expand Down Expand Up @@ -4444,7 +4431,6 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li>relative or authority state, <a href="#relative-or-authority-state">4.2</a>
<li>relative path start state, <a href="#relative-path-start-state">4.2</a>
<li>relative path state, <a href="#relative-path-state">4.2</a>
<li>relative scheme, <a href="#relative-scheme">4</a>
<li>relative slash state, <a href="#relative-slash-state">4.2</a>
<li>relative state, <a href="#relative-state">4.2</a>
<li>relative URL, <a href="#concept-relative-url">4.1</a>
Expand All @@ -4463,6 +4449,7 @@ <h3 class="no-num heading settled" id="index-defined-here"><span class="content"
<li>set the password, <a href="#set-the-password">4.2</a>
<li>set the username, <a href="#set-the-username">4.2</a>
<li>simple encode set, <a href="#simple-encode-set">2</a>
<li>special scheme, <a href="#special-scheme">4</a>
<li>stringification behavior
<ul>
<li>dfn for URLUtils, <a href="#URLUtils-stringification-behavior">6</a>
Expand Down

0 comments on commit d5470b8

Please sign in to comment.