fix(css_shim): fixes multiple uses of polyfill-unscoped-rule.

This commit is contained in:
Rado Kirov 2015-07-10 10:38:24 -07:00
parent a6210466c7
commit 749d043258
2 changed files with 9 additions and 1 deletions

View File

@ -258,7 +258,7 @@ export class ShadowCss {
var rule = m[0];
rule = StringWrapper.replace(rule, m[2], '');
rule = StringWrapper.replace(rule, m[1], m[3]);
r = rule + '\n\n';
r += rule + '\n\n';
}
return r;
}

View File

@ -123,6 +123,14 @@ export function main() {
expect(StringWrapper.contains(css, '#menu > .bar {;color:blue;}')).toBeTruthy();
});
it('should support multiple instances polyfill-unscoped-rule', () => {
var css = s("polyfill-unscoped-rule {content: 'foo';color: blue;}" +
"polyfill-unscoped-rule {content: 'bar';color: blue;}",
'a');
expect(StringWrapper.contains(css, 'foo {;color:blue;}')).toBeTruthy();
expect(StringWrapper.contains(css, 'bar {;color:blue;}')).toBeTruthy();
});
it('should support polyfill-rule', () => {
var css = s("polyfill-rule {content: ':host.foo .bar';color: blue;}", 'a', 'a-host');
expect(css).toEqual('[a-host].foo .bar {color:blue;}');