File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -203,8 +203,9 @@ function findElementsInElements(elements = [], selector = '') {
203203 return found ;
204204}
205205function elementChildren ( element , selector = '' ) {
206+ const window = getWindow ( ) ;
206207 const children = [ ...element . children ] ;
207- if ( element instanceof HTMLSlotElement ) {
208+ if ( window . HTMLSlotElement && element instanceof HTMLSlotElement ) {
208209 children . push ( ...element . assignedElements ( ) ) ;
209210 }
210211
@@ -229,8 +230,9 @@ function elementIsChildOfSlot(el, slot) {
229230 }
230231}
231232function elementIsChildOf ( el , parent ) {
233+ const window = getWindow ( ) ;
232234 let isChild = parent . contains ( el ) ;
233- if ( ! isChild && parent instanceof HTMLSlotElement ) {
235+ if ( ! isChild && window . HTMLSlotElement && parent instanceof HTMLSlotElement ) {
234236 const children = [ ...parent . assignedElements ( ) ] ;
235237 isChild = children . includes ( el ) ;
236238 if ( ! isChild ) {
You can’t perform that action at this time.
0 commit comments