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

Commit

Permalink
use HTMLImports for css path resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Aug 4, 2014
1 parent 8495b0a commit db8c71c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/ShadowCSS.js
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ function withCssRules(cssText, callback) {
var style = cssTextToStyle(cssText);
inFrame(function(doc) {
doc.head.appendChild(style.impl);
rules = style.sheet.cssRules;
rules = Array.prototype.slice.call(style.sheet.cssRules, 0);
callback(rules);
});
} else {
Expand Down Expand Up @@ -732,11 +732,10 @@ if (window.ShadowDOMPolyfill) {
}
if (elt.__resource) {
style = elt.ownerDocument.createElement('style');
style.textContent = urlResolver.resolveCssText(
elt.__resource, elt.href);
} else {
urlResolver.resolveStyle(style);
style.textContent = elt.__resource;
}
// relay on HTMLImports for path fixup
HTMLImports.path.resolveUrlsInStyle(style);
style.textContent = ShadowCSS.shimStyle(style);
style.removeAttribute(SHIM_ATTRIBUTE, '');
style.setAttribute(SHIMMED_ATTRIBUTE, '');
Expand Down

0 comments on commit db8c71c

Please sign in to comment.