Re: [whatwg/dom] Validating a qualified name does not match browsers in a corner case (#319)

> We could try to rewrite our validation algorithm to produce the output the spec expects while staying to a single pass, but that code is a bit fiddly, so this would have nontrivial regression risk in practice.

I think we have pretty good tests for this.

> As far as whether the spec is "right"... it's not obvious to me why you consider it "right". It could be rewritten in terms of a slightly more complicated (in spec terms) but simpler to implement as a single pass validation algorithm, and such an algorithm may naturally treat a localName following a ':' but not matching the NCName production because it doesn't start with NameStartChar as being an invalid char err, not a namespace err, because it's not at all a namespace error, afaict.

It's a namespace error insofar as it is valid in XML without namespaces but invalid in XML with namespaces, so the error is only in namespace-land.  I don't know what other meaning you would give to InvalidCharacterError vs. NamespaceError here.

>I think ideally we just throw InvalidCharacterError here and forget about the distinction. We don't have DOM without namespaces after all.

That's very logical, but completely doesn't match browsers.  Am I too optimistic in hoping that maybe changing the exception type is not going to cause compat issues?  If it won't, maybe we can just get everyone to change their exception types.  (Did we succeed in getting rid of DOMError?)

-- 
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/dom/issues/319#issuecomment-257289499

Received on Monday, 31 October 2016 13:11:11 UTC