This commit is contained in:
timmywil 2011-03-25 23:03:02 -04:00
parent 56014a1a00
commit 5caf7d8376

View File

@ -294,14 +294,15 @@ jQuery.extend({
} }
var ret, hooks, var ret, hooks,
notxml = nType !== 1 || !jQuery.isXMLDoc( elem ), notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
isFormObjects = formHook && ( name === "name" || elem.nodeName === "FORM" );
// Normalize the name if needed // Normalize the name if needed
name = notxml && jQuery.attrFix[ name ] || name; name = notxml && jQuery.attrFix[ name ] || name;
// Get the appropriate hook, or the formHook if getSetAttribute is not supported and we have form objects in IE6/7 // Get the appropriate hook, or the formHook if getSetAttribute is not supported and we have form objects in IE6/7
hooks = isFormObjects ? formHook( name ) : jQuery.attrHooks[ name ]; hooks = formHook && ( name === "name" || elem.nodeName === "FORM" ) ?
formHook( name ) :
jQuery.attrHooks[ name ];
if ( value !== undefined ) { if ( value !== undefined ) {
@ -432,7 +433,9 @@ if ( !jQuery.support.getSetAttribute ) {
get: function( elem ) { get: function( elem ) {
var ret = elem.getAttributeNode( name ); var ret = elem.getAttributeNode( name );
// Return undefined if not specified instead of empty string // Return undefined if not specified instead of empty string
return ret && ret.specified ? ret.nodeValue : undefined; return ret && ret.specified ?
ret.nodeValue :
undefined;
}, },
set: function( elem, value ) { set: function( elem, value ) {
// Check form objects in IE (multiple bugs related) // Check form objects in IE (multiple bugs related)
@ -482,7 +485,6 @@ if ( !jQuery.support.style ) {
get: function( elem ) { get: function( elem ) {
return elem.style.cssText; return elem.style.cssText;
}, },
set: function( elem, value ) { set: function( elem, value ) {
return (elem.style.cssText = "" + value); return (elem.style.cssText = "" + value);
} }