From b0848070bcd237ecbddee216e0d96461dd720a19 Mon Sep 17 00:00:00 2001 From: Gilbert Date: Fri, 5 Aug 2016 00:49:26 -0500 Subject: [PATCH] Overwrite an element's style using cssText This is the proper way to do it: https://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration-cssText --- render/render.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/render/render.js b/render/render.js index 50d2404c..906291cb 100644 --- a/render/render.js +++ b/render/render.js @@ -441,11 +441,11 @@ module.exports = function($window) { //style function updateStyle(element, old, style) { - if (old === style) element.style = "", old = null - if (style == null) element.style = "" - else if (typeof style === "string") element.style = style + if (old === style) element.cssText = "", old = null + if (style == null) element.cssText = "" + else if (typeof style === "string") element.cssText = style else { - if (typeof old === "string") element.style = "" + if (typeof old === "string") element.cssText = "" for (var key in style) { element.style[key] = style[key] }