Re: [whatwg/url] Fix Windows drive letter handling in the file slash state (#343)

annevk commented on this pull request.

Just editorial feedback. I haven't reviewed the new behavior in detail. Did you look at various implementations?

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>
+ <li><p>it contains at least two code points and the first two code points are
+ <a>Windows drive letter</a>.
+
+ <li><p>it contains two code points or the third code point is U+002F (/), U+005C (\), U+003F (?),
+ or U+0023 (#).

its length (xref Infra) is two*

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>
+ <li><p>it contains at least two code points and the first two code points are
+ <a>Windows drive letter</a>.

its length is greater than 1*

I'd give the second requirement its own bullet point since we already AND the whole list

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>

Probably better to use `<ul class=brief>` here without `<p>`s to make it more of a single paragraph.

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>
+ <li><p>it contains at least two code points and the first two code points are
+ <a>Windows drive letter</a>.

Also, no bullet at the end here since the sentence isn't finished

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>
+ <li><p>it contains at least two code points and the first two code points are
+ <a>Windows drive letter</a>.
+
+ <li><p>it contains two code points or the third code point is U+002F (/), U+005C (\), U+003F (?),
+ or U+0023 (#).
+</ul>
+
+<div class=example id=example-starts-with-widows-drive-letter>
+ <table>
+  <tr>
+   <th>String
+   <th>Result

Maybe "Starts with a Windows drive letter" instead of "Result" to make it more clear?

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:

a Windows drive letter*

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:
+
+<ul>
+ <li><p>it contains at least two code points and the first two code points are
+ <a>Windows drive letter</a>.

a Windows drive letter*

> @@ -1834,17 +1861,9 @@ string <var>input</var>, optionally with a <a>base URL</a> <var>base</var>, opti
        <dd>
         <ol>
          <li>
-          <p>If at least one of the following is true
-
-          <ul class=brief>
-           <li><p><a>remaining</a> consists of zero code points
-           <li><p><a>c</a> and the first code point of <a>remaining</a> are not a
-           <a>Windows drive letter</a>
-           <li><p><a>remaining</a> has at least 2 code points and <a>remaining</a>'s second code
-           point is <em>not</em> U+002F (/), U+005C (\), U+003F (?), or U+0023 (#)
-          </ul>
-
-          <p>then set <var>url</var>'s <a for=url>host</a> to <var>base</var>'s <a for=url>host</a>,
+          <p>If the substring from <var>pointer</var> in the <var>input</var> does not

No need for "the" in front of _input_ I think. Do we need to say the substring from pointer onward? We also haven't really defined substring. Not sure if that's problematic.

> @@ -1068,6 +1068,33 @@ code point is U+003A (:).
 <p class="note">As per the <a href=#url-writing>URL writing</a> section, only a
 <a>normalized Windows drive letter</a> is conforming.
 
+<p>A string <dfn>starts with Windows drive letter</dfn> if all of the following are true:

Also, to allow alternative spelling later on use `lt="start with a Windows drive letter|starts with a Windows drive letter"` here.

> @@ -1878,7 +1897,8 @@ 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 and <var>base</var>'s <a for=url>scheme</a> is

s/ and/,/

> @@ -1878,7 +1897,8 @@ 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 and <var>base</var>'s <a for=url>scheme</a> is
-        "<code>file</code>", then:
+        "<code>file</code>" and the substring from <var>pointer</var> in the <var>input</var> does

s/ and/, and/
s/in the/in/

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/url/pull/343#pullrequestreview-62106461

Received on Tuesday, 12 September 2017 12:16:35 UTC