Bug Tracker

Opened 9 years ago

Closed 9 years ago

#7116 closed enhancement (fixed)

jQuery tries to set "NaNpx" and "nullpx" as CSS size values

Reported by: trevorparscal Owned by:
Priority: high Milestone: 1.4.3
Component: css Version: 1.4.2
Keywords: NaNpx nullpx css height width Cc:
Blocked by: Blocking:

Description

When setting width or height on an element, if size is null or NaN, it is rendered to a string and appended with 'px', such as 'nullpx' or 'NaNpx'. In Internet Explorer this causes errors to be thrown.

While it's not jQuery's fault that the bad data has been given to the height() or width() functions, this should be handled more elegantly than performing generic string conversion to anything that's not a string.

Attachments (1)

jquery.js.patch (465 bytes) - added by trevorparscal 9 years ago.
Adds robust integer parsing and conditionally defaults to zero if the result is NaN

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by trevorparscal

Attachment: jquery.js.patch added

Adds robust integer parsing and conditionally defaults to zero if the result is NaN

comment:1 Changed 9 years ago by snover

Resolution: duplicate
Status: newclosed

Duplicate of #7080.

comment:2 Changed 9 years ago by john

Resolution: duplicate
Status: closedreopened

comment:3 Changed 9 years ago by john

Resolution: fixed
Status: reopenedclosed
Note: See TracTickets for help on using tickets.