Bug Tracker

Ticket #8117 (closed bug: fixed)

Opened 4 years ago

Last modified 3 years ago

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

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

comment:1 Changed 4 years ago by jitter

  • Priority changed from undecided to low
  • Status changed from new to open
  • Component changed from unfiled to attributes
  • Milestone changed from 1.next to 1.5.1

comment:2 Changed 4 years ago by jitter

  • Owner set to jitter
  • Status changed from open to assigned

Note to self related to #7981

comment:3 Changed 4 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 3 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 3 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 3 years ago by timmywil

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

comment:7 Changed 3 years ago by rwaldron

#8647 is a duplicate of this ticket.

comment:8 Changed 3 years ago by timmywil

  • Owner changed from jitter to timmywil
  • Version changed from 1.5 to 1.5.2
  • Milestone changed from 1.5.1 to 1.6

comment:9 Changed 3 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 3 years ago by timmywil

  • Status changed from assigned to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.