W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2007

[whatwg] adoption agency parse errors

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 19 Jun 2007 03:30:27 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.0706190110290.26929@dhalsim.dreamhost.com>
On Sun, 14 Jan 2007, Anne van Kesteren wrote:
>
> Is it correct that:
> 
>  <!doctype html><i><p><b></i>
> 
> throws exactly two parse errors because of step 1, paragraph 3 of the 
> adoption agency algorithm. (Since you need to iterate two times through 
> it the </i> will hit there twice.) Some of the submitted testcases from 
> Google to html5lib assume a single error.

My parser explicitly avoided reporting that particular error more than 
once per invokation of the AAA. Exactly how many parse errors are reported 
is up to the implementation, so long as it fits this criteria:

# 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 conditions exist in the document. Conformance 
# checkers are not required to recover from parse errors.

Generally speaking, from a UI point of view, you want to only report one 
error per correction that the user has to make. For example, if the user 
omitted a quote mark in a string in a script and that caused the string's 
contents to be treated as code, you'd ideally just want the compiler to 
say "missing quote mark", not start listing all the contents of the string 
and say how each part in turn isn't valid script. Sadly, this is often 
quite difficult to achieve!

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 18 June 2007 20:30:27 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:56 UTC