Permalink
Browse files

Don't transform CSS ID selectors. Fix #2528102.

  • Loading branch information...
1 parent d7953d5 commit 4c54e62890bc61d72122be044fd8c1e6fa83912b @reid reid committed May 26, 2011
@@ -240,12 +240,17 @@ public void compress(Writer out, int linebreakpos)
m = p.matcher(css);
sb = new StringBuffer();
while (m.find()) {
- // Test for AABBCC pattern
- if (m.group(3).equalsIgnoreCase(m.group(4)) &&
+ if (m.group(1).equals("}")) {
+ // Likely an ID selector. Don't touch.
+ // #AABBCC is a valid ID. IDs are case-sensitive.
+ m.appendReplacement(sb, m.group());
+ } else if (m.group(3).equalsIgnoreCase(m.group(4)) &&
m.group(5).equalsIgnoreCase(m.group(6)) &&
m.group(7).equalsIgnoreCase(m.group(8))) {
+ // #AABBCC pattern
m.appendReplacement(sb, (m.group(1) + m.group(2) + "#" + m.group(3) + m.group(5) + m.group(7)).toLowerCase());
} else {
+ // Any other color.
m.appendReplacement(sb, m.group().toLowerCase());
}
}
View
@@ -0,0 +1,12 @@
+#AddAddressForm {
+ padding: 0;
+}
+#AddAddressForm .messageBoxNeutral {
+ padding: 0;
+}
+#FeedbackMailForm{
+ padding: 0;
+}
+#FeedbackMailForm .classe{
+ margin: 0;
+}
@@ -0,0 +1 @@
+#AddAddressForm{padding:0}#AddAddressForm .messageBoxNeutral{padding:0}#FeedbackMailForm{padding:0}#FeedbackMailForm .classe{margin:0}

0 comments on commit 4c54e62

Please sign in to comment.