@@ -8,8 +8,9 @@ import { hydrating } from '../hydration.js';
88 * @param {string } [priority]
99 */
1010function update_styles ( dom , prev = { } , next , priority ) {
11- for ( const key in next ) {
12- const value = next [ key ] ;
11+ for ( var key in next ) {
12+ var value = next [ key ] ;
13+
1314 if ( prev [ key ] !== value ) {
1415 if ( next [ key ] == null ) {
1516 dom . style . removeProperty ( key ) ;
@@ -29,15 +30,18 @@ function update_styles(dom, prev = {}, next, priority) {
2930export function set_style ( dom , value , prev_styles , next_styles ) {
3031 // @ts -expect-error
3132 var prev = dom . __style ;
33+
3234 if ( hydrating || prev !== value ) {
3335 var next_style_attr = to_style ( value , next_styles ) ;
36+
3437 if ( ! hydrating || next_style_attr !== dom . getAttribute ( 'style' ) ) {
3538 if ( next_style_attr == null ) {
3639 dom . removeAttribute ( 'style' ) ;
3740 } else {
3841 dom . style . cssText = next_style_attr ;
3942 }
4043 }
44+
4145 // @ts -expect-error
4246 dom . __style = value ;
4347 } else if ( next_styles ) {
@@ -48,5 +52,6 @@ export function set_style(dom, value, prev_styles, next_styles) {
4852 update_styles ( dom , prev_styles , next_styles ) ;
4953 }
5054 }
55+
5156 return next_styles ;
5257}
0 commit comments