[whatwg] Parse errors for invalid characters

Ian Hickson ian at hixie.ch
Tue Nov 26 12:22:52 PST 2013

On Sat, 7 Sep 2013, Geoffrey Sneddon wrote:
> > 
> > [...] this seems ... cubersome ... to implement in a conformance 
> > checker. Which reminds me, does
> > 
> >     # Conformance checkers must report at least one parse error
> >     # condition to the user if one or more parse error conditions exist
> >     # in the document and must not report parse error conditions if none
> >     # exist in the document. Conformance checkers may report more than
> >     # one parse error condition if more than one parse error condition
> >     # exists in the document.
> > 
> > mean validator.nu and Firefox view source are non-conforming because
> > they do nothing about document.write() ?
> > 
> > I think we should exempt conformance checkers from scripts instead.
> They already are. From the "Conformance classes" section:
> > Conformance checkers must check that the input document conforms when parsed
> > without a browsing context (meaning that no scripts are run, and that the
> > parser's scripting flag is disabled), and should also check that the input
> > document conforms when parsed with a browsing context in which scripts
> > execute, and that the scripts never cause non-conforming states to occur
> > other than transiently during script execution itself. (This is only a
> > "SHOULD" and not a "MUST" requirement because it has been proven to be
> > impossible. [COMPUTABLE])


> (I feel like pedanting and pointing out this is untrue — it has not been 
> proven impossible to do, it has been proven impossible to do in general. 

I'm not sure what the distinction is here.

> It wouldn't be that hard to design a conformance checker to check 
> "<html><script>document.write("<p>")</script>".)

It wouldn't be very useful to have a conformance checker only check that 
literal string, and as soon as you start allowing more things, the 
complexity becomes astronomically high very quickly.

But I'm all in favour of conformance checkers checking these things as 
much as possible.

> On the other hand, a JS console can reasonably report parse errors from 
> script, so the parse errors are still worthwhile to have.


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

More information about the whatwg mailing list