test(() => { const template = document.createElement("template"); assert_false(template.hasAttribute("shadowrootcustomelementregistry")); assert_equals(template.shadowRootCustomElementRegistry, ""); template.shadowRootCustomElementRegistry = "blah"; assert_equals(template.getAttribute("shadowrootcustomelementregistry"), "blah"); assert_equals(template.shadowRootCustomElementRegistry, "blah"); }, "shadowRootCustomElementRegistry reflects as string"); test(() => { const div = document.createElement("div"); div.setHTMLUnsafe(`
`); assert_equals(div.firstChild.firstChild, null); assert_equals(div.getHTML({ serializableShadowRoots: true }), ""); }, "Serializing a ShadowRoot with a null registry"); test(() => { const div = document.createElement("div"); div.setHTMLUnsafe(``); const registry = new CustomElementRegistry(); registry.initialize(div.firstChild.shadowRoot); assert_equals(div.firstChild.shadowRoot.customElementRegistry, registry); assert_equals(div.getHTML({ serializableShadowRoots: true }), ""); }, "Serializing a ShadowRoot with a registry that differs from its host");