Bug 41898 - HTMLImageElement's "complete" attribute should be false for empty images
Summary: HTMLImageElement's "complete" attribute should be false for empty images
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5
Depends on:
Blocks:
 
Reported: 2010-07-08 13:41 PDT by Andreas Kling
Modified: 2010-08-10 17:48 PDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (8.03 KB, patch)
2010-07-08 13:57 PDT, Andreas Kling
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Kling 2010-07-08 13:41:16 PDT
Quoth HTML5:
"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."

This change will fix one in-tree layout test:
- canvas/philip/tests/2d.pattern.image.incomplete.html

Spec link:
http://www.whatwg.org/specs/web-apps/current-work/#dom-img-complete
Comment 1 Andreas Kling 2010-07-08 13:57:30 PDT
Created attachment 60951 [details]
Proposed patch
Comment 2 Darin Adler 2010-07-08 14:08:58 PDT
Comment on attachment 60951 [details]
Proposed patch

I just tried this in Firefox:

    javascript:(new Image()).complete

And I got the value "true". It's great to match the HTML5 specification, but I worry that we are moving from matching Firefox to not matching it. Can we discuss this on the WHATWG mailing list before making the change?
Comment 3 Andreas Kling 2010-07-08 14:18:56 PDT
(In reply to comment #2)
> It's great to match the HTML5 specification, but I worry that we are moving from matching Firefox to not matching it. Can we discuss this on the WHATWG mailing list before making the change?

Indeed, we would be the first to implement this behavior. I'll post something to  [whatwg] in a sec.
Comment 4 Andreas Kling 2010-07-08 15:31:15 PDT
Posted on the WHATWG mailing list:
http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2010-July/027086.html
Comment 5 Adam Barth 2010-07-27 07:26:00 PDT
Comment on attachment 60951 [details]
Proposed patch

Looks like no one has replied to your message yet.  This patch appears to be blocked on feedback from the working group.  Please feel free to re-nominate for review when we're sure we want to do this.

Is there more motivation for making this change beyond just the spec?
Comment 6 Andreas Kling 2010-07-27 07:32:11 PDT
(In reply to comment #5)
> Is there more motivation for making this change beyond just the spec?

No, that's pretty much it.

Though I personally like that it makes it easy to create an image with complete=false for testing purposes.
Comment 7 Ian 'Hixie' Hickson 2010-08-10 16:28:15 PDT
Note: the spec has changed.
Comment 8 Darin Adler 2010-08-10 17:48:04 PDT
(In reply to comment #7)
> Note: the spec has changed.

Thanks for letting us know. I’ll close this.