Skip to main content

Bug Tracker

Side navigation

#6848 closed bug (invalid)

Opened July 29, 2010 03:02PM UTC

Closed July 29, 2010 10:40PM UTC

Last modified March 13, 2012 09:36PM UTC

style function fails to check for parseFloat(value) == NaN causing IE6 error

Reported by: crispi Owned by:
Priority: undecided Milestone: 1.4.3
Component: css Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:
Description

This error only occurs in IE6 - other browsers appear to tolerate it.

When the style function is called and a null or non-float value is passed for name = "height", IE6 errors out.

Attachments (0)
Change History (3)

Changed July 29, 2010 03:05PM UTC by crispi comment:1

Changing the code to this appears to fix it:

if ( (name === "width" || name === "height") && (parseFloat(value) < 0 || isNaN(parseFloat(value)))) {

value = undefined;

}

Changed July 29, 2010 10:40PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

Can you reopen with a test case? I am not sure why it would be necessary to check for NaN. This works in IE6:

$("div").width("14px");
$("div").css("width", "auto");

These do not but they are passing invalid input to jQuery:

$("div").width("sorry");  // not a number
$("div").css("width", "0.2km");  // invalid units

Changed October 06, 2010 01:30AM UTC by snover comment:3

priority: → undecided

#7080 and #7116 are duplicates of this bug.