W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2008

[whatwg] CanvasRenderingContext2D::createPattern and partially loaded images

From: Eric Seidel <eric@webkit.org>
Date: Fri, 8 Aug 2008 17:03:13 -0700
Message-ID: <f3f9e0a30808081703p4b425effv68eb20c7c5257297@mail.gmail.com>

Notes that:
The first argument gives the image to use as the pattern (either an
HTMLImageElement or an HTMLCanvasElement). Modifying this image after
calling the createPattern() method must not affect the pattern.

What does this mean for images which are not yet fully loaded from the
network?  Safari's current behavior is that the pattern will draw the
image with as much data as we know about that network resource *at the
time the pattern is drawn*.  Instead of at the time the pattern is
created (as the spec seems to imply).  Meaning if you're a web author,
and you don't bother to listen for Image load events, if your user is
on a slow network, each time you draw your pattern, you'll have
slightly more of the image until it completes.

I can disable this feature of Safari (make it so that
"createPattern()" creates a copy of the image, in whatever loaded
state it may be), or we can change the spec to say that incremental
loading images do not count as "modifying the image after calling


Received on Friday, 8 August 2008 17:03:13 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:04 UTC