? .DS_Store
? includes/.DS_Store
? includes/database/.DS_Store
? modules/search/.new.MKbmKA
? sites/all/.DS_Store
? sites/all/modules/.DS_Store
? sites/all/modules/content_browser
? sites/all/modules/devel
? sites/default/files
? sites/default/private
? sites/default/settings.php
Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.1077
diff -u -p -r1.1077 common.inc
--- includes/common.inc	4 Jan 2010 23:08:34 -0000	1.1077
+++ includes/common.inc	5 Jan 2010 17:08:22 -0000
@@ -3277,7 +3277,6 @@ function drupal_get_css($css = NULL) {
       $previous_item[$basename] = $key;
     }
   }
-
   // If CSS preprocessing is off, we still need to output the styles.
   // Additionally, go through any remaining styles if CSS preprocessing is on
   // and output the non-cached ones.
@@ -3290,7 +3289,9 @@ function drupal_get_css($css = NULL) {
   );
   $rendered_css = array();
   $inline_css = '';
-  $external_css = '';
+  $overflow_css = '';
+  $external_css = array();
+  $preprocessed_css = array();
   $preprocess_items = array();
   foreach ($css as $data => $item) {
     // Loop through each of the stylesheets, including them appropriately based
@@ -3302,7 +3303,7 @@ function drupal_get_css($css = NULL) {
           $element = $css_element;
           $element['#attributes']['media'] = $item['media'];
           $element['#attributes']['href'] = file_create_url($item['data']) . $query_string;
-          $rendered_css[] = theme('html_tag', array('element' => $element));
+          $rendered_css[] = $element;
         }
         else {
           $preprocess_items[$item['media']][] = $item;
@@ -3320,7 +3321,7 @@ function drupal_get_css($css = NULL) {
         $element = $css_element;
         $element['#attributes']['media'] = $item['media'];
         $element['#attributes']['href'] = $item['data'];
-        $external_css .= theme('html_tag', array('element' => $element));
+        $external_css[] = $element;
         break;
     }
   }
@@ -3333,9 +3334,44 @@ function drupal_get_css($css = NULL) {
       $element['#attributes']['media'] = $media;
       $filename = 'css_' . md5(serialize($items) . $query_string) . '.css';
       $element['#attributes']['href'] = file_create_url(drupal_build_css_cache($items, $filename));
-      $rendered_css['preprocess'] .= theme('html_tag', array('element' => $element));
+      $preprocessed_css[] = $element; 
     }
+    // Find the offset of the ['preprocess'] element.
+    $offsetByKey = array_flip(array_keys($rendered_css));
+    $offset = $offsetByKey['preprocess'];
+    // Insert $preprocessed_css.
+    $rendered_css = array_splice($rendered_css, $offset, 1, $preprocessed_css);
+  }
+
+  // IE ignores >30 <link> tags, so split the array.
+  $overflow_horizon = 30;
+  $stylesheet_elements = array_merge($rendered_css,$external_css);
+  $overflow_elements = variable_get('workaround_ie_limit', 1) ? array_splice($stylesheet_elements,$overflow_horizon) : array();
+
+  $stylesheets = '';
+  foreach ($stylesheet_elements as $element){
+    $stylesheets .= theme('html_tag', array('element' => $element)) . "\n";
+  }
+
+  $stylesheets_overflow = '';
+  foreach ($overflow_elements as $element){
+    $path = $element['#attributes']['href'];
+    $media = $element['#attributes']['media'];
+    $stylesheets_overflow .= theme('css_import', array('path' => $path, 'media' => $media));
+  }
+
+  if (!empty($stylesheets_overflow)) {
+    // Build a <style> tag containing @import statements for the overflow stylesheets.
+    $overflow_element = array(
+      '#tag' => 'style',
+      '#attributes' => array(
+        'type' => 'text/css',
+      ),
+      '#value' => $stylesheets_overflow,
+    );
+    $stylesheets_overflow = theme('html_tag', array('element' => $overflow_element));
   }
+
   // Enclose the inline CSS with the style tag if required.
   if (!empty($inline_css)) {
     $element = $css_element;
@@ -3344,9 +3380,8 @@ function drupal_get_css($css = NULL) {
     unset($element['#attributes']['rel']);
     $inline_css = "\n" . theme('html_tag', array('element' => $element));
   }
-
   // Output all the CSS files with the inline stylesheets showing up last.
-  return implode($rendered_css) . $external_css . $inline_css;
+  return $stylesheets . $stylesheets_overflow . $inline_css;
 }
 
 /**
@@ -5468,7 +5503,7 @@ function drupal_common_theme() {
       'variables' => array('url' => NULL, 'title' => NULL),
     ),
     'more_link' => array(
-      'variables' => array('url' => NULL, 'title' => NULL)
+      'variables' => array('url' => NULL, 'title' => NULL),
     ),
     'blocks' => array(
       'variables' => array('region' => NULL),
@@ -5485,6 +5520,9 @@ function drupal_common_theme() {
     'html_tag' => array(
       'render element' => 'element',
     ),
+    'css_import' => array(
+      'variables' => array('path' => NULL, 'media' => ''),
+    ),
     // from theme.maintenance.inc
     'maintenance_page' => array(
       'variables' => array('content' => NULL, 'show_messages' => TRUE),
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.562
diff -u -p -r1.562 theme.inc
--- includes/theme.inc	4 Jan 2010 16:20:20 -0000	1.562
+++ includes/theme.inc	5 Jan 2010 17:08:23 -0000
@@ -2033,12 +2033,24 @@ function theme_html_tag($variables) {
 }
 
 /**
+ * Generates code for a css import statement.
+ *
+ * @param $variables
+ *   An associative array containing:
+ *   - path: Path to css file.
+ *   - media: (optional) CSS media (ex. print, screen, etc.).
+ */
+function theme_css_import($variables) {
+  return '@import url("' . $variables['path'] . '") ' . $variables['media'] . ";\n";
+}
+
+/**
  * Returns code that emits the 'more' link used on blocks.
  *
  * @param $variables
  *   An associative array containing:
- *   - url: The url of the main page
- *   - title: A descriptive verb for the link, like 'Read more'
+ *   - url: The url of the main page.
+ *   - title: A descriptive verb for the link, like 'Read more'.
  */
 function theme_more_link($variables) {
   return '<div class="more-link">' . t('<a href="@link" title="@title">more</a>', array('@link' => check_url($variables['url']), '@title' => $variables['title'])) . '</div>';
Index: modules/system/system.admin.inc
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.admin.inc,v
retrieving revision 1.246
diff -u -p -r1.246 system.admin.inc
--- modules/system/system.admin.inc	4 Jan 2010 21:31:52 -0000	1.246
+++ modules/system/system.admin.inc	5 Jan 2010 17:08:25 -0000
@@ -1685,6 +1685,12 @@ function system_performance_settings() {
     '#default_value' => intval(variable_get('preprocess_css', 0) && $is_writable),
     '#disabled' => $disabled,
   );
+  $form['bandwidth_optimization']['workaround_ie_limit'] = array(
+    '#type' => 'checkbox',
+    '#title' => t('Employ workaround for this ' . l('IE stylesheet limit bug','http://support.microsoft.com/default.aspx?scid=kb;en-us;262161') . '.'),
+    '#description' => t('All stylesheets after the 30th will be included using the slower @import method.'),
+    '#default_value' => intval(variable_get('workaround_ie_limit', 1) && $is_writable),
+  );
   $form['bandwidth_optimization']['preprocess_js'] = array(
     '#type' => 'checkbox',
     '#title' => t('Aggregate JavaScript files into one file.'),
