Fixes for IE style ordering issue.

This commit is contained in:
Steven Orvell 2016-02-04 19:03:28 -08:00
parent b5ba9a8219
commit 162f81ea0d
2 changed files with 4 additions and 2 deletions

View File

@ -47,6 +47,8 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
var cssText = styleTransformer.elementStyles(this); var cssText = styleTransformer.elementStyles(this);
// do we really need to output shimmed styles // do we really need to output shimmed styles
var needsStatic = this._needsStaticStyles(this._styles); var needsStatic = this._needsStaticStyles(this._styles);
// NOTE: IE has css style ordering issues unless there's at least a
// space in the stylesheet.
cssText = needsStatic ? cssText : ' '; cssText = needsStatic ? cssText : ' ';
// under shady dom we always output a shimmed style (which may be // under shady dom we always output a shimmed style (which may be
// empty) so that other dynamic stylesheets can always be placed // empty) so that other dynamic stylesheets can always be placed

View File

@ -32,7 +32,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
_needsStaticStyles: function(styles) { _needsStaticStyles: function(styles) {
var needsStatic; var needsStatic;
for (var i=0, l=styles.length, css; i < l; i++) { for (var i=0, l=styles.length, css; i < l; i++) {
css = styles[i].textContent; css = styleUtil.parser._clean(styles[i].textContent);
needsStatic = needsStatic || Boolean(css); needsStatic = needsStatic || Boolean(css);
if (css.match(propertyUtils.rx.MIXIN_MATCH) || if (css.match(propertyUtils.rx.MIXIN_MATCH) ||
css.match(propertyUtils.rx.VAR_MATCH)) { css.match(propertyUtils.rx.VAR_MATCH)) {