Skip to main content

Bug Tracker

Side navigation

#7928 closed bug (cantfix)

Opened January 09, 2011 12:05PM UTC

Closed July 12, 2011 08:01PM UTC

Last modified July 01, 2013 09:28PM UTC

Firefox gives wrong height and width for percentage-styled elements within a hidden iframe

Reported by: tangphillip Owned by:
Priority: low Milestone: 1.next
Component: dimensions Version: 1.4.4
Keywords: Cc:
Blocked by: Blocking:
Description

Setup:

An outer document that contains a

display:none
-styled iframe.

An inner document that contains an element with a percentage-based style for width or height.

Sample outer document: http://jsfiddle.net/tangphillip/dnDUu/

Sample inner document: http://jsfiddle.net/tangphillip/SJACn/

Bug:

In both Firefox 3 and 4, running on either Windows or Mac, jQuery will return the

height()
of the iframed element as the percentage listed in the style. For instance, if the element in the iframe had
height:40%
, jQuery would say that the element is 40 pixels tall, no matter what the height actually is once the iframe is revealed. It behaves similarly with width.

Attachments (0)
Change History (4)

Changed January 17, 2011 12:52AM UTC by jitter comment:1

component: unfileddimensions
priority: undecidedlow
status: newopen

test case.

Seems reproducible on FF and Chrome (chrome has even more weird results). Needs some chross-checking with other "hidden"-width/height related tickets.

Changed March 30, 2011 05:40PM UTC by rwaldron comment:2

#8552 is a duplicate of this ticket.

Changed July 12, 2011 08:01PM UTC by rwaldron comment:3

resolution: → cantfix
status: openclosed

I recently learned that Firefox doesn't grant "presentation" to elements inside of iframes set to display:none

Changed July 01, 2013 09:28PM UTC by dmethvin comment:4

#14078 is a duplicate of this ticket.