Skip to main content

Bug Tracker

Side navigation

#8117 closed bug (fixed)

Opened February 01, 2011 10:16AM UTC

Closed April 10, 2011 08:02PM UTC

Last modified March 19, 2012 09:25PM UTC

.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.

Attachments (0)
Change History (10)

Changed February 01, 2011 11:16AM UTC by jitter comment:1

component: unfiledattributes
milestone: 1.next1.5.1
priority: undecidedlow
status: newopen

Changed February 02, 2011 12:04AM UTC by jitter comment:2

owner: → jitter
status: openassigned

Note to self related to #7981

Changed March 11, 2011 12:41AM UTC by mounir.lamouri comment:3

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.

Changed March 24, 2011 02:21PM UTC by mounir.lamouri comment:4

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.

Changed March 28, 2011 08:45PM UTC by anonymous comment:5

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;

}

Changed March 28, 2011 09:03PM UTC by timmywil comment:6

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

Changed March 30, 2011 07:31PM UTC by rwaldron comment:7

#8647 is a duplicate of this ticket.

Changed April 02, 2011 01:52AM UTC by timmywil comment:8

milestone: 1.5.11.6
owner: jittertimmywil
version: 1.51.5.2

Changed April 04, 2011 01:27AM UTC by mounir.lamouri comment:9

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

Changed April 10, 2011 08:02PM UTC by timmywil comment:10

resolution: → fixed
status: assignedclosed