* next(prev, current, isPre) returns the next node in the sequence, given the * current and previous nodes. * * @param {Node} prev * @param {Node} current * @param {Function} isPre * @return {Node}
(prev, current, isPre)
| 490 | * @return {Node} |
| 491 | */ |
| 492 | function next (prev, current, isPre) { |
| 493 | if ((prev && prev.parentNode === current) || isPre(current)) { |
| 494 | return current.nextSibling || current.parentNode |
| 495 | } |
| 496 | |
| 497 | return current.firstChild || current.nextSibling || current.parentNode |
| 498 | } |
| 499 | |
| 500 | /* |
| 501 | * Set up window for Node.js |
no outgoing calls
no test coverage detected