<!DOCTYPE html><html><head><title>Test lazy loading iframe remains lazy loading originally created in a script-disabled document, then got adopted to a regular document</title><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script></head><script>constt=async_test("Test lazy loading iframe remains lazy loading originally created"+"in a script-disabled document, then got adopted to a regular document");constlazyIFrameInScriptDisabledDocumentOnLoad=t.unreached_func("lazy loading iframe shoudn't be loaded because it's not visible");window.addEventListener("load",t.step_func(()=>{constparser=newDOMParser();constremoteDoc=` <!DOCTYPE html> <html> <iframe id="lazyIFrameInScriptDisabledDocument" src="resources/subframe.html" loading="lazy" width="600" height="400" style="display: none" > Your browser does not support iframes. </iframe> </html>`;consthtmlDoc=parser.parseFromString(remoteDoc,"text/html");varnewIframe=htmlDoc.getElementById("lazyIFrameInScriptDisabledDocument");newIframe.onload=lazyIFrameInScriptDisabledDocumentOnLoad;document.body.appendChild(newIframe);// Give some time to the "load" event to fire.t.step_timeout(t.step_func_done(),2000);}));</script></html>