Bug 49369 - Philip Canvas test 2d.drawImage.wrongtype fails
Summary: Philip Canvas test 2d.drawImage.wrongtype fails
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://philip.html5.org/tests/canvas/...
Depends on:
Blocks: 46506
  Show dependency treegraph
Reported: 2010-11-11 01:16 PST by Helder Correia
Modified: 2010-11-11 12:53 PST (History)
2 users (show)

See Also:

Patch (3.36 KB, patch)
2010-11-11 01:23 PST, Helder Correia
kling: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helder Correia 2010-11-11 01:16:17 PST
According to the spec (http://philip.html5.org/tests/canvas/suite/tests/spec.html#testrefs.2d.drawImage.type), if the image is of the wrong type, the implementation must raise a TYPE_MISMATCH_ERR exception.  For this reason, I think this test is inconsistent with the spec, since it checks if the exception raised is an instance of TypeError instead.  It is also inconsistent with the 2d.drawImage.null.html test (see Bug 49368 which fixes it).
Comment 1 Helder Correia 2010-11-11 01:23:55 PST
Created attachment 73589 [details]
Comment 2 Andreas Kling 2010-11-11 03:07:32 PST
Comment on attachment 73589 [details]

This is incorrect, if the first argument to drawImage() isn't either null, a HTMLImageElement, a HTMLVideoElement or a HTMLCanvasElement, it doesn't match any of the overloads and Web IDL specifies that a TypeError exception should be raised.
Comment 3 Philip Taylor 2010-11-11 03:11:37 PST
That's an old copy of the spec - http://whatwg.org/html5#dom-context-2d-drawimage is the latest version. (Also that's from an old copy of the tests - http://test.w3.org/html/tests/submission/PhilipTaylor/canvas/ is the latest now). It no longer has a comment about "wrong type", because it's impossible for it to be wrong type at that point: WebIDL will throw a TypeError before reaching this stage.
Comment 4 Helder Correia 2010-11-11 12:53:57 PST
Thanks, guys. Closing this.