Index: src/wp-admin/theme-editor.php
===================================================================
--- src/wp-admin/theme-editor.php	(revision 61450)
+++ src/wp-admin/theme-editor.php	(working copy)
@@ -98,13 +98,7 @@
 	}
 }
 
-// Move functions.php and style.css to the top.
-if ( isset( $allowed_files['functions.php'] ) ) {
-	$allowed_files = array( 'functions.php' => $allowed_files['functions.php'] ) + $allowed_files;
-}
-if ( isset( $allowed_files['style.css'] ) ) {
-	$allowed_files = array( 'style.css' => $allowed_files['style.css'] ) + $allowed_files;
-}
+ksort( $allowed_files );
 
 if ( empty( $file ) ) {
 	$relative_file = 'style.css';
Index: src/wp-admin/includes/misc.php
===================================================================
--- src/wp-admin/includes/misc.php	(revision 61450)
+++ src/wp-admin/includes/misc.php	(working copy)
@@ -364,6 +364,28 @@
  * @param array $allowed_files List of theme file paths.
  * @return array Tree structure for listing theme files.
  */
+function _wp_sort_file_tree( $tree ) {
+	if ( ! is_array( $tree ) ) {
+		return $tree;
+	}
+
+	$folders = array();
+	$files   = array();
+
+	foreach ( $tree as $key => $value ) {
+		if ( is_array( $value ) ) {
+			$folders[ $key ] = _wp_sort_file_tree( $value );
+		} else {
+			$files[ $key ] = $value;
+		}
+	}
+
+	ksort( $folders );
+	ksort( $files );
+
+	return $folders + $files;
+}
+
 function wp_make_theme_file_tree( $allowed_files ) {
 	$tree_list = array();
 
@@ -378,7 +400,7 @@
 		$last_dir = $file_name;
 	}
 
-	return $tree_list;
+	return _wp_sort_file_tree( $tree_list );
 }
 
 /**
@@ -483,7 +505,7 @@
 		$last_dir = $plugin_file;
 	}
 
-	return $tree_list;
+	return _wp_sort_file_tree( $tree_list );
 }
 
 /**
@@ -1080,7 +1102,7 @@
 		);
 	}
 
-	echo '<script>var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ";</script>\n";
+	echo '<script type="text/javascript">var _wpColorScheme = ' . wp_json_encode( array( 'icons' => $icon_colors ), JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) . ";</script>\n";
 }
 
 /**
