File tree Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Expand file tree Collapse file tree 1 file changed +5
-13
lines changed Original file line number Diff line number Diff line change @@ -663,9 +663,12 @@ try {
663
663
664
664
var sortOrder ;
665
665
666
- if ( document . documentElement . compareDocumentPosition ) {
666
+ if ( Array . prototype . indexOf ) {
667
+ var indexOf = Array . prototype . indexOf ,
668
+ allSort = document . getElementsByTagName ( "*" ) ;
669
+
667
670
sortOrder = function ( a , b ) {
668
- var ret = a . compareDocumentPosition ( b ) & 4 ? - 1 : a === b ? 0 : 1 ;
671
+ var ret = indexOf . call ( allSort , a ) - indexOf . call ( allSort , b ) ;
669
672
if ( ret === 0 ) {
670
673
hasDuplicate = true ;
671
674
}
@@ -679,17 +682,6 @@ if ( document.documentElement.compareDocumentPosition ) {
679
682
}
680
683
return ret ;
681
684
} ;
682
- } else if ( Array . prototype . indexOf ) {
683
- var indexOf = Array . prototype . indexOf ,
684
- allSort = document . getElementsByTagName ( "*" ) ;
685
-
686
- sortOrder = function ( a , b ) {
687
- var ret = indexOf . call ( allSort , a ) - indexOf . call ( allSort , b ) ;
688
- if ( ret === 0 ) {
689
- hasDuplicate = true ;
690
- }
691
- return ret ;
692
- } ;
693
685
}
694
686
695
687
// Check to see if the browser returns elements by name when
You can’t perform that action at this time.
0 commit comments