* Finds the next node in document order, if it exists. Returns that node, or null if it doesn't exist. * Updates currentNode, if it exists, else currentNode stays the same. * * @return {?Node}
()
| 1829 | * @return {?Node} |
| 1830 | */ |
| 1831 | nextNode() { |
| 1832 | if (this.useQuerySelector_) { |
| 1833 | if (this.index_ == this.nodeList_.length) { |
| 1834 | return null; |
| 1835 | } |
| 1836 | const next = this.nodeList_[this.index_++]; |
| 1837 | this.currentNode = next; |
| 1838 | return next; |
| 1839 | } |
| 1840 | |
| 1841 | const walker = this.treeWalker_; |
| 1842 | const next = walker.nextNode(); |
| 1843 | // This matches the TreeWalker's behavior. |
| 1844 | if (next !== null) { |
| 1845 | this.currentNode = next; |
| 1846 | } |
| 1847 | return next; |
| 1848 | } |
| 1849 | |
| 1850 | /** |
| 1851 | * Skips the remaining sibling nodes in the current parent. Returns the next node in document order. |
no outgoing calls
no test coverage detected