Core: Drop support for Edge Legacy (i.e. non-Chromium Microsoft Edge)

Drop support for Edge Legacy: the non-Chromium, EdgeHTML-based Microsoft
Edge version. Also, restrict some workarounds that were applied
unconditionally in all browsers to run only in IE now. This slightly
increases the size but reduces the performance burden on modern browsers
that don't need the workarounds.

Also, clean up some comments & remove some obsolete workarounds.

Fixes gh-4568
Closes gh-4792
This commit is contained in:
Michał Gołębiowski-Owczarek 2020-09-22 17:49:28 +02:00 committed by GitHub
parent 15ae361485
commit e35fb62db4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
24 changed files with 105 additions and 244 deletions

View File

@ -543,7 +543,7 @@ jQuery.extend( {
if ( s.crossDomain == null ) {
urlAnchor = document.createElement( "a" );
// Support: IE <=8 - 11+, Edge 12 - 17 only
// Support: IE <=8 - 11+
// IE throws exception on accessing the href property if url is malformed,
// e.g. http://example.com:80x/
try {

View File

@ -69,8 +69,10 @@ jQuery.extend( {
if (
rfocusable.test( elem.nodeName ) ||
rclickable.test( elem.nodeName ) &&
elem.href
// href-less anchor's `tabIndex` property value is `0` and
// the `tabindex` attribute value: `null`. We want `-1`.
rclickable.test( elem.nodeName ) && elem.href
) {
return 0;
}

View File

@ -273,18 +273,7 @@ jQuery.extend( {
ret += jQuery.text( node );
}
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
// Use textContent for elements
// innerText usage removed for consistency of new lines (jQuery #11153)
if ( typeof elem.textContent === "string" ) {
return elem.textContent;
} else {
// Traverse its children
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
ret += jQuery.text( elem );
}
}
return elem.textContent;
} else if ( nodeType === 3 || nodeType === 4 ) {
return elem.nodeValue;
}

View File

@ -10,26 +10,14 @@ var preservedScriptAttributes = {
function DOMEval( code, node, doc ) {
doc = doc || document;
var i, val,
var i,
script = doc.createElement( "script" );
script.text = code;
if ( node ) {
for ( i in preservedScriptAttributes ) {
// Support: Firefox <=64 - 66+, Edge <=18+
// Some browsers don't support the "nonce" property on scripts.
// On the other hand, just using `getAttribute` is not enough as
// the `nonce` attribute is reset to an empty string whenever it
// becomes browsing-context connected.
// See https://github.com/whatwg/html/issues/2369
// See https://html.spec.whatwg.org/#nonce-attributes
// The `node.getAttribute` check was added for the sake of
// `jQuery.globalEval` so that it can fake a nonce-containing node
// via an object.
val = node[ i ] || node.getAttribute && node.getAttribute( i );
if ( val ) {
script.setAttribute( i, val );
if ( node[ i ] ) {
script[ i ] = node[ i ];
}
}
}

View File

@ -4,16 +4,17 @@ import documentElement from "../var/documentElement.js";
import "../selector/contains.js"; // jQuery.contains
var isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem );
return jQuery.contains( elem.ownerDocument, elem ) ||
elem.getRootNode( composed ) === elem.ownerDocument;
},
composed = { composed: true };
// Support: IE 9 - 11+, Edge 12 - 18+
// Check attachment across shadow DOM boundaries when possible (gh-3504)
if ( documentElement.getRootNode ) {
// Support: IE 9 - 11+
// Check attachment across shadow DOM boundaries when possible (gh-3504).
// Provide a fallback for browsers without Shadow DOM v1 support.
if ( !documentElement.getRootNode ) {
isAttached = function( elem ) {
return jQuery.contains( elem.ownerDocument, elem ) ||
elem.getRootNode( composed ) === elem.ownerDocument;
return jQuery.contains( elem.ownerDocument, elem );
};
}

View File

@ -11,7 +11,6 @@ import getStyles from "./css/var/getStyles.js";
import swap from "./css/var/swap.js";
import curCSS from "./css/curCSS.js";
import adjustCSS from "./css/adjustCSS.js";
import support from "./css/support.js";
import finalPropName from "./css/finalPropName.js";
import "./core/init.js";
@ -135,15 +134,19 @@ function getWidthOrHeight( elem, dimension, extra ) {
}
// Support: IE 9 - 11+
// Use offsetWidth/offsetHeight for when box sizing is unreliable.
// In those cases, the computed value can be trusted to be border-box.
if ( ( isIE && isBorderBox ||
if ( ( isIE &&
(
// Support: IE 10 - 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
!support.reliableTrDimensions() && nodeName( elem, "tr" ) ||
// Support: IE 9 - 11+
// Use offsetWidth/offsetHeight for when box sizing is unreliable.
// In those cases, the computed value can be trusted to be border-box.
isBorderBox ||
// Support: IE 10 - 11+
// IE misreports `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
nodeName( elem, "tr" )
) ||
// Fall back to offsetWidth/offsetHeight when value is "auto"
// This happens for inline elements with no explicit setting (gh-3571)

View File

@ -5,7 +5,7 @@ var rmsPrefix = /^-ms-/;
// Convert dashed to camelCase, handle vendor prefixes.
// Used by the css & effects modules.
// Support: IE <=9 - 11+, Edge 12 - 18+
// Support: IE <=9 - 11+
// Microsoft forgot to hump their vendor prefix (#9572)
function cssCamelCase( string ) {
return camelCase( string.replace( rmsPrefix, "ms-" ) );

View File

@ -1,34 +0,0 @@
import document from "../var/document.js";
import documentElement from "../var/documentElement.js";
import support from "../var/support.js";
var reliableTrDimensionsVal;
// Support: IE 11+, Edge 15 - 18+
// IE/Edge misreport `getComputedStyle` of table rows with width/height
// set in CSS while `offset*` properties report correct values.
support.reliableTrDimensions = function() {
var table, tr, trChild, trStyle;
if ( reliableTrDimensionsVal == null ) {
table = document.createElement( "table" );
tr = document.createElement( "tr" );
trChild = document.createElement( "div" );
table.style.cssText = "position:absolute;left:-11111px";
tr.style.height = "1px";
trChild.style.height = "9px";
documentElement
.appendChild( table )
.appendChild( tr )
.appendChild( trChild );
trStyle = window.getComputedStyle( tr );
reliableTrDimensionsVal = parseInt( trStyle.height ) > 3;
documentElement.removeChild( table );
}
return reliableTrDimensionsVal;
};
export default support;

5
src/effects.js vendored
View File

@ -143,10 +143,9 @@ function defaultPrefilter( elem, props, opts ) {
// Restrict "overflow" and "display" styles during box animations
if ( isBox && elem.nodeType === 1 ) {
// Support: IE <=9 - 11+, Edge 12 - 18+
// Support: IE <=9 - 11+
// Record all 3 overflow attributes because IE does not infer the shorthand
// from identically-valued overflowX and overflowY and Edge just mirrors
// the overflowX value there.
// from identically-valued overflowX and overflowY.
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
// Identify a display type, preferring old show/hide data over the CSS cascade

View File

@ -23,9 +23,8 @@ import "./event.js";
var
// Support: IE <=10 - 11+, Edge 12 - 13 only
// In IE/Edge using regex groups here causes severe slowdowns.
// See https://connect.microsoft.com/IE/feedback/details/1736512/
// Support: IE <=10 - 11+
// In IE using regex groups here causes severe slowdowns.
rnoInnerhtml = /<script|<style|<link/i,
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;
@ -157,7 +156,7 @@ function domManip( collection, args, callback, ignored ) {
// Optional AJAX dependency, but won't run scripts if not present
if ( jQuery._evalUrl && !node.noModule ) {
jQuery._evalUrl( node.src, {
nonce: node.nonce || node.getAttribute( "nonce" ),
nonce: node.nonce,
crossOrigin: node.crossOrigin
}, doc );
}

View File

@ -7,7 +7,7 @@ import pop from "./var/pop.js";
import push from "./var/push.js";
import whitespace from "./selector/var/whitespace.js";
import rbuggyQSA from "./selector/rbuggyQSA.js";
import support from "./selector/support.js";
import isIE from "./var/isIE.js";
// The following utils are attached directly to the jQuery object.
import "./selector/contains.js";
@ -131,9 +131,9 @@ var i,
},
// Used for iframes; see `setDocument`.
// Support: IE 9 - 11+, Edge 12 - 18+
// Support: IE 9 - 11+
// Removing the function wrapper causes a "Permission Denied"
// error in IE/Edge.
// error in IE.
unloadHandler = function() {
setDocument();
},
@ -229,9 +229,9 @@ function find( selector, context, results, seed ) {
newContext = rsibling.test( selector ) && testContext( context.parentNode ) ||
context;
// We can use :scope instead of the ID hack if the browser
// supports it & if we're not changing the context.
if ( newContext !== context || !support.scope ) {
// Outside of IE, if we're not changing the context we can
// use :scope instead of an ID.
if ( newContext !== context || isIE ) {
// Capture the context ID, setting it first if necessary
if ( ( nid = context.getAttribute( "id" ) ) ) {
@ -360,7 +360,6 @@ function createDisabledPseudo( disabled ) {
return elem.isDisabled === disabled ||
// Where there is no isDisabled, check manually
/* jshint -W018 */
elem.isDisabled !== !disabled &&
inDisabledFieldset( elem ) === disabled;
}
@ -419,8 +418,8 @@ function setDocument( node ) {
doc = node ? node.ownerDocument || node : preferredDoc;
// Return early if doc is invalid or already selected
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( doc == document || doc.nodeType !== 9 ) {
@ -432,16 +431,14 @@ function setDocument( node ) {
documentElement = document.documentElement;
documentIsHTML = !jQuery.isXMLDoc( document );
// Support: IE 9 - 11+, Edge 12 - 18+
// Support: IE 9 - 11+
// Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936)
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( preferredDoc != document &&
if ( isIE && preferredDoc != document &&
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
// Support: IE 9 - 11+, Edge 12 - 18+
subWindow.addEventListener( "unload", unloadHandler );
}
}
@ -928,7 +925,7 @@ Expr = jQuery.expr = {
// Accessing the selectedIndex property
// forces the browser to treat the default option as
// selected when in an optgroup.
if ( elem.parentNode ) {
if ( isIE && elem.parentNode ) {
// eslint-disable-next-line no-unused-expressions
elem.parentNode.selectedIndex;
}
@ -1412,8 +1409,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
if ( outermost ) {
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
outermostContext = context == document || context || outermost;
@ -1424,8 +1421,8 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
if ( byElement && elem ) {
j = 0;
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( !context && elem.ownerDocument != document ) {

View File

@ -1,29 +1,19 @@
import document from "../var/document.js";
import isIE from "../var/isIE.js";
import whitespace from "./var/whitespace.js";
var rbuggyQSA = [],
testEl = document.createElement( "div" ),
input = document.createElement( "input" );
var rbuggyQSA = isIE && new RegExp(
// Support: IE 9 - 11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
if ( isIE ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}
// Support: IE 9 - 11+
// IE's :disabled selector does not pick up the children of disabled fieldsets
":enabled|:disabled|" +
// Support: IE 11+, Edge 15 - 18+
// IE 11/Edge don't find elements on a `[name='']` query in some cases.
// Adding a temporary attribute to the document before the selection works
// around the issue.
// Interestingly, IE 10 & older don't seem to have the issue.
input.setAttribute( "name", "" );
testEl.appendChild( input );
if ( !testEl.querySelectorAll( "[name='']" ).length ) {
rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" +
whitespace + "*(?:''|\"\")" );
}
// Support: IE 11+
// IE 11 doesn't find elements on a `[name='']` query in some cases.
// Adding a temporary attribute to the document before the selection works
// around the issue.
"\\[" + whitespace + "*name" + whitespace + "*=" +
whitespace + "*(?:''|\"\")"
rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) );
);
export default rbuggyQSA;

View File

@ -1,11 +0,0 @@
import document from "../var/document.js";
import support from "../var/support.js";
// Support: IE 9 - 11+, Edge 12 - 18+
// IE/Edge don't support the :scope pseudo-class.
try {
document.querySelectorAll( ":scope" );
support.scope = true;
} catch ( e ) {}
export default support;

View File

@ -20,8 +20,8 @@ function sortOrder( a, b ) {
}
// Calculate position if both inputs belong to the same document
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ?
@ -34,8 +34,8 @@ function sortOrder( a, b ) {
if ( compare & 1 ) {
// Choose the first element that is related to the document
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( a == document || a.ownerDocument == document &&
@ -43,8 +43,8 @@ function sortOrder( a, b ) {
return -1;
}
// Support: IE 11+, Edge 17 - 18+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
// Support: IE 11+
// IE sometimes throws a "Permission denied" error when strict-comparing
// two documents; shallow comparisons work.
// eslint-disable-next-line eqeqeq
if ( b == document || b.ownerDocument == document &&

View File

@ -1,7 +1,7 @@
import arr from "./arr.js";
// Support: IE 11+, Edge 18+
// Provide fallback for browsers without Array#flat.
// Support: IE 11+
// IE doesn't have Array#flat; provide a fallback.
export default arr.flat ? function( array ) {
return arr.flat.call( array );
} : function( array ) {

4
test/jquery.js vendored
View File

@ -58,8 +58,8 @@
// This doesn't apply to iframes because they synchronously expect jQuery to be there.
if ( config.esmodules && QUnit ) {
// Support: IE 11+, Edge 12 - 18+
// IE/Edge don't support the dynamic import syntax so they'd crash
// Support: IE 11+
// IE doesn't support the dynamic import syntax so it would crash
// with a SyntaxError here.
dynamicImportSource = "" +
"import( `${ parentUrl }src/jquery.js` )\n" +

View File

@ -271,7 +271,7 @@ QUnit.module( "ajax", {
"Nullable": null,
"undefined": undefined
// Support: IE 9 - 11+, Edge 12 - 14 only
// Support: IE 9 - 11+
// IE can receive empty headers but not send them.
}, QUnit.isIE ? {} : {
"Empty": ""
@ -2281,9 +2281,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
// beforeunload, unload, pagehide, and visibilitychange event handlers.
// See https://bugs.chromium.org/p/chromium/issues/detail?id=952452
// Safari 13 did similar changes. The below check will catch them both.
// Edge Legacy fakes Chrome which fakes Safari in their user agents so we need
// to exclude Edge specifically here so that the test continues to run there.
if ( !/safari/i.test( navigator.userAgent ) || /edge\//i.test( navigator.userAgent ) ) {
if ( !/safari/i.test( navigator.userAgent ) ) {
testIframe(
"#14379 - jQuery.ajax() on unload",
"ajax/onunload.html",

View File

@ -801,15 +801,15 @@ QUnit.test( "jQuery.map", function( assert ) {
assert.equal( result.length, 3, "Array flatten only one level down" );
assert.ok( Array.isArray( result[ 0 ] ), "Array flatten only one level down" );
// Support: IE 11+, Edge 18+
// Skip the test in browsers without Array#flat.
if ( Array.prototype.flat ) {
// Support: IE 11+
// IE doesn't have Array#flat so it'd fail the test.
if ( !QUnit.isIE ) {
result = jQuery.map( Array( 300000 ), function( v, k ) {
return k;
} );
assert.equal( result.length, 300000, "Able to map 300000 records without any problems (#4320)" );
} else {
assert.ok( "skip", "Array#flat doesn't supported on all browsers" );
assert.ok( "skip", "Array#flat isn't supported in IE" );
}
} );

View File

@ -638,9 +638,9 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
span.remove();
} );
// Support: IE 11+, Edge 12 - 18+
// IE/Edge don't support Shadow DOM.
QUnit[ document.body.getRootNode ? "test" : "skip" ](
// Support: IE 11+
// IE doesn't support Shadow DOM.
QUnit.testUnlessIE(
"show/hide shadow child nodes", function( assert ) {
assert.expect( 28 );
@ -1022,7 +1022,7 @@ QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle ? "test" : "skip" ]( "detached
"cascade-hidden element in detached tree" );
} );
QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle && document.body.getRootNode ? "test" : "skip" ](
QUnit[ QUnit.jQuerySelectors && jQuery.fn.toggle && !QUnit.isIE ? "test" : "skip" ](
"shadow toggle()", function( assert ) {
assert.expect( 4 );
@ -1758,9 +1758,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
var div = jQuery( "<div>" ).appendTo( "#qunit-fixture" ),
$elem = jQuery( "<div>" ).addClass( "test__customProperties" )
.appendTo( "#qunit-fixture" ),
webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ) &&
!/\bfirefox\b/i.test( navigator.userAgent ) &&
!/\bedge\b/i.test( navigator.userAgent ),
webkitOrBlink = /\bsafari\b/i.test( navigator.userAgent ),
expected = 10;
if ( webkitOrBlink ) {

View File

@ -629,10 +629,6 @@ QUnit.test( ".data always sets data with the camelCased key (gh-2257)", function
key: "boolFalse",
value: false
},
// JSHint enforces double quotes,
// but JSON strings need double quotes to parse
// so we need escaped double quotes here
"some-json": {
key: "someJson",
value: "{ \"foo\": \"bar\" }"
@ -693,10 +689,6 @@ QUnit.test( ".data supports interoperable hyphenated/camelCase get/set of proper
key: "boolFalse",
value: false
},
// JSHint enforces double quotes,
// but JSON strings need double quotes to parse
// so we need escaped double quotes here
"some-json": {
key: "someJson",
value: "{ \"foo\": \"bar\" }"
@ -756,10 +748,6 @@ QUnit.test( ".data supports interoperable removal of hyphenated/camelCase proper
"an-object": {},
"bool-true": true,
"bool-false": false,
// JSHint enforces double quotes,
// but JSON strings need double quotes to parse
// so we need escaped double quotes here
"some-json": "{ \"foo\": \"bar\" }"
};
@ -797,10 +785,6 @@ QUnit.test( ".data supports interoperable removal of properties SET TWICE #13850
"an-object": {},
"bool-true": true,
"bool-false": false,
// JSHint enforces double quotes,
// but JSON strings need double quotes to parse
// so we need escaped double quotes here
"some-json": "{ \"foo\": \"bar\" }"
};

View File

@ -216,9 +216,9 @@ supportjQuery.each( hideOptions, function( type, setup ) {
clock.tick( 300 );
} );
// Support: IE 11+, Edge 12 - 18+
// IE/Edge don't support Shadow DOM.
QUnit[ document.body.getRootNode ? "test" : "skip" ](
// Support: IE 11+
// IE doesn't support Shadow DOM.
QUnit.testUnlessIE(
"Persist correct display value - " + type + " hidden, shadow child", function( assert ) {
assert.expect( 3 );

View File

@ -1762,13 +1762,9 @@ QUnit.test( "html(Function)", function( assert ) {
testHtml( manipulationFunctionReturningObj, assert );
} );
QUnit[
// Support: Edge 16 - 18+
// Edge sometimes doesn't execute module scripts so skip the test there.
( QUnit.isIE || /edge\//i.test( navigator.userAgent ) ) ?
"skip" :
"test"
]( "html(script type module)", function( assert ) {
// Support: IE 9 - 11+
// IE doesn't support modules.
QUnit.testUnlessIE( "html(script type module)", function( assert ) {
assert.expect( 4 );
var done = assert.async(),
$fixture = jQuery( "#qunit-fixture" );
@ -2897,12 +2893,7 @@ testIframe(
assert.equal( data, "", "No log request should be sent" );
supportjQuery.get( baseURL + "mock.php?action=cspClean" ).done( done );
} );
},
// Support: Edge <=18+
// Edge doesn't support nonce in non-inline scripts.
// See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
QUnit[ /\bedge\//i.test( navigator.userAgent ) ? "skip" : "test" ]
}
);
testIframe(
@ -2920,10 +2911,7 @@ testIframe(
},
// The AJAX module is needed for jQuery._evalUrl.
// Support: Edge <=18+
// Edge doesn't support nonce in non-inline scripts.
// See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
QUnit[ jQuery.ajax && !/\bedge\//i.test( navigator.userAgent ) ? "test" : "skip" ]
QUnit[ jQuery.ajax ? "test" : "skip" ]
);
testIframe(
@ -2938,12 +2926,7 @@ testIframe(
assert.equal( data, "", "No log request should be sent" );
supportjQuery.get( baseURL + "mock.php?action=cspClean" ).done( done );
} );
},
// Support: Edge <=18+
// Edge doesn't support nonce in non-inline scripts.
// See https://web.archive.org/web/20171203124125/https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13246371/
QUnit[ /\bedge\//i.test( navigator.userAgent ) ? "skip" : "test" ]
}
);
QUnit.test( "Sanitized HTML doesn't get unsanitized", function( assert ) {

View File

@ -1661,14 +1661,10 @@ QUnit.test( "context", function( assert ) {
}
} );
// Support: IE 11+, Edge 12 - 18+
// IE/Edge don't support the :scope pseudo-class so they will trigger MutationObservers.
// Support: IE 11+
// IE doesn't support the :scope pseudo-class so it will trigger MutationObservers.
// The test is skipped there.
QUnit[
( QUnit.isIE || /edge\//i.test( navigator.userAgent ) ) ?
"skip" :
"test"
]( "selectors maintaining context don't trigger mutation observers", function( assert ) {
QUnit.testUnlessIE( "selectors maintaining context don't trigger mutation observers", function( assert ) {
assert.expect( 1 );
var timeout,
@ -1742,10 +1738,10 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "disconnected nodes", function
assert.equal( $opt.is( ":selected" ), true, "selected option" );
} );
// Support: IE 11+, Edge 12 - 18+
// IE/Edge don't support Shadow DOM.
// Support: IE 11+
// IE doesn't support Shadow DOM.
// selector-native doesn't support querying inside of Shadow DOM.
QUnit[ QUnit.jQuerySelectors && document.body.getRootNode ? "test" : "skip" ](
QUnit[ QUnit.jQuerySelectors && !QUnit.isIE ? "test" : "skip" ](
"Shadow DOM nodes supported as root", function( assert ) {
assert.expect( 2 );

View File

@ -58,39 +58,18 @@ testIframe(
var expected,
userAgent = window.navigator.userAgent,
expectedMap = {
edge: {
reliableTrDimensions: false,
scope: undefined
},
ie_11: {
reliableTrDimensions: false,
scope: undefined
},
chrome: {
reliableTrDimensions: true,
scope: true
},
safari: {
reliableTrDimensions: true,
scope: true
},
firefox: {
reliableTrDimensions: true,
scope: true
},
ios: {
reliableTrDimensions: true,
scope: true
}
ie_11: {},
chrome: {},
safari: {},
firefox: {},
ios: {}
};
if ( /edge\//i.test( userAgent ) ) {
expected = expectedMap.edge;
} else if ( document.documentMode ) {
if ( document.documentMode ) {
expected = expectedMap.ie_11;
} else if ( /chrome/i.test( userAgent ) ) {
// Catches Chrome on Android & Opera as well.
// Catches Edge, Chrome on Android & Opera as well.
expected = expectedMap.chrome;
} else if ( /\b\d+(\.\d+)+ safari/i.test( userAgent ) ) {
expected = expectedMap.safari;