This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5856 - height/width DOM attributes in combination with display:none
Summary: height/width DOM attributes in combination with display:none
Alias: None
Product: HTML WG
Classification: Unclassified
Component: pre-LC1 HTML5 spec (editor: Ian Hickson) (show other bugs)
Version: unspecified
Hardware: All All
: P5 normal
Target Milestone: ---
Assignee: Ian 'Hixie' Hickson
QA Contact: HTML WG Bugzilla archive list
Keywords: NoReply
Depends on:
Reported: 2008-07-11 14:18 UTC by Anne
Modified: 2010-10-04 14:33 UTC (History)
4 users (show)

See Also:


Description Anne 2008-07-11 14:18:59 UTC
HTML5 should make it clear that when the image from the <img> element is not rendered the height/width DOM attributes return the intrinsic image height/width and not zero. (A May version of the draft had this backwards and the current version is not clear; probably because the rendering section is not done yet.)
Comment 1 Ian 'Hixie' Hickson 2008-07-11 19:59:19 UTC
Yeah, it should return 0 when there's no image, and the intrinsic width if the image isn't rendered.
Comment 2 Olivier Gendrin 2008-07-25 07:56:06 UTC
Ian : what do you call 'no image' : an empty source, or an 404 HTTP request ? And is 'intrinsic image height/width' overriden by @width and @height img attributes ?
Comment 3 Ian 'Hixie' Hickson 2008-07-25 09:36:04 UTC
Does the text in the spec now answer those questions?
Comment 4 Olivier Gendrin 2008-07-25 12:09:19 UTC
Ian, if you mean, the last sentence miss the img tag ("The width and height DOM attributes on the embed, object, and video elements must reflect the content attributes of the same name.").

And if the img is missing, yes, it answers my question, thanks.
Comment 5 Ian 'Hixie' Hickson 2008-07-25 18:23:02 UTC
Well I don't only mean that section, I also mean the bits that define HTMLImageElement.height and .width, the height/width content attributes, fetching, and so forth.
Comment 6 Olivier Gendrin 2008-07-28 10:14:16 UTC
You mean "The DOM attributes width and height must return the rendered width and height of the image, in CSS pixels, if the image is being rendered, and is being rendered to a visual medium; or else the intrinsic with and height of the image, in CSS pixels, if the image is available but not being rendered to a visual medium; or else 0, if the image is not available or its dimensions are not known." ?

(I think that the last 'or', "if the image is not available or its dimensions are not known.", should be an 'and'.)
Comment 7 Ian 'Hixie' Hickson 2008-07-28 19:42:33 UTC
So what should it return if the image is available but it's dimensions are not known? (e.g. it has no intrinsic dimensions, like a dynamically sized gradient or infinite pattern)
Comment 8 Olivier Gendrin 2008-07-29 08:02:05 UTC
Ok, would never have though to so strange 'images'...

Thank you very much.
Comment 9 Maciej Stachowiak 2010-03-14 13:15:11 UTC
This bug predates the HTML Working Group Decision Policy.

If you are satisfied with the resolution of this bug, please change the state of this bug to CLOSED. If
you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document:

This bug is now being moved to VERIFIED. Please respond within two weeks. If this bug is not closed, reopened or escalated within two weeks, it may be marked as NoReply and will no longer be considered a pending comment.