* 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 )
| 910 | * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b |
| 911 | */ |
| 912 | function siblingCheck( a, b ) { |
| 913 | var cur = b && a, |
| 914 | diff = cur && a.nodeType === 1 && b.nodeType === 1 && |
| 915 | ( ~b.sourceIndex || MAX_NEGATIVE ) - |
| 916 | ( ~a.sourceIndex || MAX_NEGATIVE ); |
| 917 | |
| 918 | // Use IE sourceIndex if available on both nodes |
| 919 | if ( diff ) { |
| 920 | return diff; |
| 921 | } |
| 922 | |
| 923 | // Check if b follows a |
| 924 | if ( cur ) { |
| 925 | while ( (cur = cur.nextSibling) ) { |
| 926 | if ( cur === b ) { |
| 927 | return -1; |
| 928 | } |
| 929 | } |
| 930 | } |
| 931 | |
| 932 | return a ? 1 : -1; |
| 933 | } |
| 934 | |
| 935 | /** |
| 936 | * Returns a function to use in pseudos for input types |
no outgoing calls
no test coverage detected
searching dependent graphs…