mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Core: Drop support for IE (all versions)
This commit is contained in:
parent
3cad5c435a
commit
6660f038ea
1
.github/workflows/browserstack.yml
vendored
1
.github/workflows/browserstack.yml
vendored
@ -21,7 +21,6 @@ jobs:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
BROWSER:
|
||||
- 'IE_11'
|
||||
- 'Safari_latest'
|
||||
- 'Safari_latest-1'
|
||||
- 'Chrome_latest'
|
||||
|
28
.github/workflows/node.js.yml
vendored
28
.github/workflows/node.js.yml
vendored
@ -87,34 +87,6 @@ jobs:
|
||||
- name: Run tests
|
||||
run: npm run ${{ matrix.NPM_SCRIPT }}
|
||||
|
||||
ie:
|
||||
runs-on: windows-latest
|
||||
env:
|
||||
NODE_VERSION: 20.x
|
||||
name: test:ie - IE
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
|
||||
|
||||
- name: Use Node.js ${{ env.NODE_VERSION }}
|
||||
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
|
||||
with:
|
||||
node-version: ${{ env.NODE_VERSION }}
|
||||
|
||||
- name: Cache
|
||||
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-${{ env.NODE_VERSION }}-npm-lock-
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install
|
||||
|
||||
- name: Run tests in Edge in IE mode
|
||||
run: npm run test:ie
|
||||
|
||||
safari:
|
||||
runs-on: macos-latest
|
||||
env:
|
||||
|
@ -11,8 +11,6 @@ const files = {
|
||||
"core-js-bundle/core-js-bundle.js": "core-js-bundle/minified.js",
|
||||
"core-js-bundle/LICENSE": "core-js-bundle/LICENSE",
|
||||
|
||||
"npo/npo.js": "native-promise-only/lib/npo.src.js",
|
||||
|
||||
"qunit/qunit.js": "qunit/qunit/qunit.js",
|
||||
"qunit/qunit.css": "qunit/qunit/qunit.css",
|
||||
"qunit/LICENSE.txt": "qunit/LICENSE.txt",
|
||||
|
@ -271,6 +271,15 @@ export default [
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
files: [
|
||||
"test/jquery.js"
|
||||
],
|
||||
languageOptions: {
|
||||
ecmaVersion: 2020
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
files: [
|
||||
"test/unit/deferred.js"
|
||||
|
7
package-lock.json
generated
7
package-lock.json
generated
@ -36,7 +36,6 @@
|
||||
"jsdom": "24.1.1",
|
||||
"marked": "13.0.2",
|
||||
"multiparty": "4.2.3",
|
||||
"native-promise-only": "0.8.1",
|
||||
"promises-aplus-tests": "2.1.2",
|
||||
"q": "1.5.1",
|
||||
"qunit": "2.21.1",
|
||||
@ -7014,12 +7013,6 @@
|
||||
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/native-promise-only": {
|
||||
"version": "0.8.1",
|
||||
"resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz",
|
||||
"integrity": "sha512-zkVhZUA3y8mbz652WrL5x0fB0ehrBkulWT3TomAQ9iDtyXZvzKeEA6GPxAItBYeNYl5yngKRX612qHOhvMkDeg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/natural-compare": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
|
||||
|
@ -74,7 +74,6 @@
|
||||
"test:chrome": "npm run pretest && npm run build:main && npm run test:unit -- -v -b chrome -h",
|
||||
"test:edge": "npm run pretest && npm run build:main && npm run test:unit -- -v -b edge -h",
|
||||
"test:firefox": "npm run pretest && npm run build:main && npm run test:unit -- -v -b firefox -h",
|
||||
"test:ie": "npm run pretest && npm run build:main && npm run test:unit -- -v -b ie",
|
||||
"test:safari": "npm run pretest && npm run build:main && npm run test:unit -- -b safari",
|
||||
"test:server": "node test/runner/server.js",
|
||||
"test:esm": "npm run pretest && npm run build:main && npm run test:unit -- --esm -h",
|
||||
@ -131,7 +130,6 @@
|
||||
"jsdom": "24.1.1",
|
||||
"marked": "13.0.2",
|
||||
"multiparty": "4.2.3",
|
||||
"native-promise-only": "0.8.1",
|
||||
"promises-aplus-tests": "2.1.2",
|
||||
"q": "1.5.1",
|
||||
"qunit": "2.21.1",
|
||||
|
32
src/ajax.js
32
src/ajax.js
@ -455,20 +455,12 @@ jQuery.extend( {
|
||||
if ( !responseHeaders ) {
|
||||
responseHeaders = {};
|
||||
while ( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
||||
|
||||
// Support: IE 11+
|
||||
// `getResponseHeader( key )` in IE doesn't combine all header
|
||||
// values for the provided key into a single result with values
|
||||
// joined by commas as other browsers do. Instead, it returns
|
||||
// them on separate lines.
|
||||
responseHeaders[ match[ 1 ].toLowerCase() + " " ] =
|
||||
( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] )
|
||||
.concat( match[ 2 ] );
|
||||
responseHeaders[ match[ 1 ].toLowerCase() + " " ] = match[ 2 ];
|
||||
}
|
||||
}
|
||||
match = responseHeaders[ key.toLowerCase() + " " ];
|
||||
}
|
||||
return match == null ? null : match.join( ", " );
|
||||
return match == null ? null : match;
|
||||
},
|
||||
|
||||
// Raw string
|
||||
@ -542,24 +534,8 @@ jQuery.extend( {
|
||||
// A cross-domain request is in order when the origin doesn't match the current origin.
|
||||
if ( s.crossDomain == null ) {
|
||||
urlAnchor = document.createElement( "a" );
|
||||
|
||||
// Support: IE <=8 - 11+
|
||||
// IE throws exception on accessing the href property if url is malformed,
|
||||
// e.g. http://example.com:80x/
|
||||
try {
|
||||
urlAnchor.href = s.url;
|
||||
|
||||
// Support: IE <=8 - 11+
|
||||
// Anchor's host property isn't correctly set when s.url is relative
|
||||
urlAnchor.href = urlAnchor.href;
|
||||
s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !==
|
||||
urlAnchor.protocol + "//" + urlAnchor.host;
|
||||
} catch ( e ) {
|
||||
|
||||
// If there is an error parsing the URL, assume it is crossDomain,
|
||||
// it can be rejected by the transport if it is invalid
|
||||
s.crossDomain = true;
|
||||
}
|
||||
urlAnchor.href = s.url;
|
||||
s.crossDomain = originAnchor.origin !== urlAnchor.origin;
|
||||
}
|
||||
|
||||
// Apply prefilters
|
||||
|
@ -50,8 +50,8 @@ jQuery.fn.load = function( url, params, callback ) {
|
||||
|
||||
self.html( selector ?
|
||||
|
||||
// If a selector was specified, locate the right elements in a dummy div
|
||||
// Exclude scripts to avoid IE 'Permission Denied' errors
|
||||
// If a selector was specified, locate the right elements in a dummy div.
|
||||
// Exclude scripts.
|
||||
jQuery( "<div>" ).append( jQuery.parseHTML( responseText ) ).find( selector ) :
|
||||
|
||||
// Otherwise use the full result
|
||||
|
@ -1,8 +1,6 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { access } from "../core/access.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
import { rnothtmlwhite } from "../var/rnothtmlwhite.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
|
||||
jQuery.fn.extend( {
|
||||
attr: function( name, value ) {
|
||||
@ -86,20 +84,3 @@ jQuery.extend( {
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
||||
// Support: IE <=11+
|
||||
// An input loses its value after becoming a radio
|
||||
if ( isIE ) {
|
||||
jQuery.attrHooks.type = {
|
||||
set: function( elem, value ) {
|
||||
if ( value === "radio" && nodeName( elem, "input" ) ) {
|
||||
var val = elem.value;
|
||||
elem.setAttribute( "type", value );
|
||||
if ( val ) {
|
||||
elem.value = val;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { access } from "../core/access.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
|
||||
var rfocusable = /^(?:input|select|textarea|button)$/i,
|
||||
rclickable = /^(?:a|area)$/i;
|
||||
@ -54,7 +53,6 @@ jQuery.extend( {
|
||||
tabIndex: {
|
||||
get: function( elem ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// elem.tabIndex doesn't always return the
|
||||
// correct value when it hasn't been explicitly set
|
||||
// Use proper attribute retrieval (trac-12072)
|
||||
@ -85,39 +83,6 @@ jQuery.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
// Support: IE <=11+
|
||||
// Accessing the selectedIndex property forces the browser to respect
|
||||
// setting selected on the option. The getter ensures a default option
|
||||
// is selected when in an optgroup. ESLint rule "no-unused-expressions"
|
||||
// is disabled for this code since it considers such accessions noop.
|
||||
if ( isIE ) {
|
||||
jQuery.propHooks.selected = {
|
||||
get: function( elem ) {
|
||||
|
||||
var parent = elem.parentNode;
|
||||
if ( parent && parent.parentNode ) {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
parent.parentNode.selectedIndex;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
set: function( elem ) {
|
||||
|
||||
|
||||
var parent = elem.parentNode;
|
||||
if ( parent ) {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
parent.selectedIndex;
|
||||
|
||||
if ( parent.parentNode ) {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
parent.parentNode.selectedIndex;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
jQuery.each( [
|
||||
"tabIndex",
|
||||
"readOnly",
|
||||
|
@ -1,6 +1,4 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { isIE } from "../var/isIE.js";
|
||||
import { stripAndCollapse } from "../core/stripAndCollapse.js";
|
||||
import { nodeName } from "../core/nodeName.js";
|
||||
|
||||
import "../core/init.js";
|
||||
@ -140,23 +138,6 @@ jQuery.extend( {
|
||||
}
|
||||
} );
|
||||
|
||||
if ( isIE ) {
|
||||
jQuery.valHooks.option = {
|
||||
get: function( elem ) {
|
||||
|
||||
var val = elem.getAttribute( "value" );
|
||||
return val != null ?
|
||||
val :
|
||||
|
||||
// Support: IE <=10 - 11+
|
||||
// option.text throws exceptions (trac-14686, trac-14858)
|
||||
// Strip and collapse whitespace
|
||||
// https://html.spec.whatwg.org/#strip-and-collapse-whitespace
|
||||
stripAndCollapse( jQuery.text( elem ) );
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
// Radios and checkboxes getter/setter
|
||||
jQuery.each( [ "radio", "checkbox" ], function() {
|
||||
jQuery.valHooks[ this ] = {
|
||||
|
11
src/core.js
11
src/core.js
@ -323,14 +323,7 @@ jQuery.extend( {
|
||||
contains: function( a, b ) {
|
||||
var bup = b && b.parentNode;
|
||||
|
||||
return a === bup || !!( bup && bup.nodeType === 1 && (
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE doesn't have `contains` on SVG.
|
||||
a.contains ?
|
||||
a.contains( bup ) :
|
||||
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
||||
) );
|
||||
return a === bup || !!( bup && bup.nodeType === 1 && a.contains( bup ) );
|
||||
},
|
||||
|
||||
merge: function( first, second ) {
|
||||
@ -395,7 +388,7 @@ jQuery.extend( {
|
||||
}
|
||||
|
||||
// Flatten any nested arrays
|
||||
return flat( ret );
|
||||
return flat.call( ret );
|
||||
},
|
||||
|
||||
// A global GUID counter for objects
|
||||
|
@ -1,19 +1,8 @@
|
||||
import { jQuery } from "../core.js";
|
||||
import { documentElement } from "../var/documentElement.js";
|
||||
|
||||
var isAttached = function( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||
elem.getRootNode( composed ) === elem.ownerDocument;
|
||||
},
|
||||
composed = { composed: true };
|
||||
var composed = { composed: true };
|
||||
|
||||
// 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 );
|
||||
};
|
||||
export function isAttached( elem ) {
|
||||
return jQuery.contains( elem.ownerDocument, elem ) ||
|
||||
elem.getRootNode( composed ) === elem.ownerDocument;
|
||||
}
|
||||
|
||||
export { isAttached };
|
||||
|
@ -7,21 +7,15 @@ jQuery.parseXML = function( data ) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE throws on parseFromString with invalid input.
|
||||
try {
|
||||
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
||||
} catch ( e ) {}
|
||||
xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" );
|
||||
|
||||
parserErrorElem = xml && xml.getElementsByTagName( "parsererror" )[ 0 ];
|
||||
if ( !xml || parserErrorElem ) {
|
||||
jQuery.error( "Invalid XML: " + (
|
||||
parserErrorElem ?
|
||||
jQuery.map( parserErrorElem.childNodes, function( el ) {
|
||||
return el.textContent;
|
||||
} ).join( "\n" ) :
|
||||
data
|
||||
) );
|
||||
parserErrorElem = xml.getElementsByTagName( "parsererror" )[ 0 ];
|
||||
if ( parserErrorElem ) {
|
||||
jQuery.error( "Invalid XML: " +
|
||||
jQuery.map( parserErrorElem.childNodes, function( el ) {
|
||||
return el.textContent;
|
||||
} ).join( "\n" )
|
||||
);
|
||||
}
|
||||
return xml;
|
||||
};
|
||||
|
31
src/css.js
31
src/css.js
@ -1,13 +1,12 @@
|
||||
import { jQuery } from "./core.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { camelCase } from "./core/camelCase.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
import { rcssNum } from "./var/rcssNum.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { rnumnonpx } from "./css/var/rnumnonpx.js";
|
||||
import { rcustomProp } from "./css/var/rcustomProp.js";
|
||||
import { cssExpand } from "./css/var/cssExpand.js";
|
||||
import { isAutoPx } from "./css/isAutoPx.js";
|
||||
import { cssCamelCase } from "./css/cssCamelCase.js";
|
||||
import { getStyles } from "./css/var/getStyles.js";
|
||||
import { swap } from "./css/var/swap.js";
|
||||
import { curCSS } from "./css/curCSS.js";
|
||||
@ -120,8 +119,7 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
||||
|
||||
// To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322).
|
||||
// Fake content-box until we know it's needed to know the true value.
|
||||
boxSizingNeeded = isIE || extra,
|
||||
isBorderBox = boxSizingNeeded &&
|
||||
isBorderBox = extra &&
|
||||
jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
||||
valueIsBorderBox = isBorderBox,
|
||||
|
||||
@ -143,14 +141,6 @@ function getWidthOrHeight( elem, dimension, extra ) {
|
||||
// This happens for inline elements with no explicit setting (gh-3571)
|
||||
val === "auto" ||
|
||||
|
||||
// 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.
|
||||
( isIE && isBorderBox ) ||
|
||||
|
||||
// Support: IE 10 - 11+
|
||||
// IE misreports `getComputedStyle` of table rows with width/height
|
||||
// set in CSS while `offset*` properties report correct values.
|
||||
// Support: Firefox 70+
|
||||
// Firefox includes border widths
|
||||
// in computed dimensions for table rows. (gh-4529)
|
||||
@ -204,7 +194,7 @@ jQuery.extend( {
|
||||
|
||||
// Make sure that we're working with the right name
|
||||
var ret, type, hooks,
|
||||
origName = cssCamelCase( name ),
|
||||
origName = camelCase( name ),
|
||||
isCustomProp = rcustomProp.test( name ),
|
||||
style = elem.style;
|
||||
|
||||
@ -240,12 +230,6 @@ jQuery.extend( {
|
||||
value += ret && ret[ 3 ] || ( isAutoPx( origName ) ? "px" : "" );
|
||||
}
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// background-* props of a cloned element affect the source element (trac-8908)
|
||||
if ( isIE && value === "" && name.indexOf( "background" ) === 0 ) {
|
||||
style[ name ] = "inherit";
|
||||
}
|
||||
|
||||
// If a hook was provided, use that value, otherwise just set the specified value
|
||||
if ( !hooks || !( "set" in hooks ) ||
|
||||
( value = hooks.set( elem, value, extra ) ) !== undefined ) {
|
||||
@ -273,7 +257,7 @@ jQuery.extend( {
|
||||
|
||||
css: function( elem, name, extra, styles ) {
|
||||
var val, num, hooks,
|
||||
origName = cssCamelCase( name ),
|
||||
origName = camelCase( name ),
|
||||
isCustomProp = rcustomProp.test( name );
|
||||
|
||||
// Make sure that we're working with the right name. We don't
|
||||
@ -316,17 +300,14 @@ jQuery.each( [ "height", "width" ], function( _i, dimension ) {
|
||||
get: function( elem, computed, extra ) {
|
||||
if ( computed ) {
|
||||
|
||||
// Certain elements can have dimension info if we invisibly show them
|
||||
// Certain elements can have dimension info if we invisibly show them,
|
||||
// but it must have a current display style that would benefit
|
||||
return rdisplayswap.test( jQuery.css( elem, "display" ) ) &&
|
||||
|
||||
// Support: Safari <=8 - 12+, Chrome <=73+
|
||||
// Table columns in WebKit/Blink have non-zero offsetWidth & zero
|
||||
// getBoundingClientRect().width unless display is changed.
|
||||
// Support: IE <=11+
|
||||
// Running getBoundingClientRect on a disconnected node
|
||||
// in IE throws an error.
|
||||
( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ?
|
||||
!elem.getBoundingClientRect().width ?
|
||||
swap( elem, cssShow, function() {
|
||||
return getWidthOrHeight( elem, dimension, extra );
|
||||
} ) :
|
||||
|
@ -1,12 +0,0 @@
|
||||
import { camelCase } from "../core/camelCase.js";
|
||||
|
||||
// Matches dashed string for camelizing
|
||||
var rmsPrefix = /^-ms-/;
|
||||
|
||||
// Convert dashed to camelCase, handle vendor prefixes.
|
||||
// Used by the css & effects modules.
|
||||
// Support: IE <=9 - 11+
|
||||
// Microsoft forgot to hump their vendor prefix (trac-9572)
|
||||
export function cssCamelCase( string ) {
|
||||
return camelCase( string.replace( rmsPrefix, "ms-" ) );
|
||||
}
|
@ -10,22 +10,18 @@ export function curCSS( elem, name, computed ) {
|
||||
|
||||
computed = computed || getStyles( elem );
|
||||
|
||||
// getPropertyValue is needed for `.css('--customProperty')` (gh-3144)
|
||||
if ( computed ) {
|
||||
|
||||
// getPropertyValue is needed for `.css('--customProperty')` (gh-3144)
|
||||
// Some regular properties - if their camelCased form is identical to
|
||||
// the kebab-cased one - would return the value from `getPropertyValue`
|
||||
// instead of directly from a property of `computed`. The value from
|
||||
// direct property access would be identical, though, so this is not
|
||||
// an issue.
|
||||
//
|
||||
// A fallback to direct property access is needed as `computed`, being
|
||||
// the output of `getComputedStyle`, contains camelCased keys and
|
||||
// `getPropertyValue` requires kebab-case ones.
|
||||
//
|
||||
// Support: IE <=9 - 11+
|
||||
// IE only supports `"float"` in `getPropertyValue`; in computed styles
|
||||
// it's only available as `"cssFloat"`. We no longer modify properties
|
||||
// sent to `.css()` apart from camelCasing, so we need to check both.
|
||||
// Normally, this would create difference in behavior: if
|
||||
// `getPropertyValue` returns an empty string, the value returned
|
||||
// by `.css()` would be `undefined`. This is usually the case for
|
||||
// disconnected elements. However, in IE even disconnected elements
|
||||
// with no styles return `"none"` for `getPropertyValue( "float" )`
|
||||
ret = computed.getPropertyValue( name ) || computed[ name ];
|
||||
|
||||
if ( isCustomProp && ret ) {
|
||||
@ -54,10 +50,5 @@ export function curCSS( elem, name, computed ) {
|
||||
}
|
||||
}
|
||||
|
||||
return ret !== undefined ?
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// IE returns zIndex value as an integer.
|
||||
ret + "" :
|
||||
ret;
|
||||
return ret;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { document } from "../var/document.js";
|
||||
|
||||
var cssPrefixes = [ "Webkit", "Moz", "ms" ],
|
||||
var cssPrefixes = [ "Webkit", "Moz" ],
|
||||
emptyStyle = document.createElement( "div" ).style,
|
||||
vendorProps = {};
|
||||
|
||||
|
@ -12,9 +12,6 @@ if ( !div.style ) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Support: IE 10 - 11+
|
||||
// IE misreports `getComputedStyle` of table rows with width/height
|
||||
// set in CSS while `offset*` properties report correct values.
|
||||
// Support: Firefox 70+
|
||||
// Only Firefox includes border widths
|
||||
// in computed dimensions. (gh-4529)
|
||||
@ -25,12 +22,11 @@ support.reliableTrDimensions = function() {
|
||||
tr = document.createElement( "tr" );
|
||||
|
||||
table.style.cssText = "position:absolute;left:-11111px;border-collapse:separate";
|
||||
tr.style.cssText = "box-sizing:content-box;border:1px solid";
|
||||
tr.style.cssText = "box-sizing:content-box;border-top:1px solid";
|
||||
|
||||
// Support: Chrome 86+
|
||||
// Height set through cssText does not get applied.
|
||||
// Computed height then comes back as 0.
|
||||
tr.style.height = "1px";
|
||||
div.style.height = "9px";
|
||||
|
||||
// Support: Android Chrome 86+
|
||||
|
@ -1,15 +1,3 @@
|
||||
export function getStyles( elem ) {
|
||||
|
||||
// Support: IE <=11+ (trac-14150)
|
||||
// In IE popup's `window` is the opener window which makes `window.getComputedStyle( elem )`
|
||||
// break. Using `elem.ownerDocument.defaultView` avoids the issue.
|
||||
var view = elem.ownerDocument.defaultView;
|
||||
|
||||
// `document.implementation.createHTMLDocument( "" )` has a `null` `defaultView`
|
||||
// property; check `defaultView` truthiness to fallback to window in such a case.
|
||||
if ( !view ) {
|
||||
view = window;
|
||||
}
|
||||
|
||||
return view.getComputedStyle( elem );
|
||||
return window.getComputedStyle( elem );
|
||||
}
|
||||
|
13
src/data.js
13
src/data.js
@ -103,15 +103,10 @@ jQuery.fn.extend( {
|
||||
if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) {
|
||||
i = attrs.length;
|
||||
while ( i-- ) {
|
||||
|
||||
// Support: IE 11+
|
||||
// The attrs elements can be null (trac-14894)
|
||||
if ( attrs[ i ] ) {
|
||||
name = attrs[ i ].name;
|
||||
if ( name.indexOf( "data-" ) === 0 ) {
|
||||
name = camelCase( name.slice( 5 ) );
|
||||
dataAttr( elem, name, data[ name ] );
|
||||
}
|
||||
name = attrs[ i ].name;
|
||||
if ( name.indexOf( "data-" ) === 0 ) {
|
||||
name = camelCase( name.slice( 5 ) );
|
||||
dataAttr( elem, name, data[ name ] );
|
||||
}
|
||||
}
|
||||
dataPriv.set( elem, "hasDataAttrs", true );
|
||||
|
13
src/effects.js
vendored
13
src/effects.js
vendored
@ -1,11 +1,11 @@
|
||||
import { jQuery } from "./core.js";
|
||||
import { camelCase } from "./core/camelCase.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { rcssNum } from "./var/rcssNum.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
import { cssExpand } from "./css/var/cssExpand.js";
|
||||
import { isHiddenWithinTree } from "./css/var/isHiddenWithinTree.js";
|
||||
import { adjustCSS } from "./css/adjustCSS.js";
|
||||
import { cssCamelCase } from "./css/cssCamelCase.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { showHide } from "./css/showHide.js";
|
||||
|
||||
@ -143,10 +143,7 @@ function defaultPrefilter( elem, props, opts ) {
|
||||
// Restrict "overflow" and "display" styles during box animations
|
||||
if ( isBox && elem.nodeType === 1 ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Record all 3 overflow attributes because IE does not infer the shorthand
|
||||
// from identically-valued overflowX and overflowY.
|
||||
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
|
||||
opts.overflow = style.overflow;
|
||||
|
||||
// Identify a display type, preferring old show/hide data over the CSS cascade
|
||||
restoreDisplay = dataShow && dataShow.display;
|
||||
@ -189,9 +186,7 @@ function defaultPrefilter( elem, props, opts ) {
|
||||
if ( opts.overflow ) {
|
||||
style.overflow = "hidden";
|
||||
anim.always( function() {
|
||||
style.overflow = opts.overflow[ 0 ];
|
||||
style.overflowX = opts.overflow[ 1 ];
|
||||
style.overflowY = opts.overflow[ 2 ];
|
||||
style.overflow = opts.overflow;
|
||||
} );
|
||||
}
|
||||
|
||||
@ -250,7 +245,7 @@ function propFilter( props, specialEasing ) {
|
||||
|
||||
// camelCase, specialEasing and expand cssHook pass
|
||||
for ( index in props ) {
|
||||
name = cssCamelCase( index );
|
||||
name = camelCase( index );
|
||||
easing = specialEasing[ name ];
|
||||
value = props[ index ];
|
||||
if ( Array.isArray( value ) ) {
|
||||
|
42
src/event.js
42
src/event.js
@ -3,7 +3,6 @@ import { documentElement } from "./var/documentElement.js";
|
||||
import { rnothtmlwhite } from "./var/rnothtmlwhite.js";
|
||||
import { rcheckableType } from "./var/rcheckableType.js";
|
||||
import { slice } from "./var/slice.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { acceptData } from "./data/var/acceptData.js";
|
||||
import { dataPriv } from "./data/var/dataPriv.js";
|
||||
import { nodeName } from "./core/nodeName.js";
|
||||
@ -353,8 +352,6 @@ jQuery.event = {
|
||||
// Support: Firefox <=42 - 66+
|
||||
// Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861)
|
||||
// https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click
|
||||
// Support: IE 11+
|
||||
// ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343)
|
||||
!( event.type === "click" && event.button >= 1 ) ) {
|
||||
|
||||
for ( ; cur !== this; cur = cur.parentNode || this ) {
|
||||
@ -726,28 +723,6 @@ jQuery.each( {
|
||||
|
||||
jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) {
|
||||
|
||||
// Support: IE 11+
|
||||
// Attach a single focusin/focusout handler on the document while someone wants focus/blur.
|
||||
// This is because the former are synchronous in IE while the latter are async. In other
|
||||
// browsers, all those handlers are invoked synchronously.
|
||||
function focusMappedHandler( nativeEvent ) {
|
||||
|
||||
// `eventHandle` would already wrap the event, but we need to change the `type` here.
|
||||
var event = jQuery.event.fix( nativeEvent );
|
||||
event.type = nativeEvent.type === "focusin" ? "focus" : "blur";
|
||||
event.isSimulated = true;
|
||||
|
||||
// focus/blur don't bubble while focusin/focusout do; simulate the former by only
|
||||
// invoking the handler at the lower level.
|
||||
if ( event.target === event.currentTarget ) {
|
||||
|
||||
// The setup part calls `leverageNative`, which, in turn, calls
|
||||
// `jQuery.event.add`, so event handle will already have been set
|
||||
// by this point.
|
||||
dataPriv.get( this, "handle" )( event );
|
||||
}
|
||||
}
|
||||
|
||||
jQuery.event.special[ type ] = {
|
||||
|
||||
// Utilize native event if possible so blur/focus sequence is correct
|
||||
@ -758,13 +733,8 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
|
||||
// dataPriv.set( this, "blur", ... )
|
||||
leverageNative( this, type, true );
|
||||
|
||||
if ( isIE ) {
|
||||
this.addEventListener( delegateType, focusMappedHandler );
|
||||
} else {
|
||||
|
||||
// Return false to allow normal processing in the caller
|
||||
return false;
|
||||
}
|
||||
// Return false to allow normal processing in the caller
|
||||
return false;
|
||||
},
|
||||
trigger: function() {
|
||||
|
||||
@ -776,13 +746,9 @@ jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateTyp
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( isIE ) {
|
||||
this.removeEventListener( delegateType, focusMappedHandler );
|
||||
} else {
|
||||
|
||||
// Return false to indicate standard teardown should be applied
|
||||
return false;
|
||||
}
|
||||
// Return false to indicate standard teardown should be applied
|
||||
return false;
|
||||
},
|
||||
|
||||
// Suppress native focus or blur if we're currently inside
|
||||
|
@ -1,6 +1,5 @@
|
||||
import { jQuery } from "./core.js";
|
||||
import { isAttached } from "./core/isAttached.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { push } from "./var/push.js";
|
||||
import { access } from "./core/access.js";
|
||||
import { rtagName } from "./manipulation/var/rtagName.js";
|
||||
@ -17,11 +16,7 @@ import "./core/init.js";
|
||||
import "./traversing.js";
|
||||
import "./event.js";
|
||||
|
||||
var
|
||||
|
||||
// Support: IE <=10 - 11+
|
||||
// In IE using regex groups here causes severe slowdowns.
|
||||
rnoInnerhtml = /<script|<style|<link/i;
|
||||
var rnoInnerhtml = /<script|<style|<link/i;
|
||||
|
||||
// Prefer a tbody over its parent table for containing new rows
|
||||
function manipulationTarget( elem, content ) {
|
||||
@ -89,31 +84,11 @@ jQuery.extend( {
|
||||
clone = elem.cloneNode( true ),
|
||||
inPage = isAttached( elem );
|
||||
|
||||
// Fix IE cloning issues
|
||||
if ( isIE && ( elem.nodeType === 1 || elem.nodeType === 11 ) &&
|
||||
!jQuery.isXMLDoc( elem ) ) {
|
||||
|
||||
// We eschew jQuery#find here for performance reasons:
|
||||
// https://jsperf.com/getall-vs-sizzle/2
|
||||
destElements = getAll( clone );
|
||||
srcElements = getAll( elem );
|
||||
|
||||
for ( i = 0, l = srcElements.length; i < l; i++ ) {
|
||||
|
||||
// Support: IE <=11+
|
||||
// IE fails to set the defaultValue to the correct value when
|
||||
// cloning textareas.
|
||||
if ( nodeName( destElements[ i ], "textarea" ) ) {
|
||||
destElements[ i ].defaultValue = srcElements[ i ].defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Copy the events from the original to the clone
|
||||
if ( dataAndEvents ) {
|
||||
if ( deepDataAndEvents ) {
|
||||
srcElements = srcElements || getAll( elem );
|
||||
destElements = destElements || getAll( clone );
|
||||
srcElements = getAll( elem );
|
||||
destElements = getAll( clone );
|
||||
|
||||
for ( i = 0, l = srcElements.length; i < l; i++ ) {
|
||||
cloneCopyEvent( srcElements[ i ], destElements[ i ] );
|
||||
|
@ -24,7 +24,7 @@ function restoreScript( elem ) {
|
||||
export function domManip( collection, args, callback, ignored ) {
|
||||
|
||||
// Flatten any nested arrays
|
||||
args = flat( args );
|
||||
args = flat.call( args );
|
||||
|
||||
var fragment, first, scripts, hasScripts, node, doc,
|
||||
i = 0,
|
||||
|
@ -4,16 +4,14 @@ import { arr } from "../var/arr.js";
|
||||
|
||||
export function getAll( context, tag ) {
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// Use typeof to avoid zero-argument method invocation on host objects (trac-15151)
|
||||
var ret;
|
||||
|
||||
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
||||
if ( context.getElementsByTagName ) {
|
||||
|
||||
// Use slice to snapshot the live collection from gEBTN
|
||||
ret = arr.slice.call( context.getElementsByTagName( tag || "*" ) );
|
||||
|
||||
} else if ( typeof context.querySelectorAll !== "undefined" ) {
|
||||
} else if ( context.querySelectorAll ) {
|
||||
ret = context.querySelectorAll( tag || "*" );
|
||||
|
||||
} else {
|
||||
|
@ -80,9 +80,6 @@ jQuery.fn.extend( {
|
||||
}
|
||||
|
||||
// Return zeros for disconnected and hidden (display: none) elements (gh-2310)
|
||||
// Support: IE <=11+
|
||||
// Running getBoundingClientRect on a
|
||||
// disconnected node in IE throws an error
|
||||
if ( !elem.getClientRects().length ) {
|
||||
return { top: 0, left: 0 };
|
||||
}
|
||||
|
@ -9,7 +9,6 @@
|
||||
* * Type selectors (:input; :checkbox; :button; etc.)
|
||||
* * State-based selectors (:animated; :visible; :hidden; etc.)
|
||||
* * :has(selector) in browsers without native support
|
||||
* * :not(complex selector) in IE
|
||||
* * custom selectors via jQuery extensions
|
||||
* * Reliable functionality on XML fragments
|
||||
* * Matching against non-elements
|
||||
@ -24,7 +23,6 @@
|
||||
import { jQuery } from "./core.js";
|
||||
import { document } from "./var/document.js";
|
||||
import { whitespace } from "./var/whitespace.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
|
||||
import { rdescend } from "./selector/var/rdescend.js";
|
||||
import { rsibling } from "./selector/var/rsibling.js";
|
||||
@ -91,9 +89,8 @@ jQuery.extend( {
|
||||
testContext( context.parentNode ) ||
|
||||
context;
|
||||
|
||||
// Outside of IE, if we're not changing the context we can
|
||||
// use :scope instead of an ID.
|
||||
if ( newContext !== context || isIE ) {
|
||||
// If we're not changing the context, we can use :scope instead of an ID.
|
||||
if ( newContext !== context ) {
|
||||
|
||||
// Capture the context ID, setting it first if necessary
|
||||
if ( ( nid = context.getAttribute( "id" ) ) ) {
|
||||
|
@ -7,7 +7,6 @@ import { push } from "./var/push.js";
|
||||
import { whitespace } from "./var/whitespace.js";
|
||||
import { rbuggyQSA } from "./selector/rbuggyQSA.js";
|
||||
import { rtrimCSS } from "./var/rtrimCSS.js";
|
||||
import { isIE } from "./var/isIE.js";
|
||||
import { identifier } from "./selector/var/identifier.js";
|
||||
import { rleadingCombinator } from "./selector/var/rleadingCombinator.js";
|
||||
import { rdescend } from "./selector/var/rdescend.js";
|
||||
@ -64,14 +63,6 @@ var i,
|
||||
// Easily-parseable/retrievable ID or TAG or CLASS selectors
|
||||
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
||||
|
||||
// Used for iframes; see `setDocument`.
|
||||
// Support: IE 9 - 11+
|
||||
// Removing the function wrapper causes a "Permission Denied"
|
||||
// error in IE.
|
||||
unloadHandler = function() {
|
||||
setDocument();
|
||||
},
|
||||
|
||||
inDisabledFieldset = addCombinator(
|
||||
function( elem ) {
|
||||
return elem.disabled === true && nodeName( elem, "fieldset" );
|
||||
@ -160,13 +151,8 @@ function find( selector, context, results, seed ) {
|
||||
testContext( context.parentNode ) ||
|
||||
context;
|
||||
|
||||
// Outside of IE, if we're not changing the context we can
|
||||
// use :scope instead of an ID.
|
||||
// Support: IE 11+
|
||||
// IE sometimes throws a "Permission denied" error when strict-comparing
|
||||
// two documents; shallow comparisons work.
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if ( newContext != context || isIE ) {
|
||||
// If we're not changing the context we can use :scope instead of an ID.
|
||||
if ( newContext !== context ) {
|
||||
|
||||
// Capture the context ID, setting it first if necessary
|
||||
if ( ( nid = context.getAttribute( "id" ) ) ) {
|
||||
@ -268,13 +254,7 @@ function createDisabledPseudo( disabled ) {
|
||||
}
|
||||
}
|
||||
|
||||
// Support: IE 6 - 11+
|
||||
// Use the isDisabled shortcut property to check for disabled fieldset ancestors
|
||||
return elem.isDisabled === disabled ||
|
||||
|
||||
// Where there is no isDisabled, check manually
|
||||
elem.isDisabled !== !disabled &&
|
||||
inDisabledFieldset( elem ) === disabled;
|
||||
return inDisabledFieldset( elem ) === disabled;
|
||||
}
|
||||
|
||||
return elem.disabled === disabled;
|
||||
@ -318,15 +298,10 @@ function createPositionalPseudo( fn ) {
|
||||
* @param {Element|Object} [node] An element or document object to use to set the document
|
||||
*/
|
||||
function setDocument( node ) {
|
||||
var subWindow,
|
||||
doc = node ? node.ownerDocument || node : preferredDoc;
|
||||
var doc = node ? node.ownerDocument || node : preferredDoc;
|
||||
|
||||
// Return early if doc is invalid or already selected
|
||||
// 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 ) {
|
||||
if ( doc === document || doc.nodeType !== 9 ) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -334,17 +309,6 @@ function setDocument( node ) {
|
||||
document = doc;
|
||||
documentElement = document.documentElement;
|
||||
documentIsHTML = !jQuery.isXMLDoc( document );
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
|
||||
// Support: IE 11+
|
||||
// IE sometimes throws a "Permission denied" error when strict-comparing
|
||||
// two documents; shallow comparisons work.
|
||||
// eslint-disable-next-line eqeqeq
|
||||
if ( isIE && preferredDoc != document &&
|
||||
( subWindow = document.defaultView ) && subWindow.top !== subWindow ) {
|
||||
subWindow.addEventListener( "unload", unloadHandler );
|
||||
}
|
||||
}
|
||||
|
||||
find.matches = function( expr, elements ) {
|
||||
@ -728,16 +692,6 @@ jQuery.expr = {
|
||||
},
|
||||
|
||||
selected: function( elem ) {
|
||||
|
||||
// Support: IE <=11+
|
||||
// Accessing the selectedIndex property
|
||||
// forces the browser to treat the default option as
|
||||
// selected when in an optgroup.
|
||||
if ( isIE && elem.parentNode ) {
|
||||
// eslint-disable-next-line no-unused-expressions
|
||||
elem.parentNode.selectedIndex;
|
||||
}
|
||||
|
||||
return elem.selected === true;
|
||||
},
|
||||
|
||||
@ -1070,14 +1024,13 @@ function matcherFromTokens( tokens ) {
|
||||
}, implicitRelative, true ),
|
||||
matchers = [ function( elem, context, xml ) {
|
||||
|
||||
// Support: IE 11+
|
||||
// IE sometimes throws a "Permission denied" error when strict-comparing
|
||||
// two documents; shallow comparisons work.
|
||||
// eslint-disable-next-line eqeqeq
|
||||
var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || (
|
||||
var ret = ( !leadingRelative &&
|
||||
( xml || context !== outermostContext )
|
||||
) || (
|
||||
( checkContext = context ).nodeType ?
|
||||
matchContext( elem, context, xml ) :
|
||||
matchAnyContext( elem, context, xml ) );
|
||||
matchAnyContext( elem, context, xml )
|
||||
);
|
||||
|
||||
// Avoid hanging onto element
|
||||
// (see https://github.com/jquery/sizzle/issues/299)
|
||||
@ -1140,12 +1093,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
||||
dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 );
|
||||
|
||||
if ( outermost ) {
|
||||
|
||||
// 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;
|
||||
outermostContext = context === document || context || outermost;
|
||||
}
|
||||
|
||||
// Add elements passing elementMatchers directly to results
|
||||
@ -1153,11 +1101,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
||||
if ( byElement && elem ) {
|
||||
j = 0;
|
||||
|
||||
// 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 ) {
|
||||
if ( !context && elem.ownerDocument !== document ) {
|
||||
setDocument( elem );
|
||||
xml = !documentIsHTML;
|
||||
}
|
||||
|
@ -1,28 +1,9 @@
|
||||
import { isIE } from "../var/isIE.js";
|
||||
import { whitespace } from "../var/whitespace.js";
|
||||
import { support } from "./support.js";
|
||||
|
||||
// Build QSA regex.
|
||||
// Regex strategy adopted from Diego Perini.
|
||||
export var rbuggyQSA = [];
|
||||
|
||||
if ( isIE ) {
|
||||
rbuggyQSA.push(
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE's :disabled selector does not pick up the children of disabled fieldsets
|
||||
":enabled",
|
||||
":disabled",
|
||||
|
||||
// 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 + "*(?:''|\"\")"
|
||||
);
|
||||
}
|
||||
|
||||
if ( !support.cssHas ) {
|
||||
|
||||
// Support: Chrome 105 - 110+, Safari 15.4 - 16.3+
|
||||
|
@ -1,12 +1,12 @@
|
||||
// CSS escapes
|
||||
// https://www.w3.org/TR/CSS21/syndata.html#escaped-characters
|
||||
// https://www.w3.org/TR/css-syntax-3/#escape-diagram
|
||||
|
||||
import { whitespace } from "../var/whitespace.js";
|
||||
|
||||
var runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
"?|\\\\([^\\r\\n\\f])", "g" ),
|
||||
funescape = function( escape, nonHex ) {
|
||||
var high = "0x" + escape.slice( 1 ) - 0x10000;
|
||||
|
||||
if ( nonHex ) {
|
||||
|
||||
// Strip the backslash prefix from a non-hex escape sequence
|
||||
@ -14,12 +14,7 @@ var runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace +
|
||||
}
|
||||
|
||||
// Replace a hexadecimal escape sequence with the encoded Unicode code point
|
||||
// Support: IE <=11+
|
||||
// For values outside the Basic Multilingual Plane (BMP), manually construct a
|
||||
// surrogate pair
|
||||
return high < 0 ?
|
||||
String.fromCharCode( high + 0x10000 ) :
|
||||
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
||||
return String.fromCodePoint( "0x" + escape.slice( 1 ) );
|
||||
};
|
||||
|
||||
export function unescapeSelector( sel ) {
|
||||
|
@ -22,11 +22,7 @@ function sortOrder( a, b ) {
|
||||
}
|
||||
|
||||
// Calculate position if both inputs belong to the same document
|
||||
// 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 ) ?
|
||||
compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
|
||||
a.compareDocumentPosition( b ) :
|
||||
|
||||
// Otherwise we know they are disconnected
|
||||
@ -36,20 +32,12 @@ function sortOrder( a, b ) {
|
||||
if ( compare & 1 ) {
|
||||
|
||||
// Choose the first element that is related to the document
|
||||
// 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 &&
|
||||
if ( a === document || a.ownerDocument === document &&
|
||||
jQuery.contains( document, a ) ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
// 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 &&
|
||||
if ( b === document || b.ownerDocument === document &&
|
||||
jQuery.contains( document, b ) ) {
|
||||
return 1;
|
||||
}
|
||||
|
@ -1,5 +1,3 @@
|
||||
import { documentElement } from "../../var/documentElement.js";
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE requires a prefix.
|
||||
export var matches = documentElement.matches || documentElement.msMatchesSelector;
|
||||
export var matches = documentElement.matches;
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { jQuery } from "./core.js";
|
||||
import { getProto } from "./var/getProto.js";
|
||||
import { indexOf } from "./var/indexOf.js";
|
||||
import { dir } from "./traversing/var/dir.js";
|
||||
import { siblings } from "./traversing/var/siblings.js";
|
||||
@ -142,21 +141,15 @@ jQuery.each( {
|
||||
return siblings( elem.firstChild );
|
||||
},
|
||||
contents: function( elem ) {
|
||||
if ( elem.contentDocument != null &&
|
||||
|
||||
// Support: IE 11+
|
||||
// <object> elements with no `data` attribute has an object
|
||||
// `contentDocument` with a `null` prototype.
|
||||
getProto( elem.contentDocument ) ) {
|
||||
|
||||
// Most non-iframe nodes have an `undefined` `contentDocument`.
|
||||
// `<object>` elements have a `null` one. Handle both cases. (gh-4384)
|
||||
if ( elem.contentDocument != null ) {
|
||||
return elem.contentDocument;
|
||||
}
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// Treat the template element as a regular one in browsers that
|
||||
// don't support it.
|
||||
if ( nodeName( elem, "template" ) ) {
|
||||
elem = elem.content || elem;
|
||||
elem = elem.content;
|
||||
}
|
||||
|
||||
return jQuery.merge( [], elem.childNodes );
|
||||
|
@ -1,9 +1,3 @@
|
||||
import { arr } from "./arr.js";
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't have Array#flat; provide a fallback.
|
||||
export var flat = arr.flat ? function( array ) {
|
||||
return arr.flat.call( array );
|
||||
} : function( array ) {
|
||||
return arr.concat.apply( [], array );
|
||||
};
|
||||
export var flat = arr.flat;
|
||||
|
@ -1,3 +0,0 @@
|
||||
import { document } from "./document.js";
|
||||
|
||||
export var isIE = document.documentMode;
|
@ -9,7 +9,6 @@
|
||||
window.onunload = function() {};
|
||||
jQuery(function() {
|
||||
setTimeout(function() {
|
||||
var parent = window.parent;
|
||||
document.write("");
|
||||
startIframeTest();
|
||||
}, 200 );
|
||||
|
@ -1 +1 @@
|
||||
QUnit.assert.ok( QUnit.isIE, "evaluated: inner nomodule script with src" );
|
||||
QUnit.assert.ok( false, "evaluated: inner nomodule script with src" );
|
||||
|
@ -1 +1 @@
|
||||
QUnit.assert.ok( QUnit.isIE, "evaluated: nomodule script with src" );
|
||||
QUnit.assert.ok( false, "evaluated: nomodule script with src" );
|
||||
|
@ -224,9 +224,7 @@ Z</textarea>
|
||||
<input id="disabled-fieldset-input" name="disabled-fieldset-input" type="text" />
|
||||
<textarea id="disabled-fieldset-textarea" name="disabled-fieldset-textarea" ></textarea>
|
||||
<button id="disabled-fieldset-button" name="disabled-fieldset-button">Go</button>
|
||||
<!-- exclude <select> because IE6 is bugged and fails
|
||||
<select id="disabled-fieldset-select" name="disabled-fieldset-select"></select>
|
||||
-->
|
||||
<span id="disabled-fieldset-span">Neither enabled nor disabled</span>
|
||||
</fieldset>
|
||||
<fieldset id="enabled-fieldset">
|
||||
|
@ -292,12 +292,6 @@ QUnit.config.autostart = false;
|
||||
// Leverage QUnit URL parsing to detect "basic" testing mode
|
||||
QUnit.basicTests = ( QUnit.urlParams.module + "" ) === "basic";
|
||||
|
||||
// Support: IE 11+
|
||||
// A variable to make it easier to skip specific tests in IE, mostly
|
||||
// testing integrations with newer Web features not supported by it.
|
||||
QUnit.isIE = !!window.document.documentMode;
|
||||
QUnit.testUnlessIE = QUnit.isIE ? QUnit.skip : QUnit.test;
|
||||
|
||||
// Returns whether a particular module like "ajax" or "deprecated"
|
||||
// is included in the current jQuery build; it handles the slim build
|
||||
// as well. The util was created so that we don't treat presence of
|
||||
|
@ -87,7 +87,7 @@ th, td {
|
||||
<tbody>
|
||||
</tbody>
|
||||
</table>
|
||||
<p>NOTE: Only IE supports propertychange, beforeactivate, beforedeactivate; buttons do not support change events.</p>
|
||||
<p>NOTE: Buttons do not support change events.</p>
|
||||
|
||||
<h2>Submit Tests</h2>
|
||||
<table>
|
||||
@ -110,7 +110,7 @@ th, td {
|
||||
<input type='submit' value="Click Me To Submit" />
|
||||
</form>
|
||||
</td>
|
||||
<td>$(document).bind('submit')</td>
|
||||
<td>$( document ).on( "submit" )</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Results:</td>
|
||||
@ -143,7 +143,7 @@ $( function() {
|
||||
} );
|
||||
|
||||
// Events we want to track in row-order
|
||||
var events = "bind-change live-change onX-change bind-propertychange live-beforeactivate live-focusin bind-focus live-beforedeactivate live-focusout bind-blur live-click live-keydown".split( " " ),
|
||||
var events = "bind-change delegated-change onX-change delegated-focusin bind-focus delegated-focusout bind-blur delegated-click delegated-keydown".split( " " ),
|
||||
counter = 0;
|
||||
blinker = function( event ) {
|
||||
if ( !counter ) {
|
||||
@ -170,18 +170,20 @@ for ( var i = 0; i < events.length; i++ ) {
|
||||
$row = $( "<tr><th>" + type + " " + api + "</th></tr>" );
|
||||
|
||||
$( "#changes thead td" ).each( function() {
|
||||
var id = "#" + this.id,
|
||||
var id = "#" + this.id,
|
||||
$cell = $( "<td></td>" );
|
||||
if ( api == "onX" ) {
|
||||
if ( api === "onX" ) {
|
||||
$( this ).find( "input, button, select, textarea" ).each( function() {
|
||||
this[ "on" + type ] = function( e ) {
|
||||
e = $.event.fix( e || event ); e.data = $cell; blinker.call( this, e );
|
||||
};
|
||||
this[ "on" + type ] = function( e ){
|
||||
e = $.event.fix( e || event );
|
||||
e.data = $cell;
|
||||
blinker.call( this, e );
|
||||
};
|
||||
} );
|
||||
} else if ( api == "bind" ) {
|
||||
$( this ).find( "input, button, select, textarea" ).bind( type, $cell, blinker );
|
||||
} else if ( api === "bind" ) {
|
||||
$( this ).find( "input, button, select, textarea" ).on( type, $cell, blinker );
|
||||
} else {
|
||||
$( id + " input," + id + " button," + id + " select," + id + " textarea" ).live( type, $cell, blinker );
|
||||
$( document ).on( type, id + " input," + id + " button," + id + " select," + id + " textarea", $cell, blinker );
|
||||
}
|
||||
$row.append( $cell );
|
||||
} );
|
||||
@ -198,8 +200,8 @@ jQuery.fn.blink = function() {
|
||||
} );
|
||||
};
|
||||
|
||||
jQuery.fn.addSubmitTest = function( id, prevent ) {
|
||||
return this.live( "submit", function( e ) {
|
||||
function addSubmitTest( selector, id, prevent ) {
|
||||
return $( document ).on( "submit", selector, function( e ) {
|
||||
if ( prevent ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@ -207,11 +209,11 @@ jQuery.fn.addSubmitTest = function( id, prevent ) {
|
||||
} );
|
||||
};
|
||||
|
||||
$( "#text_submit" ).addSubmitTest( "#textSubmit", true );
|
||||
$( "#password_submit" ).addSubmitTest( "#passwordSubmit", true );
|
||||
$( "#submit_submit" ).addSubmitTest( "#submitSubmit", true );
|
||||
$( "#prog_submit" ).addSubmitTest( "#submitSubmit", true );
|
||||
$( document ).bind( "submit", function() {
|
||||
addSubmitTest( "#text_submit", "#textSubmit", true );
|
||||
addSubmitTest( "#password_submit", "#passwordSubmit", true );
|
||||
addSubmitTest( "#submit_submit", "#submitSubmit", true );
|
||||
addSubmitTest( "#prog_submit", "#submitSubmit", true );
|
||||
$( document ).on( "submit", function() {
|
||||
jQuery( "#boundSubmit" ).blink();
|
||||
} );
|
||||
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
<script src="../external/qunit/qunit.js"></script>
|
||||
<script src="../external/sinon/sinon.js"></script>
|
||||
<script src="../external/npo/npo.js"></script>
|
||||
<script src="../external/requirejs/require.js"></script>
|
||||
<!-- See testinit for the list of tests -->
|
||||
<script src="data/testinit.js"></script>
|
||||
|
@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Test for gh-1764 - test iframe</title>
|
||||
<link rel="stylesheet" href="gh-1764-fullscreen-iframe.css">
|
||||
</head>
|
||||
|
@ -10,52 +10,13 @@ function bootstrapFrom( mainSelector, mode ) {
|
||||
return;
|
||||
}
|
||||
|
||||
var fullscreenSupported = document.exitFullscreen ||
|
||||
document.exitFullscreen ||
|
||||
document.msExitFullscreen ||
|
||||
document.mozCancelFullScreen ||
|
||||
document.webkitExitFullscreen;
|
||||
|
||||
function isFullscreen() {
|
||||
return !!( document.fullscreenElement ||
|
||||
document.mozFullScreenElement ||
|
||||
document.webkitFullscreenElement ||
|
||||
document.msFullscreenElement );
|
||||
}
|
||||
|
||||
function requestFullscreen( element ) {
|
||||
if ( !isFullscreen() ) {
|
||||
if ( element.requestFullscreen ) {
|
||||
element.requestFullscreen();
|
||||
} else if ( element.msRequestFullscreen ) {
|
||||
element.msRequestFullscreen();
|
||||
} else if ( element.mozRequestFullScreen ) {
|
||||
element.mozRequestFullScreen();
|
||||
} else if ( element.webkitRequestFullscreen ) {
|
||||
element.webkitRequestFullscreen();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function exitFullscreen() {
|
||||
if ( document.exitFullscreen ) {
|
||||
document.exitFullscreen();
|
||||
} else if ( document.msExitFullscreen ) {
|
||||
document.msExitFullscreen();
|
||||
} else if ( document.mozCancelFullScreen ) {
|
||||
document.mozCancelFullScreen();
|
||||
} else if ( document.webkitExitFullscreen ) {
|
||||
document.webkitExitFullscreen();
|
||||
}
|
||||
return !!( document.fullscreenElement );
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var dimensions;
|
||||
if ( !fullscreenSupported ) {
|
||||
jQuery( mainSelector + " .result" )
|
||||
.attr( "class", "result success" )
|
||||
.text( "Fullscreen mode is not supported in this browser. Test not run." );
|
||||
} else if ( !isFullscreen() ) {
|
||||
if ( !isFullscreen() ) {
|
||||
jQuery( mainSelector + " .result" )
|
||||
.attr( "class", "result warn" )
|
||||
.text( "Enable fullscreen mode to fire the test." );
|
||||
@ -80,20 +41,15 @@ function bootstrapFrom( mainSelector, mode ) {
|
||||
|
||||
function toggleFullscreen() {
|
||||
if ( isFullscreen() ) {
|
||||
exitFullscreen();
|
||||
document.exitFullscreen();
|
||||
} else {
|
||||
requestFullscreen( jQuery( mainSelector + " .container" )[ 0 ] );
|
||||
jQuery( mainSelector + " .container" )[ 0 ].requestFullscreen();
|
||||
}
|
||||
}
|
||||
|
||||
$( mainSelector + " .toggle-fullscreen" ).on( "click", toggleFullscreen );
|
||||
|
||||
$( document ).on( [
|
||||
"webkitfullscreenchange",
|
||||
"mozfullscreenchange",
|
||||
"fullscreenchange",
|
||||
"MSFullscreenChange"
|
||||
].join( " " ), runTest );
|
||||
$( document ).on( "fullscreenchange", runTest );
|
||||
|
||||
runTest();
|
||||
}
|
||||
|
@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Test for gh-1764</title>
|
||||
<link rel="stylesheet" href="./data/gh-1764-fullscreen-iframe.css">
|
||||
<style>
|
||||
|
@ -2,7 +2,6 @@
|
||||
<html>
|
||||
<head lang="en">
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<title>Test for gh-2343 (IE11)</title>
|
||||
<script src="../../dist/jquery.js"></script>
|
||||
<script>
|
||||
|
33
test/jquery.js
vendored
33
test/jquery.js
vendored
@ -1,6 +1,8 @@
|
||||
// Use the right jQuery source on the test page (and iframes)
|
||||
( function() {
|
||||
var dynamicImportSource, config, src,
|
||||
/* global loadTests: false */
|
||||
|
||||
var config, src,
|
||||
parentUrl = window.location.protocol + "//" + window.location.host,
|
||||
QUnit = window.QUnit;
|
||||
|
||||
@ -47,24 +49,19 @@
|
||||
// This doesn't apply to iframes because they synchronously expect jQuery to be there.
|
||||
if ( config.esmodules && QUnit ) {
|
||||
|
||||
// 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" +
|
||||
" .then( ( { jQuery } ) => {\n" +
|
||||
" window.jQuery = jQuery;\n" +
|
||||
" if ( typeof loadTests === \"function\" ) {\n" +
|
||||
" // Include tests if specified\n" +
|
||||
" loadTests();\n" +
|
||||
" }\n" +
|
||||
" } )\n" +
|
||||
" .catch( error => {\n" +
|
||||
" console.error( error );\n" +
|
||||
" QUnit.done();\n" +
|
||||
" } );";
|
||||
import( `${ parentUrl }/src/jquery.js` )
|
||||
.then( ( { jQuery } ) => {
|
||||
window.jQuery = jQuery;
|
||||
|
||||
eval( dynamicImportSource );
|
||||
// Include tests if specified
|
||||
if ( typeof loadTests === "function" ) {
|
||||
loadTests();
|
||||
}
|
||||
} )
|
||||
.catch( error => {
|
||||
console.error( error );
|
||||
QUnit.done();
|
||||
} );
|
||||
|
||||
// Otherwise, load synchronously
|
||||
} else {
|
||||
|
@ -5,13 +5,11 @@ import { getBrowsers } from "../browserstack/api.js";
|
||||
|
||||
export const browsers = [
|
||||
"chrome",
|
||||
"ie",
|
||||
"firefox",
|
||||
"edge",
|
||||
"safari",
|
||||
"opera",
|
||||
"yandex",
|
||||
"IE Mobile",
|
||||
"Android Browser",
|
||||
"Mobile Safari",
|
||||
"jsdom"
|
||||
|
@ -2,7 +2,6 @@ const browserMap = {
|
||||
chrome: "Chrome",
|
||||
edge: "Edge",
|
||||
firefox: "Firefox",
|
||||
ie: "IE",
|
||||
jsdom: "JSDOM",
|
||||
opera: "Opera",
|
||||
safari: "Safari"
|
||||
|
@ -2,7 +2,6 @@ import { Builder, Capabilities, logging } from "selenium-webdriver";
|
||||
import Chrome from "selenium-webdriver/chrome.js";
|
||||
import Edge from "selenium-webdriver/edge.js";
|
||||
import Firefox from "selenium-webdriver/firefox.js";
|
||||
import IE from "selenium-webdriver/ie.js";
|
||||
import { browserSupportsHeadless } from "../lib/getBrowserString.js";
|
||||
|
||||
// Set script timeout to 10min
|
||||
@ -11,15 +10,9 @@ const DRIVER_SCRIPT_TIMEOUT = 1000 * 60 * 10;
|
||||
export default async function createDriver( { browserName, headless, url, verbose } ) {
|
||||
const capabilities = Capabilities[ browserName ]();
|
||||
|
||||
// Support: IE 11+
|
||||
// When those are set for IE, the process crashes with an error:
|
||||
// "Unable to match capability set 0: goog:loggingPrefs is an unknown
|
||||
// extension capability for IE".
|
||||
if ( browserName !== "ie" ) {
|
||||
const prefs = new logging.Preferences();
|
||||
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
|
||||
capabilities.setLoggingPrefs( prefs );
|
||||
}
|
||||
const prefs = new logging.Preferences();
|
||||
prefs.setLevel( logging.Type.BROWSER, logging.Level.ALL );
|
||||
capabilities.setLoggingPrefs( prefs );
|
||||
|
||||
let driver = new Builder().withCapabilities( capabilities );
|
||||
|
||||
@ -57,10 +50,6 @@ export default async function createDriver( { browserName, headless, url, verbos
|
||||
edgeOptions.setEdgeChromiumBinaryPath( process.env.EDGE_BIN );
|
||||
}
|
||||
|
||||
const ieOptions = new IE.Options();
|
||||
ieOptions.setEdgeChromium( true );
|
||||
ieOptions.setEdgePath( "C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" );
|
||||
|
||||
if ( headless ) {
|
||||
chromeOptions.addArguments( "--headless=new" );
|
||||
firefoxOptions.addArguments( "--headless" );
|
||||
@ -77,7 +66,6 @@ export default async function createDriver( { browserName, headless, url, verbos
|
||||
.setChromeOptions( chromeOptions )
|
||||
.setFirefoxOptions( firefoxOptions )
|
||||
.setEdgeOptions( edgeOptions )
|
||||
.setIeOptions( ieOptions )
|
||||
.build();
|
||||
|
||||
if ( verbose ) {
|
||||
|
@ -314,18 +314,14 @@ QUnit.module( "ajax", {
|
||||
} );
|
||||
},
|
||||
url: url( "mock.php?action=headers&keys=siMPle|SometHing-elsE|OthEr|Nullable|undefined|Empty|ajax-send" ),
|
||||
headers: supportjQuery.extend( {
|
||||
headers: {
|
||||
"siMPle": "value",
|
||||
"SometHing-elsE": "other value",
|
||||
"OthEr": "something else",
|
||||
"Nullable": null,
|
||||
"undefined": undefined
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE can receive empty headers but not send them.
|
||||
}, QUnit.isIE ? {} : {
|
||||
"undefined": undefined,
|
||||
"Empty": ""
|
||||
} ),
|
||||
},
|
||||
success: function( data, _, xhr ) {
|
||||
var i,
|
||||
requestHeaders = jQuery.extend( this.headers, {
|
||||
@ -3266,7 +3262,7 @@ if ( typeof window.ArrayBuffer === "undefined" || typeof new XMLHttpRequest().re
|
||||
assert.strictEqual( data, "pan", "URLSearchParams sent correctly" );
|
||||
}
|
||||
};
|
||||
}, QUnit.testUnlessIE );
|
||||
} );
|
||||
|
||||
ajaxTest( "jQuery.ajax() - Blob", 1, function( assert ) {
|
||||
var blob = new Blob( [ "name=peter" ], { type: "text/plain" } );
|
||||
|
@ -982,8 +982,7 @@ QUnit.test( "val() respects numbers without exception (Bug trac-9319) - progress
|
||||
$progress.remove();
|
||||
} );
|
||||
|
||||
// IE doesn't support <meter>
|
||||
QUnit.testUnlessIE( "val() respects numbers without exception (Bug trac-9319) - meter",
|
||||
QUnit.test( "val() respects numbers without exception (Bug trac-9319) - meter",
|
||||
function( assert ) {
|
||||
|
||||
assert.expect( 2 );
|
||||
|
@ -322,7 +322,7 @@ QUnit.test( "isPlainObject", function( assert ) {
|
||||
}
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "isPlainObject(Symbol)", function( assert ) {
|
||||
QUnit.test( "isPlainObject(Symbol)", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
assert.equal( jQuery.isPlainObject( Symbol() ), false, "Symbol" );
|
||||
@ -335,7 +335,7 @@ QUnit.test( "isPlainObject(localStorage)", function( assert ) {
|
||||
assert.equal( jQuery.isPlainObject( localStorage ), false );
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "isPlainObject(Object.assign(...))",
|
||||
QUnit.test( "isPlainObject(Object.assign(...))",
|
||||
function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
@ -548,7 +548,7 @@ QUnit.test( "jQuery(selector, xml).text(str) - loaded via xml document", functio
|
||||
|
||||
var xml = createDashboardXML(),
|
||||
|
||||
// tests for trac-1419 where ie was a problem
|
||||
// tests for trac-1419 where IE was a problem
|
||||
tab = jQuery( "tab", xml ).eq( 0 );
|
||||
assert.equal( tab.text(), "blabla", "verify initial text correct" );
|
||||
tab.text( "newtext" );
|
||||
@ -819,16 +819,10 @@ 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+
|
||||
// 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 (gh-4320)" );
|
||||
} else {
|
||||
assert.ok( "skip", "Array#flat isn't supported in IE" );
|
||||
}
|
||||
result = jQuery.map( Array( 300000 ), function( v, k ) {
|
||||
return k;
|
||||
} );
|
||||
assert.equal( result.length, 300000, "Able to map 300000 records without any problems (gh-4320)" );
|
||||
} );
|
||||
|
||||
QUnit.test( "jQuery.merge()", function( assert ) {
|
||||
@ -1452,10 +1446,7 @@ QUnit.test( "jQuery.parseXML", function( assert ) {
|
||||
}
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE throws an error when parsing invalid XML instead of reporting the error
|
||||
// in a `parsererror` element, skip the test there.
|
||||
QUnit.testUnlessIE( "jQuery.parseXML - error reporting", function( assert ) {
|
||||
QUnit.test( "jQuery.parseXML - error reporting", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var errorArg, lineMatch, line, columnMatch, column;
|
||||
@ -1616,7 +1607,7 @@ QUnit.test( "jQuery.contains in SVG (jQuery trac-10832)", function( assert ) {
|
||||
"parent (negative)" );
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "jQuery.contains within <template/> doesn't throw (gh-5147)", function( assert ) {
|
||||
QUnit.test( "jQuery.contains within <template/> doesn't throw (gh-5147)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var template = jQuery( "<template><div><div class='a'></div></div></template>" ),
|
||||
|
121
test/unit/css.js
121
test/unit/css.js
@ -634,11 +634,7 @@ QUnit.test( "show/hide detached nodes", function( assert ) {
|
||||
span.remove();
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support Shadow DOM.
|
||||
QUnit.testUnlessIE(
|
||||
"show/hide shadow child nodes", function( assert ) {
|
||||
|
||||
QUnit.test( "show/hide shadow child nodes", function( assert ) {
|
||||
assert.expect( 28 );
|
||||
jQuery( "<div id='shadowHost'></div>" ).appendTo( "#qunit-fixture" );
|
||||
var shadowHost = document.querySelector( "#shadowHost" );
|
||||
@ -1018,7 +1014,7 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "detached toggle()", function(
|
||||
"cascade-hidden element in detached tree" );
|
||||
} );
|
||||
|
||||
QUnit[ QUnit.jQuerySelectors && !QUnit.isIE ? "test" : "skip" ](
|
||||
QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ](
|
||||
"shadow toggle()", function( assert ) {
|
||||
|
||||
assert.expect( 4 );
|
||||
@ -1209,8 +1205,7 @@ QUnit.test( "Do not append px (trac-9548, trac-12990, gh-2792)", function( asser
|
||||
} );
|
||||
|
||||
|
||||
// IE doesn't support the standard version of CSS Grid.
|
||||
QUnit.testUnlessIE( "Do not append px to CSS Grid-related properties (gh-4007)",
|
||||
QUnit.test( "Do not append px to CSS Grid-related properties (gh-4007)",
|
||||
function( assert ) {
|
||||
|
||||
assert.expect( 12 );
|
||||
@ -1428,7 +1423,7 @@ testIframe(
|
||||
);
|
||||
} )();
|
||||
|
||||
QUnit.testUnlessIE( "css('width') and css('height') should return fractional values for nodes in the document", function( assert ) {
|
||||
QUnit.test( "css('width') and css('height') should return fractional values for nodes in the document", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var el = jQuery( "<div class='test-div'></div>" ).appendTo( "#qunit-fixture" );
|
||||
@ -1440,7 +1435,7 @@ QUnit.testUnlessIE( "css('width') and css('height') should return fractional val
|
||||
"css('height') should return fractional values" );
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "css('width') and css('height') should return fractional values for disconnected nodes", function( assert ) {
|
||||
QUnit.test( "css('width') and css('height') should return fractional values for disconnected nodes", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var el = jQuery( "<div style='width: 33.3px; height: 88.8px;'></div>" );
|
||||
@ -1702,78 +1697,40 @@ QUnit.test( "Do not throw on frame elements from css method (trac-15098)", funct
|
||||
}
|
||||
} );
|
||||
|
||||
( function() {
|
||||
var vendorPrefixes = [ "Webkit", "Moz", "ms" ];
|
||||
QUnit.test( "Don't default to a cached previously used wrong prefixed name (gh-2015)", function( assert ) {
|
||||
|
||||
QUnit.test( "Don't default to a cached previously used wrong prefixed name (gh-2015)", function( assert ) {
|
||||
// Note: this test needs a property we know is only supported in a prefixed version
|
||||
// by at least one of our main supported browsers. This may get out of date but
|
||||
// for now "-webkit-line-clamp" looks good to use.
|
||||
|
||||
// Note: this test needs a property we know is only supported in a prefixed version
|
||||
// by at least one of our main supported browsers. This may get out of date so let's
|
||||
// use -(webkit|moz)-appearance as well as those two are not on a standards track.
|
||||
var appearanceName, transformName, elem, elemStyle,
|
||||
transformVal = "translate(5px, 2px)",
|
||||
emptyStyle = document.createElement( "div" ).style;
|
||||
assert.expect( 2 );
|
||||
|
||||
if ( "appearance" in emptyStyle ) {
|
||||
appearanceName = "appearance";
|
||||
} else {
|
||||
jQuery.each( vendorPrefixes, function( index, prefix ) {
|
||||
var prefixedProp = prefix + "Appearance";
|
||||
if ( prefixedProp in emptyStyle ) {
|
||||
appearanceName = prefixedProp;
|
||||
}
|
||||
} );
|
||||
}
|
||||
var elem = jQuery( "<div></div>" )
|
||||
|
||||
if ( "transform" in emptyStyle ) {
|
||||
transformName = "transform";
|
||||
} else {
|
||||
jQuery.each( vendorPrefixes, function( index, prefix ) {
|
||||
var prefixedProp = prefix + "Transform";
|
||||
if ( prefixedProp in emptyStyle ) {
|
||||
transformName = prefixedProp;
|
||||
}
|
||||
} );
|
||||
}
|
||||
|
||||
assert.expect( !!appearanceName + !!transformName + 1 );
|
||||
|
||||
elem = jQuery( "<div></div>" )
|
||||
.css( {
|
||||
msAppearance: "none",
|
||||
appearance: "none",
|
||||
|
||||
// Only the ms prefix is used to make sure we haven't e.g. set
|
||||
// webkitTransform ourselves in the test.
|
||||
msTransform: transformVal,
|
||||
transform: transformVal
|
||||
} );
|
||||
// Only the moz prefix is used to make sure we haven't e.g. set
|
||||
// webkitTransform ourselves in the test.
|
||||
.css( "-moz-line-clamp", "1" )
|
||||
.css( "line-clamp", "1" ),
|
||||
elemStyle = elem[ 0 ].style;
|
||||
|
||||
if ( appearanceName ) {
|
||||
assert.equal( elemStyle[ appearanceName ], "none", "setting properly-prefixed appearance" );
|
||||
}
|
||||
if ( transformName ) {
|
||||
assert.equal( elemStyle[ transformName ], transformVal, "setting properly-prefixed transform" );
|
||||
}
|
||||
assert.equal( elemStyle.undefined, undefined, "Nothing writes to node.style.undefined" );
|
||||
} );
|
||||
assert.equal( elemStyle.WebkitLineClamp, "1",
|
||||
"setting properly-prefixed -webkit-line-clamp" );
|
||||
assert.equal( elemStyle.undefined, undefined,
|
||||
"Nothing writes to node.style.undefined" );
|
||||
} );
|
||||
|
||||
QUnit.test( "Don't detect fake set properties on a node when caching the prefixed version", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
QUnit.test( "Don't detect fake set properties on a node when caching the prefixed version", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var elem = jQuery( "<div></div>" ),
|
||||
style = elem[ 0 ].style;
|
||||
style.MozFakeProperty = "old value";
|
||||
elem.css( "fakeProperty", "new value" );
|
||||
var elem = jQuery( "<div></div>" ),
|
||||
style = elem[ 0 ].style;
|
||||
style.MozFakeProperty = "old value";
|
||||
elem.css( "fakeProperty", "new value" );
|
||||
|
||||
assert.equal( style.MozFakeProperty, "old value", "Fake prefixed property is not cached" );
|
||||
} );
|
||||
assert.equal( style.MozFakeProperty, "old value", "Fake prefixed property is not cached" );
|
||||
} );
|
||||
|
||||
} )();
|
||||
|
||||
// IE doesn't support CSS variables.
|
||||
QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
|
||||
QUnit.test( "css(--customProperty)", function( assert ) {
|
||||
|
||||
jQuery( "#qunit-fixture" ).append(
|
||||
"<style>\n" +
|
||||
@ -1851,8 +1808,7 @@ QUnit.testUnlessIE( "css(--customProperty)", function( assert ) {
|
||||
assert.equal( $elem.css( "--nonexistent" ), undefined );
|
||||
} );
|
||||
|
||||
// IE doesn't support CSS variables.
|
||||
QUnit.testUnlessIE( "Don't append px to CSS vars", function( assert ) {
|
||||
QUnit.test( "Don't append px to CSS vars", function( assert ) {
|
||||
|
||||
assert.expect( 3 );
|
||||
|
||||
@ -1868,21 +1824,4 @@ QUnit.testUnlessIE( "Don't append px to CSS vars", function( assert ) {
|
||||
assert.equal( $div.css( "--lineHeight" ), "5", "--lineHeight: 5" );
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// This test requires Grid to be *not supported* to work.
|
||||
if ( QUnit.isIE ) {
|
||||
|
||||
// Make sure explicitly provided IE vendor prefix (`-ms-`) is not converted
|
||||
// to a non-working `Ms` prefix in JavaScript.
|
||||
QUnit.test( "IE vendor prefixes are not mangled", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var div = jQuery( "<div>" ).appendTo( "#qunit-fixture" );
|
||||
|
||||
div.css( "-ms-grid-row", "1" );
|
||||
|
||||
assert.strictEqual( div.css( "-ms-grid-row" ), "1", "IE vendor prefixing" );
|
||||
} );
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ QUnit.test( "jQuery.Deferred.then - spec compatibility", function( assert ) {
|
||||
} catch ( _ ) {}
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "jQuery.Deferred.then - IsCallable determination (gh-3596)",
|
||||
QUnit.test( "jQuery.Deferred.then - IsCallable determination (gh-3596)",
|
||||
function( assert ) {
|
||||
|
||||
assert.expect( 1 );
|
||||
|
@ -690,8 +690,7 @@ QUnit.test( "interaction with scrollbars (gh-3589)", function( assert ) {
|
||||
.css( { position: "absolute", width: "1000px", height: "1000px" } )
|
||||
.appendTo( "#qunit-fixture" ),
|
||||
|
||||
// Workarounds for IE kill fractional output here.
|
||||
fraction = document.documentMode ? 0 : 0.5,
|
||||
fraction = 0.5,
|
||||
borderWidth = 1,
|
||||
padding = 2,
|
||||
size = 100 + fraction,
|
||||
|
4
test/unit/effects.js
vendored
4
test/unit/effects.js
vendored
@ -218,9 +218,7 @@ supportjQuery.each( hideOptions, function( type, setup ) {
|
||||
clock.tick( fxInterval * 30 );
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support Shadow DOM.
|
||||
QUnit.testUnlessIE(
|
||||
QUnit.test(
|
||||
"Persist correct display value - " + type + " hidden, shadow child", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
|
@ -2617,7 +2617,6 @@ QUnit.test( "event object properties on natively-triggered event", function( ass
|
||||
$link = jQuery( link ),
|
||||
evt = document.createEvent( "MouseEvents" );
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// IE requires element to be in the body before it will dispatch
|
||||
$link.appendTo( "body" ).on( "click", function( e ) {
|
||||
|
||||
@ -2702,14 +2701,7 @@ testIframe(
|
||||
|
||||
// Create a focusin handler on the parent; shouldn't affect the iframe's fate
|
||||
jQuery( "body" ).on( "focusin.iframeTest", function() {
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE does propagate the event to the parent document. In this test
|
||||
// we mainly care about the inner element so we'll just skip this one
|
||||
// assertion in IE.
|
||||
if ( !document.documentMode ) {
|
||||
assert.ok( false, "fired a focusin event in the parent document" );
|
||||
}
|
||||
assert.ok( false, "fired a focusin event in the parent document" );
|
||||
} );
|
||||
|
||||
input.on( "focusin", function() {
|
||||
@ -3283,17 +3275,6 @@ QUnit.test( "Event handling works with multiple async focus events (gh-4350)", f
|
||||
if ( remaining > 0 ) {
|
||||
input.trigger( "blur" );
|
||||
} else {
|
||||
|
||||
if ( QUnit.isIE ) {
|
||||
|
||||
// Support: <=IE 11+
|
||||
// In IE, one of the blurs sometimes triggers a focus on body
|
||||
// which in turn restores focus to the input, leading to 4 assertions
|
||||
// firing instead of three. This only happens if other tests are
|
||||
// running on the same test page. Avoid this issue in tests by removing
|
||||
// the handler early.
|
||||
input.off( "focus" );
|
||||
}
|
||||
done();
|
||||
}
|
||||
} )
|
||||
@ -3307,8 +3288,6 @@ QUnit.test( "Event handling works with multiple async focus events (gh-4350)", f
|
||||
input.trigger( "focus" );
|
||||
} );
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// focus and blur events are asynchronous.
|
||||
// The browser window must be topmost for this to work properly!!
|
||||
QUnit.test( "async focus queues properly (gh-4859)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
@ -3327,8 +3306,6 @@ QUnit.test( "async focus queues properly (gh-4859)", function( assert ) {
|
||||
}, 500 );
|
||||
} );
|
||||
|
||||
// Support: IE <=9 - 11+
|
||||
// focus and blur events are asynchronous.
|
||||
// The browser window must be topmost for this to work properly!!
|
||||
QUnit.test( "async focus queues properly with blur (gh-4856)", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
@ -3381,17 +3358,6 @@ QUnit.test( "native-backed events preserve trigger data (gh-1741, gh-4139)", fun
|
||||
var type = event.type;
|
||||
assert.deepEqual( slice.call( arguments, 1 ), data,
|
||||
type + " handler received correct data" );
|
||||
|
||||
if ( QUnit.isIE && type === "focus" ) {
|
||||
|
||||
// Support: <=IE 11+
|
||||
// In IE, one of the blurs sometimes triggers a focus on body
|
||||
// which in turn restores focus to the input, leading to 4 assertions
|
||||
// firing instead of three. This only happens if other tests are
|
||||
// running on the same test page. Avoid this issue in tests by removing
|
||||
// the handler early.
|
||||
checkbox.off( "focus" );
|
||||
}
|
||||
} );
|
||||
checkbox.trigger( "focus", data );
|
||||
|
||||
@ -3418,15 +3384,8 @@ QUnit.test( "focus change during a focus handler (gh-4382)", function( assert )
|
||||
button.trigger( "focus" );
|
||||
} );
|
||||
|
||||
jQuery( document ).on( "focusin.focusTests", function( ev ) {
|
||||
|
||||
// Support: IE 11+
|
||||
// In IE focus is async so focusin on document is fired multiple times,
|
||||
// for each of the elements. In other browsers it's fired just once, for
|
||||
// the last one.
|
||||
if ( ev.target === button[ 0 ] ) {
|
||||
assert.ok( true, "focusin propagated to document from the button" );
|
||||
}
|
||||
jQuery( document ).on( "focusin.focusTests", function() {
|
||||
assert.ok( true, "focusin propagated to document from the button" );
|
||||
} );
|
||||
|
||||
select.trigger( "focus" );
|
||||
@ -3473,28 +3432,20 @@ QUnit.test( "trigger(focus) works after focusing when hidden (gh-4950)", functio
|
||||
QUnit.test( "trigger(focus) fires native & jQuery handlers (gh-5015)", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var input = jQuery( "<input />" ),
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// focus is async in IE; we now emulate it via sync focusin in jQuery
|
||||
// but this test also attaches native handlers.
|
||||
done = assert.async( 3 );
|
||||
var input = jQuery( "<input />" );
|
||||
|
||||
input.appendTo( "#qunit-fixture" );
|
||||
|
||||
input[ 0 ].addEventListener( "focus", function() {
|
||||
assert.ok( true, "1st native handler fired" );
|
||||
done();
|
||||
} );
|
||||
|
||||
input.on( "focus", function() {
|
||||
assert.ok( true, "jQuery handler fired" );
|
||||
done();
|
||||
} );
|
||||
|
||||
input[ 0 ].addEventListener( "focus", function() {
|
||||
assert.ok( true, "2nd native handler fired" );
|
||||
done();
|
||||
} );
|
||||
|
||||
input.trigger( "focus" );
|
||||
|
@ -1771,9 +1771,7 @@ QUnit.test( "html(Function)", function( assert ) {
|
||||
testHtml( manipulationFunctionReturningObj, assert );
|
||||
} );
|
||||
|
||||
// Support: IE 9 - 11+
|
||||
// IE doesn't support modules.
|
||||
QUnit.testUnlessIE( "html(script type module)", function( assert ) {
|
||||
QUnit.test( "html(script type module)", function( assert ) {
|
||||
assert.expect( 4 );
|
||||
var done = assert.async(),
|
||||
$fixture = jQuery( "#qunit-fixture" );
|
||||
@ -1797,17 +1795,17 @@ QUnit.testUnlessIE( "html(script type module)", function( assert ) {
|
||||
|
||||
QUnit.test( "html(script nomodule)", function( assert ) {
|
||||
|
||||
// `nomodule` scripts should be executed by legacy browsers only.
|
||||
assert.expect( QUnit.isIE ? 4 : 0 );
|
||||
// `nomodule` scripts should not be executed.
|
||||
assert.expect( 0 );
|
||||
var done = assert.async(),
|
||||
$fixture = jQuery( "#qunit-fixture" );
|
||||
|
||||
$fixture.html(
|
||||
[
|
||||
"<script nomodule>QUnit.assert.ok( QUnit.isIE, 'evaluated: nomodule script' );</script>",
|
||||
"<script nomodule>QUnit.assert.ok( false, 'not evaluated: nomodule script' );</script>",
|
||||
"<script nomodule src='" + url( "nomodule.js" ) + "'></script>",
|
||||
"<div>",
|
||||
"<script nomodule>QUnit.assert.ok( QUnit.isIE, 'evaluated: inner nomodule script' );</script>",
|
||||
"<script nomodule>QUnit.assert.ok( false, 'not evaluated: inner nomodule script' );</script>",
|
||||
"<script nomodule src='" + url( "inner_nomodule.js" ) + "'></script>",
|
||||
"</div>"
|
||||
].join( "" )
|
||||
@ -2189,11 +2187,11 @@ QUnit.test( "jQuery.cleanData", function( assert ) {
|
||||
assert.ok( false, type + " " + pos + " Focus event fired." );
|
||||
} ).end().appendTo( "body" );
|
||||
|
||||
div[ 0 ].detachEvent = div[ 0 ].removeEventListener = function( t ) {
|
||||
div[ 0 ].removeEventListener = function( t ) {
|
||||
assert.ok( true, type + " Outer " + t + " event unbound" );
|
||||
};
|
||||
|
||||
div[ 0 ].firstChild.detachEvent = div[ 0 ].firstChild.removeEventListener = function( t ) {
|
||||
div[ 0 ].firstChild.removeEventListener = function( t ) {
|
||||
assert.ok( true, type + " Inner " + t + " event unbound" );
|
||||
};
|
||||
|
||||
@ -2866,7 +2864,7 @@ QUnit.test( "Make sure tr is not appended to the wrong tbody (gh-3439)", functio
|
||||
} );
|
||||
|
||||
[ true, false ].forEach( function( adoptedCase ) {
|
||||
QUnit.testUnlessIE(
|
||||
QUnit.test(
|
||||
"Manip within <template /> content moved back & forth doesn't throw - " + (
|
||||
adoptedCase ? "explicitly adopted" : "not explicitly adopted"
|
||||
) + " (gh-5147)",
|
||||
|
@ -1165,42 +1165,21 @@ QUnit.test( "pseudo - :not", function( assert ) {
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(.foo)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(#blargh)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
|
||||
if ( QUnit.jQuerySelectors || !QUnit.isIE ) {
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(div.foo)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(p.foo)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(div#blargh)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(p#blargh)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
} else {
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support `:not(complex selector)`.
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
}
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(div.foo)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(p.foo)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(div#blargh)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not() failing interior", "#qunit-fixture p:not(p#blargh)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not(a)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not( a )", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not( p )", [] );
|
||||
assert.t( ":not Multiple", "p:not(p)", [] );
|
||||
|
||||
if ( QUnit.jQuerySelectors || !QUnit.isIE ) {
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not(a, b)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not(a, b, div)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "p:not(a,p)", [] );
|
||||
assert.t( ":not Multiple", "p:not(p,a)", [] );
|
||||
assert.t( ":not Multiple", "p:not(a,p,b)", [] );
|
||||
} else {
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support `:not(complex selector)`.
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
}
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not(a, b)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "#qunit-fixture p:not(a, b, div)", [ "firstp", "ap", "sndp", "en", "sap", "first" ] );
|
||||
assert.t( ":not Multiple", "p:not(a,p)", [] );
|
||||
assert.t( ":not Multiple", "p:not(p,a)", [] );
|
||||
assert.t( ":not Multiple", "p:not(a,p,b)", [] );
|
||||
|
||||
if ( QUnit.jQuerySelectors ) {
|
||||
assert.t( ":not Multiple", ":input:not(:image,:input,:submit)", [] );
|
||||
@ -1219,14 +1198,7 @@ QUnit.test( "pseudo - :not", function( assert ) {
|
||||
assert.t( ":not() Multiple Class", "#foo a:not(.blog)", [ "yahoo", "anchor2" ] );
|
||||
assert.t( ":not() Multiple Class", "#foo a:not(.link)", [ "yahoo", "anchor2" ] );
|
||||
|
||||
if ( QUnit.jQuerySelectors || !QUnit.isIE ) {
|
||||
assert.t( ":not() Multiple Class", "#foo a:not(.blog.link)", [ "yahoo", "anchor2" ] );
|
||||
} else {
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support `:not(complex selector)`.
|
||||
assert.ok( "skip", ":not(complex selector) not supported in selector-native" );
|
||||
}
|
||||
assert.t( ":not() Multiple Class", "#foo a:not(.blog.link)", [ "yahoo", "anchor2" ] );
|
||||
|
||||
if ( QUnit.jQuerySelectors ) {
|
||||
assert.t( ":not chaining (compound)", "#qunit-fixture div[id]:not(:has(div, span)):not(:has(*))", [ "nothiddendivchild", "divWithNoTabIndex", "fx-tests" ] );
|
||||
@ -1395,12 +1367,6 @@ QUnit.test( "pseudo - :(dis|en)abled, explicitly disabled", function( assert ) {
|
||||
var container = document.getElementById( "disabled-tests" );
|
||||
container.disabled = true;
|
||||
|
||||
// Support: IE 6 - 11
|
||||
// Unset the property where it is not meaningless
|
||||
if ( document.getElementById( "enabled-input" ).isDisabled ) {
|
||||
container.disabled = undefined;
|
||||
}
|
||||
|
||||
assert.t(
|
||||
"Explicitly disabled elements",
|
||||
"#enabled-fieldset :disabled",
|
||||
@ -1447,7 +1413,7 @@ QUnit.test( "pseudo - :disabled by ancestry", function( assert ) {
|
||||
"Inputs inherit disabled from fieldset",
|
||||
"#disabled-fieldset :disabled",
|
||||
[ "disabled-fieldset-input", "disabled-fieldset-textarea",
|
||||
"disabled-fieldset-button" ]
|
||||
"disabled-fieldset-button", "disabled-fieldset-select" ]
|
||||
);
|
||||
} );
|
||||
|
||||
@ -1687,10 +1653,7 @@ QUnit.test( "context", function( assert ) {
|
||||
}
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support the :scope pseudo-class so it will trigger MutationObservers.
|
||||
// The test is skipped there.
|
||||
QUnit.testUnlessIE( "selectors maintaining context don't trigger mutation observers", function( assert ) {
|
||||
QUnit.test( "selectors maintaining context don't trigger mutation observers", function( assert ) {
|
||||
assert.expect( 1 );
|
||||
|
||||
var timeout,
|
||||
@ -1764,9 +1727,7 @@ QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "disconnected nodes", function
|
||||
assert.equal( $opt.is( ":selected" ), true, "selected option" );
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support Shadow DOM.
|
||||
QUnit.testUnlessIE( "Shadow DOM nodes supported as root", function( assert ) {
|
||||
QUnit.test( "Shadow DOM nodes supported as root", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
var shadowHost = jQuery( "<div></div>" ).appendTo( "#qunit-fixture" )[ 0 ],
|
||||
|
@ -35,8 +35,6 @@ if ( includesModule( "css" ) ) {
|
||||
);
|
||||
}
|
||||
|
||||
// This test checks CSP only for browsers with "Content-Security-Policy" header support
|
||||
// i.e. no IE
|
||||
testIframe(
|
||||
"Check CSP (https://developer.mozilla.org/en-US/docs/Security/CSP) restrictions",
|
||||
"mock.php?action=cspFrame",
|
||||
@ -80,10 +78,6 @@ testIframe(
|
||||
var expected, browserKey,
|
||||
userAgent = window.navigator.userAgent,
|
||||
expectedMap = {
|
||||
ie_11: {
|
||||
cssHas: true,
|
||||
reliableTrDimensions: false
|
||||
},
|
||||
chrome_111: {
|
||||
cssHas: false,
|
||||
reliableTrDimensions: true
|
||||
@ -125,9 +119,7 @@ testIframe(
|
||||
}
|
||||
}
|
||||
|
||||
if ( document.documentMode ) {
|
||||
expected = expectedMap.ie_11;
|
||||
} else if ( /\b(?:headless)?chrome\/(?:10\d|11[01])\b/i.test( userAgent ) ) {
|
||||
if ( /\b(?:headless)?chrome\/(?:10\d|11[01])\b/i.test( userAgent ) ) {
|
||||
expected = expectedMap.chrome_111;
|
||||
} else if ( /\b(?:headless)?chrome\//i.test( userAgent ) ) {
|
||||
|
||||
|
@ -447,9 +447,7 @@ QUnit.test( "closest(jQuery)", function( assert ) {
|
||||
assert.ok( $child.closest( $body.add( $parent ) ).is( "#nothiddendiv" ), "Closest ancestor retrieved." );
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support complex selectors inside `:not()`.
|
||||
QUnit.testUnlessIE( "not(Selector)", function( assert ) {
|
||||
QUnit.test( "not(Selector)", function( assert ) {
|
||||
assert.expect( 7 );
|
||||
assert.equal( jQuery( "#qunit-fixture > p#ap > a" ).not( "#google" ).length, 2, "not('selector')" );
|
||||
|
||||
@ -535,9 +533,7 @@ QUnit.test( "not(jQuery)", function( assert ) {
|
||||
);
|
||||
} );
|
||||
|
||||
// Support: IE 11+
|
||||
// IE doesn't support complex selectors inside `:not()`.
|
||||
QUnit.testUnlessIE( "not(Selector) excludes non-element nodes (gh-2808)", function( assert ) {
|
||||
QUnit.test( "not(Selector) excludes non-element nodes (gh-2808)", function( assert ) {
|
||||
assert.expect( 3 );
|
||||
|
||||
var mixedContents = jQuery( "#nonnodes" ).contents(),
|
||||
@ -844,7 +840,7 @@ QUnit.test( "contents() for <template />", function( assert ) {
|
||||
assert.equal( contents.filter( "div" ).length, 3, "Count cloned elements from template" );
|
||||
} );
|
||||
|
||||
QUnit.testUnlessIE( "contents() for <template /> remains inert", function( assert ) {
|
||||
QUnit.test( "contents() for <template /> remains inert", function( assert ) {
|
||||
assert.expect( 2 );
|
||||
|
||||
Globals.register( "testScript" );
|
||||
|
Loading…
Reference in New Issue
Block a user