Index: wp-includes/class.wp-dependencies.php
===================================================================
--- wp-includes/class.wp-dependencies.php	(revision 18444)
+++ wp-includes/class.wp-dependencies.php	(working copy)
@@ -39,7 +39,7 @@
 		$this->all_deps( $handles );
 
 		foreach( $this->to_do as $key => $handle ) {
-			if ( !in_array($handle, $this->done) && isset($this->registered[$handle]) ) {
+			if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) {
 
 				if ( ! $this->registered[$handle]->src ) { // Defines a group.
 					$this->done[] = $handle;
Index: wp-includes/class.wp-scripts.php
===================================================================
--- wp-includes/class.wp-scripts.php	(revision 18444)
+++ wp-includes/class.wp-scripts.php	(working copy)
@@ -167,15 +167,7 @@
 	}
 
 	function do_footer_items() {
-		if ( !empty($this->in_footer) ) {
-			foreach( $this->in_footer as $key => $handle ) {
-				if ( !in_array($handle, $this->done, true) && isset($this->registered[$handle]) ) {
-					$this->do_item($handle);
-					$this->done[] = $handle;
-					unset( $this->in_footer[$key] );
-				}
-			}
-		}
+		$this->do_items(false, 1);
 		return $this->done;
 	}
 
Index: wp-includes/class.wp-styles.php
===================================================================
--- wp-includes/class.wp-styles.php	(revision 18444)
+++ wp-includes/class.wp-styles.php	(working copy)
@@ -122,5 +122,17 @@
 		}
 		return false;
 	}
+	
+	function do_footer_items() { // HTML 5 allows styles in the body, grab late enqueued items and output them in the footer.
+		$this->do_items(false, 1);
+		return $this->done;
+	}
 
+	function reset() {
+		$this->do_concat = false;
+		$this->concat = '';
+		$this->concat_version = '';
+		$this->print_html = '';
+	}
 }
+
Index: wp-includes/default-filters.php
===================================================================
--- wp-includes/default-filters.php	(revision 18444)
+++ wp-includes/default-filters.php	(working copy)
@@ -242,7 +242,7 @@
 add_action( 'do_robots',                  'do_robots'                      );
 add_action( 'sanitize_comment_cookies',   'sanitize_comment_cookies'       );
 add_action( 'admin_print_scripts',        'print_head_scripts',      20    );
-add_action( 'admin_print_footer_scripts', 'print_footer_scripts',    20    );
+add_action( 'admin_print_footer_scripts', 'wp_print_footer_scripts', 20    );
 add_action( 'admin_print_styles',         'print_admin_styles',      20    );
 add_action( 'init',                       'smilies_init',             5    );
 add_action( 'plugins_loaded',             'wp_maybe_load_widgets',    0    );
Index: wp-includes/script-loader.php
===================================================================
--- wp-includes/script-loader.php	(revision 18444)
+++ wp-includes/script-loader.php	(working copy)
@@ -474,7 +474,7 @@
 	$styles->content_url = defined('WP_CONTENT_URL')? WP_CONTENT_URL : '';
 	$styles->default_version = get_bloginfo( 'version' );
 	$styles->text_direction = function_exists( 'is_rtl' ) && is_rtl() ? 'rtl' : 'ltr';
-	$styles->default_dirs = array('/wp-admin/');
+	$styles->default_dirs = array('/wp-admin/', '/wp-includes/');
 
 	$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '.dev' : '';
 
@@ -723,7 +723,9 @@
  * @since 2.8
  */
 function wp_print_footer_scripts() {
-	return print_footer_scripts();
+	print_late_styles();
+	print_footer_scripts();
+	return true;
 }
 
 /**
@@ -752,23 +754,47 @@
 
 	$wp_styles->do_items(false);
 
-	if ( apply_filters('print_admin_styles', true) ) {
-		if ( !empty($wp_styles->concat) ) {
-			$dir = $wp_styles->text_direction;
-			$ver = md5("$wp_styles->concat_version{$dir}");
-			$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . "&ver=$ver";
-			echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
-		}
+	if ( apply_filters('print_admin_styles', true) )
+		_print_styles();
 
-		if ( !empty($wp_styles->print_html) )
-			echo $wp_styles->print_html;
-	}
+	$wp_styles->reset();
+	return $wp_styles->done;
+}
 
-	$wp_styles->do_concat = false;
-	$wp_styles->concat = $wp_styles->concat_version = $wp_styles->print_html = '';
+function print_late_styles() {
+	global $wp_styles, $concatenate_scripts;
+
+	if ( !is_a($wp_styles, 'WP_Styles') )
+		return;
+
+	$wp_styles->do_concat = $concatenate_scripts;
+	$wp_styles->do_footer_items();
+
+	if ( apply_filters('print_late_styles', true) )
+		_print_styles();
+
+	$wp_styles->reset();
 	return $wp_styles->done;
 }
 
+function _print_styles() {
+	global $wp_styles, $compress_css;
+
+	$zip = $compress_css ? 1 : 0;
+	if ( $zip && defined('ENFORCE_GZIP') && ENFORCE_GZIP )
+		$zip = 'gzip';
+
+	if ( !empty($wp_styles->concat) ) {
+		$dir = $wp_styles->text_direction;
+		$ver = md5("$wp_styles->concat_version{$dir}");
+		$href = $wp_styles->base_url . "/wp-admin/load-styles.php?c={$zip}&dir={$dir}&load=" . trim($wp_styles->concat, ', ') . "&ver=$ver";
+		echo "<link rel='stylesheet' href='" . esc_attr($href) . "' type='text/css' media='all' />\n";
+	}
+
+	if ( !empty($wp_styles->print_html) )
+		echo $wp_styles->print_html;
+}
+
 function script_concat_settings() {
 	global $concatenate_scripts, $compress_scripts, $compress_css;
 
