From: Michał Gołębiowski Date: Wed, 23 Mar 2016 14:03:06 +0000 (+0100) Subject: Docs: Update support comments to follow the new syntax X-Git-Tag: 3.0.0-rc1~51 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6072d150d61655ec07f714e1d58a0bd7baa5ec3f;p=jquery.git 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 --- diff --git a/src/.jshintrc b/src/.jshintrc index ea3549d5c..a45fdb5ba 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -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, diff --git a/src/ajax/parseXML.js b/src/ajax/parseXML.js index eb17dbd26..8b13139a5 100644 --- a/src/ajax/parseXML.js +++ b/src/ajax/parseXML.js @@ -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" ); diff --git a/src/ajax/xhr.js b/src/ajax/xhr.js index 9b8f47310..5a93891ab 100644 --- a/src/ajax/xhr.js +++ b/src/ajax/xhr.js @@ -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 ) { diff --git a/src/attributes/prop.js b/src/attributes/prop.js index af3be36d0..908c19ff6 100644 --- a/src/attributes/prop.js +++ b/src/attributes/prop.js @@ -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/ diff --git a/src/attributes/support.js b/src/attributes/support.js index 16c8fcb82..ee6115a68 100644 --- a/src/attributes/support.js +++ b/src/attributes/support.js @@ -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 !== ""; diff --git a/src/core.js b/src/core.js index e86ae2048..a9898e51d 100644 --- a/src/core.js +++ b/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 diff --git a/src/core/ready.js b/src/core/ready.js index 73c3d706a..d8c688832 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -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 ) ) { diff --git a/src/css.js b/src/css.js index f8bd8636a..9e673fc18 100644 --- a/src/css.js +++ b/src/css.js @@ -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 ) ? diff --git a/src/css/curCSS.js b/src/css/curCSS.js index 9054d4cf9..5f738c2d0 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -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; diff --git a/src/css/support.js b/src/css/support.js index 0c02b71d7..b0a0c4d10 100644 --- a/src/css/support.js +++ b/src/css/support.js @@ -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"; diff --git a/src/css/var/getStyles.js b/src/css/var/getStyles.js index f9dc5cb24..f3aab668b 100644 --- a/src/css/var/getStyles.js +++ b/src/css/var/getStyles.js @@ -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; diff --git a/src/data/Data.js b/src/data/Data.js index 779b291a5..cc8822a3c 100644 --- a/src/data/Data.js +++ b/src/data/Data.js @@ -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) diff --git a/src/deferred/exceptionHook.js b/src/deferred/exceptionHook.js index 652cc7d64..99d2819bf 100644 --- a/src/deferred/exceptionHook.js +++ b/src/deferred/exceptionHook.js @@ -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 ); diff --git a/src/effects.js b/src/effects.js index 1c7e2c2f8..4adb23024 100644 --- a/src/effects.js +++ b/src/effects.js @@ -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, diff --git a/src/effects/Tween.js b/src/effects/Tween.js index 8379ded7a..399823901 100644 --- a/src/effects/Tween.js +++ b/src/effects/Tween.js @@ -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 = {}; } ); diff --git a/src/event.js b/src/event.js index 8cd8e3faa..ddd117cfe 100644 --- a/src/event.js +++ b/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 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; diff --git a/src/event/focusin.js b/src/event/focusin.js index 6c6267be3..c7af0df2c 100644 --- a/src/event/focusin.js +++ b/src/event/focusin.js @@ -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 diff --git a/src/manipulation.js b/src/manipulation.js index 7d4fc295b..a041408d7 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -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() ); } diff --git a/src/manipulation/buildFragment.js b/src/manipulation/buildFragment.js index cfdd1c0e6..1db3caa38 100644 --- a/src/manipulation/buildFragment.js +++ b/src/manipulation/buildFragment.js @@ -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 ); diff --git a/src/manipulation/getAll.js b/src/manipulation/getAll.js index a5a0ccaf2..5f3141048 100644 --- a/src/manipulation/getAll.js +++ b/src/manipulation/getAll.js @@ -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 || "*" ) : diff --git a/src/manipulation/support.js b/src/manipulation/support.js index da474e0a3..d01c439ee 100644 --- a/src/manipulation/support.js +++ b/src/manipulation/support.js @@ -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 = ""; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; diff --git a/src/manipulation/wrapMap.js b/src/manipulation/wrapMap.js index fdb430a03..921c2eac5 100644 --- a/src/manipulation/wrapMap.js +++ b/src/manipulation/wrapMap.js @@ -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, "" ], // 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; diff --git a/src/offset.js b/src/offset.js index 0ff739df8..907dc0989 100644 --- a/src/offset.js +++ b/src/offset.js @@ -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 diff --git a/test/unit/css.js b/test/unit/css.js index c82d8c203..26660ab4f 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -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. diff --git a/test/unit/deferred.js b/test/unit/deferred.js index e2683fd92..3854f225f 100644 --- a/test/unit/deferred.js +++ b/test/unit/deferred.js @@ -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. diff --git a/test/unit/deprecated.js b/test/unit/deprecated.js index baf4562b1..e559db82f 100644 --- a/test/unit/deprecated.js +++ b/test/unit/deprecated.js @@ -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" ); diff --git a/test/unit/event.js b/test/unit/event.js index 33393c835..1c46b4607 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -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 ); diff --git a/test/unit/offset.js b/test/unit/offset.js index ba40e11f1..52113fb9f 100644 --- a/test/unit/offset.js +++ b/test/unit/offset.js @@ -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" );