Permalink
Browse files

Removed redundant A-F check in regex. We're already using the i flag.…

… Reminded me to add case variance to the test file
  • Loading branch information...
1 parent f023e8c commit cb68d7761c5a4ec03619418e06206b16a1189f89 @sdesai sdesai committed Sep 23, 2011
Showing with 7 additions and 6 deletions.
  1. +1 −1 ports/js/cssmin.js
  2. +5 −4 tests/color.css
  3. +1 −1 tests/color.css.min
View
2 ports/js/cssmin.js
@@ -119,7 +119,7 @@ YAHOO.compressor._extractDataUrls = function (css, preservedTokens) {
YAHOO.compressor._compressHexColors = function(css) {
// Look for hex colors inside { ... } (to avoid IDs) and which don't have a =, or a " in front of them (to avoid filters)
- var pattern = /([^"'=\s])(\s*)#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])(\}|[^0-9a-fA-F{][^{]*?\})/gi,
+ var pattern = /([^"'=\s])(\s*)#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])(\}|[^0-9a-f{][^{]*?\})/gi,
m,
index = 0,
sb = [];
View
9 tests/color.css
@@ -1,6 +1,6 @@
.color {
me: rgb(123, 123, 123);
- impressed: #ffeedd;
+ impressed: #FfEedD;
again: #456789;
andagain:#aa66cc;
background-color:#aa66ccc;
@@ -14,16 +14,17 @@
background-color:#ffee11;
filter: chroma(color="#FFFFFF");
color:#441122;
+ border-color:#aa66ccC
}
.foo #AABBCC {
- background-color:#ffee11;
+ background-color:#fFEe11;
color:#441122;
filter: chroma(color="#FFFFFF")
}
.bar, #AABBCC {
- background-color:#ffee11;
+ background-color:#FFee11;
color:#441122;
}
@@ -34,7 +35,7 @@
@media screen {
.bar, #AABBCC {
- background-color:#ffee11;
+ background-color:#ffEE11;
color:#441122
}
}
View
2 tests/color.css.min
@@ -1,3 +1,3 @@
-.color{me:#7b7b7b;impressed:#fed;again:#456789;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 #f00;alpha:rgba(1,2,3,4);color:#12a}#AABBCC{background-color:#fe1;filter:chroma(color="#FFFFFF");color:#412}.foo #AABBCC{background-color:#fe1;color:#412;filter:chroma(color="#FFFFFF")}.bar,#AABBCC{background-color:#fe1;color:#412}.foo,#AABBCC.foobar{background-color:#fe1;color:#412}@media screen{.bar,#AABBCC{background-color:#fe1;color:#412}}
+.color{me:#7b7b7b;impressed:#fed;again:#456789;andagain:#a6c;background-color:#aa66ccc;filter:chroma(color="#FFFFFF");background:none repeat scroll 0 0 #f00;alpha:rgba(1,2,3,4);color:#12a}#AABBCC{background-color:#fe1;filter:chroma(color="#FFFFFF");color:#412;border-color:#aa66ccC}.foo #AABBCC{background-color:#fe1;color:#412;filter:chroma(color="#FFFFFF")}.bar,#AABBCC{background-color:#fe1;color:#412}.foo,#AABBCC.foobar{background-color:#fe1;color:#412}@media screen{.bar,#AABBCC{background-color:#fe1;color:#412}}

0 comments on commit cb68d77

Please sign in to comment.