X Tutup
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion modules/angular2/src/test_lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ export function normalizeCSS(css: string): string {
css = StringWrapper.replaceAll(css, /:\s/g, ':');
css = StringWrapper.replaceAll(css, /'/g, '"');
css = StringWrapper.replaceAll(css, / }/g, '}');
css = StringWrapper.replaceAllMapped(css, /url\(\"(.+)\\"\)/g, (match) => `url(${match[1]})`);
css = StringWrapper.replaceAllMapped(css, /url\((\"|\s)(.+)(\"|\s)\)(\s*)/g,
(match) => `url("${match[2]}")`);
css = StringWrapper.replaceAllMapped(css, /\[(.+)=([^"\]]+)\]/g,
(match) => `[${match[1]}="${match[2]}"]`);
return css;
Expand Down
14 changes: 9 additions & 5 deletions modules/angular2/test/core/compiler/shadow_css_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,14 @@ export function main() {
expect(css).toEqual('x[a] y[a] {}');
});

it('should pass through @import directives', () => {
var styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");';
var css = s(styleStr, 'a');
expect(css).toEqual(styleStr);
});
// Can't work in Firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=625013
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you qualify this comment with TODO: so we can find it later and fix it?

// Issue opened to track that: https://github.com/angular/angular/issues/4628
if (!browserDetection.isFirefox) {
it('should pass through @import directives', () => {
var styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");';
var css = s(styleStr, 'a');
expect(css).toEqual(styleStr);
});
}
});
}
X Tutup