[whatwg] Default value of "complete" attribute on new Image objects

Diego Perini diego.perini at gmail.com
Fri Jul 9 03:23:21 PDT 2010

Just to add that also by using DOM methods like:

   document.createElement('img').complete; // true

the result is the same: "complete" is always true. Only tested on Firefox
3.5.10 and Opera 10.60.

On FF after setting src="" the "complete" property return true while on
Opera it return false.
On FF after setting src="/nonexisting.gif" the "complete" property remains
true like it does in Opera.

Ugh ! Quite an unreliable behaviour... I would expect false in all the above

Diego Perini

On Thu, Jul 8, 2010 at 11:27 PM, Andreas Kling <andreas.kling at nokia.com>wrote:

> The current HTML5 specification says:
> "The IDL attribute complete must return true if the user agent has fetched
> the image specified in the src attribute, and it is in a supported image
> type (i.e. it was decoded without fatal errors), even if the final task
> queued by the networking task source for the fetching of the image resource
> has not yet been processed. Otherwise, the attribute must return false." [1]
> This reads to me as if a "new Image()" should have complete=false
> No browser currently does this AFAIK. I've posted a patch to implement this
> behavior in WebKit here:
> https://bugs.webkit.org/show_bug.cgi?id=41898
> Does anyone have thoughts on this?
> Anything that might break?
> Reasons it's currently defaulting to true?
> -Kling
> [1] http://www.whatwg.org/specs/web-apps/current-work/#dom-img-complete
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100709/a656963a/attachment-0001.htm>

More information about the whatwg mailing list