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

Commit

Permalink
installScopeStyle can optionally specify a scope.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Mar 18, 2014
1 parent ef3f6e8 commit c690632
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/instance/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
}
}
},
installScopeStyle: function(style, name) {
var scope = this.findStyleScope(), name = name || '';
installScopeStyle: function(style, name, scope) {
var scope = this.findStyleScope(scope), name = name || '';
if (scope && !this.scopeHasNamedStyle(scope, this.localName + name)) {
var cssText = '';
if (style instanceof Array) {
Expand Down Expand Up @@ -65,9 +65,9 @@
// cache that this style has been applied
scope._scopeStyles[this.localName + name] = true;
},
findStyleScope: function() {
findStyleScope: function(node) {
// find the shadow root that contains this element
var n = this;
var n = node || this;
while (n.parentNode) {
n = n.parentNode;
}
Expand Down

0 comments on commit c690632

Please sign in to comment.