MCPcopy
hub / github.com/ampproject/amphtml / waitForMutationObserver

Function waitForMutationObserver

test/unit/test-3p-environment.js:208–219  ·  view source on GitHub ↗
(iframe)

Source from the content-addressed store, hash-verified

206 }
207
208 function waitForMutationObserver(iframe) {
209 if (
210 iframe.contentWindow &&
211 iframe.contentWindow.document &&
212 iframe.contentWindow.document.body.childNodes.length
213 ) {
214 return timer.promise(10);
215 }
216 return loadPromise(iframe).then(() => {
217 return timer.promise(10);
218 });
219 }
220
221 function makeChildIframeSrcdoc(win) {
222 const doc = win.document;

Callers 1

Calls 3

loadPromiseFunction · 0.90
promiseMethod · 0.80
thenMethod · 0.45

Tested by

no test coverage detected