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	8 Feb 2010 11:01:08 -0000
@@ -563,9 +563,12 @@
 
   /**
    * Tests rendering inline stylesheets with preprocessing on.
+   *
+   * @import command inside inline stylesheets should not be replaced with the
+   * contents of the actual stylesheet.
    */
   function testRenderInlinePreprocess() {
-    $css = 'body { padding: 0px; }';
+    $css = '@import url(modules/system/defaults.css); body { padding: 0px; }';
     $css_preprocessed = '<style type="text/css">' . drupal_load_stylesheet_content($css, TRUE) . '</style>';
     drupal_add_css($css, 'inline');
     $styles = drupal_get_css();
@@ -574,9 +577,12 @@
 
   /**
    * Tests rendering inline stylesheets with preprocessing off.
+   *
+   * @import command inside inline stylesheets should not be replaced with the
+   * contents of the actual stylesheet.
    */
   function testRenderInlineNoPreprocess() {
-    $css = 'body { padding: 0px; }';
+    $css = '@import url(modules/system/defaults.css); body { padding: 0px; }';
     drupal_add_css($css, array('type' => 'inline', 'preprocess' => FALSE));
     $styles = drupal_get_css();
     $this->assertTrue(strpos($styles, $css) > 0, t('Rendering non-preprocessed inline CSS adds it to the page.'));
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1101
diff -u -r1.1101 common.inc
--- includes/common.inc	7 Feb 2010 05:12:34 -0000	1.1101
+++ includes/common.inc	8 Feb 2010 11:01:08 -0000
@@ -3290,8 +3290,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.
@@ -3445,10 +3445,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);
 
