@@ -498,6 +498,7 @@ export const vnode_diff = (
498498 if ( vProjectedNode == null ) {
499499 // Nothing to project, so render content of the slot.
500500 vnode_insertBefore (
501+ container ,
501502 vParent as ElementVNode | VirtualVNode ,
502503 ( vNewNode = vnode_newVirtual ( ) ) ,
503504 vCurrent && getInsertBefore ( )
@@ -512,6 +513,7 @@ export const vnode_diff = (
512513 } else {
513514 // move from q:template to the target node
514515 vnode_insertBefore (
516+ container ,
515517 vParent as ElementVNode | VirtualVNode ,
516518 ( vNewNode = vProjectedNode ) ,
517519 vCurrent && getInsertBefore ( )
@@ -544,7 +546,7 @@ export const vnode_diff = (
544546 continue ;
545547 }
546548 cleanup ( container , vNode ) ;
547- vnode_remove ( vParent , vNode , true ) ;
549+ vnode_remove ( container , vParent , vNode , true ) ;
548550 }
549551 vSideBuffer . clear ( ) ;
550552 vSideBuffer = null ;
@@ -589,7 +591,7 @@ export const vnode_diff = (
589591 cleanup ( container , vChild ) ;
590592 vChild = vChild . nextSibling as VNode | null ;
591593 }
592- vnode_truncate ( vCurrent as ElementVNode | VirtualVNode , vFirstChild ) ;
594+ vnode_truncate ( container , vCurrent as ElementVNode | VirtualVNode , vFirstChild ) ;
593595 }
594596 }
595597
@@ -604,7 +606,7 @@ export const vnode_diff = (
604606 cleanup ( container , toRemove ) ;
605607 // If we are diffing projection than the parent is not the parent of the node.
606608 // If that is the case we don't want to remove the node from the parent.
607- vnode_remove ( vParent , toRemove , true ) ;
609+ vnode_remove ( container , vParent , toRemove , true ) ;
608610 }
609611 }
610612 }
@@ -615,7 +617,7 @@ export const vnode_diff = (
615617 cleanup ( container , vCurrent ) ;
616618 const toRemove = vCurrent ;
617619 advanceToNextSibling ( ) ;
618- vnode_remove ( vParent , toRemove , true ) ;
620+ vnode_remove ( container , vParent , toRemove , true ) ;
619621 }
620622 }
621623
@@ -666,7 +668,7 @@ export const vnode_diff = (
666668 vnode_setProp ( vNewNode ! , HANDLER_PREFIX + ':' + scopedEvent , value ) ;
667669 if ( scope ) {
668670 // window and document need attrs so qwik loader can find them
669- vnode_setAttr ( vNewNode ! , key , '' ) ;
671+ vnode_setAttr ( container , vNewNode ! , key , '' ) ;
670672 }
671673 // register an event for qwik loader (window/document prefixed with '-')
672674 registerQwikLoaderEvent ( loaderScopedEvent ) ;
@@ -744,7 +746,7 @@ export const vnode_diff = (
744746 }
745747 }
746748
747- vnode_insertBefore ( vParent as ElementVNode , vNewNode as ElementVNode , vCurrent ) ;
749+ vnode_insertBefore ( container , vParent as ElementVNode , vNewNode as ElementVNode , vCurrent ) ;
748750
749751 return needsQDispatchEventPatch ;
750752 }
@@ -829,7 +831,7 @@ export const vnode_diff = (
829831 const setAttribute = ( vnode : ElementVNode , key : string , value : any ) => {
830832 const serializedValue =
831833 value != null ? serializeAttribute ( key , value , scopedStyleIdPrefix ) : null ;
832- vnode_setAttr ( vnode , key , serializedValue ) ;
834+ vnode_setAttr ( container , vnode , key , serializedValue ) ;
833835 } ;
834836
835837 const record = ( key : string , value : any ) => {
@@ -1092,7 +1094,12 @@ export const vnode_diff = (
10921094 }
10931095 }
10941096 }
1095- vnode_insertBefore ( parentForInsert as ElementVNode | VirtualVNode , buffered , vCurrent ) ;
1097+ vnode_insertBefore (
1098+ container ,
1099+ parentForInsert as ElementVNode | VirtualVNode ,
1100+ buffered ,
1101+ vCurrent
1102+ ) ;
10961103 vCurrent = buffered ;
10971104 vNewNode = null ;
10981105 return ;
@@ -1117,6 +1124,7 @@ export const vnode_diff = (
11171124
11181125 const createNew = ( ) => {
11191126 vnode_insertBefore (
1127+ container ,
11201128 vParent as VirtualVNode ,
11211129 ( vNewNode = vnode_newVirtual ( ) ) ,
11221130 vCurrent && getInsertBefore ( )
@@ -1259,6 +1267,7 @@ export const vnode_diff = (
12591267 clearAllEffects ( container , host ) ;
12601268 }
12611269 vnode_insertBefore (
1270+ container ,
12621271 vParent as VirtualVNode ,
12631272 ( vNewNode = vnode_newVirtual ( ) ) ,
12641273 vCurrent && getInsertBefore ( )
@@ -1272,6 +1281,7 @@ export const vnode_diff = (
12721281
12731282 function insertNewInlineComponent ( ) {
12741283 vnode_insertBefore (
1284+ container ,
12751285 vParent as VirtualVNode ,
12761286 ( vNewNode = vnode_newVirtual ( ) ) ,
12771287 vCurrent && getInsertBefore ( )
@@ -1289,13 +1299,14 @@ export const vnode_diff = (
12891299 const type = vnode_getType ( vCurrent ) ;
12901300 if ( type === 3 /* Text */ ) {
12911301 if ( text !== vnode_getText ( vCurrent as TextVNode ) ) {
1292- vnode_setText ( vCurrent as TextVNode , text ) ;
1302+ vnode_setText ( container , vCurrent as TextVNode , text ) ;
12931303 return ;
12941304 }
12951305 return ;
12961306 }
12971307 }
12981308 vnode_insertBefore (
1309+ container ,
12991310 vParent as VirtualVNode ,
13001311 ( vNewNode = vnode_newText ( container . document . createTextNode ( text ) , text ) ) ,
13011312 vCurrent
@@ -1542,7 +1553,7 @@ export function cleanup(container: ClientContainer, vNode: VNode) {
15421553 projectionChild = projectionChild . nextSibling as VNode | null ;
15431554 }
15441555
1545- cleanupStaleUnclaimedProjection ( projection ) ;
1556+ cleanupStaleUnclaimedProjection ( container , projection ) ;
15461557 }
15471558 }
15481559 }
@@ -1615,7 +1626,7 @@ export function cleanup(container: ClientContainer, vNode: VNode) {
16151626 } while ( true as boolean ) ;
16161627}
16171628
1618- function cleanupStaleUnclaimedProjection ( projection : VNode ) {
1629+ function cleanupStaleUnclaimedProjection ( container : ClientContainer , projection : VNode ) {
16191630 // we are removing a node where the projection would go after slot render.
16201631 // This is not needed, so we need to cleanup still unclaimed projection
16211632 const projectionParent = projection . parent ;
@@ -1626,7 +1637,7 @@ function cleanupStaleUnclaimedProjection(projection: VNode) {
16261637 vnode_getElementName ( projectionParent as ElementVNode ) === QTemplate
16271638 ) {
16281639 // if parent is the q:template element then projection is still unclaimed - remove it
1629- vnode_remove ( projectionParent as ElementVNode | VirtualVNode , projection , true ) ;
1640+ vnode_remove ( container , projectionParent as ElementVNode | VirtualVNode , projection , true ) ;
16301641 }
16311642 }
16321643}
0 commit comments