Skip to content
Permalink
Browse files
Support: clean up comments and Support notation
Closes gh-1577
  • Loading branch information
dmethvin committed Jun 11, 2014
1 parent ff9dcfb commit d837f119c3729565103005d5d7fa89e1dd8110cb
@@ -44,8 +44,8 @@ var
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
allTypes = "*/".concat("*");

// #8138, IE may throw an exception when accessing
// a field from window.location if document.domain has been set
// Support: IE6
// Exception accessing window.location.href if document.domain is set (#8138)
try {
ajaxLocation = location.href;
} catch( e ) {
@@ -610,7 +610,7 @@ jQuery.extend({
return jqXHR.abort();
}

// aborting is no longer a cancellation
// Aborting is no longer a cancellation
strAbort = "abort";

// Install callbacks on deferreds
@@ -722,8 +722,7 @@ jQuery.extend({
isSuccess = !error;
}
} else {
// We extract error from statusText
// then normalize statusText and status for non-aborts
// Extract error from statusText and normalize for non-aborts
error = statusText;
if ( status || !statusText ) {
statusText = "error";
@@ -779,7 +778,7 @@ jQuery.extend({

jQuery.each( [ "get", "post" ], function( i, method ) {
jQuery[ method ] = function( url, data, callback, type ) {
// shift arguments if data argument was omitted
// Shift arguments if data argument was omitted
if ( jQuery.isFunction( data ) ) {
type = type || callback;
callback = data;
@@ -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 ) {
@@ -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.
@@ -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 ) {
@@ -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";
@@ -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;
};
}
@@ -132,7 +132,7 @@ jQuery.extend = jQuery.fn.extend = function() {
if ( typeof target === "boolean" ) {
deep = target;

// skip the boolean and the target
// Skip the boolean and the target
target = arguments[ i ] || {};
i++;
}
@@ -142,7 +142,7 @@ jQuery.extend = jQuery.fn.extend = function() {
target = {};
}

// extend jQuery itself if only one argument is passed
// Extend jQuery itself if only one argument is passed
if ( i === length ) {
target = this;
i--;
@@ -199,9 +199,6 @@ jQuery.extend({

noop: function() {},

// See test/unit/core.js for details concerning isFunction.
// Since version 1.3, DOM methods and functions like alert
// aren't supported. They return false on IE (#2968).
isFunction: function( obj ) {
return jQuery.type(obj) === "function";
},
@@ -251,7 +248,7 @@ jQuery.extend({
if ( obj == null ) {
return obj + "";
}
// Support: Android < 4.0, iOS < 6 (functionish RegExp)
// Support: Android<4.0, iOS<6 (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[ toString.call(obj) ] || "object" :
typeof obj;
@@ -281,6 +278,7 @@ jQuery.extend({
},

// Convert dashed to camelCase; used by the css and data modules
// Support: IE9-11+
// Microsoft forgot to hump their vendor prefix (#9572)
camelCase: function( string ) {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
@@ -38,7 +38,7 @@ var rootjQuery,
if ( match[1] ) {
context = context instanceof jQuery ? context[0] : context;

// scripts is true for back-compat
// Option to run scripts is true for back-compat
// Intentionally let the error be thrown if parseHTML is not present
jQuery.merge( this, jQuery.parseHTML(
match[1],
@@ -66,8 +66,8 @@ var rootjQuery,
} else {
elem = document.getElementById( match[2] );

// Check parentNode to catch when Blackberry 4.6 returns
// nodes that are no longer in the document #6963
// Support: Blackberry 4.6
// gEBID returns nodes no longer in the document (#6963)
if ( elem && elem.parentNode ) {
// Inject the element directly into the jQuery object
this.length = 1;
@@ -73,7 +73,7 @@ jQuery.ready.promise = function( obj ) {
readyList = jQuery.Deferred();

// Catch cases where $(document).ready() is called after the browser event has already occurred.
// we once tried to use readyState "interactive" here, but it caused issues like the one
// We once tried to use readyState "interactive" here, but it caused issues like the one
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
if ( document.readyState === "complete" ) {
// Handle it asynchronously to allow scripts the opportunity to delay ready
Loading

0 comments on commit d837f11

Please sign in to comment.