Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.101
diff -u -r1.101 common.test
--- modules/simpletest/tests/common.test	9 Jan 2010 23:36:55 -0000	1.101
+++ modules/simpletest/tests/common.test	14 Jan 2010 18:53:44 -0000
@@ -583,6 +583,21 @@
   }
 
   /**
+   * Tests rendering an inline stylesheet containing an @import command.
+   *
+   * @import command inside inline stylesheets should not be replaced with the
+   * contents of the actual stylesheet.
+   */
+  function testRenderInlineAtImport() {
+    $css = '@import url(modules/system/defaults.css);';
+    drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
+
+    $expected = "\n" . '<style type="text/css">@import url(modules/system/defaults.css);</style>' . "\n";
+    $styles = drupal_get_css();
+    $this->assertEqual($styles, $expected, t('Rendering inline CSS with @import command adds it to the page.'));
+  }
+
+  /**
    * Tests rendering inline stylesheets through a full page request.
    */
   function testRenderInlineFullPage() {
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1090
diff -u -r1.1090 common.inc
--- includes/common.inc	14 Jan 2010 18:45:17 -0000	1.1090
+++ includes/common.inc	14 Jan 2010 18:53:44 -0000
@@ -3319,8 +3319,8 @@
         }
         break;
       case 'inline':
-        // Include inline stylesheets.
-        $inline_css .= drupal_load_stylesheet_content($item['data'], $item['preprocess']);
+        // Include inline stylesheets, but don't resolve @import rules.
+        $inline_css .= drupal_load_stylesheet_content($item['data'], $item['preprocess'], FALSE);
         break;
       case 'external':
         // Preprocessing for external CSS files is ignored.
@@ -3474,10 +3474,13 @@
  * @param $optimize
  *   (optional) Boolean whether CSS contents should be minified. Defaults to
  *   FALSE.
+ * @param $flatten
+ *   (internal) Boolean whether @import rules should be replaced with the actual
+ *   stylesheet content. Defaults to TRUE.
  * @return
  *   Contents of the stylesheet including the imported stylesheets.
  */
-function drupal_load_stylesheet_content($contents, $optimize = FALSE) {
+function drupal_load_stylesheet_content($contents, $optimize = FALSE, $flatten = TRUE) {
   // Remove multiple charset declarations for standards compliance (and fixing Safari problems).
   $contents = preg_replace('/^@charset\s+[\'"](\S*)\b[\'"];/i', '', $contents);
 
