File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,8 @@ export function normalizeCSS(css: string): string {
8888 css = StringWrapper . replaceAll ( css , / : \s / g, ':' ) ;
8989 css = StringWrapper . replaceAll ( css , / ' / g, '"' ) ;
9090 css = StringWrapper . replaceAll ( css , / } / g, '}' ) ;
91- css = StringWrapper . replaceAllMapped ( css , / u r l \( \" ( .+ ) \\ " \) / g, ( match ) => `url(${ match [ 1 ] } )` ) ;
91+ css = StringWrapper . replaceAllMapped ( css , / u r l \( ( \" | \s ) ( .+ ) ( \" | \s ) \) ( \s * ) / g,
92+ ( match ) => `url("${ match [ 2 ] } ")` ) ;
9293 css = StringWrapper . replaceAllMapped ( css , / \[ ( .+ ) = ( [ ^ " \] ] + ) \] / g,
9394 ( match ) => `[${ match [ 1 ] } ="${ match [ 2 ] } "]` ) ;
9495 return css ;
Original file line number Diff line number Diff line change @@ -155,10 +155,14 @@ export function main() {
155155 expect ( css ) . toEqual ( 'x[a] y[a] {}' ) ;
156156 } ) ;
157157
158- it ( 'should pass through @import directives' , ( ) => {
159- var styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");' ;
160- var css = s ( styleStr , 'a' ) ;
161- expect ( css ) . toEqual ( styleStr ) ;
162- } ) ;
158+ // TODO: can't work in Firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=625013
159+ // Issue opened to track that: https://github.com/angular/angular/issues/4628
160+ if ( ! browserDetection . isFirefox ) {
161+ it ( 'should pass through @import directives' , ( ) => {
162+ var styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");' ;
163+ var css = s ( styleStr , 'a' ) ;
164+ expect ( css ) . toEqual ( styleStr ) ;
165+ } ) ;
166+ }
163167 } ) ;
164168}
You can’t perform that action at this time.
0 commit comments