Skip to main content

Bug Tracker

Side navigation

#11729 closed bug (patchwelcome)

Opened May 08, 2012 03:19PM UTC

Closed May 08, 2012 04:31PM UTC

height() returns wrong height on hidden elements containing floats

Reported by: fanin@me.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.2
Keywords: Cc:
Blocked by: Blocking:
Description

http://jsfiddle.net/hTHQt/

When getting height() on a hidden element that contains a floating element it returns wrong height.

Attachments (0)
Change History (2)

Changed May 08, 2012 03:32PM UTC by Fjandin comment:1

Seems like this is a webkit issue. I'm seeing this in chrome and safari. Firefox shows correct height.

I don't have a windows machine so can't see it in explorer.

Changed May 08, 2012 04:31PM UTC by dmethvin comment:2

resolution: → patchwelcome
status: newclosed

IE9 reports 18px for both hidden and visible.

It is not a good idea at all to ask for the dimensions of a hidden element. The browser must completely reflow the document with the element visible and make you wait while it does. This is probably one of the worst performance things you could do.

Since the problem occurs only in Webkit and it's not a good idea anyway, I'll mark this patchwelcome.