Ticket #10413: descendantOf.patch
| File descendantOf.patch, 0.9 kB (added by kamil.szot, 1 year ago) |
|---|
-
src/dom.js
old new 364 364 if (element.compareDocumentPosition) 365 365 return (element.compareDocumentPosition(ancestor) & 8) === 8; 366 366 367 if (element.sourceIndex && !Prototype.Browser.Opera) {367 if (element.sourceIndex && ancestor.sourceIndex && !Prototype.Browser.Opera) { 368 368 var e = element.sourceIndex, a = ancestor.sourceIndex, 369 369 nextAncestor = ancestor.nextSibling; 370 370 if (!nextAncestor) { 371 371 do { ancestor = ancestor.parentNode; } 372 372 while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode); 373 373 } 374 if (nextAncestor ) return (e > a && e < nextAncestor.sourceIndex);374 if (nextAncestor && nextAncestor.sourceIndex) return (e > a && e < nextAncestor.sourceIndex); 375 375 } 376 376 377 377 while (element = element.parentNode)