diff options
author | timmywil <timmywillisn@gmail.com> | 2011-10-12 00:06:30 -0400 |
---|---|---|
committer | timmywil <timmywillisn@gmail.com> | 2011-10-12 00:06:54 -0400 |
commit | 3ad0ba62f03ff3d7aec7d3dfb25492cdf33350a7 (patch) | |
tree | 125a6db3dc3c84b844995a59d50911c358fbf723 /src/manipulation.js | |
parent | 92b06d302cc8e94d52e0c60c9167ec17606984f3 (diff) | |
download | jquery-3ad0ba62f03ff3d7aec7d3dfb25492cdf33350a7.tar.gz jquery-3ad0ba62f03ff3d7aec7d3dfb25492cdf33350a7.zip |
Do not call getElements on a script tag. Avoids unnecessary execution. Fixes #10176.
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 0f7f9dd9b..11dca3100 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -530,10 +530,10 @@ jQuery.each({ }); function getAll( elem ) { - if ( "getElementsByTagName" in elem ) { + if ( typeof elem.getElementsByTagName !== "undefined" ) { return elem.getElementsByTagName( "*" ); - } else if ( "querySelectorAll" in elem ) { + } else if ( typeof elem.querySelectorAll !== "undefined" ) { return elem.querySelectorAll( "*" ); } else { @@ -549,9 +549,11 @@ function fixDefaultChecked( elem ) { } // Finds all inputs and passes them to fixDefaultChecked function findInputs( elem ) { - if ( jQuery.nodeName( elem, "input" ) ) { + var nodeName = (elem.nodeName || "").toLowerCase(); + if ( nodeName === "input" ) { fixDefaultChecked( elem ); - } else if ( "getElementsByTagName" in elem ) { + // Skip scripts, get other children + } else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) { jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked ); } } |