diff --git a/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/PasswordWidget.php b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/PasswordWidget.php
new file mode 100644
index 0000000..a2d77f2
--- /dev/null
+++ b/core/lib/Drupal/Core/Field/Plugin/Field/FieldWidget/PasswordWidget.php
@@ -0,0 +1,42 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\PasswordWidget.
+ */
+
+namespace Drupal\Core\Field\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Plugin implementation of the 'password' widget.
+ *
+ * @FieldWidget(
+ *   id = "password",
+ *   label = @Translation("Password field"),
+ *   field_types = {
+ *     "string"
+ *   },
+ *   settings = {
+ *     "size" = ""
+ *   }
+ * )
+ */
+class PasswordWidget extends WidgetBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
+    $element['value'] = $element + array(
+      '#type' => 'password_confirm',
+      '#size' => $this->getSetting('size'),
+    );
+    $element['value']['#description'] = $this->t('To change the current user password, enter the new password in both fields.');
+
+    return $element;
+  }
+}
diff --git a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraintValidator.php b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraintValidator.php
index 31ffc5b..abe1139 100644
--- a/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraintValidator.php
+++ b/core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/ComplexDataConstraintValidator.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Validation\Plugin\Validation\Constraint;
 
 use Drupal\Core\TypedData\ComplexDataInterface;
+use Drupal\Core\TypedData\ListInterface;
 use Symfony\Component\Validator\Constraint;
 use Symfony\Component\Validator\ConstraintValidator;
 use Symfony\Component\Validator\Exception\UnexpectedTypeException;
diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php
index b92ad85..cd59b35 100644
--- a/core/modules/contact/src/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/src/Tests/ContactPersonalTest.php
@@ -249,10 +249,10 @@ protected function checkContactAccess($response, $contact_value = NULL) {
     }
     $name = $this->randomMachineName();
     $edit = array(
-      'name' => $name,
-      'mail' => $this->randomMachineName() . '@example.com',
-      'pass[pass1]' => $pass = $this->randomString(),
-      'pass[pass2]' => $pass,
+      'name[0][value]' => $name,
+      'mail[0][value]' => $this->randomMachineName() . '@example.com',
+      'pass[0][value][pass1]' => $pass = $this->randomString(),
+      'pass[0][value][pass2]' => $pass,
       'notify' => FALSE,
     );
     if (isset($contact_value)) {
diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php
index ec34a6c..cfac002 100644
--- a/core/modules/dblog/src/Tests/DbLogTest.php
+++ b/core/modules/dblog/src/Tests/DbLogTest.php
@@ -252,10 +252,10 @@ private function doUser() {
     // Add a user using the form to generate an add user event (which is not
     // triggered by drupalCreateUser).
     $edit = array();
-    $edit['name'] = $name;
-    $edit['mail'] = $name . '@example.com';
-    $edit['pass[pass1]'] = $pass;
-    $edit['pass[pass2]'] = $pass;
+    $edit['name[0][value]'] = $name;
+    $edit['mail[0][value]'] = $name . '@example.com';
+    $edit['pass[0][value][pass1]'] = $pass;
+    $edit['pass[0][value][pass2]'] = $pass;
     $edit['status'] = 1;
     $this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
     $this->assertResponse(200);
diff --git a/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
index a3f3a64..7cf6f3f 100644
--- a/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
+++ b/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
@@ -90,7 +90,7 @@ public function testDateTimezone() {
     $this->drupalLogin($test_user);
 
     // Set up the user with a different timezone than the site.
-    $edit = array('mail' => $test_user->getEmail(), 'timezone' => 'Asia/Manila');
+    $edit = array('mail[0][value]' => $test_user->getEmail(), 'timezone' => 'Asia/Manila');
     $this->drupalPostForm('user/' . $test_user->id() . '/edit', $edit, t('Save'));
 
     // Disable session saving as we are about to modify the global $user.
diff --git a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
index 3f21cbc..ba90684 100644
--- a/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
+++ b/core/modules/system/src/Tests/Form/ArbitraryRebuildTest.php
@@ -53,13 +53,13 @@ protected function setUp() {
    */
   function testUserRegistrationRebuild() {
     $edit = array(
-      'name' => 'foo',
-      'mail' => 'bar@example.com',
+      'name[0][value]' => 'foo',
+      'mail[0][value]' => 'bar@example.com',
     );
     $this->drupalPostForm('user/register', $edit, 'Rebuild');
     $this->assertText('Form rebuilt.');
-    $this->assertFieldByName('name', 'foo', 'Entered username has been kept.');
-    $this->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
+    $this->assertFieldByName('name[0][value]', 'foo', 'Entered username has been kept.');
+    $this->assertFieldByName('mail[0][value]', 'bar@example.com', 'Entered mail address has been kept.');
   }
 
   /**
@@ -67,12 +67,12 @@ function testUserRegistrationRebuild() {
    */
   function testUserRegistrationMultipleField() {
     $edit = array(
-      'name' => 'foo',
-      'mail' => 'bar@example.com',
+      'name[0][value]' => 'foo',
+      'mail[0][value]' => 'bar@example.com',
     );
     $this->drupalPostForm('user/register', $edit, t('Add another item'));
     $this->assertText('Test a multiple valued field', 'Form has been rebuilt.');
-    $this->assertFieldByName('name', 'foo', 'Entered username has been kept.');
-    $this->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
+    $this->assertFieldByName('name[0][value]', 'foo', 'Entered username has been kept.');
+    $this->assertFieldByName('mail[0][value]', 'bar@example.com', 'Entered mail address has been kept.');
   }
 }
diff --git a/core/modules/system/src/Tests/System/MainContentFallbackTest.php b/core/modules/system/src/Tests/System/MainContentFallbackTest.php
index ae10847..a6624fe 100644
--- a/core/modules/system/src/Tests/System/MainContentFallbackTest.php
+++ b/core/modules/system/src/Tests/System/MainContentFallbackTest.php
@@ -64,7 +64,7 @@ function testMainContentFallback() {
     // Request a user* page and see if it is displayed.
     $this->drupalLogin($this->web_user);
     $this->drupalGet('user/' . $this->web_user->id() . '/edit');
-    $this->assertField('mail', 'User interface still available.');
+    $this->assertField('mail[0][value]', 'User interface still available.');
 
     // Enable the block module again.
     $this->drupalLogin($this->admin_user);
diff --git a/core/modules/user/config/schema/user.schema.yml b/core/modules/user/config/schema/user.schema.yml
index 772deea..60ada60 100644
--- a/core/modules/user/config/schema/user.schema.yml
+++ b/core/modules/user/config/schema/user.schema.yml
@@ -174,3 +174,13 @@ condition.plugin.user_role:
       type: sequence
       sequence:
         - type: string
+
+entity_form_display.field.email_user:
+  type: entity_field_form_display_base
+  label: 'User mail widget.'
+  mapping:
+    settings:
+      type: sequence
+      label: 'Settings'
+      sequence:
+        - type: string
diff --git a/core/modules/user/src/AccountForm.php b/core/modules/user/src/AccountForm.php
index 602f0e7..05ef42d 100644
--- a/core/modules/user/src/AccountForm.php
+++ b/core/modules/user/src/AccountForm.php
@@ -75,6 +75,8 @@ public function form(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
     $config = \Drupal::config('user.settings');
 
+    $form = parent::form($form, $form_state, $account);
+
     $language_interface = \Drupal::languageManager()->getCurrentLanguage();
     $register = $account->isAnonymous();
     $admin = $user->hasPermission('administer users');
@@ -85,42 +87,13 @@ public function form(array $form, FormStateInterface $form_state) {
       '#weight' => -10,
     );
 
-    // The mail field is NOT required if account originally had no mail set
-    // and the user performing the edit has 'administer users' permission.
-    // This allows users without email address to be edited and deleted.
-    $form['account']['mail'] = array(
-      '#type' => 'email',
-      '#title' => $this->t('Email address'),
-      '#description' => $this->t('A valid email address. All emails from the system will be sent to this address. The email address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by email.'),
-      '#required' => !(!$account->getEmail() && $user->hasPermission('administer users')),
-      '#default_value' => (!$register ? $account->getEmail() : ''),
-    );
-
-    // Only show name field on registration form or user can change own username.
-    $form['account']['name'] = array(
-      '#type' => 'textfield',
-      '#title' => $this->t('Username'),
-      '#maxlength' => USERNAME_MAX_LENGTH,
-      '#description' => $this->t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.'),
-      '#required' => TRUE,
-      '#attributes' => array(
-        'class' => array('username'),
-        'autocorrect' => 'off',
-        'autocapitalize' => 'off',
-        'spellcheck' => 'false',
-      ),
-      '#default_value' => (!$register ? $account->getUsername() : ''),
-      '#access' => ($register || ($user->id() == $account->id() && $user->hasPermission('change own username')) || $admin),
-    );
+    $form['name']['#group'] = 'account';
+    $form['mail']['#group'] = 'account';
 
     // Display password field only for existing users or when user is allowed to
     // assign a password during registration.
     if (!$register) {
-      $form['account']['pass'] = array(
-        '#type' => 'password_confirm',
-        '#size' => 25,
-        '#description' => $this->t('To change the current user password, enter the new password in both fields.'),
-      );
+      $form['pass']['#group'] = 'account';
 
       // To skip the current password field, the user must have logged in via a
       // one-time link and have the token in the URL.
@@ -132,7 +105,7 @@ public function form(array $form, FormStateInterface $form_state) {
       // The user may only change their own password without their current
       // password if they logged in via a one-time login link.
       if (!$pass_reset) {
-        $protected_values['mail'] = $form['account']['mail']['#title'];
+        $protected_values['mail'] = $this->t('E-mail address');
         $protected_values['pass'] = $this->t('Password');
         $request_new = $this->l($this->t('Request new password'), new Url('user.pass', array(), array('attributes' => array('title' => $this->t('Request new password via email.')))));
         $current_pass_description = $this->t('Required if you want to change the %mail or %pass below. !request_new.', array('%mail' => $protected_values['mail'], '%pass' => $protected_values['pass'], '!request_new' => $request_new));
@@ -163,20 +136,16 @@ public function form(array $form, FormStateInterface $form_state) {
       }
     }
     elseif (!$config->get('verify_mail') || $admin) {
-      $form['account']['pass'] = array(
-        '#type' => 'password_confirm',
-        '#size' => 25,
-        '#description' => $this->t('Provide a password for the new account in both fields.'),
-        '#required' => TRUE,
-      );
+      $form['pass']['widget'][0]['value']['#description'] = $this->t('Provide a password for the new account in both fields.');
+      $form['pass']['widget'][0]['value']['#required'] = TRUE;
     }
 
     // When not building the user registration form, prevent web browsers from
     // autofilling/prefilling the email, username, and password fields.
     if ($this->getOperation() != 'register') {
       foreach (array('mail', 'name', 'pass') as $key) {
-        if (isset($form['account'][$key])) {
-          $form['account'][$key]['#attributes']['autocomplete'] = 'off';
+        if (isset($form[$key]['widget'][0]['value'])) {
+          $form[$key]['widget'][0]['value']['#attributes']['autocomplete'] = 'off';
         }
       }
     }
@@ -300,7 +269,7 @@ public function form(array $form, FormStateInterface $form_state) {
       '#weight' => 100,
     );
 
-    return parent::form($form, $form_state, $account);
+    return $form;
   }
 
   /**
@@ -325,49 +294,6 @@ public function buildEntity(array $form, FormStateInterface $form_state) {
   public function validate(array $form, FormStateInterface $form_state) {
     parent::validate($form, $form_state);
 
-    $account = $this->entity;
-    // Validate new or changing username.
-    if ($form_state->hasValue('name')) {
-      if ($error = user_validate_name($form_state->getValue('name'))) {
-        $form_state->setErrorByName('name', $error);
-      }
-      // Cast the user ID as an integer. It might have been set to NULL, which
-      // could lead to unexpected results.
-      else {
-        $name_taken = (bool) $this->entityQuery->get('user')
-          ->condition('uid', (int) $account->id(), '<>')
-          ->condition('name', $form_state->getValue('name'))
-          ->range(0, 1)
-          ->count()
-          ->execute();
-
-        if ($name_taken) {
-          $form_state->setErrorByName('name', $this->t('The username %name is already taken.', array('%name' => $form_state->getValue('name'))));
-        }
-      }
-    }
-
-    $mail = $form_state->getValue('mail');
-
-    if (!empty($mail)) {
-      $mail_taken = (bool) $this->entityQuery->get('user')
-        ->condition('uid', (int) $account->id(), '<>')
-        ->condition('mail', $mail)
-        ->range(0, 1)
-        ->count()
-        ->execute();
-
-      if ($mail_taken) {
-        // Format error message dependent on whether the user is logged in or not.
-        if (\Drupal::currentUser()->isAuthenticated()) {
-          $form_state->setErrorByName('mail', $this->t('The email address %email is already taken.', array('%email' => $mail)));
-        }
-        else {
-          $form_state->setErrorByName('mail', $this->t('The email address %email is already registered. <a href="@password">Have you forgotten your password?</a>', array('%email' => $mail, '@password' => $this->url('user.pass'))));
-        }
-      }
-    }
-
     // Make sure the signature isn't longer than the size of the database field.
     // Signatures are disabled by default, so make sure it exists first.
     if ($signature = $form_state->getValue('signature')) {
diff --git a/core/modules/user/src/Entity/User.php b/core/modules/user/src/Entity/User.php
index 629ce9c..bf5025a 100644
--- a/core/modules/user/src/Entity/User.php
+++ b/core/modules/user/src/Entity/User.php
@@ -451,14 +451,17 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
       ->setDescription(t('The user UUID.'))
       ->setReadOnly(TRUE);
 
+    // @todo Use LanguageWidget once https://drupal.org/node/2226493 lands.
     $fields['langcode'] = BaseFieldDefinition::create('language')
       ->setLabel(t('Language code'))
       ->setDescription(t('The user language code.'));
 
+    // @todo Use LanguageWidget once https://drupal.org/node/2226493 lands.
     $fields['preferred_langcode'] = BaseFieldDefinition::create('language')
       ->setLabel(t('Preferred language code'))
       ->setDescription(t("The user's preferred language code for receiving emails and viewing the site."));
 
+    // @todo Use LanguageWidget once https://drupal.org/node/2226493 lands.
     $fields['preferred_admin_langcode'] = BaseFieldDefinition::create('language')
       ->setLabel(t('Preferred admin language code'))
       ->setDescription(t("The user's preferred language code for viewing administration pages."))
@@ -467,25 +470,46 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
     // The name should not vary per language. The username is the visual
     // identifier for a user and needs to be consistent in all languages.
     $fields['name'] = BaseFieldDefinition::create('string')
-      ->setLabel(t('Name'))
+      ->setLabel(t('Username'))
       ->setDescription(t('The name of this user.'))
       ->setDefaultValue('')
+      ->setRequired(TRUE)
+      ->setSettings(array(
+       'max_length' => USERNAME_MAX_LENGTH,
+      ))
       ->setConstraints(array(
-        // No Length constraint here because the UserName constraint also covers
-        // that.
         'UserName' => array(),
         'UserNameUnique' => array(),
+      ))
+      ->setDisplayOptions('form', array(
+        'type' => 'username',
+        'weight' => -20,
       ));
 
     $fields['pass'] = BaseFieldDefinition::create('string')
       ->setLabel(t('Password'))
-      ->setDescription(t('The password of this user (hashed).'));
+      ->setDescription(t('The password of this user (hashed).'))
+      ->setDisplayOptions('form', array(
+        'type' => 'password',
+        'weight' => 0,
+        'settings' => array(
+          'size' => 25,
+        ),
+      ));
 
     $fields['mail'] = BaseFieldDefinition::create('email')
-      ->setLabel(t('Email'))
+      ->setLabel(t('E-mail address'))
       ->setDescription(t('The email of this user.'))
       ->setDefaultValue('')
-      ->setConstraints(array('UserMailUnique' => array()));
+//      ->setPropertyConstraints('value', array('UserMailUnique' => array()))
+      ->setDisplayOptions('form', array(
+        'type' => 'email_user',
+        'weight' => -10,
+      ))
+      ->setConstraints(array(
+        'UserMailUnique' => array(),
+      ))
+      ->setDisplayConfigurable('form', TRUE);
 
     // @todo Convert to a text field in https://drupal.org/node/1548204.
     $fields['signature'] = BaseFieldDefinition::create('string')
diff --git a/core/modules/user/src/Plugin/Field/FieldWidget/EmailUserWidget.php b/core/modules/user/src/Plugin/Field/FieldWidget/EmailUserWidget.php
new file mode 100644
index 0000000..73711dd
--- /dev/null
+++ b/core/modules/user/src/Plugin/Field/FieldWidget/EmailUserWidget.php
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\user\Plugin\Field\FieldWidget\EmailUserWidget.
+ */
+
+namespace Drupal\user\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Plugin implementation of the 'email_user' widget.
+ *
+ * @FieldWidget(
+ *   id = "email_user",
+ *   label = @Translation("User e-mail"),
+ *   field_types = {
+ *     "email"
+ *   }
+ * )
+ */
+class EmailUserWidget extends WidgetBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
+    $account = $items->getParent()->getValue();
+    $user = \Drupal::currentUser();
+
+    $element['value'] = $element + array(
+      '#type' => 'email',
+      '#description' => $this->t('A valid e-mail address. All e-mails from the system will be sent to this address. The e-mail address is not made public and will only be used if you wish to receive a new password or wish to receive certain news or notifications by e-mail.'),
+      // The mail field is NOT required if account originally had no mail set
+      // and the user performing the edit has 'administer users' permission.
+      // This allows users without e-mail address to be edited and deleted.
+      '#required' => !(!$account->getEmail() && $user->hasPermission('administer users')),
+      '#default_value' => (!$account->isAnonymous() ? $account->getEmail() : ''),
+    );
+
+    return $element;
+  }
+
+}
diff --git a/core/modules/user/src/Plugin/Field/FieldWidget/UserNameWidget.php b/core/modules/user/src/Plugin/Field/FieldWidget/UserNameWidget.php
new file mode 100644
index 0000000..c7ce142
--- /dev/null
+++ b/core/modules/user/src/Plugin/Field/FieldWidget/UserNameWidget.php
@@ -0,0 +1,57 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Field\Plugin\Field\FieldWidget\StringWidget.
+ */
+
+namespace Drupal\user\Plugin\Field\FieldWidget;
+
+use Drupal\Core\Field\FieldItemListInterface;
+use Drupal\Core\Field\WidgetBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Plugin implementation of the 'user name' widget.
+ *
+ * @FieldWidget(
+ *   id = "username",
+ *   label = @Translation("User name field"),
+ *   field_types = {
+ *     "string"
+ *   }
+ * )
+ */
+class UserNameWidget extends WidgetBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {
+    $account = $items->getParent()->getValue();
+    $user = \Drupal::currentUser();
+
+    $is_anon = $account->isAnonymous();
+    $is_admin = $user->hasPermission('administer users');;
+
+    $element['value'] = $element + array(
+      '#type' => 'textfield',
+      '#size' => $this->getSetting('size'),
+      '#maxlength' => $this->getFieldSetting('max_length'),
+      '#attributes' => array(
+        'class' => array('username'),
+        'autocorrect' => 'off',
+        'autocapitalize' => 'off',
+        'spellcheck' => 'false',
+      ),
+      '#default_value' => (!$is_anon ? $account->getUsername() : ''),
+      // Only show name field on registration form or user can change own
+      // username.
+      '#access' => ($is_anon || ($user->id() == $account->id() && $user->hasPermission('change own username')) || $is_admin),
+    );
+    $element['value']['#description'] = $this->t('Spaces are allowed; punctuation is not allowed except for periods, hyphens, apostrophes, and underscores.');
+
+    return $element;
+  }
+
+}
diff --git a/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraint.php b/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraint.php
index 381d3cf..2fea6ee 100644
--- a/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraint.php
+++ b/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraint.php
@@ -24,5 +24,4 @@ class UserNameConstraint extends Constraint {
   public $spaceEndMessage = 'The username cannot end with a space.';
   public $multipleSpacesMessage = 'The username cannot contain multiple spaces in a row.';
   public $illegalMessage = 'The username contains an illegal character.';
-  public $tooLongMessage = 'The username %name is too long: it must be %max characters or less.';
 }
diff --git a/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraintValidator.php b/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraintValidator.php
index 12d4fa3..28a2251 100644
--- a/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraintValidator.php
+++ b/core/modules/user/src/Plugin/Validation/Constraint/UserNameConstraintValidator.php
@@ -49,8 +49,5 @@ public function validate($items, Constraint $constraint) {
     ) {
       $this->context->addViolation($constraint->illegalMessage);
     }
-    if (Unicode::strlen($name) > USERNAME_MAX_LENGTH) {
-      $this->context->addViolation($constraint->tooLongMessage, array('%name' => $name, '%max' => USERNAME_MAX_LENGTH));
-    }
   }
 }
diff --git a/core/modules/user/src/RegisterForm.php b/core/modules/user/src/RegisterForm.php
index bbf131e..ae55ab3 100644
--- a/core/modules/user/src/RegisterForm.php
+++ b/core/modules/user/src/RegisterForm.php
@@ -7,10 +7,7 @@
 
 namespace Drupal\user;
 
-use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Entity\Query\QueryFactory;
 use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Language\LanguageManagerInterface;
 
 /**
  * Form controller for the user register forms.
@@ -20,13 +17,6 @@ class RegisterForm extends AccountForm {
   /**
    * {@inheritdoc}
    */
-  public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager, QueryFactory $entity_query) {
-    parent::__construct($entity_manager, $language_manager, $entity_query);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function form(array $form, FormStateInterface $form_state) {
     $user = $this->currentUser();
     /** @var \Drupal\user\UserInterface $account */
@@ -59,6 +49,8 @@ public function form(array $form, FormStateInterface $form_state) {
     // Start with the default user account fields.
     $form = parent::form($form, $form_state, $account);
 
+    $form['name']['#access'] = TRUE;
+
     return $form;
   }
 
@@ -78,16 +70,13 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     $admin = $form_state->getValue('administer_users');
 
     if (!\Drupal::config('user.settings')->get('verify_mail') || $admin) {
-      $pass = $form_state->getValue('pass');
+      $pass = $form_state->getValue(array('pass', 0, 'value'));
     }
     else {
       $pass = user_password();
     }
 
-    // Remove unneeded values.
-    $form_state->cleanValues();
-
-    $form_state->setValue('pass', $pass);
+    $form_state->setValue(array('pass', 0, 'value'), $pass);
     $form_state->setValue('init', $form_state->getValue('mail'));
 
     parent::submitForm($form, $form_state);
@@ -97,19 +86,18 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
    * {@inheritdoc}
    */
   public function save(array $form, FormStateInterface $form_state) {
+    /** @var \Drupal\user\UserInterface $account */
     $account = $this->entity;
     $pass = $account->getPassword();
     $admin = $form_state->getValue('administer_users');
     $notify = !$form_state->isValueEmpty('notify');
 
-    // Save has no return value so this cannot be tested.
-    // Assume save has gone through correctly.
     $account->save();
 
     $form_state->set('user', $account);
     $form_state->setValue('uid', $account->id());
 
-    $this->logger('user')->notice('New user: %name %email.', array('%name' => $form_state->getValue('name'), '%email' => '<' . $form_state->getValue('mail') . '>', 'type' => $account->link($this->t('Edit'), 'edit-form')));
+    $this->logger('user')->notice('New user: %name %email.', array('%name' => $account->getUsername(), '%email' => '<' . $account->getEMail() . '>', 'type' => $account->link($this->t('Edit'), 'edit-form')));
 
     // Add plain text password into user account to generate mail tokens.
     $account->password = $pass;
diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
index 384fee3..be46be8 100644
--- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
+++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
@@ -43,7 +43,7 @@ function testInstallConfigureForm() {
     // Verify that web browsers may autocomplete the email value and
     // autofill/prefill the name and pass values.
     foreach (array('mail', 'name', 'pass') as $key) {
-      $this->assertFalse(isset($form['account'][$key]['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found.");
+      $this->assertFalse(isset($form['account'][$key]['widget'][0]['value']['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found.");
     }
   }
 
@@ -63,12 +63,12 @@ function testUserRegistrationForm() {
     $form = $this->buildAccountForm('register');
 
     // Verify name and pass field order.
-    $this->assertFieldOrder($form['account']);
+    $this->assertFieldOrder($form);
 
     // Verify that web browsers may autocomplete the email value and
     // autofill/prefill the name and pass values.
     foreach (array('mail', 'name', 'pass') as $key) {
-      $this->assertFalse(isset($form['account'][$key]['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found.");
+      $this->assertFalse(isset($form[$key]['widget'][0]['value']['#attributes']['autocomplete']), "'$key' field: 'autocomplete' attribute not found.");
     }
   }
 
@@ -86,11 +86,11 @@ function testUserEditForm() {
     $form = $this->buildAccountForm('default');
 
     // Verify name and pass field order.
-    $this->assertFieldOrder($form['account']);
+    $this->assertFieldOrder($form);
 
     // Verify that autocomplete is off on all account fields.
     foreach (array('mail', 'name', 'pass') as $key) {
-      $this->assertIdentical($form['account'][$key]['#attributes']['autocomplete'], 'off', "'$key' field: 'autocomplete' attribute is 'off'.");
+      $this->assertIdentical($form[$key]['widget'][0]['value']['#attributes']['autocomplete'], 'off', "'$key' field: 'autocomplete' attribute is 'off'.");
     }
   }
 
diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php
index 900090c..2b512ba 100644
--- a/core/modules/user/src/Tests/UserAdminTest.php
+++ b/core/modules/user/src/Tests/UserAdminTest.php
@@ -165,10 +165,10 @@ function testNotificationEmailAddress() {
       ->save();
     // Register a new user account.
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
-    $subject = 'Account details for ' . $edit['name'] . ' at ' . $system->get('name') . ' (pending admin approval)';
+    $subject = 'Account details for ' . $edit['name[0][value]'] . ' at ' . $system->get('name') . ' (pending admin approval)';
     // Ensure that admin notification mail is sent to the configured
     // Notification Email address.
     $admin_mail = $this->drupalGetMails(array(
@@ -180,7 +180,7 @@ function testNotificationEmailAddress() {
     // Ensure that user notification mail is sent from the configured
     // Notification Email address.
     $user_mail = $this->drupalGetMails(array(
-      'to' => $edit['mail'],
+      'to' => $edit['mail[0][value]'],
       'from' => $server_address,
       'reply-to' => $notify_address,
       'subject' => $subject,
diff --git a/core/modules/user/src/Tests/UserCreateFailMailTest.php b/core/modules/user/src/Tests/UserCreateFailMailTest.php
index 677effe..3eac839 100644
--- a/core/modules/user/src/Tests/UserCreateFailMailTest.php
+++ b/core/modules/user/src/Tests/UserCreateFailMailTest.php
@@ -35,15 +35,15 @@ protected function testUserAdd() {
     // Create a user, but fail to send an email.
     $name = $this->randomMachineName();
     $edit = array(
-      'name' => $name,
-      'mail' => $this->randomMachineName() . '@example.com',
-      'pass[pass1]' => $pass = $this->randomString(),
-      'pass[pass2]' => $pass,
+      'name[0][value]' => $name,
+      'mail[0][value]' => $this->randomMachineName() . '@example.com',
+      'pass[0][value][pass1]' => $pass = $this->randomString(),
+      'pass[0][value][pass2]' => $pass,
       'notify' => TRUE,
     );
     $this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
 
     $this->assertText(t('Unable to send email. Contact the site administrator if the problem persists.'));
-    $this->assertNoText(t('A welcome message with further instructions has been emailed to the new user @name.', array('@name' => $edit['name'])));
+    $this->assertNoText(t('A welcome message with further instructions has been emailed to the new user @name.', array('@name' => $edit['name[0][value]'])));
   }
 }
diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php
index 911c9ae..f9cefb2 100644
--- a/core/modules/user/src/Tests/UserCreateTest.php
+++ b/core/modules/user/src/Tests/UserCreateTest.php
@@ -92,25 +92,25 @@ protected function testUserAdd() {
     foreach (array(FALSE, TRUE) as $notify) {
       $name = $this->randomMachineName();
       $edit = array(
-        'name' => $name,
-        'mail' => $this->randomMachineName() . '@example.com',
-        'pass[pass1]' => $pass = $this->randomString(),
-        'pass[pass2]' => $pass,
+        'name[0][value]' => $name,
+        'mail[0][value]' => $this->randomMachineName() . '@example.com',
+        'pass[0][value][pass1]' => $pass = $this->randomString(),
+        'pass[0][value][pass2]' => $pass,
         'notify' => $notify,
       );
       $this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
 
       if ($notify) {
-        $this->assertText(t('A welcome message with further instructions has been emailed to the new user @name.', array('@name' => $edit['name'])), 'User created');
+        $this->assertText(t('A welcome message with further instructions has been emailed to the new user @name.', array('@name' => $edit['name[0][value]'])), 'User created');
         $this->assertEqual(count($this->drupalGetMails()), 1, 'Notification email sent');
       }
       else {
-        $this->assertText(t('Created a new user account for @name. No email has been sent.', array('@name' => $edit['name'])), 'User created');
+        $this->assertText(t('Created a new user account for @name. No email has been sent.', array('@name' => $edit['name[0][value]'])), 'User created');
         $this->assertEqual(count($this->drupalGetMails()), 0, 'Notification email not sent');
       }
 
       $this->drupalGet('admin/people');
-      $this->assertText($edit['name'], 'User found in list of users');
+      $this->assertText($edit['name[0][value]'], 'User found in list of users');
       $user = user_load_by_name($name);
       $this->assertEqual($user->isActive(), 'User is not blocked');
     }
diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php
index 1e7dc7f..fddc5ef 100644
--- a/core/modules/user/src/Tests/UserEditTest.php
+++ b/core/modules/user/src/Tests/UserEditTest.php
@@ -26,28 +26,28 @@ function testUserEdit() {
     $this->drupalLogin($user1);
 
     // Test that error message appears when attempting to use a non-unique user name.
-    $edit['name'] = $user2->getUsername();
+    $edit['name[0][value]'] = $user2->getUsername();
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
-    $this->assertRaw(t('The username %name is already taken.', array('%name' => $edit['name'])));
+    $this->assertRaw(t('The username %name is already taken.', array('%name' => $edit['name[0][value]'])));
 
     // Check that filling out a single password field does not validate.
     $edit = array();
-    $edit['pass[pass1]'] = '';
-    $edit['pass[pass2]'] = $this->randomMachineName();
+    $edit['pass[0][value][pass1]'] = '';
+    $edit['pass[0][value][pass2]'] = $this->randomMachineName();
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
     $this->assertText(t("The specified passwords do not match."), 'Typing mismatched passwords displays an error message.');
 
-    $edit['pass[pass1]'] = $this->randomMachineName();
-    $edit['pass[pass2]'] = '';
+    $edit['pass[0][value][pass1]'] = $this->randomMachineName();
+    $edit['pass[0][value][pass2]'] = '';
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
     $this->assertText(t("The specified passwords do not match."), 'Typing mismatched passwords displays an error message.');
 
     // Test that the error message appears when attempting to change the mail or
     // pass without the current password.
     $edit = array();
-    $edit['mail'] = $this->randomMachineName() . '@new.example.com';
+    $edit['mail[0][value]'] = $this->randomMachineName() . '@new.example.com';
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
-    $this->assertRaw(t("Your current password is missing or incorrect; it's required to change the %name.", array('%name' => t('Email address'))));
+    $this->assertRaw(t("Your current password is missing or incorrect; it's required to change the %name.", array('%name' => t('E-mail address'))));
 
     $edit['current_pass'] = $user1->pass_raw;
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
@@ -55,8 +55,8 @@ function testUserEdit() {
 
     // Test that the user must enter current password before changing passwords.
     $edit = array();
-    $edit['pass[pass1]'] = $new_pass = $this->randomMachineName();
-    $edit['pass[pass2]'] = $new_pass;
+    $edit['pass[0][value][pass1]'] = $new_pass = $this->randomMachineName();
+    $edit['pass[0][value][pass2]'] = $new_pass;
     $this->drupalPostForm("user/" . $user1->id() . "/edit", $edit, t('Save'));
     $this->assertRaw(t("Your current password is missing or incorrect; it's required to change the %name.", array('%name' => t('Password'))));
 
@@ -99,7 +99,7 @@ function testUserWithoutEmailEdit() {
     // This user has no email address.
     $user1->mail = '';
     $user1->save();
-    $this->drupalPostForm("user/" . $user1->id() . "/edit", array('mail' => ''), t('Save'));
+    $this->drupalPostForm("user/" . $user1->id() . "/edit", array('mail[0][value]' => ''), t('Save'));
     $this->assertRaw(t("The changes have been saved."));
   }
 }
diff --git a/core/modules/user/src/Tests/UserEditedOwnAccountTest.php b/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
index 6da8015..bf1b84e 100644
--- a/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
+++ b/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
@@ -27,14 +27,14 @@ function testUserEditedOwnAccount() {
 
     // Change own username.
     $edit = array();
-    $edit['name'] = $this->randomMachineName();
+    $edit['name[0][value]'] = $this->randomMachineName();
     $this->drupalPostForm('user/' . $account->id() . '/edit', $edit, t('Save'));
 
     // Log out.
     $this->drupalLogout();
 
     // Set the new name on the user account and attempt to log back in.
-    $account->name = $edit['name'];
+    $account->name = $edit['name[0][value]'];
     $this->drupalLogin($account);
   }
 }
diff --git a/core/modules/user/src/Tests/UserLanguageCreationTest.php b/core/modules/user/src/Tests/UserLanguageCreationTest.php
index fc95906..53c370c 100644
--- a/core/modules/user/src/Tests/UserLanguageCreationTest.php
+++ b/core/modules/user/src/Tests/UserLanguageCreationTest.php
@@ -53,10 +53,10 @@ function testLocalUserCreation() {
     // language is set.
     $username = $this->randomMachineName(10);
     $edit = array(
-      'name' => $username,
-      'mail' => $this->randomMachineName(4) . '@example.com',
-      'pass[pass1]' => $username,
-      'pass[pass2]' => $username,
+      'name[0][value]' => $username,
+      'mail[0][value]' => $this->randomMachineName(4) . '@example.com',
+      'pass[0][value][pass1]' => $username,
+      'pass[0][value][pass2]' => $username,
     );
 
     $this->drupalPostForm($langcode . '/admin/people/create', $edit, t('Create new account'));
@@ -73,8 +73,8 @@ function testLocalUserCreation() {
 
     $username = $this->randomMachineName(10);
     $edit = array(
-      'name' => $username,
-      'mail' => $this->randomMachineName(4) . '@example.com',
+      'name[0][value]' => $username,
+      'mail[0][value]' => $this->randomMachineName(4) . '@example.com',
     );
 
     $this->drupalPostForm($langcode . '/user/register', $edit, t('Create new account'));
@@ -94,8 +94,8 @@ function testLocalUserCreation() {
     // Set pass_raw so we can login the new user.
     $user->pass_raw = $this->randomMachineName(10);
     $edit = array(
-      'pass[pass1]' => $user->pass_raw,
-      'pass[pass2]' => $user->pass_raw,
+      'pass[0][value][pass1]' => $user->pass_raw,
+      'pass[0][value][pass2]' => $user->pass_raw,
     );
 
     $this->drupalPostForm($user_edit, $edit, t('Save'));
diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php
index e69cfa8..b21f04c 100644
--- a/core/modules/user/src/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/src/Tests/UserPasswordResetTest.php
@@ -91,7 +91,7 @@ function testUserPasswordReset() {
 
     // Change the forgotten password.
     $password = user_password();
-    $edit = array('pass[pass1]' => $password, 'pass[pass2]' => $password);
+    $edit = array('pass[0][value][pass1]' => $password, 'pass[0][value][pass2]' => $password);
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), 'Forgotten password changed.');
 
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index a1f189d..0e4d6e5 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -37,8 +37,8 @@ function testRegistrationWithEmailVerification() {
     // Allow registration by site visitors without administrator approval.
     $config->set('register', USER_REGISTER_VISITORS)->save();
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
     $this->assertText(t('A welcome message with further instructions has been sent to your email address.'), 'User registered successfully.');
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
@@ -48,8 +48,8 @@ function testRegistrationWithEmailVerification() {
     // Allow registration by site visitors, but require administrator approval.
     $config->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
     $this->container->get('entity.manager')->getStorage('user')->resetCache();
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
@@ -67,18 +67,18 @@ function testRegistrationWithoutEmailVerification() {
       ->save();
 
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
 
     // Try entering a mismatching password.
-    $edit['pass[pass1]'] = '99999.0';
-    $edit['pass[pass2]'] = '99999';
+    $edit['pass[0][value][pass1]'] = '99999.0';
+    $edit['pass[0][value][pass2]'] = '99999';
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
     $this->assertText(t('The specified passwords do not match.'), 'Typing mismatched passwords displays an error message.');
 
     // Enter a correct password.
-    $edit['pass[pass1]'] = $new_pass = $this->randomMachineName();
-    $edit['pass[pass2]'] = $new_pass;
+    $edit['pass[0][value][pass1]'] = $new_pass = $this->randomMachineName();
+    $edit['pass[0][value][pass2]'] = $new_pass;
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
     $this->container->get('entity.manager')->getStorage('user')->resetCache();
     $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
@@ -90,10 +90,10 @@ function testRegistrationWithoutEmailVerification() {
     // Allow registration by site visitors, but require administrator approval.
     $config->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)->save();
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
-    $edit['pass[pass1]'] = $pass = $this->randomMachineName();
-    $edit['pass[pass2]'] = $pass;
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
+    $edit['pass[0][value][pass1]'] = $pass = $this->randomMachineName();
+    $edit['pass[0][value][pass2]'] = $pass;
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
     $this->assertText(t('Thank you for applying for an account. Your account is currently pending approval by the site administrator.'), 'Users are notified of pending approval');
 
@@ -133,18 +133,18 @@ function testRegistrationEmailDuplicates() {
     $duplicate_user = $this->drupalCreateUser();
 
     $edit = array();
-    $edit['name'] = $this->randomMachineName();
-    $edit['mail'] = $duplicate_user->getEmail();
+    $edit['name[0][value]'] = $this->randomMachineName();
+    $edit['mail[0][value]'] = $duplicate_user->getEmail();
 
     // Attempt to create a new account using an existing email address.
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
-    $this->assertText(t('The email address @email is already registered.', array('@email' => $duplicate_user->getEmail())), 'Supplying an exact duplicate email address displays an error message');
+    $this->assertText(t('The email address @email is already taken.', array('@email' => $duplicate_user->getEmail())), 'Supplying an exact duplicate email address displays an error message');
 
     // Attempt to bypass duplicate email registration validation by adding spaces.
-    $edit['mail'] = '   ' . $duplicate_user->getEmail() . '   ';
+    $edit['mail[0][value]'] = '   ' . $duplicate_user->getEmail() . '   ';
 
     $this->drupalPostForm('user/register', $edit, t('Create new account'));
-    $this->assertText(t('The email address @email is already registered.', array('@email' => $duplicate_user->getEmail())), 'Supplying a duplicate email address with added whitespace displays an error message');
+    $this->assertText(t('The email address @email is already taken.', array('@email' => $duplicate_user->getEmail())), 'Supplying a duplicate email address with added whitespace displays an error message');
   }
 
   function testRegistrationDefaultValues() {
@@ -167,10 +167,10 @@ function testRegistrationDefaultValues() {
     $this->assertNoRaw('<details id="edit-account"><summary>Account information</summary>');
 
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
-    $edit['pass[pass1]'] = $new_pass = $this->randomMachineName();
-    $edit['pass[pass2]'] = $new_pass;
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
+    $edit['pass[0][value][pass1]'] = $new_pass = $this->randomMachineName();
+    $edit['pass[0][value][pass2]'] = $new_pass;
     $this->drupalPostForm(NULL, $edit, t('Create new account'));
 
     // Check user fields.
@@ -226,8 +226,8 @@ function testRegistrationWithUserFields() {
 
     // Check that validation errors are correctly reported.
     $edit = array();
-    $edit['name'] = $name = $this->randomMachineName();
-    $edit['mail'] = $mail = $edit['name'] . '@example.com';
+    $edit['name[0][value]'] = $name = $this->randomMachineName();
+    $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
     // Missing input in required field.
     $edit['test_user_field[0][value]'] = '';
     $this->drupalPostForm(NULL, $edit, t('Create new account'));
@@ -266,8 +266,8 @@ function testRegistrationWithUserFields() {
       // Submit with three values.
       $edit['test_user_field[1][value]'] = $value + 1;
       $edit['test_user_field[2][value]'] = $value + 2;
-      $edit['name'] = $name = $this->randomMachineName();
-      $edit['mail'] = $mail = $edit['name'] . '@example.com';
+      $edit['name[0][value]'] = $name = $this->randomMachineName();
+      $edit['mail[0][value]'] = $mail = $edit['name[0][value]'] . '@example.com';
       $this->drupalPostForm(NULL, $edit, t('Create new account'));
       // Check user fields.
       $accounts = entity_load_multiple_by_properties('user', array('name' => $name, 'mail' => $mail));
diff --git a/core/modules/user/src/Tests/UserRolesAssignmentTest.php b/core/modules/user/src/Tests/UserRolesAssignmentTest.php
index 71c9482..3ac4588 100644
--- a/core/modules/user/src/Tests/UserRolesAssignmentTest.php
+++ b/core/modules/user/src/Tests/UserRolesAssignmentTest.php
@@ -52,16 +52,16 @@ function testCreateUserWithRole() {
     $rid = $this->drupalCreateRole(array('administer users'));
     // Create a new user and add the role at the same time.
     $edit = array(
-      'name' => $this->randomMachineName(),
-      'mail' => $this->randomMachineName() . '@example.com',
-      'pass[pass1]' => $pass = $this->randomString(),
-      'pass[pass2]' => $pass,
+      'name[0][value]' => $this->randomMachineName(),
+      'mail[0][value]' => $this->randomMachineName() . '@example.com',
+      'pass[0][value][pass1]' => $pass = $this->randomString(),
+      'pass[0][value][pass2]' => $pass,
       "roles[$rid]" => $rid,
     );
     $this->drupalPostForm('admin/people/create', $edit, t('Create new account'));
-    $this->assertText(t('Created a new user account for !name.', array('!name' => $edit['name'])));
+    $this->assertText(t('Created a new user account for !name.', array('!name' => $edit['name[0][value]'])));
     // Get the newly added user.
-    $account = user_load_by_name($edit['name']);
+    $account = user_load_by_name($edit['name[0][value]']);
 
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->assertFieldChecked('edit-roles-' . $rid, 'Role is assigned.');
diff --git a/core/modules/user/src/Tests/UserTimeZoneTest.php b/core/modules/user/src/Tests/UserTimeZoneTest.php
index 4c09de0..9a0d404 100644
--- a/core/modules/user/src/Tests/UserTimeZoneTest.php
+++ b/core/modules/user/src/Tests/UserTimeZoneTest.php
@@ -61,7 +61,7 @@ function testUserTimeZone() {
 
     // Change user time zone to Santiago time.
     $edit = array();
-    $edit['mail'] = $web_user->getEmail();
+    $edit['mail[0][value]'] = $web_user->getEmail();
     $edit['timezone'] = 'America/Santiago';
     $this->drupalPostForm("user/" . $web_user->id() . "/edit", $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), 'Time zone changed to Santiago time.');
diff --git a/core/modules/user/src/Tests/UserTranslationUITest.php b/core/modules/user/src/Tests/UserTranslationUITest.php
index 5a98be4..aff8d52 100644
--- a/core/modules/user/src/Tests/UserTranslationUITest.php
+++ b/core/modules/user/src/Tests/UserTranslationUITest.php
@@ -49,7 +49,7 @@ protected function getTranslatorPermissions() {
    */
   protected function getNewEntityValues($langcode) {
     // User name is not translatable hence we use a fixed value.
-    return array('name' => $this->name) + parent::getNewEntityValues($langcode);
+    return array('name' => [0 => ['value' => $this->name]]) + parent::getNewEntityValues($langcode);
   }
 
 }
diff --git a/core/modules/user/src/Tests/UserValidationTest.php b/core/modules/user/src/Tests/UserValidationTest.php
index f5ae202..6bb95a1 100644
--- a/core/modules/user/src/Tests/UserValidationTest.php
+++ b/core/modules/user/src/Tests/UserValidationTest.php
@@ -84,8 +84,8 @@ function testValidation() {
     $user->set('name', $name);
     $violations = $user->validate();
     $this->assertEqual(count($violations), 1, 'Violation found when name is too long.');
-    $this->assertEqual($violations[0]->getPropertyPath(), 'name');
-    $this->assertEqual($violations[0]->getMessage(), t('The username %name is too long: it must be %max characters or less.', array('%name' => $name, '%max' => 60)));
+    $this->assertEqual($violations[0]->getPropertyPath(), 'name.0.value');
+    $this->assertEqual($violations[0]->getMessage(), t('%name: may not be longer than @max characters.', array('%name' => 'Username', '@max' => USERNAME_MAX_LENGTH)));
 
     // Create a second test user to provoke a name collision.
     $user2 = entity_create('user', array(
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index a02d098..8125778 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -313,7 +313,10 @@ function user_load_by_name($name) {
  */
 function user_validate_name($name) {
   $definition = BaseFieldDefinition::create('string')
-    ->addConstraint('UserName', array());
+    ->setSettings(array(
+      'max_length' => USERNAME_MAX_LENGTH,
+    ))
+    ->addConstraint('UserName', []);
   $data = \Drupal::typedDataManager()->create($definition);
   $data->setValue($name);
   $violations = $data->validate();
@@ -449,7 +452,8 @@ function user_validate_current_pass(&$form, FormStateInterface $form_state) {
     // form values like password_confirm that have their own validation
     // that prevent them from being empty if they are changed.
     $current_value = $account->hasField($key) ? $account->get($key)->value : $account->$key;
-    if ((strlen(trim($form_state->getValue($key))) > 0) && ($form_state->getValue($key) != $current_value)) {
+    $form_value = isset($form_state->getValue($key)[0]['value']) ? $form_state->getValue($key)[0]['value'] : $form_state->getValue($key);
+    if ((strlen(trim($form_value)) > 0) && ($form_value != $current_value)) {
       $current_pass_failed = $form_state->isValueEmpty('current_pass') || !\Drupal::service('password')->check($form_state->getValue('current_pass'), $account);
       if ($current_pass_failed) {
         $form_state->setErrorByName('current_pass', t("Your current password is missing or incorrect; it's required to change the %name.", array('%name' => $name)));
diff --git a/core/profiles/standard/config/install/core.entity_form_display.user.user.default.yml b/core/profiles/standard/config/install/core.entity_form_display.user.user.default.yml
index d93cb2c..823f330 100644
--- a/core/profiles/standard/config/install/core.entity_form_display.user.user.default.yml
+++ b/core/profiles/standard/config/install/core.entity_form_display.user.user.default.yml
@@ -3,6 +3,13 @@ targetEntityType: user
 bundle: user
 mode: default
 content:
+  mail:
+    type: email_user
+    weight: -10
+    settings: {  }
+    third_party_settings: {  }
+  account:
+    weight: -10
   user_picture:
     type: image_image
     settings:
@@ -10,8 +17,11 @@ content:
       preview_image_style: thumbnail
     third_party_settings: {  }
     weight: -1
+langcode: und
 status: true
 dependencies:
+  config:
+    - field.field.user.user.user_picture
   module:
     - image
     - user
