Skip to content

Commit

Permalink
Fix IE style cache performance
Browse files Browse the repository at this point in the history
Continue workaround from 80be0df for @media staleness, but only refresh
the stylesheet if it came from the cache and has @media queries.

Fixes #3965
  • Loading branch information
dfreedm committed Sep 26, 2016
1 parent 1a01896 commit d08b694
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 @@ -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) {
Expand All @@ -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;
},

Expand Down

0 comments on commit d08b694

Please sign in to comment.