Skip to content

Commit

Permalink
Docs: Update support comments to follow the new syntax
Browse files Browse the repository at this point in the history
The changes follow the spec proposed in:
jquery/contribute.jquery.org#95 (comment)
  • Loading branch information
mgol committed Mar 23, 2016
1 parent bc1cc54 commit 884284d
Show file tree
Hide file tree
Showing 28 changed files with 53 additions and 54 deletions.
2 changes: 1 addition & 1 deletion src/.jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

"sub": true,

// Support: IE < 10, Android < 4.1
// Support: IE <=9 only, Android <=4.0 only
// The above browsers are failing a lot of tests in the ES5
// test suite at http://test262.ecmascript.org.
"es3": true,
Expand Down
2 changes: 1 addition & 1 deletion src/ajax/parseXML.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jQuery.parseXML = function( data ) {
return null;
}

// Support: IE 9-11 only
// Support: IE 9 - 11 only
// IE throws on parseFromString with invalid input.
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
Expand Down
8 changes: 4 additions & 4 deletions src/ajax/xhr.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var xhrSuccessStatus = {
// File protocol always yields status code 0, assume 200
0: 200,

// Support: IE9 only
// Support: IE <=9 only
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
Expand Down Expand Up @@ -79,7 +79,7 @@ jQuery.ajaxTransport( function( options ) {
xhr.abort();
} else if ( type === "error" ) {

// Support: IE9 only
// Support: IE <=9 only
// On a manual native abort, IE9 throws
// errors on any property access that is not readyState
if ( typeof xhr.status !== "number" ) {
Expand All @@ -97,7 +97,7 @@ jQuery.ajaxTransport( function( options ) {
xhrSuccessStatus[ xhr.status ] || xhr.status,
xhr.statusText,

// Support: IE9 only
// Support: IE <=9 only
// IE9 has no XHR2 but throws on binary (trac-11426)
// For XHR2 non-text, let the caller handle it (gh-2498)
( xhr.responseType || "text" ) !== "text" ||
Expand All @@ -115,7 +115,7 @@ jQuery.ajaxTransport( function( options ) {
xhr.onload = callback();
errorCallback = xhr.onerror = callback( "error" );

// Support: IE9 only
// Support: IE 9 only
// Use onreadystatechange to replace onabort
// to handle uncaught aborts
if ( xhr.onabort !== undefined ) {
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jQuery.extend( {
tabIndex: {
get: function( elem ) {

// Support: IE 9-11 only
// Support: IE <=9 - 11 only
// elem.tabIndex doesn't always return the
// correct value when it hasn't been explicitly set
// https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
Expand Down
2 changes: 1 addition & 1 deletion src/attributes/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define( [

input.type = "checkbox";

// Support: Android<4.4
// Support: Android <=4.3 only
// Default value for a checkbox should be "on"
support.checkOn = input.value !== "";

Expand Down
10 changes: 5 additions & 5 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var
return new jQuery.fn.init( selector, context );
},

// Support: Android<4.1
// Support: Android <=4.0 only
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,

Expand Down Expand Up @@ -262,7 +262,7 @@ jQuery.extend( {
return obj + "";
}

// Support: Android<4.0 (functionish RegExp)
// Support: Android <=2.3 only (functionish RegExp)
return typeof obj === "object" || typeof obj === "function" ?
class2type[ toString.call( obj ) ] || "object" :
typeof obj;
Expand Down Expand Up @@ -305,7 +305,7 @@ jQuery.extend( {
return obj;
},

// Support: Android<4.1
// Support: Android <=4.0 only
trim: function( text ) {
return text == null ?
"" :
Expand Down Expand Up @@ -334,7 +334,7 @@ jQuery.extend( {
return arr == null ? -1 : indexOf.call( arr, elem, i );
},

// Support: Android<4.1, PhantomJS<2
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
merge: function( first, second ) {
var len = +second.length,
Expand Down Expand Up @@ -458,7 +458,7 @@ function( i, name ) {

function isArrayLike( obj ) {

// Support: iOS 8.2 (not reproducible in simulator)
// Support: iOS 8.2 only (not reproducible in simulator)
// `in` check used to prevent JIT error (gh-2145)
// hasOwn isn't used here due to false negatives
// regarding Nodelist length in IE
Expand Down
2 changes: 1 addition & 1 deletion src/core/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jQuery.ready.promise = function( obj ) {

// Catch cases where $(document).ready() is called
// after the browser event has already occurred.
// Support: IE9-10 only
// Support: IE <=9 - 10 only
// Older IE sometimes signals "interactive" too soon
if ( document.readyState === "complete" ||
( document.readyState !== "loading" && !document.documentElement.doScroll ) ) {
Expand Down
7 changes: 3 additions & 4 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,14 +119,14 @@ function getWidthOrHeight( elem, name, extra ) {
styles = getStyles( elem ),
isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box";

// Support: IE <= 11 only
// Support: IE <=11 only
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
if ( elem.getClientRects().length ) {
val = elem.getBoundingClientRect()[ name ];
}

// Support: IE11 only
// Support: IE 11 only
// In IE 11 fullscreen elements inside of an iframe have
// 100x too small dimensions (gh-1764).
if ( document.msFullscreenElement && window.top !== window ) {
Expand Down Expand Up @@ -251,7 +251,6 @@ jQuery.extend( {
value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" );
}

// Support: IE9-11+
// background-* props affect original clone's values
if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) {
style[ name ] = "inherit";
Expand Down Expand Up @@ -325,7 +324,7 @@ jQuery.each( [ "height", "width" ], function( i, name ) {
// Support: Safari 8+
// Table columns in Safari have non-zero offsetWidth & zero
// getBoundingClientRect().width unless display is changed.
// Support: IE <= 11 only
// Support: IE <=11 only
// Running getBoundingClientRect on a disconnected node
// in IE throws an error.
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
Expand Down
4 changes: 2 additions & 2 deletions src/css/curCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function curCSS( elem, name, computed ) {

computed = computed || getStyles( elem );

// Support: IE9 only
// Support: IE <=9 only
// getPropertyValue is only needed for .css('filter') (#12537)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
Expand Down Expand Up @@ -47,7 +47,7 @@ function curCSS( elem, name, computed ) {

return ret !== undefined ?

// Support: IE9-11 only
// Support: IE <=9 - 11 only
// IE returns zIndex value as an integer.
ret + "" :
ret;
Expand Down
2 changes: 1 addition & 1 deletion src/css/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ define( [
return;
}

// Support: IE9-11 only
// Support: IE <=9 - 11 only
// Style of cloned element affects source element cloned (#8908)
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
Expand Down
2 changes: 1 addition & 1 deletion src/css/var/getStyles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define( function() {
return function( elem ) {

// Support: IE<=11 only, Firefox<=30+ (#15098, #14150)
// Support: IE <=11 only, Firefox <=30 (#15098, #14150)
// IE throws on elements created in popups
// FF meanwhile throws on frame elements through "defaultView.getComputedStyle"
var view = elem.ownerDocument.defaultView;
Expand Down
2 changes: 1 addition & 1 deletion src/data/Data.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ Data.prototype = {
// Remove the expando if there's no more data
if ( key === undefined || jQuery.isEmptyObject( cache ) ) {

// Support: Chrome <= 35-45+
// Support: Chrome <=35 - 45
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
// https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
Expand Down
2 changes: 1 addition & 1 deletion src/deferred/exceptionHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;

jQuery.Deferred.exceptionHook = function( error, stack ) {

// Support: IE9 only
// Support: IE 8-9 only
// Console exists when dev tools are open, which can happen at any time
if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) {
window.console.warn( "jQuery.Deferred exception: " + error.message, stack );
Expand Down
2 changes: 1 addition & 1 deletion src/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ function Animation( elem, properties, options ) {
var currentTime = fxNow || createFxNow(),
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),

// Support: Android 2.3
// Support: Android 2.3 only
// Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497)
temp = remaining / animation.duration || 0,
percent = 1 - temp,
Expand Down
4 changes: 2 additions & 2 deletions src/effects/Tween.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Tween.propHooks = {
}
};

// Support: IE9 only
// Support: IE <=9 only
// Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
Expand All @@ -110,7 +110,7 @@ jQuery.easing = {

jQuery.fx = Tween.prototype.init;

// Back Compat <1.8 extension point
// Back compat <1.8 extension point
jQuery.fx.step = {};

} );
10 changes: 5 additions & 5 deletions src/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function returnFalse() {
return false;
}

// Support: IE9 only
// Support: IE <=9 only
// See #13393 for more info
function safeActiveElement() {
try {
Expand Down Expand Up @@ -347,11 +347,11 @@ jQuery.event = {
delegateCount = handlers.delegateCount,
cur = event.target;

// Support (at least): Chrome, IE9
// Support: IE <=9
// Find delegate handlers
// Black-hole SVG <use> instance trees (#13180)
//
// Support: Firefox<=42+
// Support: Firefox <=42
// Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343)
if ( delegateCount && cur.nodeType &&
( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) {
Expand Down Expand Up @@ -469,7 +469,7 @@ jQuery.event = {
event[ prop ] = originalEvent[ prop ];
}

// Support: Safari 6-8+
// Support: Safari <=6 - 7 only
// Target should not be a text node (#504, #13143)
if ( event.target.nodeType === 3 ) {
event.target = event.target.parentNode;
Expand Down Expand Up @@ -558,7 +558,7 @@ jQuery.Event = function( src, props ) {
this.isDefaultPrevented = src.defaultPrevented ||
src.defaultPrevented === undefined &&

// Support: Android<4.0
// Support: Android <=2.3 only
src.returnValue === false ?
returnTrue :
returnFalse;
Expand Down
4 changes: 2 additions & 2 deletions src/event/focusin.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ define( [
"./trigger"
], function( jQuery, dataPriv, support ) {

// Support: Firefox 44+
// Support: Firefox <=44+
// Firefox doesn't have focus(in | out) events
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
//
// Support: Chrome 48+, Safari 9.0+
// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1
// focus(in | out) events fire after focus & blur events,
// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order
// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
Expand Down
8 changes: 4 additions & 4 deletions src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ function domManip( collection, args, callback, ignored ) {
// Keep references to cloned scripts for later restoration
if ( hasScripts ) {

// Support: Android<4.1, PhantomJS<2
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( scripts, getAll( node, "script" ) );
}
Expand Down Expand Up @@ -292,13 +292,13 @@ jQuery.extend( {
}
}

// Support: Chrome <= 35-45+
// Support: Chrome <=35 - 45+
// Assign undefined instead of using delete, see Data#remove
elem[ dataPriv.expando ] = undefined;
}
if ( elem[ dataUser.expando ] ) {

// Support: Chrome <= 35-45+
// Support: Chrome <=35 - 45+
// Assign undefined instead of using delete, see Data#remove
elem[ dataUser.expando ] = undefined;
}
Expand Down Expand Up @@ -465,7 +465,7 @@ jQuery.each( {
elems = i === last ? this : this.clone( true );
jQuery( insert[ i ] )[ original ]( elems );

// Support: Android<4.1, PhantomJS<2
// Support: Android <=4.0 only, PhantomJS 1 only
// .get() because push.apply(_, arraylike) throws on ancient WebKit
push.apply( ret, elems.get() );
}
Expand Down
4 changes: 2 additions & 2 deletions src/manipulation/buildFragment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
// Add nodes directly
if ( jQuery.type( elem ) === "object" ) {

// Support: Android<4.1, PhantomJS<2
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );

Expand All @@ -47,7 +47,7 @@ function buildFragment( elems, context, scripts, selection, ignored ) {
tmp = tmp.lastChild;
}

// Support: Android<4.1, PhantomJS<2
// Support: Android <=4.0 only, PhantomJS 1 only
// push.apply(_, arraylike) throws on ancient WebKit
jQuery.merge( nodes, tmp.childNodes );

Expand Down
2 changes: 1 addition & 1 deletion src/manipulation/getAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define( [

function getAll( context, tag ) {

// Support: IE9-11 only
// Support: IE <=9 - 11 only
// Use typeof to avoid zero-argument method invocation on host objects (#15151)
var ret = typeof context.getElementsByTagName !== "undefined" ?
context.getElementsByTagName( tag || "*" ) :
Expand Down
4 changes: 2 additions & 2 deletions src/manipulation/support.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ define( [

div.appendChild( input );

// Support: Android<4.2
// Support: Android <=4.1 only
// Older WebKit doesn't clone checked state correctly in fragments
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;

// Support: IE<=11 only
// Support: IE <=11 only
// Make sure textarea (and checkbox) defaultValue is properly cloned
div.innerHTML = "<textarea>x</textarea>";
support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
Expand Down
4 changes: 2 additions & 2 deletions src/manipulation/wrapMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ define( function() {
// We have to close these tags to support XHTML (#13200)
var wrapMap = {

// Support: IE9
// Support: IE <=9 only
option: [ 1, "<select multiple='multiple'>", "</select>" ],

// XHTML parsers do not magically insert elements in the
Expand All @@ -17,7 +17,7 @@ var wrapMap = {
_default: [ 0, "", "" ]
};

// Support: IE9
// Support: IE <=9 only
wrapMap.optgroup = wrapMap.option;

wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
Expand Down
2 changes: 1 addition & 1 deletion src/offset.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function(
};
} );

// Support: Safari<7-9.0+, Chrome<37-48+
// Support: Safari <=7 - 9.1, Chrome <=37 - 49
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
Expand Down
Loading

0 comments on commit 884284d

Please sign in to comment.