Bug Tracker

Modify

Ticket #7225 (closed bug: fixed)

Opened 4 years ago

Last modified 2 years ago

CSS width and height of hidden and disconnected elements is incorrect

Reported by: shikakaa@… Owned by: danheberden
Priority: blocker Milestone: 1.4.4
Component: css Version: 1.4.3
Keywords: regression Cc:
Blocking: Blocked by:

Description

Made a test case on jsfiddle.net.

 http://jsfiddle.net/x9tcZ/1/

Basically, if a textarea is hidden using a display:none on a parent element, jquery 1.4.3 will return incorrect, negative css height values, instead of the explicit set correct value that jquery 1.4.2 returns

Change History

comment:1 Changed 4 years ago by anonymous

Tested in Chrome and FF 3.6.x. I don't know if it's any more general than this. The new behaviour is different than 1.4.2, this is not what I expected and I don't find it logical.

comment:2 Changed 4 years ago by snover

  • Keywords regression added
  • Priority changed from undecided to blocker
  • Status changed from new to open
  • Component changed from unfiled to css
Last edited 4 years ago by snover (previous) (diff)

comment:3 Changed 4 years ago by addyosmani

#7235 is a duplicate of this ticket.

comment:4 Changed 4 years ago by snover

#7265 is a duplicate of this ticket.

comment:5 Changed 4 years ago by snover

  • Summary changed from CSS height of hidden elements is incorrect to CSS width and height of hidden elements is incorrect

comment:6 Changed 4 years ago by snover

  • Summary changed from CSS width and height of hidden elements is incorrect to CSS width and height of hidden and disconnected elements is incorrect

comment:7 Changed 4 years ago by snover

#7267 is a duplicate of this ticket.

comment:8 Changed 4 years ago by snover

  • Owner set to danheberden
  • Status changed from open to assigned

comment:9 Changed 4 years ago by jeresig

  • Status changed from assigned to closed
  • Resolution set to fixed

Make sure that height/width getters work on hidden inputs and disconnected elements. Fixes #7225.

Changeset: e4a38670b10b1ce776afff389bae34991e986180

comment:10 Changed 4 years ago by jeresig

Make sure that the correct height/width of the elements is retreived. Fixes #7225.

Changeset: 7e02cee5ff8b5e9117366d7b43af7b5794f0f258

comment:11 Changed 4 years ago by anonymous

Sorry for easy question, but when will this fix be in stable release of Jquery ? I don't know where to get this information. Will it be 1.4.4 ? Right now, I have to 1.4.2 due to this bug, but I am very looking forward to using 1.4.3 enhancements.

comment:12 Changed 4 years ago by jeresig

Make sure that .width()/.height() don't return NaN also standardize on returning instead of auto for default values (which is what we do elsewhere in .css() as well). Fixes #7225.

Changeset: 53396b879bd29c090824da182e3cf69158829f82

comment:13 Changed 3 years ago by pwnedd

Still running into issues with Git version,e.g.:

1.4.3  http://jsfiddle.net/VERw5/1/ Git  http://jsfiddle.net/VERw5/2/

comment:14 Changed 3 years ago by pwnedd

Seems to be fixed in the Git now.

comment:15 Changed 3 years ago by anonymous

Shouldn't this also be fixed for outerWidth and outerHeight?

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.