@@ -27,7 +27,8 @@ function normalizeProperty(property: string) {
27
27
export const STYLE_ORIGINAL_VALUE = Symbol ( "style_original_value" ) ;
28
28
29
29
function addStyleProperty ( el : NSVElement , property : string , value : any ) {
30
- const _sov : Map < string , any > = ( el [ STYLE_ORIGINAL_VALUE ] ??= new Map ( ) ) ;
30
+ const _sov : Map < string , any > =
31
+ el [ STYLE_ORIGINAL_VALUE ] ?? ( el [ STYLE_ORIGINAL_VALUE ] = new Map ( ) ) ;
31
32
property = normalizeProperty ( property ) ;
32
33
33
34
if ( ! _sov . has ( property ) ) {
@@ -38,7 +39,8 @@ function addStyleProperty(el: NSVElement, property: string, value: any) {
38
39
}
39
40
40
41
function removeStyleProperty ( el : NSVElement , property : string ) {
41
- const _sov : Map < string , any > = ( el [ STYLE_ORIGINAL_VALUE ] ??= new Map ( ) ) ;
42
+ const _sov : Map < string , any > =
43
+ el [ STYLE_ORIGINAL_VALUE ] ?? ( el [ STYLE_ORIGINAL_VALUE ] = new Map ( ) ) ;
42
44
property = normalizeProperty ( property ) ;
43
45
44
46
// only delete styles we added
@@ -53,6 +55,7 @@ function removeStyleProperty(el: NSVElement, property: string) {
53
55
}
54
56
}
55
57
58
+ // todo: perhaps mimic dom version with prefixing stripped out: https://github.com/vuejs/core/blob/main/packages/runtime-dom/src/modules/style.ts
56
59
export function patchStyle ( el : NSVElement , prev : Style , next : Style ) {
57
60
if ( prev ) {
58
61
const style = normalizeStyle ( prev ) ;
0 commit comments