@@ -107,10 +107,7 @@ export interface RendererOptions<
107107 prevValue : any ,
108108 nextValue : any ,
109109 namespace ?: ElementNamespace ,
110- prevChildren ?: VNode < HostNode , HostElement > [ ] ,
111110 parentComponent ?: ComponentInternalInstance | null ,
112- parentSuspense ?: SuspenseBoundary | null ,
113- unmountChildren ?: UnmountChildrenFn ,
114111 ) : void
115112 insert ( el : HostNode , parent : HostElement , anchor ?: HostNode | null ) : void
116113 remove ( el : HostNode ) : void
@@ -670,17 +667,7 @@ function baseCreateRenderer(
670667 if ( props ) {
671668 for ( const key in props ) {
672669 if ( key !== 'value' && ! isReservedProp ( key ) ) {
673- hostPatchProp (
674- el ,
675- key ,
676- null ,
677- props [ key ] ,
678- namespace ,
679- vnode . children as VNode [ ] ,
680- parentComponent ,
681- parentSuspense ,
682- unmountChildren ,
683- )
670+ hostPatchProp ( el , key , null , props [ key ] , namespace , parentComponent )
684671 }
685672 }
686673 /**
@@ -833,6 +820,15 @@ function baseCreateRenderer(
833820 dynamicChildren = null
834821 }
835822
823+ // #9135 innerHTML / textContent unset needs to happen before possible
824+ // new children mount
825+ if (
826+ ( oldProps . innerHTML && newProps . innerHTML == null ) ||
827+ ( oldProps . textContent && newProps . textContent == null )
828+ ) {
829+ hostSetElementText ( el , '' )
830+ }
831+
836832 if ( dynamicChildren ) {
837833 patchBlockChildren (
838834 n1 . dynamicChildren ! ,
@@ -869,15 +865,7 @@ function baseCreateRenderer(
869865 // (i.e. at the exact same position in the source template)
870866 if ( patchFlag & PatchFlags . FULL_PROPS ) {
871867 // element props contain dynamic keys, full diff needed
872- patchProps (
873- el ,
874- n2 ,
875- oldProps ,
876- newProps ,
877- parentComponent ,
878- parentSuspense ,
879- namespace ,
880- )
868+ patchProps ( el , oldProps , newProps , parentComponent , namespace )
881869 } else {
882870 // class
883871 // this flag is matched when the element has dynamic class bindings.
@@ -908,17 +896,7 @@ function baseCreateRenderer(
908896 const next = newProps [ key ]
909897 // #1471 force patch value
910898 if ( next !== prev || key === 'value' ) {
911- hostPatchProp (
912- el ,
913- key ,
914- prev ,
915- next ,
916- namespace ,
917- n1 . children as VNode [ ] ,
918- parentComponent ,
919- parentSuspense ,
920- unmountChildren ,
921- )
899+ hostPatchProp ( el , key , prev , next , namespace , parentComponent )
922900 }
923901 }
924902 }
@@ -933,15 +911,7 @@ function baseCreateRenderer(
933911 }
934912 } else if ( ! optimized && dynamicChildren == null ) {
935913 // unoptimized, full diff
936- patchProps (
937- el ,
938- n2 ,
939- oldProps ,
940- newProps ,
941- parentComponent ,
942- parentSuspense ,
943- namespace ,
944- )
914+ patchProps ( el , oldProps , newProps , parentComponent , namespace )
945915 }
946916
947917 if ( ( vnodeHook = newProps . onVnodeUpdated ) || dirs ) {
@@ -998,11 +968,9 @@ function baseCreateRenderer(
998968
999969 const patchProps = (
1000970 el : RendererElement ,
1001- vnode : VNode ,
1002971 oldProps : Data ,
1003972 newProps : Data ,
1004973 parentComponent : ComponentInternalInstance | null ,
1005- parentSuspense : SuspenseBoundary | null ,
1006974 namespace : ElementNamespace ,
1007975 ) => {
1008976 if ( oldProps !== newProps ) {
@@ -1015,10 +983,7 @@ function baseCreateRenderer(
1015983 oldProps [ key ] ,
1016984 null ,
1017985 namespace ,
1018- vnode . children as VNode [ ] ,
1019986 parentComponent ,
1020- parentSuspense ,
1021- unmountChildren ,
1022987 )
1023988 }
1024989 }
@@ -1030,17 +995,7 @@ function baseCreateRenderer(
1030995 const prev = oldProps [ key ]
1031996 // defer patching value
1032997 if ( next !== prev && key !== 'value' ) {
1033- hostPatchProp (
1034- el ,
1035- key ,
1036- prev ,
1037- next ,
1038- namespace ,
1039- vnode . children as VNode [ ] ,
1040- parentComponent ,
1041- parentSuspense ,
1042- unmountChildren ,
1043- )
998+ hostPatchProp ( el , key , prev , next , namespace , parentComponent )
1044999 }
10451000 }
10461001 if ( 'value' in newProps ) {
0 commit comments