|
|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { to_style } from '../../../shared/attributes.js';
|
|
|
|
|
import { STYLE_CACHE_SYMBOL } from '../../constants.js';
|
|
|
|
|
import { STYLE_CACHE } from '../../constants.js';
|
|
|
|
|
import { hydrating } from '../hydration.js';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -29,7 +29,7 @@ function update_styles(dom, prev = {}, next, priority) {
|
|
|
|
|
* @param {Record<string, any> | [Record<string, any>, Record<string, any>]} [next_styles]
|
|
|
|
|
*/
|
|
|
|
|
export function set_style(dom, value, prev_styles, next_styles) {
|
|
|
|
|
var prev = /** @type {any} */ (dom)[STYLE_CACHE_SYMBOL];
|
|
|
|
|
var prev = /** @type {any} */ (dom)[STYLE_CACHE];
|
|
|
|
|
|
|
|
|
|
if (hydrating || prev !== value) {
|
|
|
|
|
var next_style_attr = to_style(value, next_styles);
|
|
|
|
|
@ -42,7 +42,7 @@ export function set_style(dom, value, prev_styles, next_styles) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @type {any} */ (dom)[STYLE_CACHE_SYMBOL] = value;
|
|
|
|
|
/** @type {any} */ (dom)[STYLE_CACHE] = value;
|
|
|
|
|
} else if (next_styles) {
|
|
|
|
|
if (Array.isArray(next_styles)) {
|
|
|
|
|
update_styles(dom, prev_styles?.[0], next_styles[0]);
|
|
|
|
|
|