Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#6848 closed bug (invalid)

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.

Change History (3)

comment:1 Changed 13 years ago by crispi

Changing the code to this appears to fix it:

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

value = undefined;

}

comment:2 Changed 13 years ago by dmethvin

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

comment:3 Changed 13 years ago by snover

Priority: undecided

#7080 and #7116 are duplicates of this bug.

Note: See TracTickets for help on using tickets.