diff options
author | Dave Methvin <dave.methvin@gmail.com> | 2014-04-25 18:26:36 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2014-06-10 23:28:14 -0400 |
commit | d837f119c3729565103005d5d7fa89e1dd8110cb (patch) | |
tree | 03f41c64a16faab49698d7fa6c2519c79874d706 /src/attributes | |
parent | ff9dcfb0c4238d405af92cbd4ac27e0a36c6ff0c (diff) | |
download | jquery-d837f119c3729565103005d5d7fa89e1dd8110cb.tar.gz jquery-d837f119c3729565103005d5d7fa89e1dd8110cb.zip |
Support: clean up comments and Support notation
Closes gh-1577
Diffstat (limited to 'src/attributes')
-rw-r--r-- | src/attributes/attr.js | 2 | ||||
-rw-r--r-- | src/attributes/classes.js | 8 | ||||
-rw-r--r-- | src/attributes/prop.js | 4 | ||||
-rw-r--r-- | src/attributes/support.js | 16 | ||||
-rw-r--r-- | src/attributes/val.js | 8 |
5 files changed, 16 insertions, 22 deletions
diff --git a/src/attributes/attr.js b/src/attributes/attr.js index 8601cfe11..a4414d11f 100644 --- a/src/attributes/attr.js +++ b/src/attributes/attr.js @@ -96,8 +96,6 @@ jQuery.extend({ set: function( elem, value ) { if ( !support.radioValue && value === "radio" && jQuery.nodeName( elem, "input" ) ) { - // Setting the type on a radio button after the value resets the value in IE6-9 - // Reset value to default in case type is set after value during creation var val = elem.value; elem.setAttribute( "type", value ); if ( val ) { diff --git a/src/attributes/classes.js b/src/attributes/classes.js index 7d714b8e1..101138415 100644 --- a/src/attributes/classes.js +++ b/src/attributes/classes.js @@ -83,7 +83,7 @@ jQuery.fn.extend({ } } - // only assign if different to avoid unneeded rendering. + // Only assign if different to avoid unneeded rendering. finalValue = value ? jQuery.trim( cur ) : ""; if ( elem.className !== finalValue ) { elem.className = finalValue; @@ -110,14 +110,14 @@ jQuery.fn.extend({ return this.each(function() { if ( type === "string" ) { - // toggle individual class names + // Toggle individual class names var className, i = 0, self = jQuery( this ), classNames = value.match( rnotwhite ) || []; while ( (className = classNames[ i++ ]) ) { - // check each className given, space separated list + // Check each className given, space separated list if ( self.hasClass( className ) ) { self.removeClass( className ); } else { @@ -132,7 +132,7 @@ jQuery.fn.extend({ data_priv.set( this, "__className__", this.className ); } - // If the element has a class name or if we're passed "false", + // If the element has a class name or if we're passed `false`, // then remove the whole classname (if there was one, the above saved it). // Otherwise bring back whatever was previously saved (if anything), // falling back to the empty string if nothing was stored. diff --git a/src/attributes/prop.js b/src/attributes/prop.js index e2b95dcab..d4ee8b6b9 100644 --- a/src/attributes/prop.js +++ b/src/attributes/prop.js @@ -28,7 +28,7 @@ jQuery.extend({ var ret, hooks, notxml, nType = elem.nodeType; - // don't get/set properties on text, comment and attribute nodes + // Don't get/set properties on text, comment and attribute nodes if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { return; } @@ -64,8 +64,6 @@ jQuery.extend({ } }); -// Support: IE9+ -// Selectedness for an option in an optgroup can be inaccurate if ( !support.optSelected ) { jQuery.propHooks.selected = { get: function( elem ) { diff --git a/src/attributes/support.js b/src/attributes/support.js index 376b54ad2..5db5c5212 100644 --- a/src/attributes/support.js +++ b/src/attributes/support.js @@ -9,21 +9,21 @@ define([ input.type = "checkbox"; - // Support: iOS 5.1, Android 4.x, Android 2.3 - // Check the default checkbox/radio value ("" on old WebKit; "on" elsewhere) + // Support: iOS<=5.1, Android<=4.2+ + // Default value for a checkbox should be "on" support.checkOn = input.value !== ""; - // Must access the parent to make an option select properly - // Support: IE9, IE10 + // Support: IE<=11+ + // Must access selectedIndex to make default options select support.optSelected = opt.selected; - // Make sure that the options inside disabled selects aren't marked as disabled - // (WebKit marks them as disabled) + // Support: Android<=2.3 + // Options inside disabled selects are incorrectly marked as disabled select.disabled = true; support.optDisabled = !opt.disabled; - // Check if an input maintains its value after becoming a radio - // Support: IE9, IE10 + // Support: IE<=11+ + // An input loses its value after becoming a radio input = document.createElement( "input" ); input.value = "t"; input.type = "radio"; diff --git a/src/attributes/val.js b/src/attributes/val.js index 42ef32343..4a1358a65 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -22,9 +22,9 @@ jQuery.fn.extend({ ret = elem.value; return typeof ret === "string" ? - // handle most common string cases + // Handle most common string cases ret.replace(rreturn, "") : - // handle cases where value is null/undef or number + // Handle cases where value is null/undef or number ret == null ? "" : ret; } @@ -132,7 +132,7 @@ jQuery.extend({ } } - // force browsers to behave consistently when non-matching value is set + // Force browsers to behave consistently when non-matching value is set if ( !optionSet ) { elem.selectedIndex = -1; } @@ -153,8 +153,6 @@ jQuery.each([ "radio", "checkbox" ], function() { }; if ( !support.checkOn ) { jQuery.valHooks[ this ].get = function( elem ) { - // Support: Webkit - // "" is returned instead of "on" if a value isn't specified return elem.getAttribute("value") === null ? "on" : elem.value; }; } |