MCPcopy Create free account
hub / github.com/OpenReservation/OpenReservation / Sizzle

Function Sizzle

OpenReservation/wwwroot/Scripts/jquery-1.10.2.js:1185–1291  ·  view source on GitHub ↗
(selector, context, results, seed)

Source from the content-addressed store, hash-verified

1183 }
1184
1185 function Sizzle(selector, context, results, seed) {
1186 var match, elem, m, nodeType,
1187 // QSA vars
1188 i, groups, old, nid, newContext, newSelector;
1189
1190 if ((context ? context.ownerDocument || context : preferredDoc) !== document) {
1191 setDocument(context);
1192 }
1193
1194 context = context || document;
1195 results = results || [];
1196
1197 if (!selector || typeof selector !== "string") {
1198 return results;
1199 }
1200
1201 if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) {
1202 return [];
1203 }
1204
1205 if (documentIsHTML && !seed) {
1206 // Shortcuts
1207 if ((match = rquickExpr.exec(selector))) {
1208 // Speed-up: Sizzle("#ID")
1209 if ((m = match[1])) {
1210 if (nodeType === 9) {
1211 elem = context.getElementById(m);
1212 // Check parentNode to catch when Blackberry 4.6 returns
1213 // nodes that are no longer in the document #6963
1214 if (elem && elem.parentNode) {
1215 // Handle the case where IE, Opera, and Webkit return items
1216 // by name instead of ID
1217 if (elem.id === m) {
1218 results.push(elem);
1219 return results;
1220 }
1221 } else {
1222 return results;
1223 }
1224 } else {
1225 // Context is not a document
1226 if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) &&
1227 contains(context, elem) && elem.id === m) {
1228 results.push(elem);
1229 return results;
1230 }
1231 }
1232
1233 // Speed-up: Sizzle("TAG")
1234 } else if (match[2]) {
1235 push.apply(results, context.getElementsByTagName(selector));
1236 return results;
1237
1238 // Speed-up: Sizzle(".CLASS")
1239 } else if ((m = match[3]) && support.getElementsByClassName && context.getElementsByClassName) {
1240 push.apply(results, context.getElementsByClassName(m));
1241 return results;
1242 }

Callers 2

jquery-1.10.2.jsFile · 0.85
multipleContextsFunction · 0.85

Calls 4

containsFunction · 0.85
tokenizeFunction · 0.85
toSelectorFunction · 0.85
selectFunction · 0.70

Tested by

no test coverage detected