[whatwg] A question about the drawimage() canvas function

Glenn Maynard glenn at zewt.org
Fri Mar 1 13:59:20 PST 2013


On Fri, Mar 1, 2013 at 11:34 AM, Rik Cabanier <cabanier at gmail.com> wrote:

> This behavior seems to match the spec [1] except for step 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.
>
>
> I think that should be:
>
> If the image argument is a  *CanvasImageSource *object with either a
> horizontal dimension or a vertical dimension equal to zero, then the
> implementation throw an InvalidStateError exception and return aborted.
>
>
Step 2 would have to come before step 1.  A "broken" image is also not
fully decodable, so step 1 would still return without throwing an exception
before step 2 happens.

I recommend leaving Firefox alone and changing WebKit (and the spec) to
match Firefox, because we already have interop (at least in the cases I
tested) between Firefox and IE, and we already have interop during loads in
all three.  Changing WebKit to throw after loading will get everyone doing
the same thing--changing Firefox will still leave IE out.

(I haven't tested with IE10, FWIW, only IE9.)

-- 
Glenn Maynard



More information about the whatwg mailing list