File tree Expand file tree Collapse file tree
custom-elements/registries Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2020 </ div >
2121</ div >
2222
23+ < template id ="template ">
24+ < div id ="template-host-1 ">
25+ < template shadowrootmode ="open " shadowrootclonable > < x-foo > </ x-foo > </ template >
26+ </ div >
27+ < div id ="template-host-2 ">
28+ < template shadowrootmode ="open " shadowrootclonable shadowrootcustomelementregistry > < x-foo > </ x-foo > </ template >
29+ </ div >
30+ </ template >
31+
2332< script >
2433
2534test ( ( ) => {
6675 assert_equals ( element . customElementRegistry , registry1 ) ;
6776} , "An element with scoped registry should not change its registry when moved into another shadow tree with different scoped registry." )
6877
78+ test ( ( ) => {
79+ customElements . define ( 'x-foo' , class extends HTMLElement { } ) ;
80+ const template = document . getElementById ( 'template' ) ;
81+ document . body . append ( template . content . cloneNode ( true ) ) ;
82+ assert_equals ( document . querySelector ( '#template-host-1' ) . shadowRoot . querySelector ( 'x-foo' ) . customElementRegistry , customElements ) ;
83+ assert_equals ( document . querySelector ( '#template-host-2' ) . shadowRoot . querySelector ( 'x-foo' ) . customElementRegistry , null ) ;
84+ } , "Declarative shadow DOM with shadowrootcustomelementregistry attribute without registry initialized should remain null registry after adoption." )
85+
6986</ script >
7087</ body >
You can’t perform that action at this time.
0 commit comments