From 08e8621ba2da5531a553c9dd5646075274ee6594 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82=C4=99biowski?= Date: Wed, 23 Mar 2016 15:03:06 +0100 Subject: [PATCH] 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 --- src/.jshintrc | 2 +- src/ajax/parseXML.js | 2 +- src/ajax/xhr.js | 8 ++++---- src/attributes/prop.js | 2 +- src/attributes/support.js | 2 +- src/attributes/val.js | 2 +- src/core.js | 10 +++++----- src/core/ready.js | 2 +- src/css.js | 7 +++---- src/css/curCSS.js | 4 ++-- src/css/support.js | 2 +- src/css/var/getStyles.js | 2 +- src/data/Data.js | 2 +- src/deferred/exceptionHook.js | 2 +- src/effects.js | 2 +- src/effects/Tween.js | 4 ++-- src/event.js | 10 +++++----- src/event/focusin.js | 2 +- src/manipulation.js | 8 ++++---- src/manipulation/buildFragment.js | 4 ++-- src/manipulation/getAll.js | 2 +- src/manipulation/support.js | 4 ++-- src/manipulation/wrapMap.js | 4 ++-- src/offset.js | 2 +- test/unit/css.js | 2 +- test/unit/deferred.js | 4 ++-- test/unit/deprecated.js | 2 +- test/unit/event.js | 6 +++--- test/unit/offset.js | 2 +- 29 files changed, 53 insertions(+), 54 deletions(-) diff --git a/src/.jshintrc b/src/.jshintrc index ea3549d5c6d..8dda6cc7f7b 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -12,7 +12,7 @@ "sub": true, - // Support: IE < 10, Android < 4.1 + // Support: IE <=9, Android <=4.0 // 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 eb17dbd262b..8b13139a5e6 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 9b8f473101d..a9fbbaf489e 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 af3be36d034..21d8c2023ad 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 16c8fcb82dd..76aa4faea12 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 // Default value for a checkbox should be "on" support.checkOn = input.value !== ""; diff --git a/src/attributes/val.js b/src/attributes/val.js index 0f760bed731..d4523f67d38 100644 --- a/src/attributes/val.js +++ b/src/attributes/val.js @@ -108,7 +108,7 @@ jQuery.extend( { for ( ; i < max; i++ ) { option = options[ i ]; - // Support: IE <10 only + // Support: IE <=9 only // IE8-9 doesn't update selected after form reset (#2551) if ( ( option.selected || i === index ) && diff --git a/src/core.js b/src/core.js index e49b0a9fc28..f7634a58152 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 // 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 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: 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 73c3d706a24..243b3eb44e1 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 f8bd8636aaa..9e673fc180a 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 9054d4cf97a..4ea1e71e595 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 1150485bfa1..235bfa51285 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 = ""; diff --git a/src/css/var/getStyles.js b/src/css/var/getStyles.js index f9dc5cb2454..0989b79005c 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 779b291a5d1..d9ac94caf90 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 652cc7d647b..a320f2947a7 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 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 b33c506f16a..b894cdc05d9 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 8379ded7a4b..8f85d3d5243 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 8cd8e3faae2..be303affb13 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 (at least): 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 - 8+ // 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 6c6267be395..8e9e0a9ee8a 100644 --- a/src/event/focusin.js +++ b/src/event/focusin.js @@ -11,7 +11,7 @@ define( [ // 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 49+, Safari 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 26662682a29..d305fc192f3 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 cfdd1c0e67c..1db3caa38d5 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 a5a0ccaf201..a725b99096d 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: IE9 - 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 da474e0a312..d01c439eef8 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 fdb430a03be..3a2ae5526e0 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 option: [ 1, "" ], // XHTML parsers do not magically insert elements in the @@ -17,7 +17,7 @@ var wrapMap = { _default: [ 0, "", "" ] }; -// Support: IE9 +// Support: IE 9 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 0ff739df861..e7c5fa0b615 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 3e4feb1a78f..2c5019f1109 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 e2683fd92fc..513c104dbfb 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 // 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 // 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 baf4562b185..4e697594553 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 dc1e95ceef6..17dad313df3 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 ) { @@ -2920,7 +2920,7 @@ if ( !( /firefox/i.test( window.navigator.userAgent ) ) ) { $text = jQuery( "#text1" ), $radio = jQuery( "#radio1" ).trigger( "focus" ); - // Support: IE <11 only + // Support: IE <=10 only // IE8-10 fire focus/blur events asynchronously; this is the resulting mess. // IE's browser window must be topmost for this to work properly!! QUnit.stop(); diff --git a/test/unit/offset.js b/test/unit/offset.js index ba40e11f1a5..7dd51d66cc0 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" );