Index: wp-login.php
===================================================================
--- wp-login.php	(revision 21203)
+++ wp-login.php	(working copy)
@@ -85,10 +85,9 @@
 	// Don't allow interim logins to navigate away from the page.
 	if ( $interim_login )
 		$login_header_url = '#';
-
 	?>
 	</head>
-	<body class="login<?php if ( wp_is_mobile() ) echo ' mobile'; ?>">
+	<body <?php login_body_class(); ?>>
 	<div id="login">
 		<h1><a href="<?php echo esc_url( $login_header_url ); ?>" title="<?php echo esc_attr( $login_header_title ); ?>"><?php bloginfo( 'name' ); ?></a></h1>
 	<?php
@@ -343,20 +342,75 @@
 	return $user_id;
 }
 
+/**
+ * Retrieve current action.
+ *
+ * @since 3.5.0
+ * @access private
+ *
+ * @return string Requested action.
+ */
+function _get_login_action() {
+	$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : 'login';
+
+	if ( isset( $_GET['key'] ) )
+		$action = 'resetpass';
+
+	// validate action so as to default to the login screen
+	if ( ! in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
+		$action = 'login';
+
+	return $action;
+}
+
+/**
+ * Display the classes for the body element.
+ *
+ * @since 3.5.0
+ *
+ * @param string|array $class One or more classes to add to the class list.
+ */
+function login_body_class( $class = '' ) {
+	echo 'class="' . join( ' ', get_login_body_class( $class ) ) . '"';
+}
+
+/**
+ * Retrieve the classes for the body element as an array.
+ *
+ * @since 3.5.0
+ *
+ * @param string|array $class One or more classes to add to the class list.
+ * @return array Array of classes.
+ */
+function get_login_body_class( $class = '' ) {
+	$classes = array( 'login' );
+	
+	$classes[] = _get_login_action();
+	
+	if ( is_rtl() )
+		$classes[] = 'rtl';
+	
+	if ( wp_is_mobile() )
+		$classes[] = 'mobile';
+	
+	if ( ! empty( $class ) ) {
+		if ( ! is_array( $class ) )
+			$class = preg_split( '#\s+#', $class );
+		$classes = array_merge( $classes, $class );
+	}
+	
+	$classes = array_map( 'esc_attr', $classes );
+	
+	return array_unique( apply_filters( 'login_body_class', $classes, $class ) );
+}
+
 //
 // Main
 //
 
-$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
+$action = _get_login_action();
 $errors = new WP_Error();
 
-if ( isset($_GET['key']) )
-	$action = 'resetpass';
-
-// validate action so as to default to the login screen
-if ( !in_array( $action, array( 'postpass', 'logout', 'lostpassword', 'retrievepassword', 'resetpass', 'rp', 'register', 'login' ), true ) && false === has_filter( 'login_form_' . $action ) )
-	$action = 'login';
-
 nocache_headers();
 
 header('Content-Type: '.get_bloginfo('html_type').'; charset='.get_bloginfo('charset'));
