@@ -725,29 +725,29 @@ function propHasMismatch(
725725 if ( key === 'class' ) {
726726 // classes might be in different order, but that doesn't affect cascade
727727 // so we just need to check if the class lists contain the same classes.
728- actual = toClassSet ( el . getAttribute ( 'class' ) || ' ')
729- expected = toClassSet ( normalizeClass ( clientValue ) )
730- if ( ! isSetEqual ( actual , expected ) ) {
728+ actual = el . getAttribute ( 'class' )
729+ expected = normalizeClass ( clientValue )
730+ if ( ! isSetEqual ( toClassSet ( actual || '' ) , toClassSet ( expected ) ) ) {
731731 mismatchType = mismatchKey = `class`
732732 }
733733 } else if ( key === 'style' ) {
734734 // style might be in different order, but that doesn't affect cascade
735- actual = toStyleMap ( el . getAttribute ( 'style' ) || ' ')
736- expected = toStyleMap (
737- isString ( clientValue )
738- ? clientValue
739- : stringifyStyle ( normalizeStyle ( clientValue ) ) ,
740- )
735+ actual = el . getAttribute ( 'style' )
736+ expected = isString ( clientValue )
737+ ? clientValue
738+ : stringifyStyle ( normalizeStyle ( clientValue ) )
739+ const actualMap = toStyleMap ( actual )
740+ const expectedMap = toStyleMap ( expected )
741741 // If `v-show=false`, `display: 'none'` should be added to expected
742742 if ( vnode . dirs ) {
743743 for ( const { dir, value } of vnode . dirs ) {
744744 // @ts -expect-error only vShow has this internal name
745745 if ( dir . name === 'show' && ! value ) {
746- expected . set ( 'display' , 'none' )
746+ expectedMap . set ( 'display' , 'none' )
747747 }
748748 }
749749 }
750- if ( ! isMapEqual ( actual , expected ) ) {
750+ if ( ! isMapEqual ( actualMap , expectedMap ) ) {
751751 mismatchType = mismatchKey = 'style'
752752 }
753753 } else if (
0 commit comments