#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 12 years ago by
Component: | unfiled → attributes |
---|---|
Milestone: | 1.next → 1.5.1 |
Priority: | undecided → low |
Status: | new → open |
comment:2 Changed 12 years ago by
Owner: | set to jitter |
---|---|
Status: | open → assigned |
Note to self related to #7981
comment:3 Changed 12 years ago by
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 12 years ago by
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 12 years ago by
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 12 years ago by
This has been fixed in the upcoming attrhooks in jQuery 1.6. http://jsfiddle.net/timmywil/bAtgQ/
comment:8 Changed 12 years ago by
Milestone: | 1.5.1 → 1.6 |
---|---|
Owner: | changed from jitter to timmywil |
Version: | 1.5 → 1.5.2 |
comment:9 Changed 12 years ago by
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 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
test case