Index: Source/core/css/make-css-file-arrays.pl |
diff --git a/Source/core/css/make-css-file-arrays.pl b/Source/core/css/make-css-file-arrays.pl |
index 66eb7dfb0e4cd9f8215eff72a47ac4618f8704b7..811d7f958fcca6d7ca7c821d6fc95d0cdf7d265d 100755 |
--- a/Source/core/css/make-css-file-arrays.pl |
+++ b/Source/core/css/make-css-file-arrays.pl |
@@ -65,10 +65,13 @@ for my $in (@ARGV) { |
# Crunch whitespace just to make it a little smaller. |
# Could do work to avoid doing this inside quote marks but our files don't have runs of spaces in quotes. |
- # Could crunch further based on places where whitespace is optional. |
- $text =~ s|\s+| |gs; |
- $text =~ s|^ ||; |
- $text =~ s| $||; |
+ # FIXME: Use a proper css minifier to crunch this further. |
+ $text =~ s|^[\s]+||gm; # remove optional leading spaces. |
+ $text =~ s|[\s]*:[\s]*|:|gm; # remove optional spaces around colons. |
+ $text =~ s|[\s]*{[\s]*|{|gm; # remove optional spaces around open braces. |
+ $text =~ s|[\s;]*}[\s]*|}|gm; # remove optional spaces around end braces and semicolons before end braces. |
+ $text =~ s|[\s]*,[\s]*|,|gm; # remove optional spaces around commas. |
+ $text =~ s|\R||g; # remove newlines. |
# Write out a C array of the characters. |
my $length = length $text; |