diff --git a/src/lib/style-properties.html b/src/lib/style-properties.html index 4544ede18a..39006eeb08 100644 --- a/src/lib/style-properties.html +++ b/src/lib/style-properties.html @@ -494,9 +494,13 @@ } // shady and cache hit but not in document } else if (!style.parentNode) { + if (IS_IE && cssText.indexOf('@media') > -1) { + // @media rules may be stale in IE 10 and 11 + // refresh the text content of the style to revalidate them. + style.textContent = cssText; + } styleUtil.applyStyle(style, null, element._scopeStyle); } - } // ensure this style is our custom style and increment its use count. if (style) { @@ -507,10 +511,6 @@ } element._customStyle = style; } - // @media rules may be stale in IE 10 and 11 - if (IS_IE) { - style.textContent = style.textContent; - } return style; },