mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Docs: Update support comments to follow the new syntax
The changes follow the spec proposed in: https://github.com/jquery/contribute.jquery.org/issues/95#issuecomment-69379197
This commit is contained in:
parent
693f1b537b
commit
6072d150d6
@ -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,
|
||||
|
@ -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" );
|
||||
|
@ -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
|
||||
},
|
||||
@ -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" ) {
|
||||
@ -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" ||
|
||||
@ -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 ) {
|
||||
|
@ -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/
|
||||
|
@ -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 !== "";
|
||||
|
||||
|
10
src/core.js
10
src/core.js
@ -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,
|
||||
|
||||
@ -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;
|
||||
@ -305,7 +305,7 @@ jQuery.extend( {
|
||||
return obj;
|
||||
},
|
||||
|
||||
// Support: Android<4.1
|
||||
// Support: Android <=4.0 only
|
||||
trim: function( text ) {
|
||||
return text == null ?
|
||||
"" :
|
||||
@ -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,
|
||||
@ -458,7 +458,7 @@ function( i, name ) {
|
||||
|
||||
function isArrayLike( obj ) {
|
||||
|
||||
// Support: iOS 8.2 (not reproducible in simulator)
|
||||
// Support: real 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
|
||||
|
@ -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 ) ) {
|
||||
|
@ -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 ) {
|
||||
@ -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";
|
||||
@ -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 ) ?
|
||||
|
@ -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 ];
|
||||
@ -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;
|
||||
|
@ -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 = "";
|
||||
@ -45,7 +45,7 @@ define( [
|
||||
var divStyle = window.getComputedStyle( div );
|
||||
pixelPositionVal = divStyle.top !== "1%";
|
||||
|
||||
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44+
|
||||
// Support: Android 4.0 - 4.3 only, Firefox <=3 - 44
|
||||
reliableMarginLeftVal = divStyle.marginLeft === "2px";
|
||||
boxSizingReliableVal = divStyle.width === "4px";
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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)
|
||||
|
@ -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 );
|
||||
|
2
src/effects.js
vendored
2
src/effects.js
vendored
@ -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,
|
||||
|
@ -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 ) {
|
||||
@ -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
src/event.js
10
src/event.js
@ -22,7 +22,7 @@ function returnFalse() {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Support: IE9 only
|
||||
// Support: IE <=9 only
|
||||
// See #13393 for more info
|
||||
function safeActiveElement() {
|
||||
try {
|
||||
@ -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 ) ) {
|
||||
@ -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;
|
||||
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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" ) );
|
||||
}
|
||||
@ -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;
|
||||
}
|
||||
@ -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() );
|
||||
}
|
||||
|
@ -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 );
|
||||
|
||||
@ -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 );
|
||||
|
||||
|
@ -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 || "*" ) :
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
@ -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;
|
||||
|
@ -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
|
||||
|
@ -1398,7 +1398,7 @@ QUnit.test(
|
||||
}
|
||||
);
|
||||
|
||||
// Support: IE < 11
|
||||
// Support: IE <=10 only
|
||||
// We have to jump through the hoops here in order to test work with "order" CSS property,
|
||||
// that some browsers do not support. This test is not, strictly speaking, correct,
|
||||
// but it's the best that we can do.
|
||||
|
@ -535,7 +535,7 @@ QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook", func
|
||||
|
||||
window.console.warn = function( msg ) {
|
||||
|
||||
// Support: Chrome < 42
|
||||
// Support: Chrome <=41 only
|
||||
// Some Chrome versions newer than 30 but older than 42 display the "undefined is
|
||||
// not a function" error, not mentioning the function name. This has been fixed
|
||||
// in Chrome 42. Relax this test there.
|
||||
@ -590,7 +590,7 @@ QUnit[ window.console ? "test" : "skip" ]( "jQuery.Deferred.exceptionHook with s
|
||||
|
||||
window.console.warn = function( msg, stack ) {
|
||||
|
||||
// Support: Chrome < 42
|
||||
// Support: Chrome <=41 only
|
||||
// Some Chrome versions newer than 30 but older than 42 display the "undefined is
|
||||
// not a function" error, not mentioning the function name. This has been fixed
|
||||
// in Chrome 42. Relax this test there.
|
||||
|
@ -83,7 +83,7 @@ QUnit.test( "jQuery.parseJSON", function( assert ) {
|
||||
assert.throws( function() {
|
||||
var result = jQuery.parseJSON( "0101" );
|
||||
|
||||
// Support: IE9+
|
||||
// Support: IE <=9 only
|
||||
// Ensure base-10 interpretation on browsers that erroneously accept leading-zero numbers
|
||||
if ( result === 101 ) {
|
||||
throw new Error( "close enough" );
|
||||
|
@ -1382,7 +1382,7 @@ QUnit.test( "Submit event can be stopped (#11049)", function( assert ) {
|
||||
form.remove();
|
||||
} );
|
||||
|
||||
// Support: iOS 7-9+
|
||||
// Support: iOS 7 - 9
|
||||
// iOS has the window.onbeforeunload field but doesn't support the beforeunload
|
||||
// handler making it impossible to feature-detect the support.
|
||||
QUnit[ /(ipad|iphone|ipod)/i.test( navigator.userAgent ) ? "skip" : "test" ](
|
||||
@ -2396,7 +2396,7 @@ QUnit.test( "event object properties on natively-triggered event", function( ass
|
||||
$link = jQuery( link ),
|
||||
evt = document.createEvent( "MouseEvents" );
|
||||
|
||||
// Support: IE 9-11 only
|
||||
// Support: IE <=9 - 11 only
|
||||
// IE requires element to be in the body before it will dispatch
|
||||
$link.appendTo( "body" ).on( "click", function( e ) {
|
||||
|
||||
@ -2867,7 +2867,7 @@ QUnit[ jQuery.fn.click ? "test" : "skip" ]( "Event aliases", function( assert )
|
||||
} );
|
||||
} );
|
||||
|
||||
// Support: IE9 only
|
||||
// Support: IE <=9 only
|
||||
// https://msdn.microsoft.com/en-us/library/hh801223(v=vs.85).aspx
|
||||
QUnit.test( "VML with special event handlers (trac-7071)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
@ -540,7 +540,7 @@ QUnit.test( "fractions (see #7730 and #7885)", function( assert ) {
|
||||
|
||||
result = div.offset();
|
||||
|
||||
// Support: Chrome 45-46+
|
||||
// Support: Chrome <=45 - 46
|
||||
// In recent Chrome these values differ a little.
|
||||
assert.ok( Math.abs( result.top - expected.top ) < 0.25, "Check top within 0.25 of expected" );
|
||||
assert.equal( result.left, expected.left, "Check left" );
|
||||
|
Loading…
Reference in New Issue
Block a user