W3C home > Mailing lists > Public > public-html-testsuite@w3.org > September 2010

Re: HTML Testing Task Force Conf Call Agenda 9/21/2010

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Tue, 21 Sep 2010 14:21:56 +0100
Message-ID: <4C98B174.9050805@cam.ac.uk>
To: Kris Krueger <krisk@microsoft.com>
CC: "'public-html-testsuite@w3.org'" <public-html-testsuite@w3.org>
Kris Krueger wrote:
> Canvas Tests with Bugs
> #1 http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/toDataURL.jpeg.quality.basic.html
> This test uses a tolerance for pass/fail.
> The spec doesn't guarantee that the pixel array from toDataURL will match across lossless images.

The pixels it's testing are in 8x8 blocks that are pure blue, so the 
lossy part of JPEG (the quantization) only has a single coefficient to 
compress (per component), and it seems unlikely an encoder would be so 
lossy that it would introduce a significant error there.

I think a technically conforming JPEG encoder could choose to replace 
the whole image with solid black, so it's impossible to test 
toDataURL('image/jpeg') in a theoretically correct way, but I think it's 
important to test practical implementations to find real bugs, so 
testing pixels with tolerances seems the most useful thing we can do. If 
a practical implementation slightly exceeds the tolerances then we can 
just increase the tolerances.

> #2 http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/toDataURL.jpeg.quality.basic.html

(I assume this should be toDataURL.jpeg.quality.notnumber)

> '0.01' should be valid input.
> Canvas Spec (http://www.w3.org/TR/html5/the-canvas-element.html)
> "For the purposes of these rules, an argument is considered to be a number if it is converted to 
> an IDL double value by the rules for handling arguments of type any in the Web IDL specification. 
> [WEBIDL]".

http://dev.w3.org/2006/webapi/WebIDL/#es-any - '0.01' is an ECMAScript 
String value, so it's converted to an IDL DOMString value, not an IDL 
double value.

> "The WebIDL for converting an argument to double (http://dev.w3.org/2006/webapi/WebIDL/#es-double)
> states that the first step is to compute ToNumber on the argument passed in, '0.01', which should 
> be valid."

That part isn't relevant, since nothing is triggering the conversion of 
the argument to double.

> #3 http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.missingargs.html
> The assertion in the testcase is no longer exists in the HTML5 spec.  
> The spec use to state that missing arguments should raise a NOT_SUPPORTED_ERR exception.
> However, the latest version does not.

The behaviour should be defined by WebIDL (which is why it was removed 
from HTML5, I believe). I think the currently-specified behaviour is 
that it should throw TypeError due to 
http://dev.w3.org/2006/webapi/WebIDL/#es-operations - is that correct, 
and/or is it the right thing to test for?

> #4 Minor - need to point images to another location, instead of http://excors.googlepages.com/yellow.png

Agreed, especially since googlepages.com shut down over a year ago and 
redirects to a different site now. The files can be moved to any URL 
that's not same-origin as where the tests are run from.

Philip Taylor
Received on Tuesday, 21 September 2010 13:22:29 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:14:29 UTC