Skip to content

Commit 749d043

Browse files
committed
fix(css_shim): fixes multiple uses of polyfill-unscoped-rule.
1 parent a621046 commit 749d043

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

modules/angular2/src/render/dom/shadow_dom/shadow_css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ export class ShadowCss {
258258
var rule = m[0];
259259
rule = StringWrapper.replace(rule, m[2], '');
260260
rule = StringWrapper.replace(rule, m[1], m[3]);
261-
r = rule + '\n\n';
261+
r += rule + '\n\n';
262262
}
263263
return r;
264264
}

modules/angular2/test/render/dom/shadow_dom/shadow_css_spec.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,14 @@ export function main() {
123123
expect(StringWrapper.contains(css, '#menu > .bar {;color:blue;}')).toBeTruthy();
124124
});
125125

126+
it('should support multiple instances polyfill-unscoped-rule', () => {
127+
var css = s("polyfill-unscoped-rule {content: 'foo';color: blue;}" +
128+
"polyfill-unscoped-rule {content: 'bar';color: blue;}",
129+
'a');
130+
expect(StringWrapper.contains(css, 'foo {;color:blue;}')).toBeTruthy();
131+
expect(StringWrapper.contains(css, 'bar {;color:blue;}')).toBeTruthy();
132+
});
133+
126134
it('should support polyfill-rule', () => {
127135
var css = s("polyfill-rule {content: ':host.foo .bar';color: blue;}", 'a', 'a-host');
128136
expect(css).toEqual('[a-host].foo .bar {color:blue;}');

0 commit comments

Comments
 (0)