@@ -725,29 +725,29 @@ function propHasMismatch(
725
725
if ( key === 'class' ) {
726
726
// classes might be in different order, but that doesn't affect cascade
727
727
// 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 ) ) ) {
731
731
mismatchType = mismatchKey = `class`
732
732
}
733
733
} else if ( key === 'style' ) {
734
734
// 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 )
741
741
// If `v-show=false`, `display: 'none'` should be added to expected
742
742
if ( vnode . dirs ) {
743
743
for ( const { dir, value } of vnode . dirs ) {
744
744
// @ts -expect-error only vShow has this internal name
745
745
if ( dir . name === 'show' && ! value ) {
746
- expected . set ( 'display' , 'none' )
746
+ expectedMap . set ( 'display' , 'none' )
747
747
}
748
748
}
749
749
}
750
- if ( ! isMapEqual ( actual , expected ) ) {
750
+ if ( ! isMapEqual ( actualMap , expectedMap ) ) {
751
751
mismatchType = mismatchKey = 'style'
752
752
}
753
753
} else if (
0 commit comments