=== modified file 'includes/common.inc'
--- includes/common.inc	2009-07-31 07:27:59 +0000
+++ includes/common.inc	2009-07-31 16:01:53 +0000
@@ -2360,13 +2360,16 @@ function drupal_add_link($attributes) {
  *   - 'inline': A string of CSS that should be placed in the given scope. Note
  *     that it is better practice to use 'file' stylesheets, rather than 'inline'
  *     as the CSS would then be aggregated and cached.
+ *   - 'external': Include an external CSS file that is not hosted on the local
+ *     server. These files will not be aggregated if CSS aggregation is
+ *     enabled.
  *
  * @param $options
  *   (optional) A string defining the 'type' of CSS that is being added in the
  *   $data parameter ('file'/'inline'), or an array which can have any or all of
  *   the following keys:
- *   - 'type': The type of stylesheet being added. Available options are 'file'
- *     or 'inline'. Defaults to 'file'.
+ *   - 'type': The type of stylesheet being added. Available options are 'file',
+ *     'inline' or 'external'. Defaults to 'file'.
  *   - 'weight': The weight of the stylesheet specifies the order in which the
  *     CSS will appear when presented on the page.
  *
@@ -2391,7 +2394,8 @@ function drupal_add_link($attributes) {
  *     files into one file that is then compressed by removing all extraneous
  *     white space. Note that preprocessed inline stylesheets will not be
  *     aggregated into this single file, instead it will just be compressed
- *     when being output on the page.
+ *     when being output on the page. External stylesheets will not be
+ *     aggregated.
  *
  *     The reason for merging the CSS files is outlined quite thoroughly here:
  *     http://www.die.net/musings/page_load_time/
@@ -2438,14 +2442,16 @@ function drupal_add_css($data = NULL, $o
 
     // Add the data to the CSS array depending on the type.
     switch ($options['type']) {
-      case 'file':
-        $css[$data] = $options;
-        break;
       case 'inline':
         // For inline stylesheets, we don't want to use the $data as the array
         // key as $data could be a very long string of CSS.
         $css[] = $options;
         break;
+      default:
+        // Stylesheets of type "file" and "external" both use the location as the
+        // array item's key.
+        $css[$data] = $options;
+        break;
     }
   }
 
@@ -2513,6 +2519,7 @@ function drupal_get_css($css = NULL) {
   // Additionally, go through any remaining styles if CSS preprocessing is on and output the non-cached ones.
   $rendered_css = array();
   $inline_css = '';
+  $external_css = '';
   $preprocess_items = array();
   foreach ($css as $data => $item) {
     // Loop through each of the stylesheets, including them appropriately based
@@ -2534,6 +2541,10 @@ function drupal_get_css($css = NULL) {
         // Include inline stylesheets.
         $inline_css .= drupal_load_stylesheet_content($item['data'], $item['preprocess']);
         break;
+      case 'external':
+        // Preprocessing for external JavaScript files is ignored.
+        $external_css .= '<link type="text/css" rel="stylesheet" media="' . $item['media'] . '" href="' . $item['data'] . '" />' . "\n";
+        break;
     }
   }
 
@@ -2552,7 +2563,7 @@ function drupal_get_css($css = NULL) {
   }
 
   // Output all the CSS files with the inline stylesheets showing up last.
-  return implode("\n", $rendered_css) . $inline_css;
+  return implode("\n", $rendered_css) . $external_css . $inline_css;
 }
 
 /**

=== modified file 'modules/simpletest/tests/common.test'
--- modules/simpletest/tests/common.test	2009-07-30 19:57:09 +0000
+++ modules/simpletest/tests/common.test	2009-07-31 15:16:48 +0000
@@ -225,6 +225,15 @@ class CascadingStylesheetsTestCase exten
   }
 
   /**
+   * Tests adding an external stylesheet.
+   */
+  function testAddExternal() {
+    $path = 'http://example.com/style.css';
+    $css = drupal_add_css($path, 'external');
+    $this->assertEqual($css[$path]['type'], 'external', t('Adding an external CSS file caches it properly.'));
+  }
+
+  /**
    * Makes sure that reseting the CSS empties the cache.
    */
   function testReset() {
@@ -242,6 +251,15 @@ class CascadingStylesheetsTestCase exten
   }
 
   /**
+   * Tests rendering an external stylesheet.
+   */
+  function testRenderExternal() {
+    $css = 'http://example.com/style.css';
+    drupal_add_css($css, 'external');
+    $this->assertTrue(strpos(drupal_get_css(), 'href="' . $css) > 0, t('Rendering an external CSS file.'));
+  }
+
+  /**
    * Tests rendering inline stylesheets with preprocessing on.
    */
   function testRenderInlinePreprocess() {

