* Checks document order of two siblings * @param {Element} a * @param {Element} b * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
( a, b )
| 914 | * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b |
| 915 | */ |
| 916 | function siblingCheck( a, b ) { |
| 917 | var cur = b && a, |
| 918 | diff = cur && a.nodeType === 1 && b.nodeType === 1 && |
| 919 | ( ~b.sourceIndex || MAX_NEGATIVE ) - |
| 920 | ( ~a.sourceIndex || MAX_NEGATIVE ); |
| 921 | |
| 922 | // Use IE sourceIndex if available on both nodes |
| 923 | if ( diff ) { |
| 924 | return diff; |
| 925 | } |
| 926 | |
| 927 | // Check if b follows a |
| 928 | if ( cur ) { |
| 929 | while ( (cur = cur.nextSibling) ) { |
| 930 | if ( cur === b ) { |
| 931 | return -1; |
| 932 | } |
| 933 | } |
| 934 | } |
| 935 | |
| 936 | return a ? 1 : -1; |
| 937 | } |
| 938 | |
| 939 | /** |
| 940 | * Returns a function to use in pseudos for input types |
no outgoing calls
no test coverage detected