Re: Clarification on Canvas Section 3.10

Jatinder Mann wrote:
> Hi,
> 
> As we continue to review the Canvas 2D API Specification [1] we came
> across an issue in Section 3.10 Images. In the spec, the following
> text appears:
> 
> "If the second argument is not one of the allowed values, throws a
> SYNTAX_ERR exception."
> 
> If you take a look at the function definitions for drawImage in this
> section, the second argument, dx, is the x coordinate of the
> destination Canvas where the image is to be drawn. This is a number.
> Does the SYNTAX_ERR exception occur when a non-number is given as an
> argument? Or was this statement intended for the first argument?

The text occurs in the green box which is "a note to authors describing 
the usage of an interface" (per the "Typographic conventions"), and 
those notes never define any normative requirements (and don't use any 
normative keywords), so they ought to be just repeating (in a simplified 
form) the real implementation requirements that are described later.

For drawImage, there are no requirements that involve throwing 
SYNTAX_ERR - the only requirements I see ("the implementation must raise 
...") are TYPE_MISMATCH_ERR and INVALID_STATE_ERR for the first 
argument, and INDEX_SIZE_ERR for the source rectangle arguments, and 
NOT_SUPPORTED_ERR for non-finite float arguments (specified in the "Web 
IDL" section in http://dev.w3.org/html5/spec/#dependencies).

So the statement about SYNTAX_ERR seems to be incorrect based on the 
normative requirements. Looks like it's just a copy-paste error from the 
equivalent text for createPattern, where the second argument is a 
keyword string, and it isn't relevant to drawImage.

Filed as http://www.w3.org/Bugs/Public/show_bug.cgi?id=9114 to make sure 
it gets fixed.

-- 
Philip Taylor
pjt47@cam.ac.uk

Received on Monday, 22 February 2010 11:49:26 UTC