aboutsummaryrefslogtreecommitdiffstats
path: root/src/attributes.js
diff options
context:
space:
mode:
authortimmywil <tim.willison@thisismedium.com>2011-03-25 23:03:02 -0400
committertimmywil <tim.willison@thisismedium.com>2011-04-03 19:13:40 -0400
commit5caf7d837630df4ac8e8fb21c79582dc897903f5 (patch)
treec3f05b1f0c810603b02ba2beaa8baf3689d7e1d8 /src/attributes.js
parent56014a1a0089be9d8d44c286ce66fc9d2066acd7 (diff)
downloadjquery-5caf7d837630df4ac8e8fb21c79582dc897903f5.tar.gz
jquery-5caf7d837630df4ac8e8fb21c79582dc897903f5.zip
Clean up
Diffstat (limited to 'src/attributes.js')
-rw-r--r--src/attributes.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/attributes.js b/src/attributes.js
index 6011c4501..bfeb6c4e1 100644
--- a/src/attributes.js
+++ b/src/attributes.js
@@ -294,14 +294,15 @@ jQuery.extend({
}
var ret, hooks,
- notxml = nType !== 1 || !jQuery.isXMLDoc( elem ),
- isFormObjects = formHook && ( name === "name" || elem.nodeName === "FORM" );
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
// Normalize the name if needed
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
- hooks = isFormObjects ? formHook( name ) : jQuery.attrHooks[ name ];
+ hooks = formHook && ( name === "name" || elem.nodeName === "FORM" ) ?
+ formHook( name ) :
+ jQuery.attrHooks[ name ];
if ( value !== undefined ) {
@@ -432,7 +433,9 @@ if ( !jQuery.support.getSetAttribute ) {
get: function( elem ) {
var ret = elem.getAttributeNode( name );
// 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 ) {
// Check form objects in IE (multiple bugs related)
@@ -482,7 +485,6 @@ if ( !jQuery.support.style ) {
get: function( elem ) {
return elem.style.cssText;
},
-
set: function( elem, value ) {
return (elem.style.cssText = "" + value);
}