Re: [whatwg/url] Is failure ever not a syntax violation? (#219)

I think we should just define a "syntax violation" as when the canonicalized URL string is not exactly equal to the input and leave it to implementers to figure out how they want to check that.  Right now the spec is missing mentioning many syntax violations.  I implemented a parser that has 67 references to syntaxViolation in https://trac.webkit.org/browser/trunk/Source/WebCore/platform/URLParser.cpp because I wanted to be efficient and use the same ref-counted immutable String object if I can, but a valid parser could parse into a different structure and have the serialization always create a string of some sort.  Such a parser would not need to worry about syntax violations unless the user agent wanted to report syntax violations, and many user agents don't.

-- 
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/219#issuecomment-279027487

Received on Friday, 10 February 2017 18:36:58 UTC