MCPcopy Create free account
hub / github.com/kkroening/ffmpeg-python / Sizzle

Function Sizzle

doc/html/_static/jquery-3.2.1.js:754–885  ·  view source on GitHub ↗
( selector, context, results, seed )

Source from the content-addressed store, hash-verified

752}
753
754function Sizzle( selector, context, results, seed ) {
755 var m, i, elem, nid, match, groups, newSelector,
756 newContext = context && context.ownerDocument,
757
758 // nodeType defaults to 9, since context defaults to document
759 nodeType = context ? context.nodeType : 9;
760
761 results = results || [];
762
763 // Return early from calls with invalid selector or context
764 if ( typeof selector !== "string" || !selector ||
765 nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) {
766
767 return results;
768 }
769
770 // Try to shortcut find operations (as opposed to filters) in HTML documents
771 if ( !seed ) {
772
773 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
774 setDocument( context );
775 }
776 context = context || document;
777
778 if ( documentIsHTML ) {
779
780 // If the selector is sufficiently simple, try using a "get*By*" DOM method
781 // (excepting DocumentFragment context, where the methods don't exist)
782 if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) {
783
784 // ID selector
785 if ( (m = match[1]) ) {
786
787 // Document context
788 if ( nodeType === 9 ) {
789 if ( (elem = context.getElementById( m )) ) {
790
791 // Support: IE, Opera, Webkit
792 // TODO: identify versions
793 // getElementById can match elements by name instead of ID
794 if ( elem.id === m ) {
795 results.push( elem );
796 return results;
797 }
798 } else {
799 return results;
800 }
801
802 // Element context
803 } else {
804
805 // Support: IE, Opera, Webkit
806 // TODO: identify versions
807 // getElementById can match elements by name instead of ID
808 if ( newContext && (elem = newContext.getElementById( m )) &&
809 contains( context, elem ) &&
810 elem.id === m ) {
811

Callers 2

jquery-3.2.1.jsFile · 0.85
multipleContextsFunction · 0.85

Calls 2

toSelectorFunction · 0.85
testContextFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…