Bug Tracker

Opened 10 years ago

Closed 10 years ago

#4915 closed bug (invalid)

Setting Style object measurement property to 'NaNpx' in IE

Reported by: Damon Owned by:
Priority: major Milestone: 1.3.2
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

Description

This bug has been widely reported on the net. See

http://groups.google.com/group/jquery-en/browse_thread/thread/f58c3172a5f52f20

for an example discussion, including a code fix at the very bottom.

The issue, as we understand it, is that when jQuery is accessing a hidden element (CSS display property set to none) in IE, it produces 'NaNpx' as a measurement. For us, it was the lineHeight property on a hidden form select that we were populating using that element's .html method. (Using $.loadJson to construct option elements that we dumped in via .html.)

The error occurs in line 1061 of jquery-1.3.2.js.

if ( set ) {

event[name] = value

The fix is to check for value=='NaNpx' and, if so, change value to a blank string.

if ( set ) {

if (value=='NaNpx'){value = } event[name] = value

For what it's worth, the listserv post I linked above recommended patching the minimized version of jquery-1.3.2 the same way.

search for this return N.toUpperCase()});if(L){ insert this if(K=='NaNpx'){K=} before this J[G]=K}return J[G]}

result: return N.toUpperCase()});if(L){if(K=='NaNpx'){K=}J[G]=K}return J[G]}

Change History (2)

comment:1 Changed 10 years ago by dmethvin

Can you provide a test case? The thread referenced doesn't have one.

comment:2 Changed 10 years ago by dmethvin

Resolution: invalid
Status: newclosed

I'm closing this for lack of a test case. A "NaNpx" is an incorrect value to use for a css measurement. jQuery shouldn't be trying to screen out invalid values passed by the caller.

Note: See TracTickets for help on using tickets.