[whatwg] I believe source rectangles for HTML5 Canvas drawImage are specified incorrectly

Robert O'Callahan robert at ocallahan.org
Tue Dec 18 13:14:40 PST 2012

On Wed, Dec 19, 2012 at 4:17 AM, Kevin Gadd <kevin.gadd at gmail.com> wrote:

> Sorry, upon reading over the ImageBitmap part of the spec again I'm
> confused: Why is constructing an ImageBitmap asynchronous? I thought
> any decoding isn't supposed to happen until drawImage, so I don't
> really understand why this operation involves a callback and a delay.
> Making ImageBitmap creation async means that you *cannot* use this as
> a replacement for drawImage source rectangles unless you know all
> possible source rectangles in advance. This is not possible for many,
> many use cases (scrolling through a bitmap would be one trivial
> example).

I think this is a real problem.

It seems to me a synchronous constructor that creates an ImageBitmap for a
subimage of another ImageBitmap (but not other kind of source!) will be

Jesus called them together and said, “You know that the rulers of the
Gentiles lord it over them, and their high officials exercise authority
over them. Not so with you. Instead, whoever wants to become great among
you must be your servant, and whoever wants to be first must be your
slave — just
as the Son of Man did not come to be served, but to serve, and to give his
life as a ransom for many.” [Matthew 20:25-28]

More information about the whatwg mailing list