Re: [whatwg/url] Record whether the URL parser removed newlines. (#284)

>  WebKit's implementation doesn't actually spend the extra time to look through the URL twice to check for tabs or newlines, and we should make it as straightforward as possible to implement efficient URL parsers.

I believe putting this into URL makes it possible for us to avoid walking through the URL twice. As @annevk notes, after parsing the URL, the data we're looking for is actually unavailable. We'd have to have a pre-processing step in various callsites in HTML (basically wrapping the URL parsing call with something that holds a variable), which is certainly doable, but strange.

We're already walking through the URL once to remove newlines; recording that state then seems reasonable.

> Do we want these flags to remain independent? If they're only ever used together...

Yeah. I realized this while playing with an implementation in Chrome; I'll update this patch accordingly.

-- 
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/284#issuecomment-303321569

Received on Tuesday, 23 May 2017 08:06:48 UTC