Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Always use xhr to load styles; relying on caching was too brittle.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Feb 19, 2014
1 parent fd17162 commit 4171728
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions src/declaration/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,7 @@
}
var styles = this.findLoadableStyles(content);
if (styles.length) {
// if SD polyfill or opt-in, use xhr for cssText, otherwise
// allow platform to cache styles.
// TODO(sorvell): experimental flag to force direct caching of cssTest
// rather than relying on platform to cache @import rules.
if (window.ShadowDOMPolyfill || this.hasAttribute('cache-csstext')) {
Platform.loader.xhrStyles(styles, callback);
} else {
Platform.loader.cacheStyles(styles, callback);
}
Platform.styleResolver.loadStyles(styles, callback);
} else if (callback) {
callback();
}
Expand Down
2 changes: 1 addition & 1 deletion test/html/styling/x-sheets.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<polymer-element name="x-sheets" cache-csstext>
<polymer-element name="x-sheets">
<style>
.red1 {
background: tomato;
Expand Down

0 comments on commit 4171728

Please sign in to comment.