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

Commit

Permalink
pass along attributes when converting links to styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Mar 4, 2014
1 parent b72d96c commit a25628b
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/declaration/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,17 @@
for (var i=0, l=s$.length, s, c; (i<l) && (s=s$[i]); i++) {
c = createStyleElement(importRuleForSheet(s, this.ownerDocument.baseURI),
this.ownerDocument);
var scope = s.getAttribute(SCOPE_ATTR);
if (scope) {
c.setAttribute(SCOPE_ATTR, scope);
}
this.copySheetAttributes(c, s);
s.parentNode.replaceChild(c, s);
}
},
copySheetAttributes: function(style, link) {
for (var i=0, a$=link.attributes, l=a$.length, a; (a=a$[i]) && i<l; i++) {
if (a.name !== 'rel' && a.name !== 'src') {
style.setAttribute(a.name, a.value);
}
}
},
findLoadableStyles: function(root) {
var loadables = [];
if (root) {
Expand Down

0 comments on commit a25628b

Please sign in to comment.