Skip to content

Commit

Permalink
Merge pull request #3997 from Polymer/perf-ie-style-cache
Browse files Browse the repository at this point in the history
Fix IE style cache performance
  • Loading branch information
Steve Orvell authored Sep 26, 2016
2 parents 03989ac + d08b694 commit e45eeff
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/lib/style-properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,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) {
Expand All @@ -513,10 +517,6 @@
}
element._customStyle = style;
}
// @media rules may be stale in IE 10 and 11
if (IS_IE) {
style.textContent = style.textContent;
}
return style;
},

Expand Down

0 comments on commit e45eeff

Please sign in to comment.