Bug Tracker

Modify

Ticket #6848 (closed bug: invalid)

Opened 3 years ago

Last modified 15 months ago

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:
Blocking: Blocked by:

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

comment:1 Changed 3 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 3 years ago by dmethvin

  • Status changed from new to closed
  • Resolution set to invalid

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 3 years ago by snover

  • Priority set to undecided

#7080 and #7116 are duplicates of this bug.

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.