Skip to content

Commit 2f96e52

Browse files
committed
Fallback to using sourceIndex, in IE, if it's available on both nodes. Fixes #7341.
1 parent e300eeb commit 2f96e52

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sizzle.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -933,6 +933,10 @@ if ( document.documentElement.compareDocumentPosition ) {
933933
hasDuplicate = true;
934934
return 0;
935935

936+
// Fallback to using sourceIndex (in IE) if it's available on both nodes
937+
} else if ( a.sourceIndex && b.sourceIndex ) {
938+
return a.sourceIndex - b.sourceIndex;
939+
936940
// If the nodes are siblings (or identical) we can do a quick check
937941
} else if ( aup === bup ) {
938942
return siblingCheck( a, b );

0 commit comments

Comments
 (0)