blob: fede6c78a8f1e7a5fa705b77d9842b0769b88ebf [file] [log] [blame]
Copybara botbe50d492023-11-30 00:16:42 +01001define( [
2 "../core",
3 "../core/nodeName"
4], function( jQuery, nodeName ) {
5
6"use strict";
7
8function getAll( context, tag ) {
9
10 // Support: IE <=9 - 11 only
11 // Use typeof to avoid zero-argument method invocation on host objects (#15151)
12 var ret;
13
14 if ( typeof context.getElementsByTagName !== "undefined" ) {
15 ret = context.getElementsByTagName( tag || "*" );
16
17 } else if ( typeof context.querySelectorAll !== "undefined" ) {
18 ret = context.querySelectorAll( tag || "*" );
19
20 } else {
21 ret = [];
22 }
23
24 if ( tag === undefined || tag && nodeName( context, tag ) ) {
25 return jQuery.merge( [ context ], ret );
26 }
27
28 return ret;
29}
30
31return getAll;
32} );