diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/DOMEval.js | 2 | ||||
-rw-r--r-- | src/core/access.js | 7 | ||||
-rw-r--r-- | src/core/init.js | 7 | ||||
-rw-r--r-- | src/core/isAttached.js | 3 | ||||
-rw-r--r-- | src/core/parseHTML.js | 27 | ||||
-rw-r--r-- | src/core/ready-no-deferred.js | 12 | ||||
-rw-r--r-- | src/core/ready.js | 5 | ||||
-rw-r--r-- | src/core/support.js | 20 | ||||
-rw-r--r-- | src/core/toType.js | 3 |
9 files changed, 25 insertions, 61 deletions
diff --git a/src/core/DOMEval.js b/src/core/DOMEval.js index 59f6e0247..df83cca52 100644 --- a/src/core/DOMEval.js +++ b/src/core/DOMEval.js @@ -20,7 +20,7 @@ define( [ if ( node ) { for ( i in preservedScriptAttributes ) { - // Support: Firefox 64+, Edge 18+ + // 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 diff --git a/src/core/access.js b/src/core/access.js index 842c4a42b..f600600d5 100644 --- a/src/core/access.js +++ b/src/core/access.js @@ -1,8 +1,7 @@ define( [ "../core", - "../core/toType", - "../var/isFunction" -], function( jQuery, toType, isFunction ) { + "../core/toType" +], function( jQuery, toType ) { "use strict"; @@ -24,7 +23,7 @@ var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { } else if ( value !== undefined ) { chainable = true; - if ( !isFunction( value ) ) { + if ( typeof value !== "function" ) { raw = true; } diff --git a/src/core/init.js b/src/core/init.js index 8865238c8..71f30e926 100644 --- a/src/core/init.js +++ b/src/core/init.js @@ -2,11 +2,10 @@ define( [ "../core", "../var/document", - "../var/isFunction", "./var/rsingleTag", "../traversing/findFilter" -], function( jQuery, document, isFunction, rsingleTag ) { +], function( jQuery, document, rsingleTag ) { "use strict"; @@ -64,7 +63,7 @@ var rootjQuery, for ( match in context ) { // Properties of context are called as methods if possible - if ( isFunction( this[ match ] ) ) { + if ( typeof this[ match ] === "function" ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes @@ -107,7 +106,7 @@ var rootjQuery, // HANDLE: $(function) // Shortcut for document ready - } else if ( isFunction( selector ) ) { + } else if ( typeof selector === "function" ) { return root.ready !== undefined ? root.ready( selector ) : diff --git a/src/core/isAttached.js b/src/core/isAttached.js index efa2465a9..1acf15714 100644 --- a/src/core/isAttached.js +++ b/src/core/isAttached.js @@ -10,8 +10,9 @@ define( [ }, composed = { composed: true }; + // Support: IE 9 - 11+, Edge 12 - 18+ // Check attachment across shadow DOM boundaries when possible (gh-3504) - if ( documentElement.attachShadow ) { + if ( documentElement.getRootNode ) { isAttached = function( elem ) { return jQuery.contains( elem.ownerDocument, elem ) || elem.getRootNode( composed ) === elem.ownerDocument; diff --git a/src/core/parseHTML.js b/src/core/parseHTML.js index 21ff6bfa7..8c5268fb1 100644 --- a/src/core/parseHTML.js +++ b/src/core/parseHTML.js @@ -2,11 +2,8 @@ define( [ "../core", "../var/document", "./var/rsingleTag", - "../manipulation/buildFragment", - - // This is the only module that needs core/support - "./support" -], function( jQuery, document, rsingleTag, buildFragment, support ) { + "../manipulation/buildFragment" +], function( jQuery, document, rsingleTag, buildFragment ) { "use strict"; @@ -29,18 +26,14 @@ jQuery.parseHTML = function( data, context, keepScripts ) { // Stop scripts or inline event handlers from being executed immediately // by using document.implementation - if ( support.createHTMLDocument ) { - context = document.implementation.createHTMLDocument( "" ); - - // Set the base href for the created document - // so any parsed elements with URLs - // are based on the document's URL (gh-2965) - base = context.createElement( "base" ); - base.href = document.location.href; - context.head.appendChild( base ); - } else { - context = document; - } + context = document.implementation.createHTMLDocument( "" ); + + // Set the base href for the created document + // so any parsed elements with URLs + // are based on the document's URL (gh-2965) + base = context.createElement( "base" ); + base.href = document.location.href; + context.head.appendChild( base ); } parsed = rsingleTag.exec( data ); diff --git a/src/core/ready-no-deferred.js b/src/core/ready-no-deferred.js index 4428020ef..2c3fc1b84 100644 --- a/src/core/ready-no-deferred.js +++ b/src/core/ready-no-deferred.js @@ -1,8 +1,7 @@ define( [ "../core", - "../var/document", - "../var/isFunction" -], function( jQuery, document, isFunction ) { + "../var/document" +], function( jQuery, document ) { "use strict"; @@ -53,7 +52,7 @@ jQuery.extend( { while ( readyCallbacks.length ) { fn = readyCallbacks.shift(); - if ( isFunction( fn ) ) { + if ( typeof fn === "function" ) { executeReady( fn ); } } @@ -77,10 +76,7 @@ function completed() { // Catch cases where $(document).ready() is called // after the browser event has already occurred. -// Support: IE9-10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { +if ( document.readyState !== "loading" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); diff --git a/src/core/ready.js b/src/core/ready.js index 794feeec0..3abb6c03a 100644 --- a/src/core/ready.js +++ b/src/core/ready.js @@ -66,10 +66,7 @@ function completed() { // Catch cases where $(document).ready() is called // after the browser event has already occurred. -// Support: IE <=9 - 10 only -// Older IE sometimes signals "interactive" too soon -if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { +if ( document.readyState !== "loading" ) { // Handle it asynchronously to allow scripts the opportunity to delay ready window.setTimeout( jQuery.ready ); diff --git a/src/core/support.js b/src/core/support.js deleted file mode 100644 index 13ae02f08..000000000 --- a/src/core/support.js +++ /dev/null @@ -1,20 +0,0 @@ -define( [ - "../var/document", - "../var/support" -], function( document, support ) { - -"use strict"; - -// Support: Safari 8 only -// In Safari 8 documents created via document.implementation.createHTMLDocument -// collapse sibling forms: the second one becomes a child of the first one. -// Because of that, this security measure has to be disabled in Safari 8. -// https://bugs.webkit.org/show_bug.cgi?id=137337 -support.createHTMLDocument = ( function() { - var body = document.implementation.createHTMLDocument( "" ).body; - body.innerHTML = "<form></form><form></form>"; - return body.childNodes.length === 2; -} )(); - -return support; -} ); diff --git a/src/core/toType.js b/src/core/toType.js index c77ba95ad..c555ef9df 100644 --- a/src/core/toType.js +++ b/src/core/toType.js @@ -10,8 +10,7 @@ function toType( obj ) { return obj + ""; } - // Support: Android <=2.3 only (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? + return typeof obj === "object" ? class2type[ toString.call( obj ) ] || "object" : typeof obj; } |