Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /custom-elements/registries/ShadowRoot-init-declarative.html - WPT Dashboard Interop Dashboard
<!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>