diff --git a/core/includes/common.inc b/core/includes/common.inc
index 52a3a43..13937bf 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2923,9 +2923,6 @@ function drupal_add_css($data = NULL, $options = NULL) {
       $options['preprocess'] = FALSE;
     }
 
-    // Always add a tiny value to the weight, to conserve the insertion order.
-    $options['weight'] += count($css) / 1000;
-
     // Add the data to the CSS array depending on the type.
     switch ($options['type']) {
       case 'inline':
@@ -3071,8 +3068,10 @@ function drupal_sort_css_js($a, $b) {
   elseif ($a['weight'] > $b['weight']) {
     return 1;
   }
+  // To preserve the original order for elements comparing as equal, return 1
+  // instead of 0.
   else {
-    return 0;
+    return 1;
   }
 }
 
@@ -4045,10 +4044,6 @@ function drupal_add_js($data = NULL, $options = NULL) {
   // Preprocess can only be set if caching is enabled.
   $options['preprocess'] = $options['cache'] ? $options['preprocess'] : FALSE;
 
-  // Tweak the weight so that files of the same weight are included in the
-  // order of the calls to drupal_add_js().
-  $options['weight'] += count($javascript) / 1000;
-
   if (isset($data)) {
     // Add jquery.js and drupal.js, as well as the basePath setting, the
     // first time a JavaScript file is added.
diff --git a/core/modules/simpletest/tests/common.test b/core/modules/simpletest/tests/common.test
index 4f20361..8b18d53 100644
--- a/core/modules/simpletest/tests/common.test
+++ b/core/modules/simpletest/tests/common.test
@@ -777,6 +777,9 @@ class CommonCascadingStylesheetsTestCase extends DrupalWebTestCase {
     $this->assert(strpos($styles, $simpletest . '/tests/system.base.css') !== FALSE, t('The overriding CSS file is output.'));
     $this->assert(strpos($styles, $system . '/system.base.css') === FALSE, t('The overridden CSS file is not output.'));
 
+    // If the static isn't cleared, the files will maintain the above order.
+    drupal_static_reset('drupal_add_css');
+
     drupal_add_css($simpletest . '/tests/system.base.css');
     drupal_add_css($system . '/system.base.css');
 
