Skip to content

Commit

Permalink
Fallback to using sourceIndex, in IE, if it's available on both nodes…
Browse files Browse the repository at this point in the history
…. Fixes #7341.
  • Loading branch information
jeresig committed May 10, 2011
1 parent e300eeb commit 2f96e52
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,10 @@ if ( document.documentElement.compareDocumentPosition ) {
hasDuplicate = true;
return 0;

// Fallback to using sourceIndex (in IE) if it's available on both nodes
} else if ( a.sourceIndex && b.sourceIndex ) {
return a.sourceIndex - b.sourceIndex;

// If the nodes are siblings (or identical) we can do a quick check
} else if ( aup === bup ) {
return siblingCheck( a, b );
Expand Down

0 comments on commit 2f96e52

Please sign in to comment.