aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/attributes/attr.js5
-rw-r--r--src/attributes/val.js7
-rw-r--r--src/core.js4
-rw-r--r--src/core/nodeName.js13
-rw-r--r--src/deprecated.js8
-rw-r--r--src/event.js8
-rw-r--r--src/manipulation.js7
-rw-r--r--src/manipulation/getAll.js7
-rw-r--r--src/offset.js6
-rw-r--r--src/traversing.js7
10 files changed, 46 insertions, 26 deletions
diff --git a/src/attributes/attr.js b/src/attributes/attr.js
index 2d9c76feb..6b5cbd2c4 100644
--- a/src/attributes/attr.js
+++ b/src/attributes/attr.js
@@ -1,10 +1,11 @@
define( [
"../core",
"../core/access",
+ "../core/nodeName",
"./support",
"../var/rnothtmlwhite",
"../selector"
-], function( jQuery, access, support, rnothtmlwhite ) {
+], function( jQuery, access, nodeName, support, rnothtmlwhite ) {
"use strict";
@@ -74,7 +75,7 @@ jQuery.extend( {
type: {
set: function( elem, value ) {
if ( !support.radioValue && value === "radio" &&
- jQuery.nodeName( elem, "input" ) ) {
+ nodeName( elem, "input" ) ) {
var val = elem.value;
elem.setAttribute( "type", value );
if ( val ) {
diff --git a/src/attributes/val.js b/src/attributes/val.js
index 9245e4e0a..04572ba05 100644
--- a/src/attributes/val.js
+++ b/src/attributes/val.js
@@ -2,8 +2,9 @@ define( [
"../core",
"../core/stripAndCollapse",
"./support",
- "../core/init"
-], function( jQuery, stripAndCollapse, support ) {
+ "../core/init",
+ "../core/nodeName"
+], function( jQuery, stripAndCollapse, support, nodeName ) {
"use strict";
@@ -121,7 +122,7 @@ jQuery.extend( {
// Don't return options that are disabled or in a disabled optgroup
!option.disabled &&
( !option.parentNode.disabled ||
- !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+ !nodeName( option.parentNode, "optgroup" ) ) ) {
// Get the specific value for the option
value = jQuery( option ).val();
diff --git a/src/core.js b/src/core.js
index c99f27e22..54b44b1ea 100644
--- a/src/core.js
+++ b/src/core.js
@@ -289,10 +289,6 @@ jQuery.extend( {
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
},
- nodeName: function( elem, name ) {
- return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
- },
-
each: function( obj, callback ) {
var length, i = 0;
diff --git a/src/core/nodeName.js b/src/core/nodeName.js
new file mode 100644
index 000000000..8a5f5f036
--- /dev/null
+++ b/src/core/nodeName.js
@@ -0,0 +1,13 @@
+define( function() {
+
+"use strict";
+
+function nodeName( elem, name ) {
+
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+
+};
+
+return nodeName;
+
+} );
diff --git a/src/deprecated.js b/src/deprecated.js
index 3c902657e..a18089c41 100644
--- a/src/deprecated.js
+++ b/src/deprecated.js
@@ -1,6 +1,7 @@
define( [
- "./core"
-], function( jQuery ) {
+ "./core",
+ "./core/nodeName"
+], function( jQuery, nodeName ) {
"use strict";
@@ -29,7 +30,8 @@ jQuery.fn.extend( {
} else {
jQuery.ready( true );
}
- }
+},
+ nodeName: nodeName
} );
jQuery.isArray = Array.isArray;
diff --git a/src/event.js b/src/event.js
index 97431773c..6a07fba8e 100644
--- a/src/event.js
+++ b/src/event.js
@@ -7,8 +7,10 @@ define( [
"./var/slice",
"./data/var/dataPriv",
"./core/init",
+ "./core/nodeName",
"./selector"
-], function( jQuery, document, documentElement, rnothtmlwhite, rcheckableType, slice, dataPriv ) {
+], function( jQuery, document, documentElement, rnothtmlwhite, rcheckableType, slice, dataPriv,
+ nodeName ) {
"use strict";
@@ -477,7 +479,7 @@ jQuery.event = {
// For checkable types, fire native event so checked state will be right
trigger: function() {
if ( rcheckableType.test( this.type ) &&
- this.click && jQuery.nodeName( this, "input" ) ) {
+ this.click && nodeName( this, "input" ) ) {
this.click();
return false;
@@ -486,7 +488,7 @@ jQuery.event = {
// For cross-browser consistency, don't fire native .click() on links
_default: function( event ) {
- return jQuery.nodeName( event.target, "a" );
+ return nodeName( event.target, "a" );
}
},
diff --git a/src/manipulation.js b/src/manipulation.js
index cadd89a2e..4e64cd132 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -18,13 +18,14 @@ define( [
"./core/DOMEval",
"./core/init",
+ "./core/nodeName",
"./traversing",
"./selector",
"./event"
], function( jQuery, concat, push, rcheckableType,
access, rtagName, rscriptType,
wrapMap, getAll, setGlobalEval, buildFragment, support,
- dataPriv, dataUser, acceptData, DOMEval ) {
+ dataPriv, dataUser, acceptData, DOMEval, nodeName ) {
"use strict";
@@ -49,8 +50,8 @@ var
// Prefer a tbody over its parent table for containing new rows
function manipulationTarget( elem, content ) {
- if ( jQuery.nodeName( elem, "table" ) &&
- jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
+ if ( nodeName( elem, "table" ) &&
+ nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
return jQuery( ">tbody", elem )[ 0 ] || elem;
}
diff --git a/src/manipulation/getAll.js b/src/manipulation/getAll.js
index f68e3219e..fede6c78a 100644
--- a/src/manipulation/getAll.js
+++ b/src/manipulation/getAll.js
@@ -1,6 +1,7 @@
define( [
- "../core"
-], function( jQuery ) {
+ "../core",
+ "../core/nodeName"
+], function( jQuery, nodeName ) {
"use strict";
@@ -20,7 +21,7 @@ function getAll( context, tag ) {
ret = [];
}
- if ( tag === undefined || tag && jQuery.nodeName( context, tag ) ) {
+ if ( tag === undefined || tag && nodeName( context, tag ) ) {
return jQuery.merge( [ context ], ret );
}
diff --git a/src/offset.js b/src/offset.js
index 467526d2a..1e5e04079 100644
--- a/src/offset.js
+++ b/src/offset.js
@@ -9,9 +9,11 @@ define( [
"./css/support",
"./core/init",
+ "./core/nodeName",
"./css",
"./selector" // contains
-], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support ) {
+], function( jQuery, access, document, documentElement, rnumnonpx, curCSS, addGetHookIf, support,
+ nodeName ) {
"use strict";
@@ -129,7 +131,7 @@ jQuery.fn.extend( {
// Get correct offsets
offset = this.offset();
- if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ if ( !nodeName( offsetParent[ 0 ], "html" ) ) {
parentOffset = offsetParent.offset();
}
diff --git a/src/traversing.js b/src/traversing.js
index d96869017..cd7f747d5 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -5,9 +5,10 @@ define( [
"./traversing/var/siblings",
"./traversing/var/rneedsContext",
"./core/init",
+ "./core/nodeName",
"./traversing/findFilter",
"./selector"
-], function( jQuery, indexOf, dir, siblings, rneedsContext ) {
+], function( jQuery, indexOf, dir, siblings, rneedsContext, nodeName ) {
"use strict";
@@ -143,14 +144,14 @@ jQuery.each( {
return siblings( elem.firstChild );
},
contents: function( elem ) {
- if ( jQuery.nodeName( elem, "iframe" ) ) {
+ if ( nodeName( elem, "iframe" ) ) {
return elem.contentDocument;
}
// Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only
// Treat the template element as a regular one in browsers that
// don't support it.
- if ( jQuery.nodeName( elem, "template" ) ) {
+ if ( nodeName( elem, "template" ) ) {
elem = elem.content || elem;
}