return null;
}
- // Support: IE9
+ // Support: IE 9-11 only
+ // IE throws on parseFromString with invalid input.
try {
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
} catch ( e ) {
// File protocol always yields status code 0, assume 200
0: 200,
- // Support: IE9
+ // Support: IE9 only
// #1450: sometimes IE returns 1223 when it should be 204
1223: 204
},
xhr.abort();
} else if ( type === "error" ) {
- // Support: IE9
+ // Support: IE9 only
// On a manual native abort, IE9 throws
// errors on any property access that is not readyState
if ( typeof xhr.status !== "number" ) {
xhr.onload = callback();
errorCallback = xhr.onerror = callback( "error" );
- // Support: IE9
+ // Support: IE9 only
// Use onreadystatechange to replace onabort
// to handle uncaught aborts
if ( xhr.onabort !== undefined ) {
"../var/support"
], function( document, support ) {
-// Support: Safari 8+
+// Support: Safari 8 only
// In Safari 8 documents created via document.implementation.createHTMLDocument
// collapse sibling forms: the second one becomes a child of the first one.
// Because of that, this security measure has to be disabled in Safari 8.
computed = computed || getStyles( elem );
- // Support: IE9
+ // Support: IE9 only
// getPropertyValue is only needed for .css('filter') (#12537)
if ( computed ) {
ret = computed.getPropertyValue( name ) || computed[ name ];
return ret !== undefined ?
- // Support: IE9-11+
+ // Support: IE9-11 only
// IE returns zIndex value as an integer.
ret + "" :
ret;
}
if ( elem.style.display === "" && jQuery.css( elem, "display" ) === "none" &&
- // Support: Firefox <=42 - 43
+ // Support: Firefox 43+
// Don't set inline display on disconnected elements with computed display: none
jQuery.contains( elem.ownerDocument, elem ) ) {
return;
}
- // Support: IE9-11+
+ // Support: IE9-11 only
// Style of cloned element affects source element cloned (#8908)
div.style.backgroundClip = "content-box";
div.cloneNode( true ).style.backgroundClip = "";
},
pixelMarginRight: function() {
- // Support: Android 4.0-4.3
+ // Support: Android 4.0 - 4.3 only
// We're checking for boxSizingReliableVal here instead of pixelMarginRightVal
// since that compresses better and they're computed together anyway.
if ( boxSizingReliableVal == null ) {
},
reliableMarginLeft: function() {
- // Support: IE <=8 only, Android 4.0 - 4.3 only, Firefox <=3 - 37
+ // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44+
if ( boxSizingReliableVal == null ) {
computeStyleTests();
}
define( function() {
return function( elem ) {
- // Support: IE<=11+, 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;
// Support: Chrome <= 35-45+
// Webkit & Blink performance suffers when deleting properties
// from DOM nodes, so set to undefined instead
- // https://code.google.com/p/chromium/issues/detail?id=378607
+ // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted)
if ( owner.nodeType ) {
owner[ this.expando ] = undefined;
} else {
jQuery.Deferred.exceptionHook = function( error, stack ) {
- // Support: IE9
+ // Support: IE9 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 );
}
};
-// Support: IE9
+// Support: IE9 only
// Panic based approach to setting things on disconnected nodes
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
set: function( tween ) {
return false;
}
-// Support: IE9
+// Support: IE9 only
// See #13393 for more info
function safeActiveElement() {
try {
//
// Support: Safari 7 only
// Safari sends mouseenter too often; see:
-// https://code.google.com/p/chromium/issues/detail?id=470258
+// https://bugs.chromium.org/p/chromium/issues/detail?id=470258
// for the description of the bug (it existed in older Chrome versions as well).
jQuery.each( {
mouseenter: "mouseover",
"./trigger"
], function( jQuery, dataPriv, support ) {
-// Support: Firefox
+// Support: Firefox 44+
// Firefox doesn't have focus(in | out) events
// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787
//
-// Support: Chrome, Safari
+// Support: Chrome 48+, Safari 9.0+
// 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://code.google.com/p/chromium/issues/detail?id=449857
+// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857
if ( !support.focusin ) {
jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) {
function getAll( context, tag ) {
- // Support: IE9-11+
+ // 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 || "*" ) :
div = fragment.appendChild( document.createElement( "div" ) ),
input = document.createElement( "input" );
- // Support: Android 4.0-4.3
+ // Support: Android 4.0 - 4.3 only
// Check state lost if the name is set (#11217)
// Support: Windows Web Apps (WWA)
// `name` and `type` must use .setAttribute for WWA (#14901)
// Older WebKit doesn't clone checked state correctly in fragments
support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
- // Support: IE<=11+
+ // 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;
};
} );
-// Support: Safari<7-8+, Chrome<37-44+
+// Support: Safari<7-9.0+, Chrome<37-48+
// Add the top/left cssHooks using jQuery.fn.position
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-// Blink bug: https://code.google.com/p/chromium/issues/detail?id=229280
+// Blink bug: https://bugs.chromium.org/p/chromium/issues/detail?id=589347
// getComputedStyle returns percent when specified for top/left/bottom/right;
// rather than make the css module depend on the offset module, just check for it here
jQuery.each( [ "top", "left" ], function( i, prop ) {
"Nullable": null,
"undefined": undefined
- // Support: Firefox
+ // Support: IE 9 - 11, Edge 12 - 13+
// Not all browsers allow empty-string headers
- // https://bugzilla.mozilla.org/show_bug.cgi?id=815299
//"Empty": ""
},
success: function( data, _, xhr ) {
}
QUnit.asyncTest( "#11743 - jQuery.ajax() - script, throws exception", 1, function( assert ) {
-
- // Support: Android 2.3 only
- // Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- assert.ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
- "errors in dynamically included scripts" );
- QUnit.start();
- return;
- }
-
var onerror = window.onerror;
window.onerror = function() {
assert.ok( true, "Exception thrown" );
var parsedXML = jQuery( jQuery.parseXML( "<tab title=\"Added\">blibli</tab>" ) ).find( "tab" );
ajaxXML = jQuery( ajaxXML );
try {
-
- // Android 2.3 doesn't automatically adopt nodes from foreign documents.
- // (see the comment in test/manipulation.js)
- // Support: Android 2.3
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- parsedXML = jQuery( ajaxXML[ 0 ].adoptNode( parsedXML[ 0 ] ) );
- }
ajaxXML.find( "infowindowtab" ).append( parsedXML );
} catch ( e ) {
assert.strictEqual( e, undefined, "error" );
assert.strictEqual( elem1.text( "foo" ).text(), "foo", ".html getter/setter" );
assert.strictEqual(
-
- // Support: IE 8 only
- // IE 8 prints tag names in upper case.
- elem1.html( "<span/>" ).html().toLowerCase(),
+ elem1.html( "<span/>" ).html(),
"<span></span>",
".html getter/setter"
);
child.before( "<b/>" );
assert.strictEqual(
-
- // Support: IE 8 only
- // IE 8 prints tag names in upper case.
- elem1.html().toLowerCase(),
+ elem1.html(),
"<div></div><b></b><span></span><a></a>",
".after/.before"
);
elem.find( "b" ).wrap( "<span>" );
assert.strictEqual(
-
- // Support: IE 8 only
- // IE 8 prints tag names in upper case.
- elem.html().toLowerCase(),
+ elem.html(),
"<a><span><b></b></span></a><a></a>",
".wrap"
);
elem.find( "span" ).wrapInner( "<em>" );
assert.strictEqual(
-
- // Support: IE 8 only
- // IE 8 prints tag names in upper case.
- elem.html().toLowerCase(),
+ elem.html(),
"<a><span><em><b></b></em></span></a><a></a>",
".wrapInner"
);
elem.find( "a" ).wrapAll( "<i>" );
assert.strictEqual(
-
- // Support: IE 8 only
- // IE 8 prints tag names in upper case.
- elem.html().toLowerCase(),
+ elem.html(),
"<i><a><span><em><b></b></em></span></a><a></a></i>",
".wrapAll"
);
$div.css( "fill-opacity", 1 );
- // Support: Android 2.3 (no support for fill-opacity)
- if ( $div.css( "fill-opacity" ) !== undefined ) {
- assert.equal( $div.css( "fill-opacity" ), 1, "Do not append px to 'fill-opacity'" );
- } else {
- assert.ok( true, "No support for fill-opacity CSS property" );
- }
+ assert.equal( $div.css( "fill-opacity" ), 1, "Do not append px to 'fill-opacity'" );
$div.css( "column-count", 1 );
if ( $div.css( "column-count" ) !== undefined ) {
QUnit.test( "css('width') and css('height') should respect box-sizing, see #11004", function( assert ) {
assert.expect( 4 );
- // Support: Android 2.3 (-webkit-box-sizing).
- var el_dis = jQuery( "<div style='width:300px;height:300px;margin:2px;padding:2px;-webkit-box-sizing:border-box;box-sizing:border-box;'>test</div>" ),
+ var el_dis = jQuery( "<div style='width:300px;height:300px;margin:2px;padding:2px;box-sizing:border-box;'>test</div>" ),
el = el_dis.clone().appendTo( "#qunit-fixture" );
assert.equal( el.css( "width" ), el.css( "width", el.css( "width" ) ).css( "width" ), "css('width') is not respecting box-sizing, see #11004" );
assert.equal( typeof el.css( "fontWeight" ), "string", ".css() returns a string" );
} );
-// only run this test in IE9
+// Support: IE 9 only
+// Only run this test in IE9
if ( document.documentMode === 9 ) {
QUnit.test( ".css('filter') returns a string in IE9, see #12537", function( assert ) {
assert.expect( 1 );
assert.equal( $divChild.outerWidth(), $divNormal.outerWidth(), "child of a hidden element outerWidth() is wrong see #9441" );
assert.equal( $divChild.outerWidth( true ), $divNormal.outerWidth( true ), "child of a hidden element outerWidth( true ) is wrong see #9300" );
- // Support: IE 10-11, Edge
+ // Support: IE 10 - 11, Edge 12 - 13+
// Child height is not always decimal
assert.equal( $divChild.height().toFixed( 3 ), $divNormal.height().toFixed( 3 ), "child of a hidden element height() is wrong see #9441" );
assert.equal( $divChild.innerHeight().toFixed( 3 ), $divNormal.innerHeight().toFixed( 3 ), "child of a hidden element innerHeight() is wrong see #9441" );
assert.equal( $divUnconnected.outerWidth(), $divNormal.outerWidth(), "unconnected element outerWidth() is wrong see #9441" );
assert.equal( $divUnconnected.outerWidth( true ), $divNormal.outerWidth( true ), "unconnected element outerWidth( true ) is wrong see #9300" );
- // Support: IE 10-11, Edge
+ // Support: IE 10 - 11, Edge 12 - 13+
// Child height is not always decimal
assert.equal( $divUnconnected.height().toFixed( 3 ), $divNormal.height().toFixed( 3 ), "unconnected element height() is wrong see #9441" );
assert.equal( $divUnconnected.innerHeight().toFixed( 3 ), $divNormal.innerHeight().toFixed( 3 ), "unconnected element innerHeight() is wrong see #9441" );
assert.equal( $divChild.outerWidth(), $divNormal.outerWidth(), "child of a hidden element outerWidth() is wrong see #10413" );
assert.equal( $divChild.outerWidth( true ), $divNormal.outerWidth( true ), "child of a hidden element outerWidth( true ) is wrong see #10413" );
- // Support: IE 10-11, Edge
+ // Support: IE 10 - 11, Edge 12 - 13+
// Child height is not always decimal
assert.equal( $divChild.height().toFixed( 3 ), $divNormal.height().toFixed( 3 ), "child of a hidden element height() is wrong see #10413" );
assert.equal( $divChild.innerHeight().toFixed( 3 ), $divNormal.innerHeight().toFixed( 3 ), "child of a hidden element innerHeight() is wrong see #10413" );
assert.equal( $divUnconnected.outerWidth(), $divNormal.outerWidth(), "unconnected element outerWidth() is wrong see #10413" );
assert.equal( $divUnconnected.outerWidth( true ), $divNormal.outerWidth( true ), "unconnected element outerWidth( true ) is wrong see #10413" );
- // Support: IE 10-11, Edge
+ // Support: IE 10 - 11, Edge 12 - 13+
// Child height is not always decimal
assert.equal( $divUnconnected.height().toFixed( 3 ), $divNormal.height().toFixed( 3 ), "unconnected element height() is wrong see #10413" );
assert.equal( $divUnconnected.innerHeight().toFixed( 3 ), $divNormal.innerHeight().toFixed( 3 ), "unconnected element innerHeight() is wrong see #10413" );
var $div = jQuery( "<div>" ).appendTo( "#qunit-fixture" );
$div.css( "fill-opacity", 0 ).animate( { "fill-opacity": 1.0 }, 0, function() {
-
- // Support: Android 2.3 (no support for fill-opacity)
- if ( jQuery( this ).css( "fill-opacity" ) ) {
- assert.equal( jQuery( this ).css( "fill-opacity" ), 1, "Do not append px to 'fill-opacity'" );
- } else {
- assert.ok( true, "No support for fill-opacity CSS property" );
- }
+ assert.equal( jQuery( this ).css( "fill-opacity" ), 1, "Do not append px to 'fill-opacity'" );
$div.remove();
} );
} );
$anchor2.off( "click" );
$main.off( "click", "**" );
- // Android 2.3 doesn't support stopImmediatePropagation; jQuery fallbacks to stopPropagation
- // in such a case.
- // Support: Android 2.3
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- assert.ok( true, "Android 2.3, skipping native stopImmediatePropagation check" );
- } else {
- $anchor2.on( "click", function( e ) {
- e.stopImmediatePropagation();
- assert.ok( true, "anchor was clicked and prop stopped" );
- } );
- $anchor2[ 0 ].addEventListener( "click", neverCallMe, false );
- fakeClick( $anchor2 );
- $anchor2[ 0 ].removeEventListener( "click", neverCallMe );
- }
+ $anchor2.on( "click", function( e ) {
+ e.stopImmediatePropagation();
+ assert.ok( true, "anchor was clicked and prop stopped" );
+ } );
+ $anchor2[ 0 ].addEventListener( "click", neverCallMe, false );
+ fakeClick( $anchor2 );
+ $anchor2[ 0 ].removeEventListener( "click", neverCallMe );
} );
QUnit.test( "on(), iframes", function( assert ) {
form.remove();
} );
-// Test beforeunload event only if it supported.
-// Support: iOS 7+, Android<4.0
-// iOS & old Android have the window.onbeforeunload field but don't support the beforeunload
+// 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.
-if ( window.onbeforeunload === null &&
- !/(ipad|iphone|ipod|android 2\.3)/i.test( navigator.userAgent ) ) {
- QUnit.test( "on(beforeunload)", 1, function( assert ) {
- var iframe = jQuery( jQuery.parseHTML( "<iframe src='data/event/onbeforeunload.html'><iframe>" ) );
- var done = assert.async();
+QUnit[ /(ipad|iphone|ipod)/i.test( navigator.userAgent ) ? "skip" : "test" ](
+ "on(beforeunload)", 1, function( assert ) {
+ var iframe = jQuery( jQuery.parseHTML( "<iframe src='data/event/onbeforeunload.html'><iframe>" ) );
+ var done = assert.async();
- window.onmessage = function( event ) {
- var payload = JSON.parse( event.data );
+ window.onmessage = function( event ) {
+ var payload = JSON.parse( event.data );
- assert.ok( payload.event, "beforeunload", "beforeunload event" );
+ assert.ok( payload.event, "beforeunload", "beforeunload event" );
- iframe.remove();
- window.onmessage = null;
- done();
- };
+ iframe.remove();
+ window.onmessage = null;
+ done();
+ };
- iframe.appendTo( "#qunit-fixture" );
- } );
-}
+ iframe.appendTo( "#qunit-fixture" );
+} );
QUnit.test( "jQuery.Event( type, props )", function( assert ) {
$link = jQuery( link ),
evt = document.createEvent( "MouseEvents" );
- // IE9+ requires element to be in the body before it will dispatch
+ // Support: IE 9-11 only
+ // IE requires element to be in the body before it will dispatch
$link.appendTo( "body" ).on( "click", function( e ) {
// Not trying to assert specific values here, just ensure the property exists
} );
} );
-// Support: IE9 (remove when IE9 is no longer supported)
+// Support: IE9 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 );
assert.expect( 5 );
- var scxml1Adopted,
- xmlDoc1 = jQuery.parseXML( "<scxml xmlns='http://www.w3.org/2005/07/scxml' version='1.0'><state x='100' y='100' initial='actions' id='provisioning'></state><state x='100' y='100' id='error'></state><state x='100' y='100' id='finished' final='true'></state></scxml>" ),
+ var xmlDoc1 = jQuery.parseXML( "<scxml xmlns='http://www.w3.org/2005/07/scxml' version='1.0'><state x='100' y='100' initial='actions' id='provisioning'></state><state x='100' y='100' id='error'></state><state x='100' y='100' id='finished' final='true'></state></scxml>" ),
xmlDoc2 = jQuery.parseXML( "<scxml xmlns='http://www.w3.org/2005/07/scxml' version='1.0'><state id='provisioning3'></state></scxml>" ),
xml1 = jQuery( xmlDoc1 ),
xml2 = jQuery( xmlDoc2 ),
scxml2 = jQuery( "scxml", xml2 ),
state = scxml2.find( "state" );
- // Android 2.3 doesn't automatically adopt nodes from foreign documents.
- // Although technically this is compliant behavior, no other browser
- // (including newer Android Browsers) behave in this way so do the adopting
- // just for Android 2.3.
- // Support: Android 2.3
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- state = jQuery( xmlDoc1.adoptNode( state[ 0 ] ) );
- }
-
scxml1.append( state );
assert.strictEqual( scxml1[ 0 ].lastChild, state[ 0 ], "append" );
scxml1.find( "#provisioning" ).before( state );
assert.strictEqual( scxml1[ 0 ].firstChild, state[ 0 ], "before" );
- // Support: Android 2.3
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- scxml1Adopted = jQuery( xmlDoc2.adoptNode( scxml1[ 0 ] ) );
- scxml2.replaceWith( scxml1Adopted );
- } else {
- scxml2.replaceWith( scxml1 );
- }
+ scxml2.replaceWith( scxml1 );
assert.deepEqual( jQuery( "state", xml2 ).get(), scxml1.find( "state" ).get(), "replaceWith" );
} );
} );
QUnit.asyncTest( "html() - script exceptions bubble (#11743)", 2, function( assert ) {
-
- // Support: Android 2.3 only
- // Android 2.3 doesn't fire the window.onerror handler, just accept the reality there.
- if ( /android 2\.3/i.test( navigator.userAgent ) ) {
- assert.ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
- "errors in dynamically included scripts" );
- assert.ok( true, "Test skipped, Android 2.3 doesn't fire window.onerror for " +
- "errors in dynamically included scripts" );
- QUnit.start();
- return;
- }
-
var onerror = window.onerror;
setTimeout( function() {
var ifDoc = jQuery( "#iframe" )[ 0 ].contentDocument;
- // Mobile Safari and Android 2.3 resize the iframe by its content
- // meaning it's not possible to scroll the iframe only its parent element.
+ // Mobile Safari resize the iframe by its content meaning it's not possible to scroll
+ // the iframe but only its parent element.
// It seems (not confirmed) in android 4.0 it's not possible to scroll iframes from the code.
if ( /iphone os/i.test( navigator.userAgent ) ||
- /android 2\.3/i.test( navigator.userAgent ) ||
/android 4\.0/i.test( navigator.userAgent ) ) {
assert.equal( true, true, "Can't scroll iframes in this environment" );
assert.equal( true, true, "Can't scroll iframes in this environment" );