Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ajax.js
Original file line number Diff line number Diff line change
Expand Up @@ -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+
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed mentions of Edge from support comments as well. Among other things, this is because many IE workarounds are now hidden behind an isIE check so a support comment mentioning Edge would be confusing as Edge wouldn't execute that code.

IE is quite special here as that's the only browser which we detect as a browser to work around its bugs instead of running support tests.

// IE throws exception on accessing the href property if url is malformed,
// e.g. http://example.com:80x/
try {
Expand Down
6 changes: 4 additions & 2 deletions src/attributes/prop.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
13 changes: 1 addition & 12 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
18 changes: 3 additions & 15 deletions src/core/DOMEval.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions src/core/isAttached.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Comment on lines +7 to +8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reorganizing the definitions decreased the gzipped size a bit.

},
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 );
};
}

Expand Down
21 changes: 12 additions & 9 deletions src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/css/cssCamelCase.js
Original file line number Diff line number Diff line change
Expand Up @@ -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-" ) );
Expand Down
34 changes: 0 additions & 34 deletions src/css/support.js

This file was deleted.

5 changes: 2 additions & 3 deletions src/effects.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
Expand Down
37 changes: 17 additions & 20 deletions src/selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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();
},
Expand Down Expand Up @@ -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" ) ) ) {
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 ) {
Expand All @@ -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 );
}
}
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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 ) {
Expand Down
32 changes: 11 additions & 21 deletions src/selector/rbuggyQSA.js
Original file line number Diff line number Diff line change
@@ -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;
11 changes: 0 additions & 11 deletions src/selector/support.js

This file was deleted.

Loading