Open Bug 513541 Opened 15 years ago Updated 5 months ago

<img>.complete should return false for invalid images

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: Gavin, Unassigned)

Details

(Keywords: html5)

Attachments

(1 file)

See http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-August/022452.html . >> The "and it is a valid image" part seems to contradict the current >> behavior of Safari 3.0.2, Opera 9.22, Firefox 2.0 and Firefox trunk (all >> tested on Windows). These browser all give values of true for an invalid >> image's "complete" property (see attached testcase or >> http://people.mozilla.org/~gavin/test/img-complete.html ). Internet >> Explorer 7 does seem to return false. > My findings match yours. I have left the spec as is, for compatibility > with IE, and because it seems the most logical.
Also: > It appears this behavior was explicitly chosen in Mozilla, in bug > 190561 (https://bugzilla.mozilla.org/show_bug.cgi?id=190561). I think > the arguments given in that bug might merit reconsideration; detection > of image existence is currently possible by other means, and I'm not > sure how much weight "the Rhino Book" should have in influencing > current DOM specs.
Attached file testcase
Expected: Image.complete is false Actual (trunk): Image.complete is true
(In reply to comment #0) > See http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-August/022452.html > > My findings match yours. I have left the spec as is, for compatibility > > with IE, and because it seems the most logical. Just making we're ok with Hixie's decision and not with https://bugzilla.mozilla.org/show_bug.cgi?id=190561 ?
From my message: > It appears this behavior was explicitly chosen in Mozilla, in bug 190561 > (https://bugzilla.mozilla.org/show_bug.cgi?id=190561). I think the > arguments given in that bug might merit reconsideration; detection of > image existence is currently possible by other means, and I'm not sure > how much weight "the Rhino Book" should have in influencing current DOM > specs.
(In reply to comment #5) > > detection of image existence is currently possible by other means Though I don't really remember what I was referring to, here... It seems to be the strongest argument for keeping our current behavior.
I was referring to detecting the image's effect on page layout: http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-August/022481.html http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2009-September/022589.html Given that, there's no reason not to make this change as far as I can tell.
For clarification, is 'invalid' a reference to the HTML5 'Broken State'? Less/More/Other? See also bug 694839, which was filed specifically with regard to IMG.complete for Broken IMGs. Thanks!
I think this bug should be RESOLVED INVALID given what the spec says and there is interop for this as far as I can tell. http://software.hixie.ch/utilities/js/live-dom-viewer/saved/3064
Status: NEW → UNCONFIRMED
Ever confirmed: false
Status: UNCONFIRMED → NEW
Ever confirmed: true
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046 Move all DOM bugs that haven't been updated in more than 3 years and has no one currently assigned to P5. If you have questions, please contact :mdaly.
Priority: -- → P5
Component: DOM → DOM: Core & HTML

I'm just noting that current behavior of img.complete is different from in Chrome. When src is empty it appears to mark the image as complete immediately, which is not the expected behavior if the intention is to set 'src' from some other code.

This caused a nasty incompatibility for us, since the resizing code fired based on complete=true and left us with a 0x0 box to put the image in !

Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: