diff --git a/src/compiler/compile/render_dom/wrappers/Element/index.ts b/src/compiler/compile/render_dom/wrappers/Element/index.ts index eb57233ed0..989e7cb82b 100644 --- a/src/compiler/compile/render_dom/wrappers/Element/index.ts +++ b/src/compiler/compile/render_dom/wrappers/Element/index.ts @@ -219,6 +219,7 @@ export default class ElementWrapper extends Wrapper { node.classes.length > 0 || node.intro || node.outro || node.handlers.length > 0 || + node.styles.length > 0 || this.node.name === 'option' || renderer.options.dev ) { diff --git a/test/runtime/samples/inline-style-directive/_config.js b/test/runtime/samples/inline-style-directive/_config.js index ec32e157e5..f5732ae0af 100644 --- a/test/runtime/samples/inline-style-directive/_config.js +++ b/test/runtime/samples/inline-style-directive/_config.js @@ -1,6 +1,8 @@ export default { html: ` -

+
+

+
`, test({ assert, target, window }) { diff --git a/test/runtime/samples/inline-style-directive/main.svelte b/test/runtime/samples/inline-style-directive/main.svelte index 1d60aefa6f..ff8acfce68 100644 --- a/test/runtime/samples/inline-style-directive/main.svelte +++ b/test/runtime/samples/inline-style-directive/main.svelte @@ -2,4 +2,6 @@ export let myColor = "red"; -

+

+

+

diff --git a/test/runtime/samples/inline-style/_config.js b/test/runtime/samples/inline-style/_config.js index 3e984d4c69..192659346c 100644 --- a/test/runtime/samples/inline-style/_config.js +++ b/test/runtime/samples/inline-style/_config.js @@ -4,9 +4,9 @@ export default { `, test({ assert, component, target, window }) { - const p = target.querySelector('div'); + const div = target.querySelector('div'); - const styles = window.getComputedStyle(p); + const styles = window.getComputedStyle(div); assert.equal(styles.color, 'red'); } };