From 562f32cf076cad90b523c6ab90f53fb0308a5d43 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 16 May 2019 16:08:00 +0100 Subject: [PATCH 1/2] refactor: remove unnecessary super.render in style attribute --- src/compile/render-dom/wrappers/Element/StyleAttribute.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts index 43524ff372..829d9ac714 100644 --- a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts +++ b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts @@ -17,7 +17,6 @@ export default class StyleAttributeWrapper extends AttributeWrapper { render(block: Block) { const style_props = optimize_style(this.node.chunks); - if (!style_props) return super.render(block); style_props.forEach((prop: StyleProp) => { let value; @@ -93,7 +92,6 @@ function optimize_style(value: Node[]) { } const result = get_style_value(chunks); - if (!result) return null; props.push({ key, value: result.value }); chunks = result.chunks; From c9085b26836cee4302e6fdeed3150d1953dc83a1 Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 16 May 2019 16:33:35 +0100 Subject: [PATCH 2/2] fix: add super.render back --- src/compile/render-dom/wrappers/Element/StyleAttribute.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts index 829d9ac714..8d59585cad 100644 --- a/src/compile/render-dom/wrappers/Element/StyleAttribute.ts +++ b/src/compile/render-dom/wrappers/Element/StyleAttribute.ts @@ -17,6 +17,7 @@ export default class StyleAttributeWrapper extends AttributeWrapper { render(block: Block) { const style_props = optimize_style(this.node.chunks); + if (!style_props) return super.render(block); style_props.forEach((prop: StyleProp) => { let value;