Files
ladybird/Tests/LibWeb/Text/input/wpt-import/custom-elements/registries/ShadowRoot-init-declarative.html
Sam Atkins fe3c6a1f9f Tests: Import WPT custom-elements/registries tests
Includes reimporting the test we already had, which has changed
significantly.

Most of these fail, but importing them now to track progress.
2026-03-27 19:49:55 +00:00

30 lines
1.0 KiB
HTML

<!doctype html>
<title>Scoped Custom Element Registries: declarative shadow root</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<div id="host">
<template shadowrootmode="open" shadowrootcustomelementregistry>
<custom-element></custom-element>
<div></div>
</template>
</div>
<script>
test(() => {
const customElement = host.shadowRoot.firstElementChild;
assert_equals(customElement.customElementRegistry, null);
customElement.attachShadow({
mode: "open"
});
assert_equals(customElement.shadowRoot.customElementRegistry, null);
}, "Custom element inside 'shadowrootcustomelementregistry' declarative shadow root");
test(() => {
const divElement = host.shadowRoot.lastElementChild;
assert_equals(divElement.customElementRegistry, null);
divElement.attachShadow({
mode: "open"
});
assert_equals(divElement.shadowRoot.customElementRegistry, null);
}, "Built-in element inside 'shadowrootcustomelementregistry' declarative shadow root");
</script>