Re: [whatwg/url] "Let pointer be a pointer to first code point in..." (#373)

> Step 11 in specification:
> 
> > 1. Keep running the following state machine by switching on _state_. (1) If after a run _pointer_ points to the EOF code point, go to the next step. (2) Otherwise, increase _pointer_ by one and continue with the state machine.
> 
> From @mattto's [#373 (comment)](https://github.com/whatwg/url/issues/373#issuecomment-365446966):
> 
> > ... Now the state machine step is over, (2) so increase pointer by one and continue. (1) pointer is again pointing to EOF, so the state machine is done.
> 
> The order of (1) and (2) operations here is different than in the spec, so result is incorrect.
> 
> If follow specification, then after (2) operation we enter the "no scheme state":
> 
> > ... set _state_ to relative state and decrease _pointer_ by one.
> 
> Then we enter the "relative state", and `c` is **EOF**:

Hi all,
Let me give my 2 cents ;)
Based on the current wording of the spec, I don't think that we ever get into the 'relative state', thus I would expect to return a new URL (as initially reported by @mattto )
If we've got an empty input then the state machine runs 'scheme start state'
After that run, and according to the spec, we simply go to step 12
> If after a run pointer points to the EOF code point, go to the next step  (-> step 12 return url)

To me we are at EOF after the 1st run since there is no stream per say as there is no content. Quick info from the spec  
> The EOF code point is a conceptual code point that signifies the end of a string or code point stream

So I am puzzled as to how it is possible to enter the "relative state" ? 
Could you please shed some light ? 
Thanks in advance


-- 
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/issues/373#issuecomment-617946702

Received on Wednesday, 22 April 2020 18:18:32 UTC