This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The canvas spec currently defines this: (http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#check-the-usability-of-the-image-argument) "When a user agent is required to check the usability of the image argument, where image is a CanvasImageSource object, the user agent must run these steps, which return either good, bad, or aborted: 1. If the image argument is an HTMLImageElement object that is not fully decodable, or if the image argument is an HTMLVideoElement object whose readyState attribute is either HAVE_NOTHING or HAVE_METADATA, then return bad and abort these steps. 2. If the image argument is an HTMLCanvasElement object with either a horizontal dimension or a vertical dimension equal to zero, then the implementation throw an InvalidStateError exception and return aborted." This is not matching up with current implementations and the language in http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-drawimage: "If the image has no image data, throws an InvalidStateError exception. If the image isn't yet fully decoded, then nothing is drawn." After some discussion, we believe that this section should read as follows: "When a user agent is required to check the usability of the image argument, where image is a CanvasImageSource object, the user agent must run these steps, which return either good, bad, or aborted: 1. If the image argument is an HTMLImageElement object in the broken state, then throw an InvalidStateError exception, return aborted and abort these steps. 2. If the image argument is an HTMLImageElement object that is not fully decodable, or if the image argument is an HTMLVideoElement object whose readyState attribute is either HAVE_NOTHING or HAVE_METADATA, then return bad and abort these steps. 3. If the image argument has either a horizontal dimension or a vertical dimension equal to zero, then the implementation throw an InvalidStateError exception and return aborted."
Do you have tests demonstrating the current behaviour?
WebKit seems to do what the spec says. (Blink too.) Gecko seems to throw an exception for both broken images and images in the unavailable state. IE seems to throw exceptions for broken images but not unavailable images. I've updated the non-normative text to be clearer, but I don't see much value in changing the normative requirements.
Checked in as WHATWG revision r7885. Check-in comment: Make non-normative text more accurate. http://html5.org/tools/web-apps-tracker?from=7884&to=7885