# HG changeset patch # User Sylvain Thénault # Date 1368627683 -7200 # Node ID 269548f2306e44fc1b57fdeb3988adc6791e5044 # Parent 57e564c0118eadfcf98c97d430caeb56aa53eedc [testlib] fix page validator selection. Closes #2869456 * use a validator that checks XML well-formness for the html5 doctype (as a convenient side-effect, it does not choke on e.g. a canvas tag like the HTMLParser does) * use a DTD validator if there is an xml declaration * else use the HTMLValidator diff -r 57e564c0118e -r 269548f2306e devtools/testlib.py --- a/devtools/testlib.py Wed May 15 14:22:51 2013 +0200 +++ b/devtools/testlib.py Wed May 15 16:21:23 2013 +0200 @@ -889,8 +889,12 @@ content_type = view.content_type if content_type is None: content_type = 'text/html' - if content_type in ('text/html', 'application/xhtml+xml'): - if output and output.startswith(''): + # only check XML well-formness since HTMLValidator isn't html5 + # compatible and won't like various other extensions + default_validator = htmlparser.XMLSyntaxValidator + elif output.startswith('