Bug Tracker

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#8117 closed bug (fixed)

.removeAttr don't works with select element's size attribute

Reported by: LaySoft Owned by: timmywil
Priority: low Milestone: 1.6
Component: attributes Version: 1.5.2
Keywords: Cc:
Blocked by: Blocking:

Description

Reproduction code: http://bogex.hu/select.php

Both tests tries to remove 'multiple' and 'size' attribute from select element. The first test doing this with javascript's own removeAttribute method, and second with jQuery's removeAttr method. The first test works under Firefox 4.0b10, but second not:

Error: uncaught exception: [Exception... "Index or size is negative or greater than the allowed amount" code: "1" nsresult: "0x80530001 (NS_ERROR_DOM_INDEX_SIZE_ERR)" location: "http://code.jquery.com/jquery-1.5.min.js Line: 16"]

On all other browsers works both the tests.

Change History (10)

comment:1 Changed 7 years ago by jitter

Component: unfiledattributes
Milestone: 1.next1.5.1
Priority: undecidedlow
Status: newopen

comment:2 Changed 7 years ago by jitter

Owner: set to jitter
Status: openassigned

Note to self related to #7981

comment:3 Changed 7 years ago by mounir.lamouri

FWIW, there is a Gecko/Firefox bug open about this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=640636 The issue might be fixed in a minor FF4 release. Unfortunately, I don't think it will be fixed for FF4 final.

comment:4 Changed 7 years ago by mounir.lamouri

This has been fixed in Firefox's trunk. It will be fixed in Firefox 5 (ETA 3 months) and *might* be fixed in a minor FF4 release.

comment:5 Changed 6 years ago by anonymous

low? this breaks sooo much in firefox 4.

The issue can not set elem.size to value is and is NOT null. This should help you genius' fix it. I would assume that if value == then value = null but have no idea what that might break having limited knowledge of the jquery internals.

if ( value === null ) {

if ( elem.nodeType === 1 ) {

elem.removeAttribute( name );

}

} else {

elem[ name ] = value;

}

comment:6 Changed 6 years ago by timmywil

This has been fixed in the upcoming attrhooks in jQuery 1.6. http://jsfiddle.net/timmywil/bAtgQ/

comment:7 Changed 6 years ago by Rick Waldron

#8647 is a duplicate of this ticket.

comment:8 Changed 6 years ago by timmywil

Milestone: 1.5.11.6
Owner: changed from jitter to timmywil
Version: 1.51.5.2

comment:9 Changed 6 years ago by mounir.lamouri

FWIW, Firefox 4.0.1 will have the same behavior as Firefox 3.6, thus the jQuery fix will not be needed anymore.

comment:10 Changed 6 years ago by timmywil

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.