initial-about-blank.window.js (1038B)
1 async_test(t => { 2 const frame = document.createElement("iframe"); 3 document.body.append(frame); 4 frame.contentWindow.eval(` 5 class AA extends HTMLElement { }; 6 self.globalAA = AA; 7 customElements.define("a-a", AA); 8 document.body.innerHTML = "<a-a>"; 9 `); 10 assert_equals(frame.contentDocument.body.firstChild.localName, "a-a"); 11 assert_true(frame.contentDocument.body.firstChild instanceof frame.contentWindow.globalAA); 12 13 const blankDocumentURL = new URL("/common/blank.html", location).href; 14 frame.src = blankDocumentURL; 15 frame.onload = t.step_func_done(t => { 16 assert_equals(frame.contentDocument.URL, blankDocumentURL); 17 assert_equals(frame.contentDocument.body.innerHTML, ""); 18 frame.contentDocument.body.innerHTML = "<a-a>"; 19 assert_equals(frame.contentDocument.body.firstChild.localName, "a-a"); 20 assert_equals(frame.contentWindow.customElements.get("a-a"), undefined); 21 assert_not_equals(frame.contentWindow.globalAA, undefined); 22 }); 23 }, "Each navigable document has its own registry");