diff --git a/includes/common.inc b/includes/common.inc
index 0c6fd0ab796e529c0224cf0f7d44e8bb49c29058..33e83d1de59f19f1b99e6f10333efa9995dffda0 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1731,55 +1731,84 @@ function drupal_add_link($attributes) {
  *   file added to the list, if exists in the same directory. This CSS file
  *   should contain overrides for properties which should be reversed or
  *   otherwise different in a right-to-left display.
- * @param $type
- *   (optional) The type of stylesheet that is being added. Types are: module
- *   or theme.
- * @param $media
- *   (optional) The media type for the stylesheet, e.g., all, print, screen.
- * @param $preprocess
- *   (optional) Should this CSS file be aggregated and compressed if this
- *   feature has been turned on under the performance section?
- *
- *   What does this actually mean?
- *   CSS preprocessing is the process of aggregating a bunch of separate CSS
- *   files into one file that is then compressed by removing all extraneous
- *   white space.
- *
- *   The reason for merging the CSS files is outlined quite thoroughly here:
- *   http://www.die.net/musings/page_load_time/
- *   "Load fewer external objects. Due to request overhead, one bigger file
- *   just loads faster than two smaller ones half its size."
- *
- *   However, you should *not* preprocess every file as this can lead to
- *   redundant caches. You should set $preprocess = FALSE when:
- *
- *     - Your styles are only used rarely on the site. This could be a special
- *       admin page, the homepage, or a handful of pages that does not represent
- *       the majority of the pages on your site.
- *
- *   Typical candidates for caching are for example styles for nodes across
- *   the site, or used in the theme.
+ * @param $options
+ *   (optional) A string defining the type of CSS that is being added in the
+ *   $path parameter ('module' or 'theme'), or an associative array of
+ *   additional options, with the following keys:
+ *     - 'type'
+ *       The type of stylesheet that is being added. Types are: module or
+ *       theme. Defaults to 'module'.
+ *     - 'media'
+ *       The media type for the stylesheet, e.g., all, print, screen. Defaults
+ *       to 'all'.
+ *     - 'preprocess':
+ *       Allow this CSS file to be aggregated and compressed if the Optimize
+ *       CSS feature has been turned on under the performance section. Defaults
+ *       to TRUE.
+ *
+ *       What does this actually mean?
+ *       CSS preprocessing is the process of aggregating a bunch of separate CSS
+ *       files into one file that is then compressed by removing all extraneous
+ *       white space.
+ *
+ *       The reason for merging the CSS files is outlined quite thoroughly here:
+ *       http://www.die.net/musings/page_load_time/
+ *       "Load fewer external objects. Due to request overhead, one bigger file
+ *       just loads faster than two smaller ones half its size."
+ *
+ *       However, you should *not* preprocess every file as this can lead to
+ *       redundant caches. You should set $preprocess = FALSE when your styles
+ *       are only used rarely on the site. This could be a special admin page,
+ *       the homepage, or a handful of pages that does not represent the
+ *       majority of the pages on your site.
+ *
+ *       Typical candidates for caching are for example styles for nodes across
+ *       the site, or used in the theme.
+ * @param $reset
+ *   (optional) Resets the currently loaded cascading stylesheets.
  * @return
  *   An array of CSS files.
  */
-function drupal_add_css($path = NULL, $type = 'module', $media = 'all', $preprocess = TRUE) {
+function drupal_add_css($path = NULL, $options = NULL, $reset = FALSE) {
   static $css = array();
   global $language;
 
+  // Request made to reset the CSS added so far.
+  if ($reset) {
+    $css = array();
+  }
+
   // Create an array of CSS files for each media type first, since each type needs to be served
   // to the browser differently.
   if (isset($path)) {
+    // Construct the options, taking the defaults into consideration.
+    if (isset($options)) {
+      if (!is_array($options)) {
+        $options = array('type' => $options);
+      }
+    }
+    else {
+      $options = array();
+    }
+    $options += array(
+      'type' => 'module',
+      'media' => 'all',
+      'preprocess' => TRUE
+    );  
+    $media = $options['media'];
+    $type = $options['type'];
+
     // This check is necessary to ensure proper cascading of styles and is faster than an asort().
     if (!isset($css[$media])) {
       $css[$media] = array('module' => array(), 'theme' => array());
     }
-    $css[$media][$type][$path] = $preprocess;
+    $css[$media][$type][$path] = $options['preprocess'];
 
     // If the current language is RTL, add the CSS file with RTL overrides.
     if (defined('LANGUAGE_RTL') && $language->direction == LANGUAGE_RTL) {
       $rtl_path = str_replace('.css', '-rtl.css', $path);
       if (file_exists($rtl_path)) {
-        $css[$media][$type][$rtl_path] = $preprocess;
+        $css[$media][$type][$rtl_path] = $options['preprocess'];
       }
     }
   }
diff --git a/includes/locale.inc b/includes/locale.inc
index 37b634c02620b6773db6c6fc53965d32e9842951..00db655f7f9388f5a84ece8f00f84250396a9e67 100644
--- a/includes/locale.inc
+++ b/includes/locale.inc
@@ -2215,7 +2215,7 @@ function _locale_rebuild_js($langcode = NULL) {
  */
 function _locale_translate_language_list($translation, $limit_language) {
   // Add CSS
-  drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'locale') . '/locale.css', array('preprocess' => FALSE));
 
   $languages = language_list();
   unset($languages['en']);
diff --git a/includes/theme.inc b/includes/theme.inc
index b90cf224d2b3aeca296b9715243f7774e902540c..ac6f955806a401f8e42c259f62639c062cdb778c 100644
--- a/includes/theme.inc
+++ b/includes/theme.inc
@@ -133,7 +133,7 @@ function _init_theme($theme, $base_theme = array(), $registry_callback = '_theme
   // And now add the stylesheets properly
   foreach ($final_stylesheets as $media => $stylesheets) {
     foreach ($stylesheets as $stylesheet) {
-      drupal_add_css($stylesheet, 'theme', $media);
+      drupal_add_css($stylesheet, array('type' => 'theme', 'media' => $media));
     }
   }
 
diff --git a/includes/theme.maintenance.inc b/includes/theme.maintenance.inc
index 713320cf656153795e256f6b96a001c01357173b..f64fd42455248c8cebb9abd4d481207d67153bac 100644
--- a/includes/theme.maintenance.inc
+++ b/includes/theme.maintenance.inc
@@ -62,11 +62,11 @@ function _drupal_maintenance_theme() {
 
   // These are usually added from system_init() -except maintenance.css.
   // When the database is inactive it's not called so we add it here.
-  drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/system.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/maintenance.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/admin.css');
 }
 
 /**
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index a8f515d031eb993e26349496b560c79100e3f754..9e16f8af62a7e0bdee5b36cf189093fc5fbf54cb 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -28,7 +28,7 @@ function block_admin_display($theme = NULL) {
 function block_admin_display_form(&$form_state, $blocks, $theme = NULL) {
   global $theme_key, $custom_theme;
 
-  drupal_add_css(drupal_get_path('module', 'block') . '/block.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'block') . '/block.css', array('preprocess' => FALSE));
 
   // If non-default theme configuration has been selected, set the custom theme.
   $custom_theme = isset($theme) ? $theme : variable_get('theme_default', 'garland');
diff --git a/modules/color/color.module b/modules/color/color.module
index e99f907fc9d0db742d7cf994710eb25521fc9a6b..51c894e514dd2975f662146f397c08a6998ea42e 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -153,11 +153,11 @@ function color_scheme_form(&$form_state, $theme) {
   $info = color_get_info($theme);
 
   // Add Farbtastic color picker.
-  drupal_add_css('misc/farbtastic/farbtastic.css', 'module', 'all', FALSE);
+  drupal_add_css('misc/farbtastic/farbtastic.css', array('preprocess' => FALSE));
   drupal_add_js('misc/farbtastic/farbtastic.js');
 
   // Add custom CSS and JS.
-  drupal_add_css($base . '/color.css', 'module', 'all', FALSE);
+  drupal_add_css($base . '/color.css', array('preprocess' => FALSE));
   drupal_add_js($base . '/color.js');
   drupal_add_js(array('color' => array(
     'reference' => color_get_palette($theme, TRUE)
diff --git a/modules/dblog/dblog.module b/modules/dblog/dblog.module
index 7fbee34bc49603f3921a5ae3f4e8b3cbf806f903..5f3623e5312089c1824927e04d8280e63104e511 100644
--- a/modules/dblog/dblog.module
+++ b/modules/dblog/dblog.module
@@ -83,7 +83,7 @@ function dblog_menu() {
 function dblog_init() {
   if (arg(0) == 'admin' && arg(1) == 'reports') {
     // Add the CSS for this module
-    drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', 'module', 'all', FALSE);
+    drupal_add_css(drupal_get_path('module', 'dblog') . '/dblog.css', array('preprocess' => FALSE));
   }
 }
 
diff --git a/modules/help/help.admin.inc b/modules/help/help.admin.inc
index 701f8fabc780ce9103aaff02c1a4196968329ad0..5b038c729f4247f4185a74486f5292b41f43be2e 100644
--- a/modules/help/help.admin.inc
+++ b/modules/help/help.admin.inc
@@ -11,7 +11,7 @@
  */
 function help_main() {
   // Add CSS
-  drupal_add_css(drupal_get_path('module', 'help') . '/help.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'help') . '/help.css', array('preprocess' => FALSE));
   $output = '<h2>' . t('Help topics') . '</h2><p>' . t('Help is available on the following items:') . '</p>' . help_links_as_list();
   return $output;
 }
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index 3af31b0d6fe644c7051967a7b59295d4f49e797b..d02c60b23b5e3e75c847c72e321e5b8a803c05b4 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -75,7 +75,7 @@ function openid_user_insert(&$edit, &$account, $category = NULL) {
  */
 function openid_form_alter(&$form, $form_state, $form_id) {
   if ($form_id == 'user_login_block' || $form_id == 'user_login') {
-    drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
+    drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css');
     drupal_add_js(drupal_get_path('module', 'openid') . '/openid.js');
     if (!empty($form_state['post']['openid_identifier'])) {
       $form['name']['#required'] = FALSE;
diff --git a/modules/openid/openid.pages.inc b/modules/openid/openid.pages.inc
index efd7684eee2a04dda918c8a691c81fc80767dc5e..28c8f947b9155e38482dbfa517116cd74875f999 100644
--- a/modules/openid/openid.pages.inc
+++ b/modules/openid/openid.pages.inc
@@ -29,7 +29,7 @@ function openid_authentication_page() {
  */
 function openid_user_identities($account) {
   drupal_set_title($account->name);
-  drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'openid') . '/openid.css');
 
   // Check to see if we got a response
   $result = openid_complete();
diff --git a/modules/search/search.module b/modules/search/search.module
index 6846f8f65611731d4077c1ed3ae177bb7df9f34f..c96dfbfa71b60be5c61392c70aadbea950edd45e 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -1031,7 +1031,7 @@ function search_get_keys() {
 function search_form(&$form_state, $action = '', $keys = '', $type = NULL, $prompt = NULL) {
 
   // Add CSS
-  drupal_add_css(drupal_get_path('module', 'search') . '/search.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'search') . '/search.css', array('preprocess' => FALSE));
 
   if (!$action) {
     $action = url('search/' . $type);
diff --git a/modules/simpletest/simpletest.module b/modules/simpletest/simpletest.module
index 372ad1f3f213a3bba13dfd99267972a2d9d972a7..c1752b84f6560f6e6e6b46183c95657d03a50aa9 100644
--- a/modules/simpletest/simpletest.module
+++ b/modules/simpletest/simpletest.module
@@ -199,7 +199,7 @@ function simpletest_test_form() {
 }
 
 function theme_simpletest_test_table($table) {
-  drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'simpletest') . '/simpletest.css');
   drupal_add_js(drupal_get_path('module', 'simpletest') . '/simpletest.js', 'module');
 
   // Create header for test selection table.
diff --git a/modules/simpletest/tests/common.test b/modules/simpletest/tests/common.test
index 74e053cf98eae6b0bfa0281cbc35cfd017ce0e52..6a82018db58ac822dc189fdd18d511442eaae9ec 100644
--- a/modules/simpletest/tests/common.test
+++ b/modules/simpletest/tests/common.test
@@ -114,6 +114,56 @@ class DrupalTagsHandlingTestCase extends DrupalWebTestCase {
   }
 }
 
+/**
+ * Test the Drupal CSS system.
+ */
+class CascadingStylesheetsTestCase extends DrupalWebTestCase {
+  /**
+   * Implementation of getInfo().
+   */
+  function getInfo() {
+    return array(
+      'name' => t('Cascading stylesheets'),
+      'description' => t('Tests adding various cascading stylesheets to the page.'),
+      'group' => t('System')
+    );
+  }
+
+  /**
+   * Implementation of setUp().
+   */
+  function setUp() {
+    parent::setUp();
+    // Reset drupal_add_css() before each test.
+    drupal_add_css(NULL, NULL, TRUE);
+  }
+
+  /**
+   * Check default stylesheets as empty.
+   */
+  function testDefault() {
+    $this->assertEqual(array(), drupal_add_css(), t('Default CSS is empty.'));
+  }
+
+  /**
+   * Tests adding a file stylesheet.
+   */
+  function testAddFile() {
+    $path = drupal_get_path('module', 'simpletest') . '/simpletest.css';
+    $css = drupal_add_css($path);
+    $this->assertEqual($css['all']['module'][$path], TRUE, t('Adding a CSS file caches it properly.'));
+  }
+
+  /**
+   * Tests rendering the stylesheets.
+   */
+  function testRenderFile() {
+    $css = drupal_get_path('module', 'simpletest') . '/simpletest.css';
+    drupal_add_css($css);
+    $this->assertTrue(strpos(drupal_get_css(), $css) > 0, t('Rendered CSS includes the added stylesheet.'));
+  }
+}
+
 /**
  * Test drupal_http_request().
  */
diff --git a/modules/system/system.module b/modules/system/system.module
index 633623a4bb62232f9c665393efbda256339595fd..ed9dda45b7a97393165216ea253eadd01a2451e6 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -706,13 +706,13 @@ function system_init() {
   if (arg(0) == 'admin' || (variable_get('node_admin_theme', '0') && arg(0) == 'node' && (arg(1) == 'add' || arg(2) == 'edit'))) {
     global $custom_theme;
     $custom_theme = variable_get('admin_theme', '0');
-    drupal_add_css(drupal_get_path('module', 'system') . '/admin.css', 'module');
+    drupal_add_css(drupal_get_path('module', 'system') . '/admin.css');
   }
 
   // Add the CSS for this module.
-  drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/system.css', 'module');
-  drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'system') . '/defaults.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/system.css');
+  drupal_add_css(drupal_get_path('module', 'system') . '/system-menus.css');
 }
 
 /**
diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc
index 027b3941928534670995a8ee8b44efd2b623e7d3..5a7fd3f3c7f92e41b676226be9cb7d941ccf70d9 100644
--- a/modules/tracker/tracker.pages.inc
+++ b/modules/tracker/tracker.pages.inc
@@ -12,7 +12,7 @@
  */
 function tracker_page($account = NULL, $set_title = FALSE) {
   // Add CSS
-  drupal_add_css(drupal_get_path('module', 'tracker') . '/tracker.css', 'module', 'all', FALSE);
+  drupal_add_css(drupal_get_path('module', 'tracker') . '/tracker.css', array('preprocess' => FALSE));
 
   if ($account) {
     if ($set_title) {
diff --git a/modules/user/user.module b/modules/user/user.module
index a8c9de8be437f72a862056e6947babcd3f84f800..351a7fe907383d3f8af858e0157e5e6ebe4d197f 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1120,7 +1120,7 @@ function user_menu() {
 }
 
 function user_init() {
-  drupal_add_css(drupal_get_path('module', 'user') . '/user.css', 'module');
+  drupal_add_css(drupal_get_path('module', 'user') . '/user.css');
 }
 
 function user_uid_optional_load($arg) {