fix(css_shim): fixes multiple uses of polyfill-unscoped-rule.
This commit is contained in:
parent
a6210466c7
commit
749d043258
|
@ -258,7 +258,7 @@ export class ShadowCss {
|
||||||
var rule = m[0];
|
var rule = m[0];
|
||||||
rule = StringWrapper.replace(rule, m[2], '');
|
rule = StringWrapper.replace(rule, m[2], '');
|
||||||
rule = StringWrapper.replace(rule, m[1], m[3]);
|
rule = StringWrapper.replace(rule, m[1], m[3]);
|
||||||
r = rule + '\n\n';
|
r += rule + '\n\n';
|
||||||
}
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,6 +123,14 @@ export function main() {
|
||||||
expect(StringWrapper.contains(css, '#menu > .bar {;color:blue;}')).toBeTruthy();
|
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', () => {
|
it('should support polyfill-rule', () => {
|
||||||
var css = s("polyfill-rule {content: ':host.foo .bar';color: blue;}", 'a', 'a-host');
|
var css = s("polyfill-rule {content: ':host.foo .bar';color: blue;}", 'a', 'a-host');
|
||||||
expect(css).toEqual('[a-host].foo .bar {color:blue;}');
|
expect(css).toEqual('[a-host].foo .bar {color:blue;}');
|
||||||
|
|
Loading…
Reference in New Issue