[Webkit-unassigned] [Bug 43559] Computed style of an image being loaded has height and width 0px instead of auto (Products don't show on plan-itinteriors.com)
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Aug 24 14:03:37 PDT 2010
https://bugs.webkit.org/show_bug.cgi?id=43559
--- Comment #16 from Ojan Vafai <ojan at chromium.org> 2010-08-24 14:03:36 PST ---
Discussion on #whatwg:
[12:27pm] ojan: annevk5: are there any cases where returning "auto" from getComputedStyle is correct?
[12:27pm] annevk5: yeah
[12:27pm] annevk5: ojan, e.g. for 'top'
[12:28pm] annevk5: iirc
[12:28pm] ojan: annevk5: i'm looking at https://bugs.webkit.org/show_bug.cgi?id=43559. there's a case where WebKit returns 0px and Gecko returns auto
[12:28pm] dbaron: also for other things that are display:none or inside something display:none, I think
[12:29pm] annevk5: ojan, the reason for that is because I aligned with WebKit; Gecko returns the used value there
[12:29pm] annevk5: ojan, oh, that's the reverse
[12:29pm] ojan: it's getting the computed width/height on an uncached image
[12:29pm] annevk5: dbaron, yeah, or where the property is in the special list and does not apply to the element
[12:29pm] ojan: shift+reload http://tinyurl.com/24qmgck to see the difference
[12:31pm] annevk5: ojan, I guess that is because in Gecko the image is treated as inline element so 'width' does not apply and therefore returns the computed value rather than the used value
[12:31pm] ojan: oh, interesting.
[12:31pm] annevk5: ojan, pretty sucky that pages can depend on how browsers generate boxes for replaced elements while loading
[12:32pm] ojan: this sounds like a scary thing to change (for webkit or gecko)
[12:32pm] annevk5: sounds like an annoying thing to define too
[12:32pm] annevk5: i guess HTML5 should define that
[12:33pm] • annevk5 checks the rendering chapter
[12:35pm] annevk5: http://www.whatwg.org/specs/web-apps/current-work/complete/rendering.html#images-0 has the WebKit behavior
[12:36pm] annevk5: http://www.w3.org/TR/CSS21/visudet.html#the-height-property "the percentage or 'auto' (see prose under <percentage>) or the absolute length; 'auto' if the property does not apply"
[12:37pm] annevk5: (and it does not apply with the Gecko <img> model; assuming I guessed all this correctly)
[12:39pm] crash\: there is a Bug for that
[12:39pm] crash\: https://bugzilla.mozilla.org/show_bug.cgi?id=321919
[12:39pm] crash\: pretty much the same problem
[12:40pm] annevk5: crash\, with the same conclusions
[12:41pm] crash\: what does getPropertyValue("width") for <input type=hidden> return?
[12:41pm] crash\: should be auto too, right?
[12:42pm] annevk5: yes
[12:44pm] crash\: maybe I should create a bug and test case for that to clarify that
[12:45pm] annevk5: make a test suite for getComputedStyle, that'd be neat
[12:47pm] crash\: I can't see where the specs say. what behaviour is right
[12:48pm] annevk5: http://dev.w3.org/csswg/cssom/#dom-window-getcomputedstyle defines it
[12:48pm] annevk5: if anything is unclear please email www-style
[12:52pm] crash\: "If the property applies to the element or pseudo-element and the resolved value of the 'display' property is not none, the resolved value is the used value." for width/height
[12:52pm] crash\: but a not loaded image is not of type display:none;
[12:53pm] annevk5: crash\, no, it's of type inline in Gecko
[12:53pm] crash\: yes, so it should be the computed value
[12:53pm] crash\: so I guess 0px would be right
[12:53pm] annevk5: no, auto
[12:54pm] annevk5: we just discussed this in this channel
[12:54pm] annevk5: I even quoted http://www.w3.org/TR/CSS21/visudet.html#the-height-property
[12:54pm] crash\: ok, since it's inline
[12:55pm] crash\: but when it was replaced it can have a width/height
[12:55pm] crash\: wired
[12:59pm] crash\: ist still dont think "auto" is right
[12:59pm] crash\: why it can't be 0px and when it can't be replaced and then alt="" is used be "auto"?
[1:00pm] annevk5: crash\, sure, that is what HTML5 defines right now
[1:00pm] annevk5: crash\, but apparently that breaks sites
[1:01pm] annevk5: crash\, again see above for the WebKit bug report
[1:02pm] crash\: ok, that confident me
My read from that is that the spec was written to match WebKit, but that breaks at least this site. Seems like we should change to match Gecko and get the spec changed?
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list