mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
commit
55b91b3db7
@ -283,14 +283,14 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
applyElementScopeSelector: function(element, selector, old, viaAttr) {
|
||||
var c = viaAttr ? element.getAttribute(styleTransformer.SCOPE_NAME) :
|
||||
element.className;
|
||||
(element.getAttribute('class') || '');
|
||||
var v = old ? c.replace(old, selector) :
|
||||
(c ? c + ' ' : '') + this.XSCOPE_NAME + ' ' + selector;
|
||||
if (c !== v) {
|
||||
if (viaAttr) {
|
||||
element.setAttribute(styleTransformer.SCOPE_NAME, v);
|
||||
} else {
|
||||
element.className = v;
|
||||
element.setAttribute('class', v);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -86,7 +86,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
.replace(scope, ''));
|
||||
}
|
||||
} else {
|
||||
element.setAttribute(CLASS, c + (c ? ' ' : '') +
|
||||
element.setAttribute(CLASS, (c ? c + ' ' : '') +
|
||||
SCOPE_NAME + ' ' + scope);
|
||||
}
|
||||
}
|
||||
|
@ -231,6 +231,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
||||
|
||||
test('svg elements properly scoped', function() {
|
||||
assert.include(styled.$.circle.getAttribute('class'), 'style-scope x-styled');
|
||||
assert.notInclude(styled.$.circle.getAttribute('class'), 'null');
|
||||
assertComputed(styled.$.circle, '1px', 'strokeWidth');
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user