MCPcopy Create free account
hub / github.com/ampproject/amphtml / skipSubtree

Method skipSubtree

extensions/amp-bind/0.1/bind-impl.js:1854–1873  ·  view source on GitHub ↗

* Skips the remaining sibling nodes in the current parent. Returns the next node in document order. * @return {?Node}

()

Source from the content-addressed store, hash-verified

1852 * @return {?Node}
1853 */
1854 skipSubtree() {
1855 if (this.useQuerySelector_) {
1856 const {currentNode} = this;
1857 let next = null;
1858 do {
1859 next = this.nextNode();
1860 } while (next !== null && currentNode.contains(next));
1861 return next;
1862 }
1863
1864 const walker = this.treeWalker_;
1865 for (let n = walker.currentNode; n; n = walker.parentNode()) {
1866 const sibling = walker.nextSibling();
1867 if (sibling !== null) {
1868 this.currentNode = sibling;
1869 return sibling;
1870 }
1871 }
1872 return null;
1873 }
1874}

Callers 1

scanNextNode_Method · 0.80

Calls 2

nextNodeMethod · 0.95
containsMethod · 0.45

Tested by

no test coverage detected