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

Function createElementIterator

build-system/tasks/e2e/driver/query-xpath.js:116–122  ·  view source on GitHub ↗

* Create an iterator over the subtree of the given element. * @param {!HTMLElement} element * @return {!Iterable<!HTMLElement>}

(element)

Source from the content-addressed store, hash-verified

114 * @return {!Iterable<!HTMLElement>}
115 */
116function createElementIterator(element) {
117 const document = element.ownerDocument;
118 return createCommonIterator(
119 document.createNodeIterator(element, NodeFilter.SHOW_ELEMENT),
120 'nextNode'
121 );
122}
123
124/**
125 * Create an iterator from an XPathResult instance.

Callers 1

queryXpathFunction · 0.85

Calls 1

createCommonIteratorFunction · 0.85

Tested by

no test coverage detected