mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 13:02:09 +02:00
Includes reimporting the test we already had, which has changed significantly. Most of these fail, but importing them now to track progress.
24 lines
1.0 KiB
JavaScript
24 lines
1.0 KiB
JavaScript
async_test(t => {
|
|
const frame = document.createElement("iframe");
|
|
document.body.append(frame);
|
|
frame.contentWindow.eval(`
|
|
class AA extends HTMLElement { };
|
|
self.globalAA = AA;
|
|
customElements.define("a-a", AA);
|
|
document.body.innerHTML = "<a-a>";
|
|
`);
|
|
assert_equals(frame.contentDocument.body.firstChild.localName, "a-a");
|
|
assert_true(frame.contentDocument.body.firstChild instanceof frame.contentWindow.globalAA);
|
|
|
|
const blankDocumentURL = new URL("/common/blank.html", location).href;
|
|
frame.src = blankDocumentURL;
|
|
frame.onload = t.step_func_done(t => {
|
|
assert_equals(frame.contentDocument.URL, blankDocumentURL);
|
|
assert_equals(frame.contentDocument.body.innerHTML, "");
|
|
frame.contentDocument.body.innerHTML = "<a-a>";
|
|
assert_equals(frame.contentDocument.body.firstChild.localName, "a-a");
|
|
assert_equals(frame.contentWindow.customElements.get("a-a"), undefined);
|
|
assert_not_equals(frame.contentWindow.globalAA, undefined);
|
|
});
|
|
}, "Each navigable document has its own registry");
|