Opened 12 years ago

Closed 12 years ago

#9761 closed defect (worksforme)

Error in building : background-image:url("data:image/gif;base64,

Reported by: emorvill Owned by: James Burke
Priority: high Milestone: tbd
Component: BuildSystem Version: 1.3.2
Keywords: RegExp buildscript Cc: Jared Jurkiewicz
Blocked By: Blocking:


When you build your project with a cssOptimize=comments, if you have a main CSS containing @import, this line :


will be copied in your main CSS like :

background-image:url(path/data:image/gif;base64, where path/ is a relative url (example : ../../css/)

In File : BuildUtil?.js line 1349 : buildUtil.cssUrlRegExp = /\url\(\s*([\)]+)\s*\)?/g;

I am not an expert of RegExp? but I think this regExp is too large.

Change History (4)

comment:1 Changed 12 years ago by Adam Peller

Cc: Jared Jurkiewicz added

comment:2 Changed 12 years ago by James Burke

(In [19961]) Refs #9761: tests for data: urls. Seems to work for me though.

comment:3 Changed 12 years ago by James Burke

(In [19962]) Refs #9761: tests for data: urls, showing how to call the test.

comment:4 Changed 12 years ago by James Burke

Milestone: 1.3.3tbd
Resolution: worksforme
Status: newclosed

This seems to work when I try some test files. I checked in some tests at util/buildscripts/test/css. You can get them from the latest trunk code, cd to that directory and run the following command:

/java -classpath ../../../shrinksafe/js.jar flattenTest.js

I also tried the same tests with the Dojo 1.3.2 codebase and it also seemed to work correctly there too.

If you can demonstrate a data URL that fails feel free to reopen the bug and attach a diff for one of the test files, or list the change in here.

Note: See TracTickets for help on using tickets.