Re: [whatwg] CanvasRenderingContext2D::createPattern and partially loaded images

2009-04-30 Thread Ian Hickson
On Fri, 8 Aug 2008, Eric Seidel wrote:
>
> http://www.whatwg.org/specs/web-apps/current-work/#createpattern
> 
> 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?

Per the spec, if the image argument is an HTMLImageElement object whose 
complete attribute is false, then the implementation must raise an 
INVALID_STATE_ERR exception.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'


Re: [whatwg] CanvasRenderingContext2D::createPattern and partially loaded images

2008-08-08 Thread Eric Seidel
Nevermind:

If the image argument is an HTMLImageElement object whose complete
attribute is false, then the implementation must raise an
INVALID_STATE_ERR exception.

-eric

On Fri, Aug 8, 2008 at 5:03 PM, Eric Seidel <[EMAIL PROTECTED]> wrote:
> http://www.whatwg.org/specs/web-apps/current-work/#createpattern
>
> 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
> createPattern()".
>
> Thoughts?
>
> -eric
>


[whatwg] CanvasRenderingContext2D::createPattern and partially loaded images

2008-08-08 Thread Eric Seidel
http://www.whatwg.org/specs/web-apps/current-work/#createpattern

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
createPattern()".

Thoughts?

-eric