Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes to file URL path normalization #544

Merged
merged 3 commits into from
Sep 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 11 additions & 25 deletions url.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2175,8 +2175,7 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<ol>
<li><p><a>Validation error</a>.

<li><p>Set <var>url</var>'s <a for=url>host</a> to null and <var>url</var>'s
<a for=url>path</a> to an empty list.
<li><p>Set <var>url</var>'s <a for=url>path</a> to an empty list.
</ol>

<p class=note>This is a (platform-independent) Windows drive letter quirk.
Expand Down Expand Up @@ -2206,22 +2205,20 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti

<ol>
<li>
<p>If <var>base</var> is non-null, <var>base</var>'s <a for=url>scheme</a> is
"<code>file</code>", and the substring from <var>pointer</var> in <var>input</var> does not
<a>start with a Windows drive letter</a>, then:
<p>If <var>base</var> is non-null and <var>base</var>'s <a for=url>scheme</a> is
"<code>file</code>", then:

<ol>
<li><p>Set <var>url</var>'s <a for=url>host</a> to <var>base</var>'s <a for=url>host</a>.

<li>
<p>If <var>base</var>'s <a for=url>path</a>[0] is a
<p>If the substring from <var>pointer</var> in <var>input</var> does not
<a>start with a Windows drive letter</a> and <var>base</var>'s <a for=url>path</a>[0] is a
<a>normalized Windows drive letter</a>, then <a for=list>append</a> <var>base</var>'s
<a for=url>path</a>[0] to <var>url</var>'s <a for=url>path</a>.

<p class=note>This is a (platform-independent) Windows drive letter quirk. Both
<var>url</var>'s and <var>base</var>'s <a for=url>host</a> are null under these conditions
and therefore not copied.
<p class=note>This is a (platform-independent) Windows drive letter quirk.

<li><p>Otherwise, set <var>url</var>'s <a for=url>host</a> to <var>base</var>'s
<a for=url>host</a>.
</ol>

<li><p>Set <var>state</var> to <a>path state</a>, and decrease <var>pointer</var> by 1.
Expand Down Expand Up @@ -2356,14 +2353,8 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
<li>
<p>If <var>url</var>'s <a for=url>scheme</a> is "<code>file</code>", <var>url</var>'s
<a for=url>path</a> <a for=list>is empty</a>, and <var>buffer</var> is a
<a>Windows drive letter</a>, then:

<ol>
<li><p>If <var>url</var>'s <a for=url>host</a> is neither the empty string nor null,
<a>validation error</a>, set <var>url</var>'s <a for=url>host</a> to the empty string.

<li><p>Replace the second code point in <var>buffer</var> with U+003A (:).
</ol>
<a>Windows drive letter</a>, then replace the second code point in <var>buffer</var> with
U+003A (:).

<p class=note>This is a (platform-independent) Windows drive letter quirk.

Expand All @@ -2372,12 +2363,6 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti

<li><p>Set <var>buffer</var> to the empty string.

<li><p>If <var>url</var>'s <a for=url>scheme</a> is "<code>file</code>" and <a>c</a> is the
<a>EOF code point</a>, U+003F (?), or U+0023 (#), then while <var>url</var>'s
<a for=url>path</a>'s <a for=list>size</a> is greater than 1 and <var>url</var>'s
<a for=url>path</a>[0] is the empty string, <a>validation error</a>, <a for=list>remove</a>
the first <a for=list>item</a> from <var>url</var>'s <a for=url>path</a>.

<li><p>If <a>c</a> is U+003F (?), then set <var>url</var>'s <a for=url>query</a> to the empty
string and <var>state</var> to <a>query state</a>.

Expand Down Expand Up @@ -3402,6 +3387,7 @@ Albert Wiersch,
Alex Christensen,
Alexandre Morgaut,
Alexis Hunt,
Alwin Blok,
Andrew Sullivan,
Arkadiusz Michalski,
Behnam Esfahbod,
Expand Down