Bug Tracker

Modify

Ticket #4915 (closed bug: invalid)

Opened 4 years ago

Last modified 4 years ago

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

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

comment:1 Changed 4 years ago by dmethvin

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

comment:2 Changed 4 years ago by dmethvin

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

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.

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.