Bug Tracker

Opened 6 years ago

Closed 6 years ago

#14368 closed bug (wontfix)

height() does not convert units in Chrome

Reported by: anonymous Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.10.2
Keywords: Cc:
Blocked by: Blocking:

Description

Under some circumstances, height() does not convert units to pt

http://jsfiddle.net/nradisch/ugvGv/

Change History (4)

comment:1 Changed 6 years ago by dekajp

I am not sure if this will be helpful. I added the element aa and bb to document and jquery height returns the right result. http://jsfiddle.net/dekajp/ugvGv/6/ (tested in chrome)

and the documentation of height says "Get the current computed height" - http://api.jquery.com/height/

comment:2 Changed 6 years ago by ziogaschr@…

This doesn't seem like a bug to me as what you achieved with jQuery works the same using only html.

You can check the html markup changes here http://jsfiddle.net/ugvGv/7/

The container <div> has a font-size set in 'pt' unit, and by that all the child elements height are affected when using 'ex' unit for its height.

ex = one ex is the x-height of a font (x-height is usually about half the font-size)

comment:3 Changed 6 years ago by dmethvin

Getting style information on disconnected markup is dicey. That's particularly true since many inherited properties won't be available from the document on disconnected markup. I'm inclined to mark this wonfix since the "fix" is to attach it to the document before doing these measurements and it's better for you to do that.

comment:4 Changed 6 years ago by timmywil

Resolution: wontfix
Status: newclosed
Note: See TracTickets for help on using tickets.