Skip to main content

Bug Tracker

Side navigation

#7116 closed enhancement (fixed)

Opened October 05, 2010 09:43PM UTC

Closed October 09, 2010 02:53PM UTC

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 (0.5 KB) - added by trevorparscal October 05, 2010 09:45PM UTC.

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

Change History (3)

Changed October 06, 2010 12:45AM UTC by snover comment:1

resolution: → duplicate
status: newclosed

Duplicate of #7080.

Changed October 09, 2010 02:52PM UTC by john comment:2

resolution: duplicate
status: closedreopened

Changed October 09, 2010 02:53PM UTC by john comment:3

resolution: → fixed
status: reopenedclosed