Index: src/wp-admin/css/forms.css
===================================================================
--- src/wp-admin/css/forms.css	(revision 42379)
+++ src/wp-admin/css/forms.css	(working copy)
@@ -443,6 +443,10 @@
 	vertical-align: baseline;
 }
 
+.wp-generate-pw + .wp-pwd {
+	margin-top: 1em;
+}
+
 #pass-strength-result {
 	background-color: #eee;
 	border: 1px solid #ddd;
Index: src/wp-admin/css/login.css
===================================================================
--- src/wp-admin/css/login.css	(revision 42379)
+++ src/wp-admin/css/login.css	(working copy)
@@ -74,24 +74,34 @@
 }
 
 .login .password-input-wrapper {
-    display: table;
+	display: table;
 }
 
 .login .input.password-input {
-    display: table-cell;
-    margin: 0;
+	display: table-cell;
+	margin: 0;
 }
 
 .login .pw-weak {
-    margin-bottom: 15px;
+	margin-bottom: 15px;
 }
 
+.login .wp-hide-pw-wrapper {
+	display: table-cell;
+	vertical-align: top;
+}
+
 .login .button.button-secondary {
-    display: table-cell;
-    border-radius: 0;
-    vertical-align: middle;
+	height: 36px;
+	margin: 0;
+	border-radius: 0;
+	line-height: normal;
 }
 
+.login .wp-hide-pw .dashicons {
+	position: static;
+}
+
 .login form {
 	margin-top: 20px;
 	margin-left: 0;
Index: src/wp-admin/install.php
===================================================================
--- src/wp-admin/install.php	(revision 42379)
+++ src/wp-admin/install.php	(working copy)
@@ -137,7 +137,7 @@
 		<?php if ( ! $user_table ) : ?>
 		<tr class="form-field form-required user-pass1-wrap">
 			<th scope="row">
-				<label for="pass1">
+				<label for="pass1" class="user-pass1-label">
 					<?php _e( 'Password' ); ?>
 				</label>
 			</th>
Index: src/wp-admin/js/user-profile.js
===================================================================
--- src/wp-admin/js/user-profile.js	(revision 42379)
+++ src/wp-admin/js/user-profile.js	(working copy)
@@ -1,7 +1,6 @@
 /* global ajaxurl, pwsL10n, userProfileL10n */
 (function($) {
 	var updateLock = false,
-
 		$pass1Row,
 		$pass1Wrap,
 		$pass1,
@@ -14,7 +13,8 @@
 		$submitButtons,
 		$submitButton,
 		currentPass,
-		inputEvent;
+		inputEvent,
+		$passwordWrapper;
 
 	/*
 	 * Use feature detection to determine whether password inputs should use
@@ -31,21 +31,23 @@
 		if ( typeof zxcvbn !== 'function' ) {
 			setTimeout( generatePassword, 50 );
 			return;
-		} else if ( ! $pass1.val() ) {
+		} else if ( ! $pass1.val() || $passwordWrapper.hasClass( 'is-open' ) ) {
 			// zxcvbn loaded before user entered password.
 			$pass1.val( $pass1.data( 'pw' ) );
 			$pass1.trigger( 'pwupdate' );
 			showOrHideWeakPasswordCheckbox();
-		}
-		else {
+		} else {
 			// zxcvbn loaded after the user entered password, check strength.
 			check_pass_strength();
 			showOrHideWeakPasswordCheckbox();
 		}
 
+		// Install screen.
 		if ( 1 !== parseInt( $toggleButton.data( 'start-masked' ), 10 ) ) {
+			// Show the password not masked if admin_password hasn't been posted yet.
 			$pass1Wrap.addClass( 'show-password' );
 		} else {
+			// Otherwise, mask the password.
 			$toggleButton.trigger( 'click' );
 		}
 
@@ -109,8 +111,6 @@
 				.removeClass( 'dashicons-visibility' )
 				.addClass( 'dashicons-hidden' );
 
-		$pass1Text.focus();
-
 		$pass1Label.attr( 'for', 'pass1-text' );
 	}
 
@@ -121,10 +121,6 @@
 				$pass1Wrap.addClass( 'show-password' );
 
 				resetToggle();
-
-				if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
-					$pass1Text[0].setSelectionRange( 0, 100 );
-				}
 			} else {
 				$pass1Wrap.removeClass( 'show-password' );
 				$toggleButton
@@ -139,26 +135,19 @@
 						.removeClass('dashicons-hidden')
 						.addClass('dashicons-visibility');
 
-				$pass1.focus();
-
 				$pass1Label.attr( 'for', 'pass1' );
-
-				if ( ! _.isUndefined( $pass1[0].setSelectionRange ) ) {
-					$pass1[0].setSelectionRange( 0, 100 );
-				}
 			}
 		});
 	}
 
 	function bindPasswordForm() {
-		var $passwordWrapper,
-			$generateButton,
+		var $generateButton,
 			$cancelButton;
 
 		$pass1Row = $('.user-pass1-wrap');
-		$pass1Label = $pass1Row.find('th label').attr( 'for', 'pass1-text' );
+		$pass1Label = $pass1Row.find( '.user-pass1-label' ).attr( 'for', 'pass1-text' );
 
-		// hide this
+		// Hide the Repeat Password field.
 		$('.user-pass2-wrap').hide();
 
 		$submitButton = $( '#submit, #wp-submit' ).on( 'click', function () {
@@ -178,7 +167,7 @@
 			bindPass1();
 		}
 
-		/**
+		/*
 		 * Fix a LastPass mismatch issue, LastPass only changes pass2.
 		 *
 		 * This fixes the issue by copying any changes from the hidden
@@ -205,32 +194,28 @@
 
 		bindToggleButton();
 
-		if ( $generateButton.length ) {
-			$passwordWrapper.hide();
-		}
-
-		$generateButton.show();
 		$generateButton.on( 'click', function () {
 			updateLock = true;
 
-			$generateButton.hide();
-			$passwordWrapper.show();
+			$generateButton.attr( 'aria-expanded', 'true' );
 
+			$passwordWrapper
+				.show()
+				.addClass( 'is-open' );
+
 			// Enable the inputs when showing.
 			$pass1.attr( 'disabled', false );
 			$pass2.attr( 'disabled', false );
 			$pass1Text.attr( 'disabled', false );
 
-			if ( $pass1Text.val().length === 0 ) {
-				generatePassword();
-			}
-
-			_.defer( function() {
-				$pass1Text.focus();
-				if ( ! _.isUndefined( $pass1Text[0].setSelectionRange ) ) {
-					$pass1Text[0].setSelectionRange( 0, 100 );
-				}
-			}, 0 );
+			// Always generate a password when clicking the button.
+			// Generate a new password.
+			wp.ajax.post( 'generate-password' )
+				.done( function( data ) {
+					$pass1.data( 'pw', data );
+					generatePassword();
+					resetToggle();
+				} );
 		} );
 
 		$cancelButton = $pass1Row.find( 'button.wp-cancel-pw' );
@@ -237,34 +222,9 @@
 		$cancelButton.on( 'click', function () {
 			updateLock = false;
 
-			// Clear any entered password.
+			// Clear password field to prevent update.
 			$pass1Text.val( '' );
-
-			// Generate a new password.
-			wp.ajax.post( 'generate-password' )
-				.done( function( data ) {
-					$pass1.data( 'pw', data );
-				} );
-
-			$generateButton.show();
-			$passwordWrapper.hide();
-
-			$weakRow.hide( 0, function () {
-				$weakCheckbox.removeProp( 'checked' );
-			} );
-
-			// Disable the inputs when hiding to prevent autofill and submission.
-			$pass1.prop( 'disabled', true );
-			$pass2.prop( 'disabled', true );
-			$pass1Text.prop( 'disabled', true );
-
-			resetToggle();
-
-			if ( $pass1Row.closest( 'form' ).is( '#your-profile' ) ) {
-				// Clear password field to prevent update
-				$pass1.val( '' ).trigger( 'pwupdate' );
-				$submitButtons.prop( 'disabled', false );
-			}
+			$pass1.val( '' ).trigger( 'pwupdate' );
 		} );
 
 		$pass1Row.closest( 'form' ).on( 'submit', function () {
@@ -373,8 +333,9 @@
 				});
 			});
 
-			/**
-			 * Replaces "Howdy, *" in the admin toolbar whenever the display name dropdown is updated for one's own profile.
+			/*
+			 * Replaces "Howdy, *" in the admin toolbar whenever the display name
+			 * dropdown is updated for one's own profile.
 			 */
 			select.on( 'change', function() {
 				if ( user_id !== current_user_id ) {
@@ -460,7 +421,7 @@
 
 	window.generatePassword = generatePassword;
 
-	/* Warn the user if password was generated but not saved */
+	// Warn the user if password was generated but not saved.
 	$( window ).on( 'beforeunload', function () {
 		if ( true === updateLock ) {
 			return userProfileL10n.warn;
Index: src/wp-admin/user-edit.php
===================================================================
--- src/wp-admin/user-edit.php	(revision 42379)
+++ src/wp-admin/user-edit.php	(working copy)
@@ -601,10 +601,10 @@
 	<h2><?php _e( 'Account Management' ); ?></h2>
 <table class="form-table">
 <tr id="password" class="user-pass1-wrap">
-	<th><label for="pass1"><?php _e( 'New Password' ); ?></label></th>
+	<th><label for="pass1" class="user-pass1-label"><?php _e( 'New Password' ); ?></label></th>
 	<td>
 		<input class="hidden" value=" " /><!-- #24364 workaround -->
-		<button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Generate Password' ); ?></button>
+		<button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="false"><?php _e( 'Set New Password' ); ?></button>
 		<div class="wp-pwd hide-if-js">
 			<span class="password-input-wrapper">
 				<input type="password" name="pass1" id="pass1" class="regular-text" value="" autocomplete="off" data-pw="<?php echo esc_attr( wp_generate_password( 24 ) ); ?>" aria-describedby="pass-strength-result" />
@@ -613,7 +613,7 @@
 				<span class="dashicons dashicons-hidden"></span>
 				<span class="text"><?php _e( 'Hide' ); ?></span>
 			</button>
-			<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+			<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel' ); ?>">
 				<span class="text"><?php _e( 'Cancel' ); ?></span>
 			</button>
 			<div style="display:none" id="pass-strength-result" aria-live="polite"></div>
@@ -623,8 +623,12 @@
 <tr class="user-pass2-wrap hide-if-js">
 	<th scope="row"><label for="pass2"><?php _e( 'Repeat New Password' ); ?></label></th>
 	<td>
-	<input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" />
-	<p class="description"><?php _e( 'Type your new password again.' ); ?></p>
+	<input name="pass2" type="password" id="pass2" class="regular-text" value="" autocomplete="off" aria-describedby="pass2-desc" />
+	<?php if ( IS_PROFILE_PAGE ) : ?>
+		<p class="description" id="pass2-desc"><?php _e( 'Type your new password again.' ); ?></p>
+	<?php else : ?>
+		<p class="description" id="pass2-desc"><?php _e( 'Type the new password again.' ); ?></p>
+	<?php endif; ?>
 	</td>
 </tr>
 <tr class="pw-weak">
@@ -632,7 +636,7 @@
 	<td>
 		<label>
 			<input type="checkbox" name="pw_weak" class="pw-checkbox" />
-			<span id="pw-weak-text-label"><?php _e( 'Confirm use of potentially weak password' ); ?></span>
+			<span id="pw-weak-text-label"><?php _e( 'Confirm use of weak password' ); ?></span>
 		</label>
 	</td>
 </tr>
Index: src/wp-admin/user-new.php
===================================================================
--- src/wp-admin/user-new.php	(revision 42379)
+++ src/wp-admin/user-new.php	(working copy)
@@ -485,7 +485,7 @@
 	</tr>
 	<tr class="form-field form-required user-pass1-wrap">
 		<th scope="row">
-			<label for="pass1">
+			<label for="pass1" class="user-pass1-label">
 				<?php _e( 'Password' ); ?>
 				<span class="description hide-if-js"><?php _e( '(required)' ); ?></span>
 			</label>
@@ -492,7 +492,7 @@
 		</th>
 		<td>
 			<input class="hidden" value=" " /><!-- #24364 workaround -->
-			<button type="button" class="button wp-generate-pw hide-if-no-js"><?php _e( 'Show password' ); ?></button>
+			<button type="button" class="button wp-generate-pw hide-if-no-js" aria-expanded="false"><?php _e( 'Set New Password' ); ?></button>
 			<div class="wp-pwd hide-if-js">
 				<?php $initial_password = wp_generate_password( 24 ); ?>
 				<span class="password-input-wrapper">
@@ -502,7 +502,7 @@
 					<span class="dashicons dashicons-hidden"></span>
 					<span class="text"><?php _e( 'Hide' ); ?></span>
 				</button>
-				<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel password change' ); ?>">
+				<button type="button" class="button wp-cancel-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Cancel' ); ?>">
 					<span class="text"><?php _e( 'Cancel' ); ?></span>
 				</button>
 				<div style="display:none" id="pass-strength-result" aria-live="polite"></div>
@@ -512,7 +512,8 @@
 	<tr class="form-field form-required user-pass2-wrap hide-if-js">
 		<th scope="row"><label for="pass2"><?php _e( 'Repeat Password' ); ?> <span class="description"><?php _e( '(required)' ); ?></span></label></th>
 		<td>
-		<input name="pass2" type="password" id="pass2" autocomplete="off" />
+		<input name="pass2" type="password" id="pass2" autocomplete="off" aria-describedby="pass2-desc" />
+		<p class="description" id="pass2-desc"><?php _e( 'Type the password again.' ); ?></p>
 		</td>
 	</tr>
 	<tr class="pw-weak">
Index: src/wp-login.php
===================================================================
--- src/wp-login.php	(revision 42379)
+++ src/wp-login.php	(working copy)
@@ -706,15 +706,17 @@
 
 	<div class="user-pass1-wrap">
 		<p>
-			<label for="pass1"><?php _e( 'New password' ); ?></label>
+			<label for="pass1" class="user-pass1-label"><?php _e( 'New password' ); ?></label>
 		</p>
 
-		<div class="wp-pwd">
+		<div class="login-wp-pwd">
 			<div class="password-input-wrapper">
 				<input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input password-input" size="24" value="" autocomplete="off" aria-describedby="pass-strength-result" />
-				<span class="button button-secondary wp-hide-pw hide-if-no-js">
-					<span class="dashicons dashicons-hidden"></span>
-				</span>
+				<span class="wp-hide-pw-wrapper">
+					<button type="button" class="button button-secondary wp-hide-pw hide-if-no-js">
+						<span class="dashicons dashicons-hidden"></span>
+					</button>
+			</span>
 			</div>
 			<div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div>
 		</div>
