Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1235
diff -u -p -r1.1235 common.inc
--- includes/common.inc	6 Oct 2010 13:45:56 -0000	1.1235
+++ includes/common.inc	6 Oct 2010 19:13:22 -0000
@@ -3463,13 +3463,27 @@ function drupal_load_stylesheet_content(
     $double_quot = '"[^"\\\\]*(?:\\\\.[^"\\\\]*)*"';
     // Regexp to match single quoted strings.
     $single_quot = "'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'";
+    // Strip all comment blocks, but keep double/single quoted strings.
     $contents = preg_replace(
-      "<($double_quot|$single_quot)|$comment>Ss",  // Strip all comment blocks
-      "$1",                                        // but keep double/single
-      $contents);                                  // quoted strings.
-    $contents = preg_replace(
-      '<\s*([@{}:;,]|\)\s|\s\()\s*>S',             // Remove whitespace around separators,
-      '\1', $contents);                            // but keep space around parentheses.
+      "<($double_quot|$single_quot)|$comment>Ss",
+      "$1",
+      $contents
+    );
+    // Remove whitespace around separators, but keep space around parentheses.
+    $contents = preg_replace('<
+      \s*           # Any leading whitespace.
+      (             # Capture and keep:
+        [@{}:;,]    # - ?!?
+      |             # or
+        \)\s        # - Closing parenthesis + whitespace. (why?)
+      |             # or
+        \s\(        # - Whitespace + opening parenthesis. (huh?)
+      )
+      \s*
+    >xS',
+      '\1',
+      $contents
+    );
     // End the file with a new line.
     $contents .= "\n";
   }
Index: modules/simpletest/files/css_test_files/css_input_without_import.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/files/css_test_files/css_input_without_import.css,v
retrieving revision 1.2
diff -u -p -r1.2 css_input_without_import.css
--- modules/simpletest/files/css_test_files/css_input_without_import.css	10 Nov 2009 17:27:53 -0000	1.2
+++ modules/simpletest/files/css_test_files/css_input_without_import.css	6 Oct 2010 18:55:31 -0000
@@ -19,10 +19,9 @@ body {
 }
 
 /**
- * CSS spec says that all whitespace is valid whitespace, so this selector should be just as
- * good as the one above.
+ * CSS spec says that all whitespace is valid whitespace, so this selector
+ * should be just as good as the one above.
  */
-
 .this
 .is
 .a
@@ -31,6 +30,12 @@ font: 1em/100% Verdana, sans-serif;
 color: #494949;
 }
 
+some :pseudo .thing {
+  -moz-border-radius: 3px;
+  -webkit-border-radius: 3px;
+  border-radius: 3px;
+}
+
 textarea, select {
   font: 1em/160% Verdana, sans-serif;
   color: #494949;
Index: modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css,v
retrieving revision 1.3
diff -u -p -r1.3 css_input_without_import.css.optimized.css
--- modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css	21 Jun 2010 01:35:25 -0000	1.3
+++ modules/simpletest/files/css_test_files/css_input_without_import.css.optimized.css	6 Oct 2010 18:57:00 -0000
@@ -6,4 +6,4 @@
 body{margin:0;padding:0;background:#edf5fa;font:76%/170% Verdana,sans-serif;color:#494949;}.this .is .a .test{font:1em/100% Verdana,sans-serif;color:#494949;}.this
 .is
 .a
-.test{font:1em/100% Verdana,sans-serif;color:#494949;}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}
+.test{font:1em/100% Verdana,sans-serif;color:#494949;}some :pseudo .thing{-moz-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}textarea,select{font:1em/160% Verdana,sans-serif;color:#494949;}
Index: modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css,v
retrieving revision 1.2
diff -u -p -r1.2 css_input_without_import.css.unoptimized.css
--- modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css	10 Nov 2009 17:27:53 -0000	1.2
+++ modules/simpletest/files/css_test_files/css_input_without_import.css.unoptimized.css	6 Oct 2010 18:55:49 -0000
@@ -19,10 +19,9 @@ body {
 }
 
 /**
- * CSS spec says that all whitespace is valid whitespace, so this selector should be just as
- * good as the one above.
+ * CSS spec says that all whitespace is valid whitespace, so this selector
+ * should be just as good as the one above.
  */
-
 .this
 .is
 .a
@@ -31,6 +30,12 @@ font: 1em/100% Verdana, sans-serif;
 color: #494949;
 }
 
+some :pseudo .thing {
+  -moz-border-radius: 3px;
+  -webkit-border-radius: 3px;
+  border-radius: 3px;
+}
+
 textarea, select {
   font: 1em/160% Verdana, sans-serif;
   color: #494949;
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.129
diff -u -p -r1.129 common.test
--- modules/simpletest/tests/common.test	5 Oct 2010 19:59:10 -0000	1.129
+++ modules/simpletest/tests/common.test	6 Oct 2010 18:53:03 -0000
@@ -862,11 +862,10 @@ class CascadingStylesheetsUnitTest exten
   /**
    * Tests basic CSS loading with and without optimization via drupal_load_stylesheet().
    *
-   * This can be enhanced by adding additional CSS files with variant test cases.
-   * Currently, this is specifically testing to make sure that whitespace
-   * is treated with adequate respect (see http://drupal.org/node/472820) and
-   * that image paths in imported files are preserved (see
-   * http://drupal.org/node/265719).
+   * Known tests:
+   * - Retain white-space in selectors. (http://drupal.org/node/472820)
+   * - Proper URLs in imported files. (http://drupal.org/node/265719)
+   * - Retain pseudo-selectors. (http://drupal.org/node/460448)
    */
   function testLoadCssBasic() {
     // Array of files to test living in 'simpletest/files/css_test_files/'.
