Feedback on Philip Taylors Canvas Tests

Here is feedback on the rest of Philip Tayor's tests, tests not listed below seem vaild per the spec.
If other have feedback on Philip tests please send these to the list.

Thanks again for contributing these tests Philip.

-Kris

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.imageData.put.wrongtype.html
Test case doesn't actually test what is stated in the spec...
>From the spec: "If the first argument to the method is null or not an ImageData object then the putImageData() method must raise a TYPE_MISMATCH_ERR exception."

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.strokeRect.zero.4.html
There is nothing in the spec that describes how the stroke width should be applied for a zero-height rect.
The spec only says "the method will draw a line instead (the path for the outline is just a straight line along the non-zero dimension)."

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.drawImage.wrongtype.html
The test description claims that the WebIDL describes that this should throw a TypeError.
This seems to conflict with the canvas spec - "The image argument is an instance of either HTMLImageElement, HTMLCanvasElement, or HTMLVideoElement. If the image is null, the implementation must raise a TYPE_MISMATCH_ERR exception." and "If the first argument isn't an img, canvas, or video element, throws a TYPE_MISMATCH_ERR exception. If the image has no image data, throws an INVALID_STATE_ERR exception."

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/size.attributes.parse.minus.html
This test seems odd - what is it testing?
I don't believe any UA actually passes IMHO.

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/size.attributes.setAttribute.percent.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/size.attributes.parse.percent.html
These tests description indicates that it's a test for 'Parsing of non-negative integers'.
Though I see no negative attributes? Test case bug?


http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/context.unrecognised.nullsuffix.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.composite.operation.nullsuffix.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.pattern.repeat.nullsuffix.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.line.cap.invalid.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.line.join.invalid.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.align.invalid.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.baseline.invalid.html
There is no interoperable consensus among the browsers for how strings should be parsed with a null suffix.
It's also not a part of HTML5 (though seems like a fine test for javascript or webidl, given the interop issues)
I believe we can test canvas without resorting to using null suffixes.


http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.space.collapse.space.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.space.collapse.other.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.space.collapse.start.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.space.collapse.end.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.measure.width.space.html
Spec does not have normative requirements for "space characters" that should be parsed by canvas.
I'd change these tests to be normative rather than a non-normative css+html5 integration test.

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/toDataURL.jpeg.quality.basic.html
This test needs to have its tolerance updated to allow more UA's to pass, if this test gets approved.
Might be better to change this test in some fashion to not have a tolerance value, since the image format is lossy.

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/toDataURL.jpeg.quality.notnumber.html
'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]".   
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."

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.missingargs.html
Test is out of date with the spec, since the spec no longer has normative requirments that states a 'NOT_SUPPORTED_ERR' should be raised.

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.pattern.image.string.html
Test should check for TYPE_MISMATCH_ERR not TypeError per the canvas spec for createPattern

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.pattern.image.broken.html
This is seems incorrect....
All browsers fail because the image's "complete" attribute actually evaluates to true, but the code expects it to be false.  
The test should find an interoperable way to pass in an image who's "complete" attribute is false

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.drawImage.outsidesource.html
Many of the test here are invalid per the latest version of the spec.  The only normative requirements are: "If the numeric arguments don't make sense (e.g. the destination is a 0×0 rectangle), throws an INDEX_SIZE_ERR exception."

http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.baseline.top.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.baseline.bottom.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.baseline.middle.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.baseline.ideographic.html
http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/2d.text.draw.baseline.hanging.html
The tests uses that CanvasTest.ttf font which contains two different contradictory sets of values in <OS/2> and <hhea> tables, both can be used depending on UA or font system.
For example Firefox is using different metrics for regular HTML and Canvas.  
Which one to use is not part of the HTML5 or the OpenType spec.
It's possible to create a Font can be "fixed", so all UAs will use the same value (with high probability) and no longer use '_assertPixlelApprox' that seems to work around this issue?

Received on Tuesday, 4 January 2011 03:51:27 UTC