mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-03 04:52:06 +02:00
Includes reimporting the test we already had, which has changed significantly. Most of these fail, but importing them now to track progress.
28 lines
1.6 KiB
JavaScript
28 lines
1.6 KiB
JavaScript
test(() => {
|
|
const contentDocument = document.implementation.createHTMLDocument();
|
|
assert_throws_dom("NotSupportedError", () => customElements.initialize(contentDocument));
|
|
assert_throws_dom("NotSupportedError", () => customElements.initialize(contentDocument.createElement("x")));
|
|
}, "initialize() of global registry should throw for nodes from another document");
|
|
|
|
test(() => {
|
|
const contentDocument = document.implementation.createHTMLDocument();
|
|
assert_throws_dom("NotSupportedError", () => contentDocument.createElement("div", { customElementRegistry: customElements }));
|
|
}, "createElement() should throw with global registry from another document");
|
|
|
|
test(() => {
|
|
const contentDocument = document.implementation.createHTMLDocument();
|
|
assert_throws_dom("NotSupportedError", () => contentDocument.createElementNS("x", "div", { customElementRegistry: customElements }));
|
|
}, "createElementNS() should throw with global registry from another document");
|
|
|
|
test(() => {
|
|
const contentDocument = document.implementation.createHTMLDocument();
|
|
const element = contentDocument.createElement("div");
|
|
assert_throws_dom("NotSupportedError", () => element.attachShadow({ mode: "closed", customElementRegistry: customElements }));
|
|
}, "attachShadow() should throw with global registry from another document");
|
|
|
|
test(() => {
|
|
const contentDocument = document.implementation.createHTMLDocument();
|
|
const element = contentDocument.createElement("div");
|
|
assert_throws_dom("NotSupportedError", () => contentDocument.importNode(element, { customElementRegistry: customElements }));
|
|
}, "importNode() should throw with global registry from another document");
|