Re: [whatwg] URL: spec review - basic_parser

On 10/10/2014 08:19 PM, Sam Ruby wrote:
> I've now completed step 1, as described at [1].
>
> Here are my questions/comments:
>
> 1) https://url.spec.whatwg.org/#url-code-points
>     U+D8000 to U+DFFFD are invalid as they are within the UTF-16
>     surrogate range

Disregard this comment, it turns out that this was a bug in my code.

> 2) https://url.spec.whatwg.org/#concept-basic-url-parser
>     I'm interpreting "terminate this algorithm" and "return failure" to
>     mean the same thing, and I'm interpreting "parse error" as "set
>     parse error flag and continue".

I'm inclined to submit a pull request standardizing on "terminate this 
algorithm" and "set parse error".

> 3) https://url.spec.whatwg.org/#authority-state
>     a) Did you really mean prepend in Step 1.1?
>
>     b) Step 1.3.3 seems problematic.  I interpret this prose to mean "if
>        any character in buffer is a "%" and the first two characters
>        after the pointer position in input aren't hex characters".
>        Specifically, it appears to be comparing a possibly
>        non-contiguous set of characters.

I plan to revisit this after I complete my initial testing (i.e. step 2).

> 4) https://url.spec.whatwg.org/#file-host-state
>     Step 1.3.2 returns failure without setting parse_error.  Is this
>     correct?
>
> 5) https://url.spec.whatwg.org/#host-state
>     Step 1.2.2 also returns failure without setting parse_error.

I'm inclined to submit a pull request changing these to to set parse 
error before failing.

> 6) https://url.spec.whatwg.org/#relative-path-state
>     If input contains a path but no query or fragment, the last part of
>     the path will be accumulated into buffer, but that buffer will never
>     be added to the path

Looks like I got confused by the prose in the spec.  I've submitted a 
pull request that makes this point clearer:

   https://github.com/whatwg/url/pull/4

There were a number of places where things weren't clear to me; after I 
complete my technical review and testing verification, I'll go back and 
identify more.  Meanwhile, here is an example:

   https://github.com/whatwg/url/pull/5

- Sam Ruby

> [1] http://lists.w3.org/Archives/Public/www-tag/2014Oct/0053.html

Received on Saturday, 11 October 2014 17:24:31 UTC