diff --git a/core/composer.json b/core/composer.json
index b1dd8cf..c806737 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -96,7 +96,6 @@
         "drupal/editor": "self.version",
         "drupal/entity_reference": "self.version",
         "drupal/field": "self.version",
-        "drupal/field_layout": "self.version",
         "drupal/field_ui": "self.version",
         "drupal/file": "self.version",
         "drupal/filter": "self.version",
@@ -107,7 +106,6 @@
         "drupal/image": "self.version",
         "drupal/inline_form_errors": "self.version",
         "drupal/language": "self.version",
-        "drupal/layout_discovery": "self.version",
         "drupal/link": "self.version",
         "drupal/locale": "self.version",
         "drupal/minimal": "self.version",
diff --git a/core/config/schema/core.entity.schema.yml b/core/config/schema/core.entity.schema.yml
index df2a2fd..de79700 100644
--- a/core/config/schema/core.entity.schema.yml
+++ b/core/config/schema/core.entity.schema.yml
@@ -84,6 +84,12 @@ core.entity_view_display.*.*.*:
       sequence:
         type: boolean
         label: 'Value'
+    layout_id:
+      type: string
+      label: 'Layout ID'
+    layout_settings:
+      type: layout_plugin.settings.[%parent.layout_id]
+      label: 'Layout settings'
 
 # Overview configuration information for form mode displays.
 core.entity_form_display.*.*.*:
@@ -135,6 +141,12 @@ core.entity_form_display.*.*.*:
       sequence:
         type: boolean
         label: 'Component'
+    layout_id:
+      type: string
+      label: 'Layout ID'
+    layout_settings:
+      type: layout_plugin.settings.[%parent.layout_id]
+      label: 'Layout settings'
 
 # Default schema for entity display field with undefined type.
 field.formatter.settings.*:
diff --git a/core/core.services.yml b/core/core.services.yml
index 40c6a8a..bdfd347 100644
--- a/core/core.services.yml
+++ b/core/core.services.yml
@@ -643,6 +643,9 @@ services:
   plugin.manager.display_variant:
     class: Drupal\Core\Display\VariantManager
     parent: default_plugin_manager
+  plugin.manager.core.layout:
+    class: Drupal\Core\Layout\LayoutPluginManager
+    arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@theme_handler']
   plugin.manager.queue_worker:
     class: Drupal\Core\Queue\QueueWorkerManager
     parent: default_plugin_manager
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index 498c490..4e583d7 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1703,6 +1703,19 @@ function template_preprocess_breadcrumb(&$variables) {
 }
 
 /**
+ * Prepares variables for layout templates.
+ *
+ * @param array &$variables
+ *   An associative array containing:
+ *   - content: An associative array containing the properties of the element.
+ *     Properties used: #settings, #layout.
+ */
+function template_preprocess_layout(&$variables) {
+  $variables['settings'] = isset($variables['content']['#settings']) ? $variables['content']['#settings'] : [];
+  $variables['layout'] = isset($variables['content']['#layout']) ? $variables['content']['#layout'] : [];
+}
+
+/**
  * Callback for usort() within template_preprocess_field_multiple_value_form().
  *
  * Sorts using ['_weight']['#value']
diff --git a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php
index 38baa15..59fcd57 100644
--- a/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php
+++ b/core/lib/Drupal/Core/Entity/Display/EntityDisplayInterface.php
@@ -128,4 +128,25 @@ public function getTargetBundle();
    */
   public function setTargetBundle($bundle);
 
+  /**
+   * Gets the field's portion of the fully built entity display render array.
+   *
+   * @param string $field_name
+   *   The field name.
+   * @param array $build
+   *   The full render array.
+   *
+   * @return array
+   *   The portion of the render array corresponding to the given field name.
+   */
+  public function getFieldFromBuild($field_name, array $build);
+
+  /**
+   * Gets the default region.
+   *
+   * @return string
+   *   The default region for this display.
+   */
+  public function getDefaultRegion();
+
 }
diff --git a/core/modules/field_layout/src/Display/EntityDisplayWithLayoutInterface.php b/core/lib/Drupal/Core/Entity/Display/EntityDisplayWithLayoutInterface.php
similarity index 71%
rename from core/modules/field_layout/src/Display/EntityDisplayWithLayoutInterface.php
rename to core/lib/Drupal/Core/Entity/Display/EntityDisplayWithLayoutInterface.php
index 3bee65e..b64eea7 100644
--- a/core/modules/field_layout/src/Display/EntityDisplayWithLayoutInterface.php
+++ b/core/lib/Drupal/Core/Entity/Display/EntityDisplayWithLayoutInterface.php
@@ -1,8 +1,7 @@
 <?php
 
-namespace Drupal\field_layout\Display;
+namespace Drupal\Core\Entity\Display;
 
-use Drupal\Core\Entity\Display\EntityDisplayInterface;
 use Drupal\Core\Layout\LayoutInterface;
 
 /**
@@ -11,14 +10,6 @@
 interface EntityDisplayWithLayoutInterface extends EntityDisplayInterface {
 
   /**
-   * Gets the default region.
-   *
-   * @return string
-   *   The default region for this display.
-   */
-  public function getDefaultRegion();
-
-  /**
    * Gets the layout plugin ID for this display.
    *
    * @return string
@@ -64,15 +55,4 @@ public function setLayout(LayoutInterface $layout);
    */
   public function getLayout();
 
-  /**
-   * Ensures this entity has a layout.
-   *
-   * @param string $default_layout_id
-   *   (optional) The layout ID to use as a default. Defaults to
-   *   'layout_onecol'.
-   *
-   * @return $this
-   */
-  public function ensureLayout($default_layout_id = 'layout_onecol');
-
 }
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
index faa6d0d..65743d6 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityFormDisplay.php
@@ -30,6 +30,8 @@
  *     "mode",
  *     "content",
  *     "hidden",
+ *     "layout_id",
+ *     "layout_settings",
  *   }
  * )
  */
@@ -186,6 +188,7 @@ public function buildForm(FieldableEntityInterface $entity, array &$form, FormSt
 
     // Add a process callback so we can assign weights and hide extra fields.
     $form['#process'][] = [$this, 'processForm'];
+    $form['#process'][] = [$this, 'applyLayout'];
   }
 
   /**
@@ -213,6 +216,30 @@ public function processForm($element, FormStateInterface $form_state, $form) {
   }
 
   /**
+   * #process callback: Applies a layout to the entity form.
+   */
+  public function applyLayout($element, FormStateInterface $form_state, $form) {
+    if ($fields = $this->getFields($element)) {
+      $layout = $this->getLayout();
+      $fill = [];
+      $fill['#process'][] = '\Drupal\Core\Render\Element\RenderElement::processGroup';
+      $fill['#pre_render'][] = '\Drupal\Core\Render\Element\RenderElement::preRenderGroup';
+      $regions = array_fill_keys($layout->getPluginDefinition()->getRegionNames(), $fill);
+      foreach ($fields as $name => $field) {
+        // As this is a form, #group can be used to relocate the fields. This
+        // avoids breaking hook_form_alter() implementations by not actually
+        // moving the field in the form structure. If a #group is already set,
+        // do not overwrite it.
+        if (!isset($element[$name]['#group'])) {
+          $element[$name]['#group'] = $field['region'];
+        }
+      }
+      $element['layout'] = $layout->build($regions);
+    }
+    return $element;
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function extractFormValues(FieldableEntityInterface $entity, array &$form, FormStateInterface $form_state) {
@@ -326,7 +353,7 @@ public function getPluginCollections() {
       }
     }
 
-    return [
+    return parent::getPluginCollections() + [
       'widgets' => new EntityDisplayPluginCollection($this->pluginManager, $configurations)
     ];
   }
diff --git a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
index 74b15b6..a3cc0f9 100644
--- a/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
+++ b/core/lib/Drupal/Core/Entity/Entity/EntityViewDisplay.php
@@ -28,6 +28,8 @@
  *     "mode",
  *     "content",
  *     "hidden",
+ *     "layout_id",
+ *     "layout_settings",
  *   }
  * )
  */
@@ -278,12 +280,34 @@ public function buildMultiple(array $entities) {
         'display' => $this,
       ];
       \Drupal::moduleHandler()->alter('entity_display_build', $build_list[$id], $context);
+      $this->applyLayout($build_list[$id]);
     }
 
     return $build_list;
   }
 
   /**
+   * Applies the layout to the build.
+   *
+   * @param array $build
+   *   Render array.
+   */
+  protected function applyLayout(array &$build) {
+    if ($fields = $this->getFields($build)) {
+      $regions = [];
+      foreach ($fields as $name => $field) {
+        // Move the field from the top-level of $build into a region-specific
+        // section.
+        // @todo Ideally the array structure would remain unchanged, see
+        //   https://www.drupal.org/node/2846393.
+        $regions[$field['region']][$name] = $build[$name];
+        unset($build[$name]);
+      }
+      $build['layout'] = $this->getLayout()->build($regions);
+    }
+  }
+
+  /**
    * {@inheritdoc}
    */
   public function getPluginCollections() {
@@ -297,7 +321,7 @@ public function getPluginCollections() {
       }
     }
 
-    return [
+    return parent::getPluginCollections() + [
       'formatters' => new EntityDisplayPluginCollection($this->pluginManager, $configurations)
     ];
   }
diff --git a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
index ca106b2..375160f 100644
--- a/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
+++ b/core/lib/Drupal/Core/Entity/EntityDisplayBase.php
@@ -4,13 +4,16 @@
 
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
+use Drupal\Core\Entity\Display\EntityDisplayWithLayoutInterface;
 use Drupal\Core\Field\FieldDefinitionInterface;
 use Drupal\Core\Entity\Display\EntityDisplayInterface;
+use Drupal\Core\Layout\LayoutInterface;
+use Drupal\Core\Plugin\DefaultSingleLazyPluginCollection;
 
 /**
  * Provides a common base class for entity view and form displays.
  */
-abstract class EntityDisplayBase extends ConfigEntityBase implements EntityDisplayInterface {
+abstract class EntityDisplayBase extends ConfigEntityBase implements EntityDisplayInterface, EntityDisplayWithLayoutInterface {
 
   /**
    * The 'mode' for runtime EntityDisplay objects used to render entities with
@@ -79,6 +82,27 @@
   protected $hidden = [];
 
   /**
+   * The layout ID.
+   *
+   * @var string
+   */
+  protected $layout_id = 'layout_onecol';
+
+  /**
+   * The layout settings.
+   *
+   * @var array
+   */
+  protected $layout_settings = [];
+
+  /**
+   * The plugin collection that holds the layout plugin for this entity.
+   *
+   * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
+   */
+  protected $pluginCollection;
+
+  /**
    * The original view or form mode that was requested (case of view/form modes
    * being configured to fall back to the 'default' display).
    *
@@ -424,7 +448,7 @@ protected function getFieldDefinition($field_name) {
    */
   protected function getFieldDefinitions() {
     if (!isset($this->fieldDefinitions)) {
-      $definitions = \Drupal::entityManager()->getFieldDefinitions($this->targetEntityType, $this->bundle);
+      $definitions = \Drupal::service('entity_field.manager')->getFieldDefinitions($this->targetEntityType, $this->bundle);
       // For "official" view modes and form modes, ignore fields whose
       // definition states they should not be displayed.
       if ($this->mode !== static::CUSTOM_MODE) {
@@ -545,13 +569,115 @@ protected function getPluginRemovedDependencies(array $plugin_dependencies, arra
   }
 
   /**
+   * Gets the fields that need to be processed.
+   *
+   * @param array $build
+   *   A renderable array representing the entity content or form.
+   *
+   * @return array
+   *   An array of configurable fields present in the build.
+   */
+  protected function getFields(array $build) {
+    $components = $this->getComponents();
+
+    // Ignore any extra fields from the list of field definitions. Field
+    // definitions can have a non-configurable display, but all extra fields are
+    // always displayed.
+    $field_definitions = array_diff_key(
+      $this->getFieldDefinitions(),
+      \Drupal::service('entity_field.manager')->getExtraFields($this->getTargetEntityTypeId(), $this->getTargetBundle())
+    );
+
+    $fields_to_exclude = array_filter($field_definitions, function (FieldDefinitionInterface $field_definition) {
+      // Remove fields with a non-configurable display.
+      return !$field_definition->isDisplayConfigurable($this->displayContext);
+    });
+    $components = array_diff_key($components, $fields_to_exclude);
+
+    // Only include fields present in the build.
+    $components = array_intersect_key($components, $build);
+
+    return $components;
+  }
+
+  /**
    * Gets the default region.
    *
    * @return string
    *   The default region for this display.
    */
-  protected function getDefaultRegion() {
-    return 'content';
+  public function getDefaultRegion() {
+    return $this->getLayout()->getPluginDefinition()->getDefaultRegion();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLayoutId() {
+    return $this->layout_id;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLayoutSettings() {
+    return $this->layout_settings;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setLayoutId($layout_id, array $layout_settings = []) {
+    $original_layout_id = $this->getLayoutId();
+    $this->layout_id = $layout_id;
+    $this->getPluginCollection()->addInstanceID($layout_id, $layout_settings);
+
+    if ($original_layout_id !== $layout_id) {
+      // @todo Devise a mechanism for mapping old regions to new ones in
+      //   https://www.drupal.org/node/2796877.
+      $layout_definition = $this->getLayout()->getPluginDefinition();
+      $new_region = $layout_definition->getDefaultRegion();
+      $layout_regions = $layout_definition->getRegions();
+      foreach ($this->getComponents() as $name => $component) {
+        if (!isset($component['region']) || !isset($layout_regions[$component['region']])) {
+          $component['region'] = $new_region;
+          $this->setComponent($name, $component);
+        }
+      }
+    }
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setLayout(LayoutInterface $layout) {
+    $this->setLayoutId($layout->getPluginId(), $layout->getConfiguration());
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getLayout() {
+    return $this->getPluginCollection()->get($this->getLayoutId());
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFieldFromBuild($field_name, array $build) {
+    $field_component = $this->getComponent($field_name);
+    if (isset($build[$field_name])) {
+      $output = $build[$field_name];
+    }
+    elseif (isset($field_component['region']) && isset($build['layout'][$field_component['region']][$field_name])) {
+      $output = $build['layout'][$field_component['region']][$field_name];
+    }
+    else {
+      $output = [];
+    }
+    return $output;
   }
 
   /**
@@ -595,4 +721,26 @@ protected function getLogger() {
     return \Drupal::logger('system');
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getPluginCollections() {
+    return [
+      'layout_settings' => $this->getPluginCollection(),
+    ];
+  }
+
+  /**
+   * Encapsulates the creation of the layout plugin collection.
+   *
+   * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
+   *   The layout plugin collection.
+   */
+  protected function getPluginCollection() {
+    if (!$this->pluginCollection) {
+      $this->pluginCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.core.layout'), $this->layout_id, $this->layout_settings);
+    }
+    return $this->pluginCollection;
+  }
+
 }
diff --git a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
index 2c3340e..778c152 100644
--- a/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
+++ b/core/lib/Drupal/Core/Entity/EntityViewBuilder.php
@@ -399,13 +399,8 @@ public function viewField(FieldItemListInterface $items, $display_options = [])
     $field_name = $items->getFieldDefinition()->getName();
     $display = $this->getSingleFieldDisplay($entity, $field_name, $display_options);
 
-    $output = [];
     $build = $display->build($entity);
-    if (isset($build[$field_name])) {
-      $output = $build[$field_name];
-    }
-
-    return $output;
+    return $display->getFieldFromBuild($field_name, $build);
   }
 
   /**
@@ -465,11 +460,14 @@ protected function getSingleFieldDisplay($entity, $field_name, $display_options)
       $bundle = $entity->bundle();
       $key = $entity_type_id . ':' . $bundle . ':' . $field_name . ':' . Crypt::hashBase64(serialize($display_options));
       if (!isset($this->singleFieldDisplays[$key])) {
-        $this->singleFieldDisplays[$key] = EntityViewDisplay::create([
+        $display = EntityViewDisplay::create([
           'targetEntityType' => $entity_type_id,
           'bundle' => $bundle,
           'status' => TRUE,
-        ])->setComponent($field_name, $display_options);
+        ]);
+        $display_options += ['region' => $display->getDefaultRegion()];
+        $display->setComponent($field_name, $display_options);
+        $this->singleFieldDisplays[$key] = $display;
       }
       $display = $this->singleFieldDisplays[$key];
     }
diff --git a/core/lib/Drupal/Core/Layout/Annotation/Layout.php b/core/lib/Drupal/Core/Layout/Annotation/Layout.php
index 1cb5ff0..4f30834 100644
--- a/core/lib/Drupal/Core/Layout/Annotation/Layout.php
+++ b/core/lib/Drupal/Core/Layout/Annotation/Layout.php
@@ -72,9 +72,9 @@ class Layout extends Plugin {
   /**
    * The template file to render this layout (relative to the 'path' given).
    *
-   * If specified, then the layout_discovery module will register the template
-   * with hook_theme() and the module or theme registering this layout does not
-   * need to do it.
+   * If specified, then the system module will register the template with
+   * hook_theme() and the module or theme registering this layout does not need
+   * to do it.
    *
    * @var string optional
    *
diff --git a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml
index e0232cf..a67c230 100644
--- a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml
+++ b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.default.yml
@@ -3,6 +3,7 @@ status: true
 dependencies:
   module:
     - aggregator
+    - system
 id: aggregator_feed.aggregator_feed.default
 targetEntityType: aggregator_feed
 bundle: aggregator_feed
@@ -36,3 +37,5 @@ content:
     label: inline
 hidden:
   more_link: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml
index 5e5e468..e4ffd92 100644
--- a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml
+++ b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_feed.aggregator_feed.summary.yml
@@ -5,6 +5,7 @@ dependencies:
     - core.entity_view_mode.aggregator_feed.summary
   module:
     - aggregator
+    - system
 id: aggregator_feed.aggregator_feed.summary
 targetEntityType: aggregator_feed
 bundle: aggregator_feed
@@ -22,3 +23,5 @@ hidden:
   feed_icon: true
   image: true
   link: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml
index 8e29395..610747a 100644
--- a/core/modules/aggregator/config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml
+++ b/core/modules/aggregator/config/install/core.entity_view_display.aggregator_item.aggregator_item.summary.yml
@@ -5,6 +5,7 @@ dependencies:
     - core.entity_view_mode.aggregator_item.summary
   module:
     - aggregator
+    - system
 id: aggregator_item.aggregator_item.summary
 targetEntityType: aggregator_item
 bundle: aggregator_item
@@ -18,3 +19,5 @@ hidden:
   description: true
   feed: true
   link: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/book/config/optional/core.entity_form_display.node.book.default.yml b/core/modules/book/config/optional/core.entity_form_display.node.book.default.yml
index 58aba45..acc9af9 100644
--- a/core/modules/book/config/optional/core.entity_form_display.node.book.default.yml
+++ b/core/modules/book/config/optional/core.entity_form_display.node.book.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.node.book.body
     - node.type.book
   module:
+    - system
     - text
 id: node.book.default
 targetEntityType: node
@@ -58,3 +59,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/book/config/optional/core.entity_view_display.node.book.default.yml b/core/modules/book/config/optional/core.entity_view_display.node.book.default.yml
index d6ef64d..51ee89e 100644
--- a/core/modules/book/config/optional/core.entity_view_display.node.book.default.yml
+++ b/core/modules/book/config/optional/core.entity_view_display.node.book.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.node.book.body
     - node.type.book
   module:
+    - system
     - text
     - user
 id: node.book.default
@@ -23,3 +24,5 @@ content:
     weight: 101
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/book/config/optional/core.entity_view_display.node.book.teaser.yml b/core/modules/book/config/optional/core.entity_view_display.node.book.teaser.yml
index 77a62c3..9dbed1e 100644
--- a/core/modules/book/config/optional/core.entity_view_display.node.book.teaser.yml
+++ b/core/modules/book/config/optional/core.entity_view_display.node.book.teaser.yml
@@ -6,6 +6,7 @@ dependencies:
     - field.field.node.book.body
     - node.type.book
   module:
+    - system
     - text
     - user
 id: node.book.teaser
@@ -25,3 +26,5 @@ content:
     weight: 101
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
index 9c94aca..df804a4 100644
--- a/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
+++ b/core/modules/field/tests/src/Kernel/EntityReference/EntityReferenceFormatterTest.php
@@ -193,6 +193,7 @@ public function testEntityFormatter() {
     <div class="field__label">Body</div>
               <div class="field__item"><p>Hello, world!</p></div>
           </div>
+
 ';
     $renderer->renderRoot($build[0]);
     $this->assertEqual($build[0]['#markup'], 'default | ' . $this->referencedEntity->label() . $expected_rendered_name_field_1 . $expected_rendered_body_field_1, sprintf('The markup returned by the %s formatter is correct for an item with a saved entity.', $formatter));
@@ -209,6 +210,7 @@ public function testEntityFormatter() {
     <div class="field__label">Body</div>
               <div class="field__item"><p>Hello, unsaved world!</p></div>
           </div>
+
 ';
 
     $renderer->renderRoot($build[1]);
diff --git a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
index c1e7ae1..bfeb312 100644
--- a/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
+++ b/core/modules/field/tests/src/Kernel/FieldAttachOtherTest.php
@@ -45,6 +45,7 @@ function testEntityDisplayBuild() {
     $display_options = [
       'label' => 'above',
       'type' => 'field_test_default',
+      'region' => 'content',
       'settings' => [
         'test_formatter_setting' => $formatter_setting,
       ],
@@ -55,6 +56,7 @@ function testEntityDisplayBuild() {
     $display_options_2 = [
       'label' => 'above',
       'type' => 'field_test_default',
+      'region' => 'content',
       'settings' => [
         'test_formatter_setting' => $formatter_setting_2,
       ],
@@ -97,6 +99,7 @@ function testEntityDisplayBuild() {
     $display->setComponent($this->fieldTestData->field_name, [
       'label' => 'above',
       'type' => 'field_test_multiple',
+      'region' => 'content',
       'settings' => [
         'test_formatter_setting_multiple' => $formatter_setting,
       ],
@@ -115,6 +118,7 @@ function testEntityDisplayBuild() {
     $display->setComponent($this->fieldTestData->field_name, [
       'label' => 'above',
       'type' => 'field_test_with_prepare_view',
+      'region' => 'content',
       'settings' => [
         'test_formatter_setting_additional' => $formatter_setting,
       ],
@@ -138,6 +142,7 @@ function testEntityDisplayViewMultiple() {
     $display = entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->fieldTestData->field_name, [
         'type' => 'field_test_with_prepare_view',
+        'region' => 'content',
       ]);
 
     // Create two entities.
diff --git a/core/modules/field_layout/config/schema/field_layout.schema.yml b/core/modules/field_layout/config/schema/field_layout.schema.yml
deleted file mode 100644
index 185fb4e..0000000
--- a/core/modules/field_layout/config/schema/field_layout.schema.yml
+++ /dev/null
@@ -1,16 +0,0 @@
-core.entity_view_display.*.*.*.third_party.field_layout:
-  type: field_layout.third_party_settings
-
-core.entity_form_display.*.*.*.third_party.field_layout:
-  type: field_layout.third_party_settings
-
-field_layout.third_party_settings:
-  type: mapping
-  label: 'Per-view-mode field layout settings'
-  mapping:
-    id:
-      type: string
-      label: 'Layout ID'
-    settings:
-      type: layout_plugin.settings.[%parent.id]
-      label: 'Layout settings'
diff --git a/core/modules/field_layout/field_layout.info.yml b/core/modules/field_layout/field_layout.info.yml
deleted file mode 100644
index 237f18d..0000000
--- a/core/modules/field_layout/field_layout.info.yml
+++ /dev/null
@@ -1,8 +0,0 @@
-name: 'Field Layout'
-type: module
-description: 'Adds layout capabilities to the Field UI.'
-package: Core (Experimental)
-version: VERSION
-core: 8.x
-dependencies:
-  - layout_discovery
diff --git a/core/modules/field_layout/field_layout.install b/core/modules/field_layout/field_layout.install
deleted file mode 100644
index 5956bf1..0000000
--- a/core/modules/field_layout/field_layout.install
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains install and update functions for Field Layout.
- */
-
-use Drupal\Core\Cache\Cache;
-use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\Core\Entity\Entity\EntityViewDisplay;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-
-/**
- * Implements hook_install().
- */
-function field_layout_install() {
-  // Ensure each entity display has a layout.
-  $entity_save = function (EntityDisplayWithLayoutInterface $entity) {
-    $entity->ensureLayout()->save();
-  };
-  array_map($entity_save, EntityViewDisplay::loadMultiple());
-  array_map($entity_save, EntityFormDisplay::loadMultiple());
-
-  // Invalidate the render cache since all content will now have a layout.
-  Cache::invalidateTags(['rendered']);
-}
-
-/**
- * Implements hook_uninstall().
- */
-function field_layout_uninstall() {
-  // Reset each entity display to use the one-column layout to best approximate
-  // the absence of layouts.
-  $entity_save = function (EntityDisplayWithLayoutInterface $entity) {
-    $entity->setLayoutId('layout_onecol')->save();
-  };
-  array_map($entity_save, EntityViewDisplay::loadMultiple());
-  array_map($entity_save, EntityFormDisplay::loadMultiple());
-
-  // Invalidate the render cache since all content will no longer have a layout.
-  Cache::invalidateTags(['rendered']);
-}
diff --git a/core/modules/field_layout/field_layout.module b/core/modules/field_layout/field_layout.module
deleted file mode 100644
index 5a5fa11..0000000
--- a/core/modules/field_layout/field_layout.module
+++ /dev/null
@@ -1,69 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides hook implementations for Field Layout.
- */
-
-use Drupal\Core\Entity\ContentEntityFormInterface;
-use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
-use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Routing\RouteMatchInterface;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-use Drupal\field_layout\Entity\FieldLayoutEntityFormDisplay;
-use Drupal\field_layout\Entity\FieldLayoutEntityViewDisplay;
-use Drupal\field_layout\FieldLayoutBuilder;
-use Drupal\field_layout\Form\FieldLayoutEntityFormDisplayEditForm;
-use Drupal\field_layout\Form\FieldLayoutEntityViewDisplayEditForm;
-
-/**
- * Implements hook_help().
- */
-function field_layout_help($route_name, RouteMatchInterface $route_match) {
-  switch ($route_name) {
-    case 'help.page.field_layout':
-      $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('The Field Layout module allows you to arrange fields into regions on forms and displays of entities such as nodes and users.') . '</p>';
-      $output .= '<p>' . t('For more information, see the <a href=":field-layout-documentation">online documentation for the Field Layout module</a>.', [':field-layout-documentation' => 'https://www.drupal.org/documentation/modules/field_layout']) . '</p>';
-      return $output;
-  }
-}
-
-/**
- * Implements hook_entity_type_alter().
- */
-function field_layout_entity_type_alter(array &$entity_types) {
-  /** @var $entity_types \Drupal\Core\Entity\EntityTypeInterface[] */
-  $entity_types['entity_view_display']->setClass(FieldLayoutEntityViewDisplay::class);
-  $entity_types['entity_form_display']->setClass(FieldLayoutEntityFormDisplay::class);
-
-  // The form classes are only needed when Field UI is installed.
-  if (\Drupal::moduleHandler()->moduleExists('field_ui')) {
-    $entity_types['entity_view_display']->setFormClass('edit', FieldLayoutEntityViewDisplayEditForm::class);
-    $entity_types['entity_form_display']->setFormClass('edit', FieldLayoutEntityFormDisplayEditForm::class);
-  }
-}
-
-/**
- * Implements hook_entity_view_alter().
- */
-function field_layout_entity_view_alter(array &$build, EntityInterface $entity, EntityViewDisplayInterface $display) {
-  if ($display instanceof EntityDisplayWithLayoutInterface) {
-    \Drupal::classResolver()->getInstanceFromDefinition(FieldLayoutBuilder::class)
-      ->buildView($build, $display);
-  }
-}
-
-/**
- * Implements hook_form_alter().
- */
-function field_layout_form_alter(&$form, FormStateInterface $form_state, $form_id) {
-  $form_object = $form_state->getFormObject();
-  if ($form_object instanceof ContentEntityFormInterface && $display = $form_object->getFormDisplay($form_state)) {
-    if ($display instanceof EntityDisplayWithLayoutInterface) {
-      \Drupal::classResolver()->getInstanceFromDefinition(FieldLayoutBuilder::class)
-        ->buildForm($form, $display);
-    }
-  }
-}
diff --git a/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php b/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
deleted file mode 100644
index 59377be..0000000
--- a/core/modules/field_layout/src/Entity/FieldLayoutEntityDisplayTrait.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Entity;
-
-use Drupal\Core\Entity\EntityStorageInterface;
-use Drupal\Core\Layout\LayoutInterface;
-
-/**
- * Provides shared code for entity displays.
- *
- * Both EntityViewDisplay and EntityFormDisplay must maintain their parent
- * hierarchy, while being identically enhanced by Field Layout. This trait
- * contains the code they both share.
- */
-trait FieldLayoutEntityDisplayTrait {
-
-  /**
-   * Gets a layout definition.
-   *
-   * @param string $layout_id
-   *   The layout ID.
-   *
-   * @return \Drupal\Core\Layout\LayoutDefinition
-   *   The layout definition.
-   */
-  protected function getLayoutDefinition($layout_id) {
-    return \Drupal::service('plugin.manager.core.layout')->getDefinition($layout_id);
-  }
-
-  /**
-   * Implements \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface::getLayoutId().
-   */
-  public function getLayoutId() {
-    return $this->getThirdPartySetting('field_layout', 'id');
-  }
-
-  /**
-   * Implements \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface::getLayoutSettings().
-   */
-  public function getLayoutSettings() {
-    return $this->getThirdPartySetting('field_layout', 'settings', []);
-  }
-
-  /**
-   * Implements \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface::setLayoutId().
-   */
-  public function setLayoutId($layout_id, array $layout_settings = []) {
-    if ($this->getLayoutId() !== $layout_id) {
-      // @todo Devise a mechanism for mapping old regions to new ones in
-      //   https://www.drupal.org/node/2796877.
-      $layout_definition = $this->getLayoutDefinition($layout_id);
-      $new_region = $layout_definition->getDefaultRegion();
-      $layout_regions = $layout_definition->getRegions();
-      foreach ($this->getComponents() as $name => $component) {
-        if (isset($component['region']) && !isset($layout_regions[$component['region']])) {
-          $component['region'] = $new_region;
-          $this->setComponent($name, $component);
-        }
-      }
-    }
-    $this->setThirdPartySetting('field_layout', 'id', $layout_id);
-    // Instantiate the plugin and consult it for the updated plugin
-    // configuration. Once layouts are no longer stored as third party settings,
-    // this will be handled by the code in
-    // \Drupal\Core\Config\Entity\ConfigEntityBase::set() that handles
-    // \Drupal\Core\Entity\EntityWithPluginCollectionInterface.
-    $layout_settings = $this->doGetLayout($layout_id, $layout_settings)->getConfiguration();
-    $this->setThirdPartySetting('field_layout', 'settings', $layout_settings);
-    return $this;
-  }
-
-  /**
-   * Implements \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface::setLayout().
-   */
-  public function setLayout(LayoutInterface $layout) {
-    $this->setLayoutId($layout->getPluginId(), $layout->getConfiguration());
-    return $this;
-  }
-
-  /**
-   * Implements \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface::getLayout().
-   */
-  public function getLayout() {
-    return $this->doGetLayout($this->getLayoutId(), $this->getLayoutSettings());
-  }
-
-  /**
-   * Gets the layout plugin.
-   *
-   * @param string $layout_id
-   *   A layout plugin ID.
-   * @param array $layout_settings
-   *   An array of settings.
-   *
-   * @return \Drupal\Core\Layout\LayoutInterface
-   *   The layout plugin.
-   */
-  protected function doGetLayout($layout_id, array $layout_settings) {
-    return \Drupal::service('plugin.manager.core.layout')->createInstance($layout_id, $layout_settings);
-  }
-
-  /**
-   * Overrides \Drupal\Core\Entity\EntityDisplayBase::init().
-   */
-  protected function init() {
-    $this->ensureLayout();
-    parent::init();
-  }
-
-  /**
-   * Overrides \Drupal\Core\Entity\EntityDisplayBase::preSave().
-   */
-  public function preSave(EntityStorageInterface $storage) {
-    parent::preSave($storage);
-
-    // Ensure the plugin configuration is updated. Once layouts are no longer
-    // stored as third party settings, this will be handled by the code in
-    // \Drupal\Core\Config\Entity\ConfigEntityBase::preSave() that handles
-    // \Drupal\Core\Entity\EntityWithPluginCollectionInterface.
-    if ($this->getLayoutId()) {
-      $this->setLayout($this->getLayout());
-    }
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function ensureLayout($default_layout_id = 'layout_onecol') {
-    if (!$this->getLayoutId()) {
-      $this->setLayoutId($default_layout_id);
-    }
-
-    return $this;
-  }
-
-  /**
-   * Overrides \Drupal\Core\Entity\EntityDisplayBase::calculateDependencies().
-   *
-   * Ensure the plugin dependencies are included. Once layouts are no longer
-   * stored as third party settings, this will be handled by the code in
-   * \Drupal\Core\Config\Entity\ConfigEntityBase::calculateDependencies() that
-   * handles \Drupal\Core\Entity\EntityWithPluginCollectionInterface.
-   */
-  public function calculateDependencies() {
-    parent::calculateDependencies();
-
-    // This can be called during uninstallation, so check for a valid ID first.
-    if ($this->getLayoutId()) {
-      $this->calculatePluginDependencies($this->getLayout());
-    }
-  }
-
-}
diff --git a/core/modules/field_layout/src/Entity/FieldLayoutEntityFormDisplay.php b/core/modules/field_layout/src/Entity/FieldLayoutEntityFormDisplay.php
deleted file mode 100644
index c58938e..0000000
--- a/core/modules/field_layout/src/Entity/FieldLayoutEntityFormDisplay.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Entity;
-
-use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-
-/**
- * Provides an entity form display entity that has a layout.
- */
-class FieldLayoutEntityFormDisplay extends EntityFormDisplay implements EntityDisplayWithLayoutInterface {
-
-  use FieldLayoutEntityDisplayTrait;
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getDefaultRegion() {
-    // This cannot be provided by the trait due to
-    // https://bugs.php.net/bug.php?id=71414 which is fixed in PHP 7.0.6.
-    return $this->getLayoutDefinition($this->getLayoutId())->getDefaultRegion();
-  }
-
-}
diff --git a/core/modules/field_layout/src/Entity/FieldLayoutEntityViewDisplay.php b/core/modules/field_layout/src/Entity/FieldLayoutEntityViewDisplay.php
deleted file mode 100644
index 4f0c274..0000000
--- a/core/modules/field_layout/src/Entity/FieldLayoutEntityViewDisplay.php
+++ /dev/null
@@ -1,24 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Entity;
-
-use Drupal\Core\Entity\Entity\EntityViewDisplay;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-
-/**
- * Provides an entity view display entity that has a layout.
- */
-class FieldLayoutEntityViewDisplay extends EntityViewDisplay implements EntityDisplayWithLayoutInterface {
-
-  use FieldLayoutEntityDisplayTrait;
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getDefaultRegion() {
-    // This cannot be provided by the trait due to
-    // https://bugs.php.net/bug.php?id=71414 which is fixed in PHP 7.0.6.
-    return $this->getLayoutDefinition($this->getLayoutId())->getDefaultRegion();
-  }
-
-}
diff --git a/core/modules/field_layout/src/FieldLayoutBuilder.php b/core/modules/field_layout/src/FieldLayoutBuilder.php
deleted file mode 100644
index 8ef5d04..0000000
--- a/core/modules/field_layout/src/FieldLayoutBuilder.php
+++ /dev/null
@@ -1,153 +0,0 @@
-<?php
-
-namespace Drupal\field_layout;
-
-use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
-use Drupal\Core\Entity\EntityFieldManagerInterface;
-use Drupal\Core\Field\FieldDefinitionInterface;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-use Drupal\Core\Layout\LayoutPluginManagerInterface;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Builds a field layout.
- */
-class FieldLayoutBuilder implements ContainerInjectionInterface {
-
-  /**
-   * The layout plugin manager.
-   *
-   * @var \Drupal\Core\Layout\LayoutPluginManagerInterface
-   */
-  protected $layoutPluginManager;
-
-  /**
-   * The entity field manager.
-   *
-   * @var \Drupal\Core\Entity\EntityFieldManagerInterface
-   */
-  protected $entityFieldManager;
-
-  /**
-   * Constructs a new FieldLayoutBuilder.
-   *
-   * @param \Drupal\Core\Layout\LayoutPluginManagerInterface $layout_plugin_manager
-   *   The layout plugin manager.
-   * @param \Drupal\Core\Entity\EntityFieldManagerInterface $entity_field_manager
-   *   The entity field manager.
-   */
-  public function __construct(LayoutPluginManagerInterface $layout_plugin_manager, EntityFieldManagerInterface $entity_field_manager) {
-    $this->layoutPluginManager = $layout_plugin_manager;
-    $this->entityFieldManager = $entity_field_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('plugin.manager.core.layout'),
-      $container->get('entity_field.manager')
-    );
-  }
-
-  /**
-   * Applies the layout to an entity build.
-   *
-   * @param array $build
-   *   A renderable array representing the entity content or form.
-   * @param \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface $display
-   *   The entity display holding the display options configured for the entity
-   *   components.
-   */
-  public function buildView(array &$build, EntityDisplayWithLayoutInterface $display) {
-    $layout_definition = $this->layoutPluginManager->getDefinition($display->getLayoutId(), FALSE);
-    if ($layout_definition && $fields = $this->getFields($build, $display, 'view')) {
-      // Add the regions to the $build in the correct order.
-      $regions = array_fill_keys($layout_definition->getRegionNames(), []);
-
-      foreach ($fields as $name => $field) {
-        // Move the field from the top-level of $build into a region-specific
-        // section.
-        // @todo Ideally the array structure would remain unchanged, see
-        //   https://www.drupal.org/node/2846393.
-        $regions[$field['region']][$name] = $build[$name];
-        unset($build[$name]);
-      }
-      // Ensure this will not conflict with any existing array elements by
-      // prefixing with an underscore.
-      $build['_field_layout'] = $display->getLayout()->build($regions);
-    }
-  }
-
-  /**
-   * Applies the layout to an entity form.
-   *
-   * @param array $build
-   *   A renderable array representing the entity content or form.
-   * @param \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface $display
-   *   The entity display holding the display options configured for the entity
-   *   components.
-   */
-  public function buildForm(array &$build, EntityDisplayWithLayoutInterface $display) {
-    $layout_definition = $this->layoutPluginManager->getDefinition($display->getLayoutId(), FALSE);
-    if ($layout_definition && $fields = $this->getFields($build, $display, 'form')) {
-      $fill = [];
-      $fill['#process'][] = '\Drupal\Core\Render\Element\RenderElement::processGroup';
-      $fill['#pre_render'][] = '\Drupal\Core\Render\Element\RenderElement::preRenderGroup';
-      // Add the regions to the $build in the correct order.
-      $regions = array_fill_keys($layout_definition->getRegionNames(), $fill);
-
-      foreach ($fields as $name => $field) {
-        // As this is a form, #group can be used to relocate the fields. This
-        // avoids breaking hook_form_alter() implementations by not actually
-        // moving the field in the form structure. If a #group is already set,
-        // do not overwrite it.
-        if (!isset($build[$name]['#group'])) {
-          $build[$name]['#group'] = $field['region'];
-        }
-      }
-      // Ensure this will not conflict with any existing array elements by
-      // prefixing with an underscore.
-      $build['_field_layout'] = $display->getLayout()->build($regions);
-    }
-  }
-
-  /**
-   * Gets the fields that need to be processed.
-   *
-   * @param array $build
-   *   A renderable array representing the entity content or form.
-   * @param \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface $display
-   *   The entity display holding the display options configured for the entity
-   *   components.
-   * @param string $display_context
-   *   The display context, either 'form' or 'view'.
-   *
-   * @return array
-   *   An array of configurable fields present in the build.
-   */
-  protected function getFields(array $build, EntityDisplayWithLayoutInterface $display, $display_context) {
-    $components = $display->getComponents();
-
-    // Ignore any extra fields from the list of field definitions. Field
-    // definitions can have a non-configurable display, but all extra fields are
-    // always displayed.
-    $field_definitions = array_diff_key(
-      $this->entityFieldManager->getFieldDefinitions($display->getTargetEntityTypeId(), $display->getTargetBundle()),
-      $this->entityFieldManager->getExtraFields($display->getTargetEntityTypeId(), $display->getTargetBundle())
-    );
-
-    $fields_to_exclude = array_filter($field_definitions, function (FieldDefinitionInterface $field_definition) use ($display_context) {
-      // Remove fields with a non-configurable display.
-      return !$field_definition->isDisplayConfigurable($display_context);
-    });
-    $components = array_diff_key($components, $fields_to_exclude);
-
-    // Only include fields present in the build.
-    $components = array_intersect_key($components, $build);
-
-    return $components;
-  }
-
-}
diff --git a/core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php b/core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php
deleted file mode 100644
index 043e5c7..0000000
--- a/core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php
+++ /dev/null
@@ -1,177 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Form;
-
-use Drupal\Core\Form\FormStateInterface;
-use Drupal\Core\Form\SubformState;
-use Drupal\Core\Plugin\PluginFormInterface;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-
-/**
- * Provides shared code for entity display forms.
- *
- * Both EntityViewDisplayEditForm and EntityFormDisplayEditForm must maintain
- * their parent hierarchy, while being identically enhanced by Field Layout.
- * This trait contains the code they both share.
- */
-trait FieldLayoutEntityDisplayFormTrait {
-
-  /**
-   * The field layout plugin manager.
-   *
-   * @var \Drupal\Core\Layout\LayoutPluginManagerInterface
-   */
-  protected $layoutPluginManager;
-
-  /**
-   * Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::getRegions().
-   */
-  public function getRegions() {
-    $regions = [];
-
-    $layout_definition = $this->layoutPluginManager->getDefinition($this->getEntity()->getLayoutId());
-    foreach ($layout_definition->getRegions() as $name => $region) {
-      $regions[$name] = [
-        'title' => $region['label'],
-        'message' => $this->t('No field is displayed.'),
-      ];
-    }
-
-    $regions['hidden'] = [
-      'title' => $this->t('Disabled', [], ['context' => 'Plural']),
-      'message' => $this->t('No field is hidden.'),
-    ];
-
-    return $regions;
-  }
-
-  /**
-   * Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::form().
-   */
-  public function form(array $form, FormStateInterface $form_state) {
-    $form = parent::form($form, $form_state);
-
-    $form['field_layouts'] = [
-      '#type' => 'details',
-      '#title' => $this->t('Layout settings'),
-    ];
-
-    $layout_plugin = $this->getLayout($this->getEntity(), $form_state);
-
-    $form['field_layouts']['field_layout'] = [
-      '#type' => 'select',
-      '#title' => $this->t('Select a layout'),
-      '#options' => $this->layoutPluginManager->getLayoutOptions(),
-      '#default_value' => $layout_plugin->getPluginId(),
-      '#ajax' => [
-        'callback' => '::settingsAjax',
-        'wrapper' => 'field-layout-settings-wrapper',
-        'trigger_as' => ['name' => 'field_layout_change'],
-      ],
-    ];
-    $form['field_layouts']['submit'] = [
-      '#type' => 'submit',
-      '#name' => 'field_layout_change',
-      '#value' => $this->t('Change layout'),
-      '#submit' => ['::settingsAjaxSubmit'],
-      '#attributes' => ['class' => ['js-hide']],
-      '#ajax' => [
-        'callback' => '::settingsAjax',
-        'wrapper' => 'field-layout-settings-wrapper',
-      ],
-    ];
-
-    $form['field_layouts']['settings_wrapper'] = [
-      '#type' => 'container',
-      '#id' => 'field-layout-settings-wrapper',
-      '#tree' => TRUE,
-    ];
-
-    if ($layout_plugin instanceof PluginFormInterface) {
-      $form['field_layouts']['settings_wrapper']['layout_settings'] = [];
-      $subform_state = SubformState::createForSubform($form['field_layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
-      $form['field_layouts']['settings_wrapper']['layout_settings'] = $layout_plugin->buildConfigurationForm($form['field_layouts']['settings_wrapper']['layout_settings'], $subform_state);
-    }
-
-    return $form;
-  }
-
-  /**
-   * Gets the layout plugin for the currently selected field layout.
-   *
-   * @param \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface $entity
-   *   The current form entity.
-   * @param \Drupal\Core\Form\FormStateInterface $form_state
-   *   The current state of the form.
-   *
-   * @return \Drupal\Core\Layout\LayoutInterface
-   *   The layout plugin.
-   */
-  protected function getLayout(EntityDisplayWithLayoutInterface $entity, FormStateInterface $form_state) {
-    if (!$layout_plugin = $form_state->get('layout_plugin')) {
-      $stored_layout_id = $entity->getLayoutId();
-      // Use selected layout if it exists, falling back to the stored layout.
-      $layout_id = $form_state->getValue('field_layout', $stored_layout_id);
-      // If the current layout is the stored layout, use the stored layout
-      // settings. Otherwise leave the settings empty.
-      $layout_settings = $layout_id === $stored_layout_id ? $entity->getLayoutSettings() : [];
-
-      $layout_plugin = $this->layoutPluginManager->createInstance($layout_id, $layout_settings);
-      $form_state->set('layout_plugin', $layout_plugin);
-    }
-    return $layout_plugin;
-  }
-
-  /**
-   * Ajax callback for the field layout settings form.
-   */
-  public static function settingsAjax($form, FormStateInterface $form_state) {
-    return $form['field_layouts']['settings_wrapper'];
-  }
-
-  /**
-   * Submit handler for the non-JS case.
-   */
-  public function settingsAjaxSubmit($form, FormStateInterface $form_state) {
-    $form_state->set('layout_plugin', NULL);
-    $form_state->setRebuild();
-  }
-
-  /**
-   * Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::validateForm().
-   */
-  public function validateForm(array &$form, FormStateInterface $form_state) {
-    parent::validateForm($form, $form_state);
-
-    $layout_plugin = $this->getLayout($this->getEntity(), $form_state);
-    if ($layout_plugin instanceof PluginFormInterface) {
-      $subform_state = SubformState::createForSubform($form['field_layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
-      $layout_plugin->validateConfigurationForm($form['field_layouts']['settings_wrapper']['layout_settings'], $subform_state);
-    }
-  }
-
-  /**
-   * Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::submitForm().
-   */
-  public function submitForm(array &$form, FormStateInterface $form_state) {
-    parent::submitForm($form, $form_state);
-
-    $entity = $this->getEntity();
-    $layout_plugin = $this->getLayout($entity, $form_state);
-    if ($layout_plugin instanceof PluginFormInterface) {
-      $subform_state = SubformState::createForSubform($form['field_layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
-      $layout_plugin->submitConfigurationForm($form['field_layouts']['settings_wrapper']['layout_settings'], $subform_state);
-    }
-
-    $entity->setLayout($layout_plugin);
-  }
-
-  /**
-   * Gets the form entity.
-   *
-   * @return \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface
-   *   The current form entity.
-   */
-  abstract public function getEntity();
-
-}
diff --git a/core/modules/field_layout/src/Form/FieldLayoutEntityFormDisplayEditForm.php b/core/modules/field_layout/src/Form/FieldLayoutEntityFormDisplayEditForm.php
deleted file mode 100644
index c42a9d8..0000000
--- a/core/modules/field_layout/src/Form/FieldLayoutEntityFormDisplayEditForm.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Form;
-
-use Drupal\Component\Plugin\PluginManagerBase;
-use Drupal\Core\Field\FieldTypePluginManagerInterface;
-use Drupal\Core\Layout\LayoutPluginManagerInterface;
-use Drupal\field_ui\Form\EntityFormDisplayEditForm;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Edit form for the EntityFormDisplay entity type.
- */
-class FieldLayoutEntityFormDisplayEditForm extends EntityFormDisplayEditForm {
-
-  use FieldLayoutEntityDisplayFormTrait;
-
-  /**
-   * FieldLayoutEntityFormDisplayEditForm constructor.
-   *
-   * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
-   *   The field type manager.
-   * @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
-   *   The widget plugin manager.
-   * @param \Drupal\Core\Layout\LayoutPluginManagerInterface $layout_plugin_manager
-   *   The layout plugin manager.
-   */
-  public function __construct(FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, LayoutPluginManagerInterface $layout_plugin_manager) {
-    parent::__construct($field_type_manager, $plugin_manager);
-    $this->layoutPluginManager = $layout_plugin_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('plugin.manager.field.field_type'),
-      $container->get('plugin.manager.field.widget'),
-      $container->get('plugin.manager.core.layout')
-    );
-  }
-
-}
diff --git a/core/modules/field_layout/src/Form/FieldLayoutEntityViewDisplayEditForm.php b/core/modules/field_layout/src/Form/FieldLayoutEntityViewDisplayEditForm.php
deleted file mode 100644
index 92bfbde..0000000
--- a/core/modules/field_layout/src/Form/FieldLayoutEntityViewDisplayEditForm.php
+++ /dev/null
@@ -1,44 +0,0 @@
-<?php
-
-namespace Drupal\field_layout\Form;
-
-use Drupal\Component\Plugin\PluginManagerBase;
-use Drupal\Core\Field\FieldTypePluginManagerInterface;
-use Drupal\Core\Layout\LayoutPluginManagerInterface;
-use Drupal\field_ui\Form\EntityViewDisplayEditForm;
-use Symfony\Component\DependencyInjection\ContainerInterface;
-
-/**
- * Edit form for the EntityViewDisplay entity type.
- */
-class FieldLayoutEntityViewDisplayEditForm extends EntityViewDisplayEditForm {
-
-  use FieldLayoutEntityDisplayFormTrait;
-
-  /**
-   * FieldLayoutEntityViewDisplayEditForm constructor.
-   *
-   * @param \Drupal\Core\Field\FieldTypePluginManagerInterface $field_type_manager
-   *   The field type manager.
-   * @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
-   *   The formatter plugin manager.
-   * @param \Drupal\Core\Layout\LayoutPluginManagerInterface $layout_plugin_manager
-   *   The field layout plugin manager.
-   */
-  public function __construct(FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, LayoutPluginManagerInterface $layout_plugin_manager) {
-    parent::__construct($field_type_manager, $plugin_manager);
-    $this->layoutPluginManager = $layout_plugin_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function create(ContainerInterface $container) {
-    return new static(
-      $container->get('plugin.manager.field.field_type'),
-      $container->get('plugin.manager.field.formatter'),
-      $container->get('plugin.manager.core.layout')
-    );
-  }
-
-}
diff --git a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php b/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
deleted file mode 100644
index 683ccd2..0000000
--- a/core/modules/field_layout/tests/src/Functional/FieldLayoutTest.php
+++ /dev/null
@@ -1,76 +0,0 @@
-<?php
-
-namespace Drupal\Tests\field_layout\Functional;
-
-use Drupal\Tests\BrowserTestBase;
-
-/**
- * Tests using field layout for entity displays.
- *
- * @group field_layout
- */
-class FieldLayoutTest extends BrowserTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['field_layout', 'field_ui', 'node'];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    $this->createContentType([
-      'type' => 'article',
-    ]);
-    $this->createNode([
-      'type' => 'article',
-      'title' => 'The node title',
-      'body' => [[
-        'value' => 'The node body',
-      ]],
-    ]);
-    $this->drupalLogin($this->drupalCreateUser([
-      'access administration pages',
-      'administer content types',
-      'administer nodes',
-      'administer node fields',
-      'administer node display',
-      'administer node form display',
-      'view the administration theme',
-    ]));
-  }
-
-  /**
-   * Tests an entity type that has fields shown by default.
-   */
-  public function testNodeView() {
-    // By default, the one-column layout is used.
-    $this->drupalGet('node/1');
-    $this->assertSession()->elementExists('css', '.layout--onecol');
-    $this->assertSession()->elementExists('css', '.layout-region--content .field--name-body');
-
-    $this->drupalGet('admin/structure/types/manage/article/display');
-    $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
-    $this->assertSession()->optionExists('fields[body][region]', 'content');
-  }
-
-  /**
-   * Gets the region titles on the page.
-   *
-   * @return string[]
-   *   An array of region titles.
-   */
-  protected function getRegionTitles() {
-    $region_titles = [];
-    $region_title_elements = $this->getSession()->getPage()->findAll('css', '.region-title td');
-    /** @var \Behat\Mink\Element\NodeElement[] $region_title_elements */
-    foreach ($region_title_elements as $region_title_element) {
-      $region_titles[] = $region_title_element->getText();
-    }
-    return $region_titles;
-  }
-
-}
diff --git a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php b/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
deleted file mode 100644
index a0fd13c..0000000
--- a/core/modules/field_layout/tests/src/FunctionalJavascript/FieldLayoutTest.php
+++ /dev/null
@@ -1,266 +0,0 @@
-<?php
-
-namespace Drupal\Tests\field_layout\FunctionalJavascript;
-
-use Drupal\entity_test\Entity\EntityTest;
-use Drupal\FunctionalJavascriptTests\JavascriptTestBase;
-
-/**
- * Tests using field layout for entity displays.
- *
- * @group field_layout
- */
-class FieldLayoutTest extends JavascriptTestBase {
-
-  /**
-   * {@inheritdoc}
-   */
-  public static $modules = ['field_layout', 'field_ui', 'field_layout_test', 'layout_test'];
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    $entity = EntityTest::create([
-      'name' => 'The name for this entity',
-      'field_test_text' => [[
-        'value' => 'The field test text value',
-      ]],
-    ]);
-    $entity->save();
-    $this->drupalLogin($this->drupalCreateUser([
-      'access administration pages',
-      'view test entity',
-      'administer entity_test content',
-      'administer entity_test fields',
-      'administer entity_test display',
-      'administer entity_test form display',
-      'view the administration theme',
-    ]));
-  }
-
-  /**
-   * Tests that layouts are unique per view mode.
-   */
-  public function testEntityViewModes() {
-    // By default, the field is not visible.
-    $this->drupalGet('entity_test/1/test');
-    $this->assertSession()->elementNotExists('css', '.layout-region--content .field--name-field-test-text');
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->elementNotExists('css', '.layout-region--content .field--name-field-test-text');
-
-    // Change the layout for the "test" view mode. See
-    // core.entity_view_mode.entity_test.test.yml.
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    $this->click('#edit-modes');
-    $this->getSession()->getPage()->checkField('display_modes_custom[test]');
-    $this->submitForm([], 'Save');
-    $this->clickLink('configure them');
-    $this->getSession()->getPage()->pressButton('Show row weights');
-    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'content');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-
-    // Each view mode has a different layout.
-    $this->drupalGet('entity_test/1/test');
-    $this->assertSession()->elementExists('css', '.layout-region--content .field--name-field-test-text');
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->elementNotExists('css', '.layout-region--content .field--name-field-test-text');
-  }
-
-  /**
-   * Tests the use of field layout for entity form displays.
-   */
-  public function testEntityForm() {
-    // By default, the one-column layout is used.
-    $this->drupalGet('entity_test/manage/1/edit');
-    $this->assertFieldInRegion('field_test_text[0][value]', 'content');
-
-    // The one-column layout is in use.
-    $this->drupalGet('entity_test/structure/entity_test/form-display');
-    $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
-
-    // Switch the layout to two columns.
-    $this->click('#edit-field-layouts');
-    $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_twocol');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-
-    // The field is moved to the default region for the new layout.
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
-
-    $this->drupalGet('entity_test/manage/1/edit');
-    // No fields are visible, and the regions don't display when empty.
-    $this->assertFieldInRegion('field_test_text[0][value]', 'left');
-    $this->assertSession()->elementExists('css', '.layout-region--left .field--name-field-test-text');
-
-    // After a refresh the new regions are still there.
-    $this->drupalGet('entity_test/structure/entity_test/form-display');
-    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
-
-    // Drag the field to the right region.
-    $field_test_text_row = $this->getSession()->getPage()->find('css', '#field-test-text');
-    $right_region_row = $this->getSession()->getPage()->find('css', '.region-right-message');
-    $field_test_text_row->find('css', '.handle')->dragTo($right_region_row);
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-
-    // The new layout is used.
-    $this->drupalGet('entity_test/manage/1/edit');
-    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
-    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
-
-    // Move the field to the right region without tabledrag.
-    $this->drupalGet('entity_test/structure/entity_test/form-display');
-    $this->getSession()->getPage()->pressButton('Show row weights');
-    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'right');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-
-    // The updated region is used.
-    $this->drupalGet('entity_test/manage/1/edit');
-    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
-
-    // The layout is still in use without Field UI.
-    $this->container->get('module_installer')->uninstall(['field_ui']);
-    $this->drupalGet('entity_test/manage/1/edit');
-    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
-  }
-
-  /**
-   * Tests the use of field layout for entity view displays.
-   */
-  public function testEntityView() {
-    // The one-column layout is in use.
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
-
-    // Switch the layout to two columns.
-    $this->click('#edit-field-layouts');
-    $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_twocol');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
-
-    $this->drupalGet('entity_test/1');
-    // No fields are visible, and the regions don't display when empty.
-    $this->assertSession()->elementNotExists('css', '.layout--twocol');
-    $this->assertSession()->elementNotExists('css', '.layout-region');
-    $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
-
-    // After a refresh the new regions are still there.
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
-
-    // Drag the field to the left region.
-    $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
-    $field_test_text_row = $this->getSession()->getPage()->find('css', '#field-test-text');
-    $left_region_row = $this->getSession()->getPage()->find('css', '.region-left-message');
-    $field_test_text_row->find('css', '.handle')->dragTo($left_region_row);
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->assertFalse($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
-    $this->submitForm([], 'Save');
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-
-    // The new layout is used.
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->elementExists('css', '.layout--twocol');
-    $this->assertSession()->elementExists('css', '.layout-region--left .field--name-field-test-text');
-
-    // Move the field to the right region without tabledrag.
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    $this->getSession()->getPage()->pressButton('Show row weights');
-    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'right');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-    $this->assertSession()->pageTextContains('Your settings have been saved.');
-
-    // The updated region is used.
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
-
-    // The layout is still in use without Field UI.
-    $this->container->get('module_installer')->uninstall(['field_ui']);
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->elementExists('css', '.layout--twocol');
-    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
-  }
-
-  /**
-   * Tests layout plugins with forms.
-   */
-  public function testLayoutForms() {
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    // Switch to a field layout with settings.
-    $this->click('#edit-field-layouts');
-
-    // Test switching between layouts with and without forms.
-    $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_test_plugin');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->assertSession()->fieldExists('settings_wrapper[layout_settings][setting_1]');
-
-    $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_test_2col');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->assertSession()->fieldNotExists('settings_wrapper[layout_settings][setting_1]');
-
-    $this->getSession()->getPage()->selectFieldOption('field_layout', 'layout_test_plugin');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->assertSession()->fieldExists('settings_wrapper[layout_settings][setting_1]');
-
-    // Move the test field to the content region.
-    $this->getSession()->getPage()->pressButton('Show row weights');
-    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'content');
-    $this->assertSession()->assertWaitOnAjaxRequest();
-    $this->submitForm([], 'Save');
-
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->pageTextContains('Blah: Default');
-
-    // Update the field layout settings.
-    $this->drupalGet('entity_test/structure/entity_test/display');
-    $this->click('#edit-field-layouts');
-    $this->getSession()->getPage()->fillField('settings_wrapper[layout_settings][setting_1]', 'Test text');
-    $this->submitForm([], 'Save');
-
-    $this->drupalGet('entity_test/1');
-    $this->assertSession()->pageTextContains('Blah: Test text');
-  }
-
-  /**
-   * Gets the region titles on the page.
-   *
-   * @return string[]
-   *   An array of region titles.
-   */
-  protected function getRegionTitles() {
-    $region_titles = [];
-    $region_title_elements = $this->getSession()->getPage()->findAll('css', '.region-title td');
-    /** @var \Behat\Mink\Element\NodeElement[] $region_title_elements */
-    foreach ($region_title_elements as $region_title_element) {
-      $region_titles[] = $region_title_element->getText();
-    }
-    return $region_titles;
-  }
-
-  /**
-   * Asserts that a field exists in a given region.
-   *
-   * @param string $field_selector
-   *   The field selector, one of field id|name|label|value.
-   * @param string $region_name
-   *   The machine name of the region.
-   */
-  protected function assertFieldInRegion($field_selector, $region_name) {
-    $region_element = $this->getSession()->getPage()->find('css', ".layout-region--$region_name");
-    $this->assertNotNull($region_element);
-    $this->assertSession()->fieldExists($field_selector, $region_element);
-  }
-
-}
diff --git a/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php b/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
deleted file mode 100644
index 8e6bf95..0000000
--- a/core/modules/field_layout/tests/src/Unit/FieldLayoutBuilderTest.php
+++ /dev/null
@@ -1,308 +0,0 @@
-<?php
-
-namespace Drupal\Tests\field_layout\Unit;
-
-use Drupal\Core\Entity\EntityFieldManagerInterface;
-use Drupal\Core\Field\FieldDefinitionInterface;
-use Drupal\field_layout\Display\EntityDisplayWithLayoutInterface;
-use Drupal\field_layout\FieldLayoutBuilder;
-use Drupal\Core\Layout\LayoutPluginManagerInterface;
-use Drupal\Core\Layout\LayoutDefault;
-use Drupal\Core\Layout\LayoutDefinition;
-use Drupal\Tests\UnitTestCase;
-use Prophecy\Argument;
-
-/**
- * @coversDefaultClass \Drupal\field_layout\FieldLayoutBuilder
- * @group field_layout
- */
-class FieldLayoutBuilderTest extends UnitTestCase {
-
-  /**
-   * @var \Drupal\Core\Layout\LayoutPluginManager|\Prophecy\Prophecy\ProphecyInterface
-   */
-  protected $layoutPluginManager;
-
-  /**
-   * @var \Drupal\Core\Entity\EntityFieldManagerInterface|\Prophecy\Prophecy\ProphecyInterface
-   */
-  protected $entityFieldManager;
-
-  /**
-   * @var \Drupal\field_layout\FieldLayoutBuilder
-   */
-  protected $fieldLayoutBuilder;
-
-  /**
-   * @var \Drupal\Core\Layout\LayoutInterface
-   */
-  protected $layoutPlugin;
-
-  /**
-   * @var \Drupal\Core\Layout\LayoutDefinition
-   */
-  protected $pluginDefinition;
-
-  /**
-   * {@inheritdoc}
-   */
-  protected function setUp() {
-    parent::setUp();
-
-    $this->pluginDefinition = new LayoutDefinition([
-      'library' => 'field_layout/drupal.layout.twocol',
-      'theme_hook' => 'layout__twocol',
-      'regions' => [
-        'left' => [
-          'label' => 'Left',
-        ],
-        'right' => [
-          'label' => 'Right',
-        ],
-      ],
-    ]);
-    $this->layoutPlugin = new LayoutDefault([], 'two_column', $this->pluginDefinition);
-
-    $this->layoutPluginManager = $this->prophesize(LayoutPluginManagerInterface::class);
-    $this->layoutPluginManager->getDefinition('unknown', FALSE)->willReturn(NULL);
-    $this->layoutPluginManager->getDefinition('two_column', FALSE)->willReturn($this->pluginDefinition);
-
-    $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class);
-
-    $this->fieldLayoutBuilder = new FieldLayoutBuilder($this->layoutPluginManager->reveal(), $this->entityFieldManager->reveal());
-  }
-
-  /**
-   * @covers ::buildView
-   * @covers ::getFields
-   */
-  public function testBuildView() {
-    $definitions = [];
-    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
-    $non_configurable_field_definition->isDisplayConfigurable('view')->willReturn(FALSE);
-    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
-    $definitions['non_configurable_field_with_extra_field'] = $non_configurable_field_definition->reveal();
-    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
-    $extra_fields = [];
-    $extra_fields['non_configurable_field_with_extra_field'] = [
-      'label' => 'This non-configurable field is also defined in hook_entity_extra_field_info()',
-    ];
-    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn($extra_fields);
-
-    $build = [
-      'test1' => [
-        '#markup' => 'Test1',
-      ],
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-      'non_configurable_field_with_extra_field' => [
-        '#markup' => 'Non-configurable with extra field',
-      ],
-    ];
-
-    $display = $this->prophesize(EntityDisplayWithLayoutInterface::class);
-    $display->getTargetEntityTypeId()->willReturn('the_entity_type_id');
-    $display->getTargetBundle()->willReturn('the_entity_type_bundle');
-    $display->getLayout()->willReturn($this->layoutPlugin);
-    $display->getLayoutId()->willReturn('two_column');
-    $display->getLayoutSettings()->willReturn([]);
-    $display->getComponents()->willReturn([
-      'test1' => [
-        'region' => 'right',
-      ],
-      'non_configurable_field' => [
-        'region' => 'left',
-      ],
-      'non_configurable_field_with_extra_field' => [
-        'region' => 'left',
-      ],
-    ]);
-
-    $expected = [
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-      '_field_layout' => [
-        'left' => [
-          'non_configurable_field_with_extra_field' => [
-            '#markup' => 'Non-configurable with extra field',
-          ],
-        ],
-        'right' => [
-          'test1' => [
-            '#markup' => 'Test1',
-          ],
-        ],
-        '#settings' => [],
-        '#layout' => $this->pluginDefinition,
-        '#theme' => 'layout__twocol',
-        '#attached' => [
-          'library' => [
-            'field_layout/drupal.layout.twocol',
-          ],
-        ],
-      ],
-    ];
-    $this->fieldLayoutBuilder->buildView($build, $display->reveal());
-    $this->assertEquals($expected, $build);
-    $this->assertSame($expected, $build);
-  }
-
-  /**
-   * @covers ::buildForm
-   * @covers ::getFields
-   */
-  public function testBuildForm() {
-    $definitions = [];
-    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
-    $non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
-    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
-    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
-    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn([]);
-
-    $build = [
-      'test1' => [
-        '#markup' => 'Test1',
-      ],
-      'test2' => [
-        '#markup' => 'Test2',
-        '#group' => 'existing_group',
-      ],
-      'field_layout' => [
-        '#markup' => 'Field created through the UI happens to be named "Layout"',
-      ],
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-    ];
-
-    $display = $this->prophesize(EntityDisplayWithLayoutInterface::class);
-    $display->getTargetEntityTypeId()->willReturn('the_entity_type_id');
-    $display->getTargetBundle()->willReturn('the_entity_type_bundle');
-    $display->getLayout()->willReturn($this->layoutPlugin);
-    $display->getLayoutId()->willReturn('two_column');
-    $display->getLayoutSettings()->willReturn([]);
-    $display->getComponents()->willReturn([
-      'test1' => [
-        'region' => 'right',
-      ],
-      'test2' => [
-        'region' => 'left',
-      ],
-      'field_layout' => [
-        'region' => 'right',
-      ],
-      'non_configurable_field' => [
-        'region' => 'left',
-      ],
-    ]);
-
-    $expected = [
-      'test1' => [
-        '#markup' => 'Test1',
-        '#group' => 'right',
-      ],
-      'test2' => [
-        '#markup' => 'Test2',
-        '#group' => 'existing_group',
-      ],
-      'field_layout' => [
-        '#markup' => 'Field created through the UI happens to be named "Layout"',
-        '#group' => 'right',
-      ],
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-      '_field_layout' => [
-        'left' => [
-          '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'],
-          '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'],
-        ],
-        'right' => [
-          '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'],
-          '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'],
-        ],
-        '#settings' => [],
-        '#layout' => $this->pluginDefinition,
-        '#theme' => 'layout__twocol',
-        '#attached' => [
-          'library' => [
-            'field_layout/drupal.layout.twocol',
-          ],
-        ],
-      ],
-    ];
-    $this->fieldLayoutBuilder->buildForm($build, $display->reveal());
-    $this->assertEquals($expected, $build);
-    $this->assertSame($expected, $build);
-  }
-
-  /**
-   * @covers ::buildForm
-   */
-  public function testBuildFormEmpty() {
-    $definitions = [];
-    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
-    $non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
-    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
-    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
-    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn([]);
-
-    $build = [
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-    ];
-
-    $display = $this->prophesize(EntityDisplayWithLayoutInterface::class);
-    $display->getTargetEntityTypeId()->willReturn('the_entity_type_id');
-    $display->getTargetBundle()->willReturn('the_entity_type_bundle');
-    $display->getLayout()->willReturn($this->layoutPlugin);
-    $display->getLayoutId()->willReturn('two_column');
-    $display->getLayoutSettings()->willReturn([]);
-    $display->getComponents()->willReturn([
-      'test1' => [
-        'region' => 'right',
-      ],
-      'non_configurable_field' => [
-        'region' => 'left',
-      ],
-    ]);
-
-    $expected = [
-      'non_configurable_field' => [
-        '#markup' => 'Non-configurable',
-      ],
-    ];
-    $this->fieldLayoutBuilder->buildForm($build, $display->reveal());
-    $this->assertSame($expected, $build);
-  }
-
-  /**
-   * @covers ::buildForm
-   */
-  public function testBuildFormNoLayout() {
-    $this->entityFieldManager->getFieldDefinitions(Argument::any(), Argument::any())->shouldNotBeCalled();
-
-    $build = [
-      'test1' => [
-        '#markup' => 'Test1',
-      ],
-    ];
-
-    $display = $this->prophesize(EntityDisplayWithLayoutInterface::class);
-    $display->getLayoutId()->willReturn('unknown');
-    $display->getLayoutSettings()->willReturn([]);
-    $display->getComponents()->shouldNotBeCalled();
-
-    $expected = [
-      'test1' => [
-        '#markup' => 'Test1',
-      ],
-    ];
-    $this->fieldLayoutBuilder->buildForm($build, $display->reveal());
-    $this->assertSame($expected, $build);
-  }
-
-}
diff --git a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
index 42a4e81..bedc8f2 100644
--- a/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
+++ b/core/modules/field_ui/src/Form/EntityDisplayFormBase.php
@@ -11,7 +11,11 @@
 use Drupal\Core\Field\FieldTypePluginManagerInterface;
 use Drupal\Core\Field\PluginSettingsInterface;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Form\SubformState;
+use Drupal\Core\Layout\LayoutPluginManagerInterface;
+use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Entity\Display\EntityDisplayWithLayoutInterface;
 use Drupal\field_ui\Element\FieldUiTable;
 use Drupal\field_ui\FieldUI;
 
@@ -35,6 +39,13 @@
   protected $pluginManager;
 
   /**
+   * The layout plugin manager.
+   *
+   * @var \Drupal\Core\Layout\LayoutPluginManagerInterface
+   */
+  protected $layoutPluginManager;
+
+  /**
    * A list of field types.
    *
    * @var array
@@ -44,7 +55,7 @@
   /**
    * The entity being used by this form.
    *
-   * @var \Drupal\Core\Entity\Display\EntityDisplayInterface
+   * @var \Drupal\Core\Entity\Display\EntityDisplayWithLayoutInterface
    */
   protected $entity;
 
@@ -55,10 +66,13 @@
    *   The field type manager.
    * @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
    *   The widget or formatter plugin manager.
+   * @param \Drupal\Core\Layout\LayoutPluginManagerInterface $layout_plugin_manager
+   *   The layout plugin manager.
    */
-  public function __construct(FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager) {
+  public function __construct(FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, LayoutPluginManagerInterface $layout_plugin_manager) {
     $this->fieldTypes = $field_type_manager->getDefinitions();
     $this->pluginManager = $plugin_manager;
+    $this->layoutPluginManager = $layout_plugin_manager;
   }
 
   /**
@@ -90,17 +104,22 @@ public function getEntityFromRouteMatch(RouteMatchInterface $route_match, $entit
    *   @endcode
    */
   public function getRegions() {
-    return [
-      'content' => [
-        'title' => $this->t('Content'),
-        'invisible' => TRUE,
-        'message' => $this->t('No field is displayed.')
-      ],
-      'hidden' => [
-        'title' => $this->t('Disabled', [], ['context' => 'Plural']),
-        'message' => $this->t('No field is hidden.')
-      ],
+    $regions = [];
+
+    $layout_definition = $this->entity->getLayout()->getPluginDefinition();
+    foreach ($layout_definition->getRegions() as $name => $region) {
+      $regions[$name] = [
+        'title' => $region['label'],
+        'message' => $this->t('No field is displayed.'),
+      ];
+    }
+
+    $regions['hidden'] = [
+      'title' => $this->t('Disabled', [], ['context' => 'Plural']),
+      'message' => $this->t('No field is hidden.'),
     ];
+
+    return $regions;
   }
 
   /**
@@ -244,6 +263,48 @@ public function form(array $form, FormStateInterface $form_state) {
       '#attributes' => ['class' => ['visually-hidden']]
     ];
 
+    $form['layouts'] = [
+      '#type' => 'details',
+      '#title' => $this->t('Layout settings'),
+    ];
+
+    $layout_plugin = $this->getLayout($this->getEntity(), $form_state);
+
+    $form['layouts']['layout'] = [
+      '#type' => 'select',
+      '#title' => $this->t('Select a layout'),
+      '#options' => $this->layoutPluginManager->getLayoutOptions(),
+      '#default_value' => $layout_plugin->getPluginId(),
+      '#ajax' => [
+        'callback' => '::settingsAjax',
+        'wrapper' => 'layout-settings-wrapper',
+        'trigger_as' => ['name' => 'layout_change'],
+      ],
+    ];
+    $form['layouts']['submit'] = [
+      '#type' => 'submit',
+      '#name' => 'layout_change',
+      '#value' => $this->t('Change layout'),
+      '#submit' => ['::settingsAjaxSubmit'],
+      '#attributes' => ['class' => ['js-hide']],
+      '#ajax' => [
+        'callback' => '::settingsAjax',
+        'wrapper' => 'layout-settings-wrapper',
+      ],
+    ];
+
+    $form['layouts']['settings_wrapper'] = [
+      '#type' => 'container',
+      '#id' => 'layout-settings-wrapper',
+      '#tree' => TRUE,
+    ];
+
+    if ($layout_plugin instanceof PluginFormInterface) {
+      $form['layouts']['settings_wrapper']['layout_settings'] = [];
+      $subform_state = SubformState::createForSubform($form['layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
+      $form['layouts']['settings_wrapper']['layout_settings'] = $layout_plugin->buildConfigurationForm($form['layouts']['settings_wrapper']['layout_settings'], $subform_state);
+    }
+
     $form['actions'] = ['#type' => 'actions'];
     $form['actions']['submit'] = [
       '#type' => 'submit',
@@ -508,6 +569,19 @@ protected function buildExtraFieldRow($field_id, $extra_field) {
   /**
    * {@inheritdoc}
    */
+  public function validateForm(array &$form, FormStateInterface $form_state) {
+    parent::validateForm($form, $form_state);
+
+    $layout_plugin = $this->getLayout($this->getEntity(), $form_state);
+    if ($layout_plugin instanceof PluginFormInterface) {
+      $subform_state = SubformState::createForSubform($form['layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
+      $layout_plugin->validateConfigurationForm($form['layouts']['settings_wrapper']['layout_settings'], $subform_state);
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     // If the main "Save" button was submitted while a field settings subform
     // was being edited, update the new incoming settings when rebuilding the
@@ -517,6 +591,15 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     }
 
     parent::submitForm($form, $form_state);
+
+    $layout_plugin = $this->getLayout($this->entity, $form_state);
+    if ($layout_plugin instanceof PluginFormInterface) {
+      $subform_state = SubformState::createForSubform($form['layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
+      $layout_plugin->submitConfigurationForm($form['layouts']['settings_wrapper']['layout_settings'], $subform_state);
+    }
+
+    $this->entity->setLayout($layout_plugin);
+
     $form_values = $form_state->getValues();
 
     // Handle the 'display modes' checkboxes if present.
@@ -684,6 +767,47 @@ public function multistepAjax($form, FormStateInterface $form_state) {
   }
 
   /**
+   * Gets the layout plugin for the currently selected layout.
+   *
+   * @param \Drupal\Core\Entity\Display\EntityDisplayWithLayoutInterface $entity
+   *   The current form entity.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   *
+   * @return \Drupal\Core\Layout\LayoutInterface
+   *   The layout plugin.
+   */
+  protected function getLayout(EntityDisplayWithLayoutInterface $entity, FormStateInterface $form_state) {
+    if (!$layout_plugin = $form_state->get('layout_plugin')) {
+      $stored_layout_id = $entity->getLayoutId();
+      // Use selected layout if it exists, falling back to the stored layout.
+      $layout_id = $form_state->getValue('layout', $stored_layout_id);
+      // If the current layout is the stored layout, use the stored layout
+      // settings. Otherwise leave the settings empty.
+      $layout_settings = $layout_id === $stored_layout_id ? $entity->getLayoutSettings() : [];
+
+      $layout_plugin = $this->layoutPluginManager->createInstance($layout_id, $layout_settings);
+      $form_state->set('layout_plugin', $layout_plugin);
+    }
+    return $layout_plugin;
+  }
+
+  /**
+   * Ajax callback for the layout settings form.
+   */
+  public static function settingsAjax($form, FormStateInterface $form_state) {
+    return $form['layouts']['settings_wrapper'];
+  }
+
+  /**
+   * Submit handler for the non-JS case.
+   */
+  public function settingsAjaxSubmit($form, FormStateInterface $form_state) {
+    $form_state->set('layout_plugin', NULL);
+    $form_state->setRebuild();
+  }
+
+  /**
    * Performs pre-render tasks on field_ui_table elements.
    *
    * @param array $elements
diff --git a/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
index 2c3e360..bfd2937 100644
--- a/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
+++ b/core/modules/field_ui/src/Form/EntityFormDisplayEditForm.php
@@ -25,7 +25,8 @@ class EntityFormDisplayEditForm extends EntityDisplayFormBase {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('plugin.manager.field.field_type'),
-      $container->get('plugin.manager.field.widget')
+      $container->get('plugin.manager.field.widget'),
+      $container->get('plugin.manager.core.layout')
     );
   }
 
diff --git a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
index c27f3d4..b3b65c7 100644
--- a/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
+++ b/core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php
@@ -25,7 +25,8 @@ class EntityViewDisplayEditForm extends EntityDisplayFormBase {
   public static function create(ContainerInterface $container) {
     return new static(
       $container->get('plugin.manager.field.field_type'),
-      $container->get('plugin.manager.field.formatter')
+      $container->get('plugin.manager.field.formatter'),
+      $container->get('plugin.manager.core.layout')
     );
   }
 
diff --git a/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php b/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
index 319e8df..57064a5 100644
--- a/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/FunctionalJavascript/EntityDisplayTest.php
@@ -15,7 +15,7 @@ class EntityDisplayTest extends JavascriptTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['field_ui', 'entity_test'];
+  public static $modules = ['field_ui', 'entity_test', 'field_layout_test', 'layout_test'];
 
   /**
    * {@inheritdoc}
@@ -49,6 +49,7 @@ public function testEntityForm() {
     $this->assertSession()->fieldExists('field_test_text[0][value]');
 
     $this->drupalGet('entity_test/structure/entity_test/form-display');
+    $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
     $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'content')->isSelected());
 
     $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'hidden');
@@ -61,6 +62,61 @@ public function testEntityForm() {
 
     $this->drupalGet('entity_test/manage/1/edit');
     $this->assertSession()->fieldNotExists('field_test_text[0][value]');
+
+    // Restore the field to the default region.
+    $this->drupalGet('entity_test/structure/entity_test/form-display');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'content');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    // Switch the layout to two columns.
+    $this->click('#edit-layouts');
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_twocol');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    // The field is moved to the default region for the new layout.
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
+
+    $this->drupalGet('entity_test/manage/1/edit');
+    // No fields are visible, and the regions don't display when empty.
+    $this->assertFieldInRegion('field_test_text[0][value]', 'left');
+    $this->assertSession()->elementExists('css', '.layout-region--left .field--name-field-test-text');
+
+    // After a refresh the new regions are still there.
+    $this->drupalGet('entity_test/structure/entity_test/form-display');
+    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
+
+    // Drag the field to the right region.
+    $field_test_text_row = $this->getSession()->getPage()->find('css', '#field-test-text');
+    $right_region_row = $this->getSession()->getPage()->find('css', '.region-right-message');
+    $field_test_text_row->find('css', '.handle')->dragTo($right_region_row);
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+
+    // The new layout is used.
+    $this->drupalGet('entity_test/manage/1/edit');
+    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
+    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
+
+    // Move the field to the right region without tabledrag.
+    $this->drupalGet('entity_test/structure/entity_test/form-display');
+    $this->getSession()->getPage()->pressButton('Show row weights');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'right');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+
+    // The updated region is used.
+    $this->drupalGet('entity_test/manage/1/edit');
+    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
+
+    // The layout is still in use without Field UI.
+    $this->container->get('module_installer')->uninstall(['field_ui']);
+    $this->drupalGet('entity_test/manage/1/edit');
+    $this->assertFieldInRegion('field_test_text[0][value]', 'right');
   }
 
   /**
@@ -71,6 +127,8 @@ public function testEntityView() {
     $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
 
     $this->drupalGet('entity_test/structure/entity_test/display');
+    // The one-column layout is in use.
+    $this->assertEquals(['Content', 'Disabled'], $this->getRegionTitles());
     $this->assertSession()->elementExists('css', '.region-content-message.region-empty');
     $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
 
@@ -84,6 +142,167 @@ public function testEntityView() {
 
     $this->drupalGet('entity_test/1');
     $this->assertSession()->elementExists('css', '.field--name-field-test-text');
+
+    // Restore the field to the hidden region.
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'hidden');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    // Switch the layout to two columns.
+    $this->click('#edit-layouts');
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_twocol');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
+
+    $this->drupalGet('entity_test/1');
+    // No fields are visible, and the regions don't display when empty.
+    $this->assertSession()->elementNotExists('css', '.layout--twocol');
+    $this->assertSession()->elementNotExists('css', '.layout-region');
+    $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
+
+    // After a refresh the new regions are still there.
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    $this->assertEquals(['Top', 'Left', 'Right', 'Bottom', 'Disabled'], $this->getRegionTitles());
+
+    // Drag the field to the left region.
+    $this->assertTrue($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
+    $field_test_text_row = $this->getSession()->getPage()->find('css', '#field-test-text');
+    $left_region_row = $this->getSession()->getPage()->find('css', '.region-left-message');
+    $field_test_text_row->find('css', '.handle')->dragTo($left_region_row);
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->assertFalse($this->assertSession()->optionExists('fields[field_test_text][region]', 'hidden')->isSelected());
+    $this->submitForm([], 'Save');
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+
+    // The new layout is used.
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->elementExists('css', '.layout--twocol');
+    $this->assertSession()->elementExists('css', '.layout-region--left .field--name-field-test-text');
+
+    // Move the field to the right region without tabledrag.
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    $this->getSession()->getPage()->pressButton('Show row weights');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'right');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+    $this->assertSession()->pageTextContains('Your settings have been saved.');
+
+    // The updated region is used.
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
+
+    // The layout is still in use without Field UI.
+    $this->container->get('module_installer')->uninstall(['field_ui']);
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->elementExists('css', '.layout--twocol');
+    $this->assertSession()->elementExists('css', '.layout-region--right .field--name-field-test-text');
+  }
+
+  /**
+   * Tests that layouts are unique per view mode.
+   */
+  public function testEntityViewModes() {
+    // By default, the field is not visible.
+    $this->drupalGet('entity_test/1/test');
+    $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
+
+    // Change the layout for the "test" view mode. See
+    // core.entity_view_mode.entity_test.test.yml.
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    $this->click('#edit-modes');
+    $this->getSession()->getPage()->checkField('display_modes_custom[test]');
+    $this->submitForm([], 'Save');
+    $this->clickLink('configure them');
+    $this->click('#edit-layouts');
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_twocol');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+    $this->getSession()->getPage()->pressButton('Show row weights');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'left');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    // Each view mode has a different layout.
+    $this->drupalGet('entity_test/1/test');
+    $this->assertSession()->elementExists('css', '.layout-region--left .field--name-field-test-text');
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->elementNotExists('css', '.field--name-field-test-text');
+  }
+
+  /**
+   * Tests layout plugins with forms.
+   */
+  public function testLayoutForms() {
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    // Switch to a layout with settings.
+    $this->click('#edit-layouts');
+
+    // Test switching between layouts with and without forms.
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_test_plugin');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->assertSession()->fieldExists('settings_wrapper[layout_settings][setting_1]');
+
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_test_2col');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->assertSession()->fieldNotExists('settings_wrapper[layout_settings][setting_1]');
+
+    $this->getSession()->getPage()->selectFieldOption('layout', 'layout_test_plugin');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->assertSession()->fieldExists('settings_wrapper[layout_settings][setting_1]');
+
+    // Move the test field to the content region.
+    $this->getSession()->getPage()->pressButton('Show row weights');
+    $this->getSession()->getPage()->selectFieldOption('fields[field_test_text][region]', 'content');
+    $this->assertSession()->assertWaitOnAjaxRequest();
+    $this->submitForm([], 'Save');
+
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->pageTextContains('Blah: Default');
+
+    // Update the layout settings.
+    $this->drupalGet('entity_test/structure/entity_test/display');
+    $this->click('#edit-layouts');
+    $this->getSession()->getPage()->fillField('settings_wrapper[layout_settings][setting_1]', 'Test text');
+    $this->submitForm([], 'Save');
+
+    $this->drupalGet('entity_test/1');
+    $this->assertSession()->pageTextContains('Blah: Test text');
+  }
+
+  /**
+   * Gets the region titles on the page.
+   *
+   * @return string[]
+   *   An array of region titles.
+   */
+  protected function getRegionTitles() {
+    $region_titles = [];
+    $region_title_elements = $this->getSession()->getPage()->findAll('css', '.region-title td');
+    /** @var \Behat\Mink\Element\NodeElement[] $region_title_elements */
+    foreach ($region_title_elements as $region_title_element) {
+      $region_titles[] = $region_title_element->getText();
+    }
+    return $region_titles;
+  }
+
+  /**
+   * Asserts that a field exists in a given region.
+   *
+   * @param string $field_selector
+   *   The field selector, one of field id|name|label|value.
+   * @param string $region_name
+   *   The machine name of the region.
+   */
+  protected function assertFieldInRegion($field_selector, $region_name) {
+    $region_element = $this->getSession()->getPage()->find('css', ".layout-region--$region_name");
+    $this->assertNotNull($region_element);
+    $this->assertSession()->fieldExists($field_selector, $region_element);
   }
 
 }
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
index 9e46d82..16f3dc9 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityDisplayTest.php
@@ -107,7 +107,7 @@ public function testEntityDisplayCRUD() {
     $new_display->save();
     $new_display = EntityViewDisplay::load($new_display->id());
     $dependencies = $new_display->calculateDependencies()->getDependencies();
-    $this->assertEqual(['config' => ['core.entity_view_mode.entity_test.other_view_mode'], 'module' => ['entity_test']], $dependencies);
+    $this->assertEqual(['config' => ['core.entity_view_mode.entity_test.other_view_mode'], 'module' => ['entity_test', 'system']], $dependencies);
     $this->assertEqual($new_display->getTargetEntityTypeId(), $display->getTargetEntityTypeId());
     $this->assertEqual($new_display->getTargetBundle(), $display->getTargetBundle());
     $this->assertEqual($new_display->getMode(), 'other_view_mode');
@@ -266,7 +266,7 @@ public function testFieldComponent() {
     // Check that the display has dependencies on the field and the module that
     // provides the formatter.
     $dependencies = $display->calculateDependencies()->getDependencies();
-    $this->assertEqual(['config' => ['field.field.entity_test.entity_test.test_field'], 'module' => ['entity_test', 'field_test']], $dependencies);
+    $this->assertEqual(['config' => ['field.field.entity_test.entity_test.test_field'], 'module' => ['entity_test', 'field_test', 'system']], $dependencies);
   }
 
   /**
diff --git a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
index 09d2a20..e5e7451 100644
--- a/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
+++ b/core/modules/field_ui/tests/src/Kernel/EntityFormDisplayTest.php
@@ -20,7 +20,7 @@ class EntityFormDisplayTest extends KernelTestBase {
    *
    * @var string[]
    */
-  public static $modules = ['field_ui', 'field', 'entity_test', 'field_test', 'user', 'text'];
+  public static $modules = ['field_ui', 'field', 'entity_test', 'field_test', 'user', 'text', 'system'];
 
   protected function setUp() {
     parent::setUp();
diff --git a/core/modules/forum/config/optional/core.entity_form_display.comment.comment_forum.default.yml b/core/modules/forum/config/optional/core.entity_form_display.comment.comment_forum.default.yml
index 4738bbb..0414a86 100644
--- a/core/modules/forum/config/optional/core.entity_form_display.comment.comment_forum.default.yml
+++ b/core/modules/forum/config/optional/core.entity_form_display.comment.comment_forum.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - comment.type.comment_forum
     - field.field.comment.comment_forum.comment_body
   module:
+    - system
     - text
 id: comment.comment_forum.default
 targetEntityType: comment
@@ -31,3 +32,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_form_display.node.forum.default.yml b/core/modules/forum/config/optional/core.entity_form_display.node.forum.default.yml
index 6773d32..66fc7b6 100644
--- a/core/modules/forum/config/optional/core.entity_form_display.node.forum.default.yml
+++ b/core/modules/forum/config/optional/core.entity_form_display.node.forum.default.yml
@@ -8,6 +8,7 @@ dependencies:
     - node.type.forum
   module:
     - comment
+    - system
     - text
 id: node.forum.default
 targetEntityType: node
@@ -73,3 +74,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_form_display.taxonomy_term.forums.default.yml b/core/modules/forum/config/optional/core.entity_form_display.taxonomy_term.forums.default.yml
index 50df98a..9eabb94 100644
--- a/core/modules/forum/config/optional/core.entity_form_display.taxonomy_term.forums.default.yml
+++ b/core/modules/forum/config/optional/core.entity_form_display.taxonomy_term.forums.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.taxonomy_term.forums.forum_container
     - taxonomy.vocabulary.forums
   module:
+    - system
     - text
 id: taxonomy_term.forums.default
 targetEntityType: taxonomy_term
@@ -27,3 +28,5 @@ content:
     third_party_settings: {  }
 hidden:
   forum_container: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_view_display.comment.comment_forum.default.yml b/core/modules/forum/config/optional/core.entity_view_display.comment.comment_forum.default.yml
index befeba8..34c73a8 100644
--- a/core/modules/forum/config/optional/core.entity_view_display.comment.comment_forum.default.yml
+++ b/core/modules/forum/config/optional/core.entity_view_display.comment.comment_forum.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - comment.type.comment_forum
     - field.field.comment.comment_forum.comment_body
   module:
+    - system
     - text
 id: comment.comment_forum.default
 targetEntityType: comment
@@ -22,3 +23,5 @@ content:
     weight: 100
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_view_display.node.forum.default.yml b/core/modules/forum/config/optional/core.entity_view_display.node.forum.default.yml
index f3e8c5c..23ff070 100644
--- a/core/modules/forum/config/optional/core.entity_view_display.node.forum.default.yml
+++ b/core/modules/forum/config/optional/core.entity_view_display.node.forum.default.yml
@@ -9,6 +9,7 @@ dependencies:
     - node.type.forum
   module:
     - comment
+    - system
     - text
     - user
 id: node.forum.default
@@ -44,3 +45,5 @@ content:
       link: true
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_view_display.node.forum.teaser.yml b/core/modules/forum/config/optional/core.entity_view_display.node.forum.teaser.yml
index 7b174f4..ee2f177 100644
--- a/core/modules/forum/config/optional/core.entity_view_display.node.forum.teaser.yml
+++ b/core/modules/forum/config/optional/core.entity_view_display.node.forum.teaser.yml
@@ -8,6 +8,7 @@ dependencies:
     - field.field.node.forum.taxonomy_forums
     - node.type.forum
   module:
+    - system
     - text
     - user
 id: node.forum.teaser
@@ -36,3 +37,5 @@ content:
     third_party_settings: {  }
 hidden:
   comment_forum: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/forum/config/optional/core.entity_view_display.taxonomy_term.forums.default.yml b/core/modules/forum/config/optional/core.entity_view_display.taxonomy_term.forums.default.yml
index b326039..ff8fa58 100644
--- a/core/modules/forum/config/optional/core.entity_view_display.taxonomy_term.forums.default.yml
+++ b/core/modules/forum/config/optional/core.entity_view_display.taxonomy_term.forums.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.taxonomy_term.forums.forum_container
     - taxonomy.vocabulary.forums
   module:
+    - system
     - text
 id: taxonomy_term.forums.default
 targetEntityType: taxonomy_term
@@ -20,3 +21,5 @@ content:
     label: above
 hidden:
   forum_container: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
index cd8a45b..a769439 100644
--- a/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
+++ b/core/modules/image/tests/src/Kernel/ImageFormatterTest.php
@@ -94,9 +94,10 @@ function testImageFormatterCacheTags() {
 
     // Generate the render array to verify if the cache tags are as expected.
     $build = $this->display->build($entity);
+    $field_build = $this->display->getFieldFromBuild($this->fieldName, $build);
 
-    $this->assertEquals($entity->{$this->fieldName}[0]->entity->getCacheTags(), $build[$this->fieldName][0]['#cache']['tags'], 'First image cache tags is as expected');
-    $this->assertEquals($entity->{$this->fieldName}[1]->entity->getCacheTags(), $build[$this->fieldName][1]['#cache']['tags'], 'Second image cache tags is as expected');
+    $this->assertEquals($entity->{$this->fieldName}[0]->entity->getCacheTags(), $field_build[0]['#cache']['tags'], 'First image cache tags is as expected');
+    $this->assertEquals($entity->{$this->fieldName}[1]->entity->getCacheTags(), $field_build[1]['#cache']['tags'], 'Second image cache tags is as expected');
   }
 
 }
diff --git a/core/modules/layout_discovery/layout_discovery.info.yml b/core/modules/layout_discovery/layout_discovery.info.yml
deleted file mode 100644
index a9a4139..0000000
--- a/core/modules/layout_discovery/layout_discovery.info.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-name: 'Layout Discovery'
-type: module
-description: 'Provides a way for modules or themes to register layouts.'
-package: Core (Experimental)
-version: VERSION
-core: 8.x
diff --git a/core/modules/layout_discovery/layout_discovery.install b/core/modules/layout_discovery/layout_discovery.install
deleted file mode 100644
index e6c99e0..0000000
--- a/core/modules/layout_discovery/layout_discovery.install
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
- * @file
- * Install, update, and uninstall functions for the Layout Discovery module.
- */
-
-/**
- * Implements hook_requirements().
- */
-function layout_discovery_requirements($phase) {
-  $requirements = [];
-  if ($phase === 'install') {
-    if (\Drupal::moduleHandler()->moduleExists('layout_plugin')) {
-      $requirements['layout_discovery'] = [
-        'description' => t('Layout Discovery cannot be installed because the Layout Plugin module is installed and incompatible.'),
-        'severity' => REQUIREMENT_ERROR,
-      ];
-    }
-  }
-  return $requirements;
-}
diff --git a/core/modules/layout_discovery/layout_discovery.libraries.yml b/core/modules/layout_discovery/layout_discovery.libraries.yml
deleted file mode 100644
index aff70e0..0000000
--- a/core/modules/layout_discovery/layout_discovery.libraries.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-onecol:
-  version: VERSION
-  css:
-    theme:
-      layouts/onecol/onecol.css: {}
-twocol_bricks:
-  version: VERSION
-  css:
-    theme:
-      layouts/twocol_bricks/twocol_bricks.css: {}
-twocol:
-  version: VERSION
-  css:
-    theme:
-      layouts/twocol/twocol.css: {}
-threecol_25_50_25:
-  version: VERSION
-  css:
-    theme:
-      layouts/threecol_25_50_25/threecol_25_50_25.css: {}
-threecol_33_34_33:
-  version: VERSION
-  css:
-    theme:
-      layouts/threecol_33_34_33/threecol_33_34_33.css: {}
diff --git a/core/modules/layout_discovery/layout_discovery.module b/core/modules/layout_discovery/layout_discovery.module
deleted file mode 100644
index 3cffee9..0000000
--- a/core/modules/layout_discovery/layout_discovery.module
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-/**
- * @file
- * Provides hook implementations for Layout Discovery.
- */
-
-/**
- * Implements hook_help().
- */
-function layout_discovery_help($route_name) {
-  switch ($route_name) {
-    case 'help.page.layout_discovery':
-      $output = '<h3>' . t('About') . '</h3>';
-      $output .= '<p>' . t('Layout Discovery allows modules or themes to register layouts, and for other modules to list the available layouts and render them.') . '</p>';
-      $output .= '<p>' . t('For more information, see the <a href=":layout-discovery-documentation">online documentation for the Layout Discovery module</a>.', [':layout-discovery-documentation' => 'https://www.drupal.org/node/2619128']) . '</p>';
-      return $output;
-  }
-}
-
-/**
- * Implements hook_theme().
- */
-function layout_discovery_theme() {
-  return \Drupal::service('plugin.manager.core.layout')->getThemeImplementations();
-}
-
-/**
- * Prepares variables for layout templates.
- *
- * @param array &$variables
- *   An associative array containing:
- *   - content: An associative array containing the properties of the element.
- *     Properties used: #settings, #layout.
- */
-function template_preprocess_layout(&$variables) {
-  $variables['settings'] = isset($variables['content']['#settings']) ? $variables['content']['#settings'] : [];
-  $variables['layout'] = isset($variables['content']['#layout']) ? $variables['content']['#layout'] : [];
-}
diff --git a/core/modules/layout_discovery/layout_discovery.services.yml b/core/modules/layout_discovery/layout_discovery.services.yml
deleted file mode 100644
index 1e24db4..0000000
--- a/core/modules/layout_discovery/layout_discovery.services.yml
+++ /dev/null
@@ -1,4 +0,0 @@
-services:
-  plugin.manager.core.layout:
-    class: Drupal\Core\Layout\LayoutPluginManager
-    arguments: ['@container.namespaces', '@cache.discovery', '@module_handler', '@theme_handler']
diff --git a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
index 79baf9b..952cca9 100644
--- a/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
+++ b/core/modules/node/src/Tests/NodeEntityViewModeAlterTest.php
@@ -43,7 +43,7 @@ function testNodeViewModeChange() {
     $this->assertNoText('Data that should appear only in the body for the node.', 'Body text not present');
 
     // Test that the correct build mode has been set.
-    $build = $this->drupalBuildEntityView($node);
+    $build = $this->drupalBuildFullEntityView($node);
     $this->assertEqual($build['#view_mode'], 'teaser', 'The view mode has correctly been set to teaser.');
   }
 
diff --git a/core/modules/node/src/Tests/SummaryLengthTest.php b/core/modules/node/src/Tests/SummaryLengthTest.php
index e953882..536cc6e 100644
--- a/core/modules/node/src/Tests/SummaryLengthTest.php
+++ b/core/modules/node/src/Tests/SummaryLengthTest.php
@@ -46,6 +46,9 @@ public function testSummaryLength() {
     // 200 characters in length and so does not include 'What is a Drupalism?'.
     $content = $this->drupalBuildEntityView($node, 'teaser');
     $this->assertTrue(strlen($content['body'][0]['#markup']) < 200, 'Teaser is less than 200 characters long.');
+
+    // Render the entire content array.
+    $content = $this->drupalBuildFullEntityView($node, 'teaser');
     $this->setRawContent($renderer->renderRoot($content));
     $this->assertText($node->label());
     $this->assertNoRaw($expected);
diff --git a/core/modules/options/tests/options_config_install_test/config/install/core.entity_form_display.node.options_install_test.default.yml b/core/modules/options/tests/options_config_install_test/config/install/core.entity_form_display.node.options_install_test.default.yml
index ff5f0ec..c760b97 100644
--- a/core/modules/options/tests/options_config_install_test/config/install/core.entity_form_display.node.options_install_test.default.yml
+++ b/core/modules/options/tests/options_config_install_test/config/install/core.entity_form_display.node.options_install_test.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.node.options_install_test.body
     - node.type.options_install_test
   module:
+    - system
     - text
 id: node.options_install_test.default
 targetEntityType: node
@@ -59,3 +60,5 @@ content:
     third_party_settings: {  }
 hidden: {  }
 third_party_settings: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.default.yml b/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.default.yml
index aaea1cb..22051df 100644
--- a/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.default.yml
+++ b/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.node.options_install_test.body
     - node.type.options_install_test
   module:
+    - system
     - text
     - user
 id: node.options_install_test.default
@@ -25,3 +26,5 @@ content:
 hidden:
   langcode: true
 third_party_settings: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.teaser.yml b/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.teaser.yml
index 6e79af9..f8ad011 100644
--- a/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.teaser.yml
+++ b/core/modules/options/tests/options_config_install_test/config/install/core.entity_view_display.node.options_install_test.teaser.yml
@@ -6,6 +6,7 @@ dependencies:
     - field.field.node.options_install_test.body
     - node.type.options_install_test
   module:
+    - system
     - text
     - user
 id: node.options_install_test.teaser
@@ -27,3 +28,5 @@ content:
 hidden:
   langcode: true
 third_party_settings: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/modules/rdf/rdf.module b/core/modules/rdf/rdf.module
index 0afcb09..e445e1a 100644
--- a/core/modules/rdf/rdf.module
+++ b/core/modules/rdf/rdf.module
@@ -5,6 +5,7 @@
  * Enables semantically enriched output for Drupal sites in the form of RDFa.
  */
 
+use Drupal\comment\CommentInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Template\Attribute;
 use Drupal\rdf\Entity\RdfMapping;
@@ -502,7 +503,19 @@ function rdf_preprocess_comment(&$variables) {
     $variables['title_attributes']['property'] = $title_mapping['properties'];
     $variables['title_attributes']['datatype'] = '';
   }
+}
 
+/**
+ * Implements hook_entity_display_build_alter().
+ */
+function rdf_entity_display_build_alter(&$build, $context) {
+  if (!($context['entity'] instanceof CommentInterface)) {
+    return;
+  }
+
+  $comment = $context['entity'];
+  $rdf_metadata_attributes = [];
+  $mapping = rdf_get_mapping('comment', $comment->bundle());
   // Annotates the parent relationship between the current comment and the node
   // it belongs to. If available, the parent comment is also annotated.
   // @todo When comments are turned into fields, this should be changed.
@@ -514,7 +527,7 @@ function rdf_preprocess_comment(&$variables) {
     // The parent entity URI is precomputed as part of the rdf_data so that it
     // can be cached as part of the entity.
     $parent_entity_attributes['resource'] = $comment->rdf_data['entity_uri'];
-    $variables['rdf_metadata_attributes'][] = $parent_entity_attributes;
+    $rdf_metadata_attributes[] = $parent_entity_attributes;
 
     // Adds the relation to parent comment, if it exists.
     if ($comment->hasParentComment()) {
@@ -522,19 +535,19 @@ function rdf_preprocess_comment(&$variables) {
       // The parent comment URI is precomputed as part of the rdf_data so that
       // it can be cached as part of the entity.
       $parent_comment_attributes['resource'] = $comment->rdf_data['pid_uri'];
-      $variables['rdf_metadata_attributes'][] = $parent_comment_attributes;
+      $rdf_metadata_attributes[] = $parent_comment_attributes;
     }
   }
   // Adds RDF metadata markup above comment body if any.
-  if (!empty($variables['rdf_metadata_attributes']) && isset($variables['content']['comment_body'])) {
+  if (!empty($rdf_metadata_attributes) && isset($build['comment_body'])) {
     $rdf_metadata = [
       '#theme' => 'rdf_metadata',
-      '#metadata' => $variables['rdf_metadata_attributes'],
+      '#metadata' => $rdf_metadata_attributes,
     ];
-    if (!empty($variables['content']['comment_body']['#prefix'])) {
-      $rdf_metadata['#suffix'] = $variables['content']['comment_body']['#prefix'];
+    if (!empty($build['comment_body']['#prefix'])) {
+      $rdf_metadata['#suffix'] = $build['comment_body']['#prefix'];
     }
-    $variables['content']['comment_body']['#prefix'] = drupal_render($rdf_metadata);
+    $build['comment_body']['#prefix'] = drupal_render($rdf_metadata);
   }
 }
 
diff --git a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
index d481291..cee1bbc 100644
--- a/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
+++ b/core/modules/responsive_image/tests/src/Kernel/ResponsiveImageIntegrationTest.php
@@ -18,7 +18,7 @@ class ResponsiveImageIntegrationTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['responsive_image', 'field', 'image', 'file', 'entity_test', 'breakpoint', 'responsive_image_test_module'];
+  public static $modules = ['responsive_image', 'field', 'image', 'file', 'entity_test', 'breakpoint', 'responsive_image_test_module', 'system'];
 
   /**
    * Tests integration with entity view display.
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index b1a0258..4078436 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -210,6 +210,17 @@ function __construct($test_id = NULL) {
   }
 
   /**
+   * Builds the portion of a renderable view of an entity that contains fields.
+   *
+   * @see ::buildEntityView()
+   */
+  protected function drupalBuildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
+    $build = $this->drupalBuildFullEntityView($entity, $view_mode, $langcode, $reset);
+    // By default all fields will be nested in the onecol layout.
+    return $build['layout']['content'];
+  }
+
+  /**
    * Builds the renderable view of an entity.
    *
    * Entities postpone the composition of their renderable arrays to #pre_render
@@ -229,11 +240,13 @@ function __construct($test_id = NULL) {
    *   the current content language.
    * @param bool $reset
    *   (optional) Whether to clear the cache for this entity.
+   *
    * @return array
+   *   The render array for the given entity.
    *
    * @see drupal_render()
    */
-  protected function drupalBuildEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
+  protected function drupalBuildFullEntityView(EntityInterface $entity, $view_mode = 'full', $langcode = NULL, $reset = FALSE) {
     $ensure_fully_built = function(&$elements) use (&$ensure_fully_built) {
       // If the default values for this element have not been loaded yet, populate
       // them.
diff --git a/core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig b/core/modules/system/layouts/onecol/layout--onecol.html.twig
similarity index 54%
copy from core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig
copy to core/modules/system/layouts/onecol/layout--onecol.html.twig
index 69fed03..34b58ee 100644
--- a/core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig
+++ b/core/modules/system/layouts/onecol/layout--onecol.html.twig
@@ -10,15 +10,4 @@
  * @ingroup themeable
  */
 #}
-{%
-set classes = [
-'layout--onecol',
-]
-%}
-{% if content %}
-<div{{ attributes.addClass(classes) }}>
-  <div class="layout-region layout-region--content">
-    {{ content }}
-  </div>
-</div>
-{% endif %}
+{{ content }}
diff --git a/core/modules/layout_discovery/layouts/onecol/onecol.css b/core/modules/system/layouts/onecol/onecol.css
similarity index 100%
rename from core/modules/layout_discovery/layouts/onecol/onecol.css
rename to core/modules/system/layouts/onecol/onecol.css
diff --git a/core/modules/layout_discovery/layouts/threecol_25_50_25/layout--threecol-25-50-25.html.twig b/core/modules/system/layouts/threecol_25_50_25/layout--threecol-25-50-25.html.twig
similarity index 100%
rename from core/modules/layout_discovery/layouts/threecol_25_50_25/layout--threecol-25-50-25.html.twig
rename to core/modules/system/layouts/threecol_25_50_25/layout--threecol-25-50-25.html.twig
diff --git a/core/modules/layout_discovery/layouts/threecol_25_50_25/threecol_25_50_25.css b/core/modules/system/layouts/threecol_25_50_25/threecol_25_50_25.css
similarity index 100%
rename from core/modules/layout_discovery/layouts/threecol_25_50_25/threecol_25_50_25.css
rename to core/modules/system/layouts/threecol_25_50_25/threecol_25_50_25.css
diff --git a/core/modules/layout_discovery/layouts/threecol_33_34_33/layout--threecol-33-34-33.html.twig b/core/modules/system/layouts/threecol_33_34_33/layout--threecol-33-34-33.html.twig
similarity index 100%
rename from core/modules/layout_discovery/layouts/threecol_33_34_33/layout--threecol-33-34-33.html.twig
rename to core/modules/system/layouts/threecol_33_34_33/layout--threecol-33-34-33.html.twig
diff --git a/core/modules/layout_discovery/layouts/threecol_33_34_33/threecol_33_34_33.css b/core/modules/system/layouts/threecol_33_34_33/threecol_33_34_33.css
similarity index 100%
rename from core/modules/layout_discovery/layouts/threecol_33_34_33/threecol_33_34_33.css
rename to core/modules/system/layouts/threecol_33_34_33/threecol_33_34_33.css
diff --git a/core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig b/core/modules/system/layouts/twocol/layout--twocol.html.twig
similarity index 100%
copy from core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig
copy to core/modules/system/layouts/twocol/layout--twocol.html.twig
diff --git a/core/modules/layout_discovery/layouts/twocol/twocol.css b/core/modules/system/layouts/twocol/twocol.css
similarity index 100%
copy from core/modules/layout_discovery/layouts/twocol/twocol.css
copy to core/modules/system/layouts/twocol/twocol.css
diff --git a/core/modules/layout_discovery/layouts/twocol/twocol.css b/core/modules/system/layouts/twocol/twocol.layout.css
similarity index 100%
rename from core/modules/layout_discovery/layouts/twocol/twocol.css
rename to core/modules/system/layouts/twocol/twocol.layout.css
diff --git a/core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig b/core/modules/system/layouts/twocol_bricks/layout--twocol-bricks.html.twig
similarity index 100%
rename from core/modules/layout_discovery/layouts/twocol_bricks/layout--twocol-bricks.html.twig
rename to core/modules/system/layouts/twocol_bricks/layout--twocol-bricks.html.twig
diff --git a/core/modules/layout_discovery/layouts/twocol_bricks/twocol_bricks.css b/core/modules/system/layouts/twocol_bricks/twocol_bricks.css
similarity index 100%
rename from core/modules/layout_discovery/layouts/twocol_bricks/twocol_bricks.css
rename to core/modules/system/layouts/twocol_bricks/twocol_bricks.css
diff --git a/core/modules/layout_discovery/layout_discovery.layouts.yml b/core/modules/system/system.layouts.yml
similarity index 87%
rename from core/modules/layout_discovery/layout_discovery.layouts.yml
rename to core/modules/system/system.layouts.yml
index 98b1ed6..a17d5e1 100644
--- a/core/modules/layout_discovery/layout_discovery.layouts.yml
+++ b/core/modules/system/system.layouts.yml
@@ -2,7 +2,7 @@ layout_onecol:
   label: 'One column'
   path: layouts/onecol
   template: layout--onecol
-  library: layout_discovery/onecol
+  library: system/drupal.layout.onecol
   category: 'Columns: 1'
   default_region: content
   regions:
@@ -13,7 +13,7 @@ layout_twocol:
   label: 'Two column'
   path: layouts/twocol
   template: layout--twocol
-  library: layout_discovery/twocol
+  library: system/drupal.layout.twocol
   category: 'Columns: 2'
   default_region: left
   regions:
@@ -30,7 +30,7 @@ layout_twocol_bricks:
   label: 'Two column bricks'
   path: layouts/twocol_bricks
   template: layout--twocol-bricks
-  library: layout_discovery/twocol_bricks
+  library: system/drupal.layout.twocol_bricks
   category: 'Columns: 2'
   default_region: middle
   regions:
@@ -53,7 +53,7 @@ layout_threecol_25_50_25:
   label: 'Three column 25/50/25'
   path: layouts/threecol_25_50_25
   template: layout--threecol-25-50-25
-  library: layout_discovery/threecol_25_50_25
+  library: system/drupal.layout.threecol_25_50_25
   category: 'Columns: 3'
   default_region: left
   regions:
@@ -72,7 +72,7 @@ layout_threecol_33_34_33:
   label: 'Three column 33/34/33'
   path: layouts/threecol_33_34_33
   template: layout--threecol-33-34-33
-  library: layout_discovery/threecol_33_34_33
+  library: system/drupal.layout.threecol_33_34_33
   category: 'Columns: 3'
   default_region: left
   regions:
diff --git a/core/modules/system/system.libraries.yml b/core/modules/system/system.libraries.yml
index 98eb283..971f2a7 100644
--- a/core/modules/system/system.libraries.yml
+++ b/core/modules/system/system.libraries.yml
@@ -80,3 +80,33 @@ drupal.system.date:
     - core/drupalSettings
     - core/jquery.once
     - core/drupal.form
+
+drupal.layout.onecol:
+  version: VERSION
+  css:
+    theme:
+      layouts/onecol/onecol.css: {}
+
+drupal.layout.twocol_bricks:
+  version: VERSION
+  css:
+    theme:
+      layouts/twocol_bricks/twocol_bricks.css: {}
+
+drupal.layout.twocol:
+  version: VERSION
+  css:
+    theme:
+      layouts/twocol/twocol.css: {}
+
+drupal.layout.threecol_25_50_25:
+  version: VERSION
+  css:
+    theme:
+      layouts/threecol_25_50_25/threecol_25_50_25.css: {}
+
+drupal.layout.threecol_33_34_33:
+  version: VERSION
+  css:
+    theme:
+      layouts/threecol_33_34_33/threecol_33_34_33.css: {}
diff --git a/core/modules/system/system.module b/core/modules/system/system.module
index a1a6b71..3bf4767 100644
--- a/core/modules/system/system.module
+++ b/core/modules/system/system.module
@@ -268,7 +268,7 @@ function system_theme() {
       ],
       'template' => 'entity-add-list',
     ],
-  ]);
+  ], \Drupal::service('plugin.manager.core.layout')->getThemeImplementations());
 }
 
 /**
diff --git a/core/modules/layout_discovery/templates/layout.html.twig b/core/modules/system/templates/layout.html.twig
similarity index 100%
copy from core/modules/layout_discovery/templates/layout.html.twig
copy to core/modules/system/templates/layout.html.twig
diff --git a/core/modules/field_layout/tests/modules/field_layout_test/config/schema/field_layout_test.schema.yml b/core/modules/system/tests/modules/field_layout_test/config/schema/field_layout_test.schema.yml
similarity index 100%
rename from core/modules/field_layout/tests/modules/field_layout_test/config/schema/field_layout_test.schema.yml
rename to core/modules/system/tests/modules/field_layout_test/config/schema/field_layout_test.schema.yml
diff --git a/core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.info.yml b/core/modules/system/tests/modules/field_layout_test/field_layout_test.info.yml
similarity index 100%
rename from core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.info.yml
rename to core/modules/system/tests/modules/field_layout_test/field_layout_test.info.yml
diff --git a/core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.routing.yml b/core/modules/system/tests/modules/field_layout_test/field_layout_test.routing.yml
similarity index 100%
rename from core/modules/field_layout/tests/modules/field_layout_test/field_layout_test.routing.yml
rename to core/modules/system/tests/modules/field_layout_test/field_layout_test.routing.yml
diff --git a/core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutContentFooter.php b/core/modules/system/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutContentFooter.php
similarity index 100%
rename from core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutContentFooter.php
rename to core/modules/system/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutContentFooter.php
diff --git a/core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php b/core/modules/system/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
similarity index 100%
rename from core/modules/field_layout/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
rename to core/modules/system/tests/modules/field_layout_test/src/Plugin/Layout/TestLayoutMainFooter.php
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index b865e95..b4a49fc 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -392,13 +392,14 @@ function user_user_view(array &$build, UserInterface $account, EntityViewDisplay
 }
 
 /**
- * Implements hook_ENTITY_TYPE_view_alter() for user entities.
+ * Implements hook_entity_display_build_alter().
  *
  * This function adds a default alt tag to the user_picture field to maintain
  * accessibility.
  */
-function user_user_view_alter(array &$build, UserInterface $account, EntityViewDisplayInterface $display) {
-  if (user_picture_enabled() && !empty($build['user_picture'])) {
+function user_entity_display_build_alter(&$build, $context) {
+  $account = $context['entity'];
+  if ($account instanceof UserInterface && user_picture_enabled() && !empty($build['user_picture'])) {
     foreach (Element::children($build['user_picture']) as $key) {
       $item = $build['user_picture'][$key]['#item'];
       if (!$item->get('alt')->getValue()) {
diff --git a/core/modules/views/src/Entity/Render/EntityFieldRenderer.php b/core/modules/views/src/Entity/Render/EntityFieldRenderer.php
index 3c38da1..95ef7fe 100644
--- a/core/modules/views/src/Entity/Render/EntityFieldRenderer.php
+++ b/core/modules/views/src/Entity/Render/EntityFieldRenderer.php
@@ -232,6 +232,7 @@ protected function buildFields(array $values) {
             $display->setComponent($field->definition['field_name'], [
               'type' => $field->options['type'],
               'settings' => $field->options['settings'],
+              'region' => $display->getDefaultRegion(),
             ]);
           }
           // Let the display build the render array for the entities.
@@ -240,7 +241,7 @@ protected function buildFields(array $values) {
           // row indexes and field IDs.
           foreach ($display_build as $row_index => $entity_build) {
             foreach ($display_fields['field_ids'] as $field_id => $field) {
-              $build[$row_index][$field_id] = !empty($entity_build[$field->definition['field_name']]) ? $entity_build[$field->definition['field_name']] : [];
+              $build[$row_index][$field_id] = $display->getFieldFromBuild($field->definition['field_name'], $entity_build);
             }
           }
         }
diff --git a/core/profiles/standard/config/install/core.entity_form_display.block_content.basic.default.yml b/core/profiles/standard/config/install/core.entity_form_display.block_content.basic.default.yml
index 7ccb5b0..7cefbc1 100644
--- a/core/profiles/standard/config/install/core.entity_form_display.block_content.basic.default.yml
+++ b/core/profiles/standard/config/install/core.entity_form_display.block_content.basic.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - block_content.type.basic
     - field.field.block_content.basic.body
   module:
+    - system
     - text
 id: block_content.basic.default
 targetEntityType: block_content
@@ -29,3 +30,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_form_display.comment.comment.default.yml b/core/profiles/standard/config/install/core.entity_form_display.comment.comment.default.yml
index 1010be2..481a7c6 100644
--- a/core/profiles/standard/config/install/core.entity_form_display.comment.comment.default.yml
+++ b/core/profiles/standard/config/install/core.entity_form_display.comment.comment.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - comment.type.comment
     - field.field.comment.comment.comment_body
   module:
+    - system
     - text
 id: comment.comment.default
 targetEntityType: comment
@@ -31,3 +32,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_form_display.node.article.default.yml b/core/profiles/standard/config/install/core.entity_form_display.node.article.default.yml
index c94e36e..3f9d743 100644
--- a/core/profiles/standard/config/install/core.entity_form_display.node.article.default.yml
+++ b/core/profiles/standard/config/install/core.entity_form_display.node.article.default.yml
@@ -12,6 +12,7 @@ dependencies:
     - comment
     - image
     - path
+    - system
     - text
 id: node.article.default
 targetEntityType: node
@@ -91,3 +92,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_form_display.node.page.default.yml b/core/profiles/standard/config/install/core.entity_form_display.node.page.default.yml
index 0b7ffd1..b8fb89d 100644
--- a/core/profiles/standard/config/install/core.entity_form_display.node.page.default.yml
+++ b/core/profiles/standard/config/install/core.entity_form_display.node.page.default.yml
@@ -6,6 +6,7 @@ dependencies:
     - node.type.page
   module:
     - path
+    - system
     - text
 id: node.page.default
 targetEntityType: node
@@ -65,3 +66,5 @@ content:
       placeholder: ''
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
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 6832229..a1f3371 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
@@ -6,6 +6,7 @@ dependencies:
     - image.style.thumbnail
   module:
     - image
+    - system
     - user
 id: user.user.default
 targetEntityType: user
@@ -33,3 +34,5 @@ content:
     weight: -1
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.block_content.basic.default.yml b/core/profiles/standard/config/install/core.entity_view_display.block_content.basic.default.yml
index e494882..09da9e0 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.block_content.basic.default.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.block_content.basic.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - block_content.type.basic
     - field.field.block_content.basic.body
   module:
+    - system
     - text
 id: block_content.basic.default
 targetEntityType: block_content
@@ -19,3 +20,5 @@ content:
     settings: {  }
     third_party_settings: {  }
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.comment.comment.default.yml b/core/profiles/standard/config/install/core.entity_view_display.comment.comment.default.yml
index 6ae213d..c3e08ab 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.comment.comment.default.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.comment.comment.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - comment.type.comment
     - field.field.comment.comment.comment_body
   module:
+    - system
     - text
 id: comment.comment.default
 targetEntityType: comment
@@ -22,3 +23,5 @@ content:
     weight: 100
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.node.article.default.yml b/core/profiles/standard/config/install/core.entity_view_display.node.article.default.yml
index 5c43252..159219f 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.node.article.default.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.node.article.default.yml
@@ -12,6 +12,7 @@ dependencies:
   module:
     - comment
     - image
+    - system
     - text
     - user
 id: node.article.default
@@ -58,3 +59,5 @@ content:
 hidden:
   field_image: true
   field_tags: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.node.article.rss.yml b/core/profiles/standard/config/install/core.entity_view_display.node.article.rss.yml
index 84660b6..1e02899 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.node.article.rss.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.node.article.rss.yml
@@ -9,6 +9,7 @@ dependencies:
     - field.field.node.article.field_tags
     - node.type.article
   module:
+    - system
     - user
 id: node.article.rss
 targetEntityType: node
@@ -23,3 +24,5 @@ hidden:
   comment: true
   field_image: true
   field_tags: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.node.article.teaser.yml b/core/profiles/standard/config/install/core.entity_view_display.node.article.teaser.yml
index 7b96908..912945d 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.node.article.teaser.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.node.article.teaser.yml
@@ -11,6 +11,7 @@ dependencies:
     - node.type.article
   module:
     - image
+    - system
     - text
     - user
 id: node.article.teaser
@@ -50,3 +51,5 @@ hidden:
   comment: true
   field_image: true
   field_tags: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.node.page.default.yml b/core/profiles/standard/config/install/core.entity_view_display.node.page.default.yml
index 8afd942..eaa319c 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.node.page.default.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.node.page.default.yml
@@ -5,6 +5,7 @@ dependencies:
     - field.field.node.page.body
     - node.type.page
   module:
+    - system
     - text
     - user
 id: node.page.default
@@ -23,3 +24,5 @@ content:
     weight: 101
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.node.page.teaser.yml b/core/profiles/standard/config/install/core.entity_view_display.node.page.teaser.yml
index bc7a68c..9b8a17c 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.node.page.teaser.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.node.page.teaser.yml
@@ -6,6 +6,7 @@ dependencies:
     - field.field.node.page.body
     - node.type.page
   module:
+    - system
     - text
     - user
 id: node.page.teaser
@@ -25,3 +26,5 @@ content:
     weight: 101
     region: content
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.user.user.compact.yml b/core/profiles/standard/config/install/core.entity_view_display.user.user.compact.yml
index 2ff13ad..1a4c8d2 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.user.user.compact.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.user.user.compact.yml
@@ -7,6 +7,7 @@ dependencies:
     - image.style.thumbnail
   module:
     - image
+    - system
     - user
 id: user.user.compact
 targetEntityType: user
@@ -24,3 +25,5 @@ content:
     label: hidden
 hidden:
   member_for: true
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/profiles/standard/config/install/core.entity_view_display.user.user.default.yml b/core/profiles/standard/config/install/core.entity_view_display.user.user.default.yml
index ef1fdd7..d526a2f 100644
--- a/core/profiles/standard/config/install/core.entity_view_display.user.user.default.yml
+++ b/core/profiles/standard/config/install/core.entity_view_display.user.user.default.yml
@@ -6,6 +6,7 @@ dependencies:
     - image.style.thumbnail
   module:
     - image
+    - system
     - user
 id: user.user.default
 targetEntityType: user
@@ -25,3 +26,5 @@ content:
     third_party_settings: {  }
     label: hidden
 hidden: {  }
+layout_id: layout_onecol
+layout_settings: {  }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
index ec1a55c..198f5a1 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayBaseTest.php
@@ -132,6 +132,7 @@ public function testOnDependencyRemoval() {
         'comment',
         'entity_test',
         'entity_test_third_party',
+        'system',
       ],
     ];
     $this->assertSame($expected_dependencies, $entity_display->getDependencies());
@@ -146,6 +147,7 @@ public function testOnDependencyRemoval() {
     $expected_dependencies['module'] = [
       'comment',
       'entity_test',
+      'system',
     ];
     $this->assertSame($expected_dependencies, $entity_display->getDependencies());
   }
diff --git a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
index 11aeede..f9157dd 100644
--- a/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityDisplayFormBaseTest.php
@@ -119,7 +119,7 @@ public function testCopyFormValuesToEntity() {
       })
       ->shouldBeCalled();
 
-    $form_object = new EntityViewDisplayEditForm($this->container->get('plugin.manager.field.field_type'), $this->container->get('plugin.manager.field.formatter'));
+    $form_object = new EntityViewDisplayEditForm($this->container->get('plugin.manager.field.field_type'), $this->container->get('plugin.manager.field.formatter'), $this->container->get('plugin.manager.core.layout'));
     $form_object->setEntityManager($this->container->get('entity.manager'));
     $form_object->setEntity($entity->reveal());
 
diff --git a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewDisplayTest.php
similarity index 62%
rename from core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
rename to core/tests/Drupal/KernelTests/Core/Entity/EntityViewDisplayTest.php
index 3ca5e59..7d124ae 100644
--- a/core/modules/field_layout/tests/src/Kernel/FieldLayoutEntityDisplayTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Entity/EntityViewDisplayTest.php
@@ -1,20 +1,95 @@
 <?php
 
-namespace Drupal\Tests\field_layout\Kernel;
+namespace Drupal\KernelTests\Core\Entity;
 
-use Drupal\field_layout\Entity\FieldLayoutEntityViewDisplay;
+use Drupal\Core\Entity\Entity\EntityViewDisplay;
+use Drupal\entity_test\Entity\EntityTest;
+use Drupal\field\Entity\FieldConfig;
+use Drupal\field\Entity\FieldStorageConfig;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
- * @coversDefaultClass \Drupal\field_layout\Entity\FieldLayoutEntityDisplayTrait
- * @group field_layout
+ * @coversDefaultClass \Drupal\Core\Entity\Entity\EntityViewDisplay
+ * @group Entity
  */
-class FieldLayoutEntityDisplayTest extends KernelTestBase {
+class EntityViewDisplayTest extends KernelTestBase {
 
   /**
    * {@inheritdoc}
    */
-  protected static $modules = ['layout_discovery', 'field_layout', 'entity_test', 'field_layout_test', 'system'];
+  protected static $modules = ['entity_test', 'field_layout_test', 'field', 'user', 'system'];
+
+  /**
+   * @covers ::preSave
+   * @covers ::applyLayout
+   */
+  public function testApplyLayout() {
+    $field_storage = FieldStorageConfig::create([
+      'entity_type' => 'entity_test',
+      'field_name' => 'test1',
+      'type' => 'string',
+    ]);
+    $field_storage->save();
+    $field = FieldConfig::create([
+      'field_storage' => $field_storage,
+      'label' => $this->randomMachineName(),
+      'bundle' => 'entity_test',
+    ]);
+    $field->save();
+    $entity_test = EntityTest::create([
+      'test1' => 'Test1',
+    ]);
+    $entity_display = EntityViewDisplay::create([
+      'targetEntityType' => 'entity_test',
+      'bundle' => 'entity_test',
+      'mode' => 'default',
+      'status' => TRUE,
+      'layout_id' => 'layout_twocol',
+      'content' => [
+        'test1' => [
+          'type' => 'string',
+          'region' => 'right',
+          'settings' => [],
+          'label' => 'hidden',
+          'third_party_settings' => [],
+          'weight' => 0,
+        ],
+      ],
+    ]);
+    $entity_display->save();
+
+    $expected_attached = [
+      'library' => [
+        'system/drupal.layout.twocol',
+      ],
+    ];
+    $expected_cache_contexts = [
+      'languages:language_interface',
+      'theme',
+      'user.permissions',
+    ];
+    $expected_markup = <<<'EOS'
+  <div class="layout--twocol">
+    <div class="layout-region layout-region--left">
+      
+    </div>
+
+    <div class="layout-region layout-region--right">
+      
+            <div>Test1</div>
+      
+    </div>
+  </div>
+
+EOS;
+
+    $build = $entity_display->build($entity_test);
+    $this->container->get('renderer')->renderRoot($build);
+
+    $this->assertEquals($expected_markup, $build['#markup']);
+    $this->assertEquals($expected_attached, $build['#attached']);
+    $this->assertEquals($expected_cache_contexts, $build['#cache']['contexts']);
+  }
 
   /**
    * @covers ::preSave
@@ -22,7 +97,7 @@ class FieldLayoutEntityDisplayTest extends KernelTestBase {
    */
   public function testPreSave() {
     // Create an entity display with one hidden and one visible field.
-    $entity_display = FieldLayoutEntityViewDisplay::create([
+    $entity_display = EntityViewDisplay::create([
       'targetEntityType' => 'entity_test',
       'bundle' => 'entity_test',
       'mode' => 'default',
@@ -38,12 +113,6 @@ public function testPreSave() {
       'langcode' => 'en',
       'status' => TRUE,
       'dependencies' => [],
-      'third_party_settings' => [
-        'field_layout' => [
-          'id' => 'layout_onecol',
-          'settings' => [],
-        ],
-      ],
       'id' => 'entity_test.entity_test.default',
       'targetEntityType' => 'entity_test',
       'bundle' => 'entity_test',
@@ -57,6 +126,8 @@ public function testPreSave() {
         ],
       ],
       'hidden' => [],
+      'layout_id' => 'layout_onecol',
+      'layout_settings' => [],
     ];
     $this->assertEntityValues($expected, $entity_display->toArray());
 
@@ -67,8 +138,7 @@ public function testPreSave() {
     // The dependencies have been updated.
     $expected['dependencies']['module'] = [
       'entity_test',
-      'field_layout',
-      'layout_discovery',
+      'system',
     ];
     // A third party setting is added by the entity_test module.
     $expected['third_party_settings']['entity_test'] = ['foo' => 'bar'];
@@ -85,13 +155,7 @@ public function testPreSave() {
     // but do not save yet.
     $entity_display->setLayoutId('test_layout_main_and_footer');
 
-    // The default settings were added.
-    $expected['third_party_settings']['field_layout'] = [
-      'id' => 'test_layout_main_and_footer',
-      'settings' => [
-        'setting_1' => 'Default',
-      ],
-    ];
+    $expected['layout_id'] = 'test_layout_main_and_footer';
     // The field was moved to the default region.
     $expected['content']['foo'] = [
       'type' => 'visible',
@@ -104,11 +168,14 @@ public function testPreSave() {
 
     // After saving, the dependencies have been updated.
     $entity_display->save();
+    // The default settings were added.
+    $expected['layout_settings'] = [
+      'setting_1' => 'Default',
+    ];
     $expected['dependencies']['module'] = [
       'dependency_from_annotation',
       'dependency_from_calculateDependencies',
       'entity_test',
-      'field_layout',
       'field_layout_test',
     ];
     $this->assertEntityValues($expected, $entity_display->toArray());
@@ -118,7 +185,7 @@ public function testPreSave() {
     $entity_display->save();
 
     // The setting overrides the default value.
-    $expected['third_party_settings']['field_layout']['settings']['setting_1'] = 'foobar';
+    $expected['layout_settings']['setting_1'] = 'foobar';
     $this->assertEntityValues($expected, $entity_display->toArray());
 
     // Move a field to the non-default region.
@@ -138,31 +205,13 @@ public function testPreSave() {
     // The dependencies have been updated.
     $expected['dependencies']['module'] = [
       'entity_test',
-      'field_layout',
       'field_layout_test',
     ];
     // The layout has been updated.
-    $expected['third_party_settings']['field_layout'] = [
-      'id' => 'test_layout_content_and_footer',
-      'settings' => [],
-    ];
+    $expected['layout_id'] = 'test_layout_content_and_footer';
+    $expected['layout_settings'] = [];
     // The field remains in its current region instead of moving to the default.
     $this->assertEntityValues($expected, $entity_display->toArray());
-
-    $this->container->get('module_installer')->uninstall(['field_layout']);
-
-    $entity_storage = $this->container->get('entity_type.manager')->getStorage('entity_view_display');
-    $entity_display = $entity_storage->load('entity_test.entity_test.default');
-
-    // The dependencies have been updated.
-    $expected['dependencies']['module'] = [
-      'entity_test',
-    ];
-    // All field_layout settings were removed.
-    unset($expected['third_party_settings']['field_layout']);
-    // The field has returned to the default content region.
-    $expected['content']['foo']['region'] = 'content';
-    $this->assertEntityValues($expected, $entity_display->toArray());
   }
 
   /**
diff --git a/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php b/core/tests/Drupal/KernelTests/Core/Layout/LayoutTest.php
similarity index 94%
rename from core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php
rename to core/tests/Drupal/KernelTests/Core/Layout/LayoutTest.php
index 8602377..998a274 100644
--- a/core/modules/layout_discovery/tests/src/Kernel/LayoutTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Layout/LayoutTest.php
@@ -1,7 +1,8 @@
 <?php
 
-namespace Drupal\Tests\layout_discovery\Kernel;
+namespace Drupal\KernelTests\Core\Layout;
 
+use Drupal\Core\Form\FormInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\KernelTests\KernelTestBase;
 
@@ -15,7 +16,7 @@ class LayoutTest extends KernelTestBase {
   /**
    * {@inheritdoc}
    */
-  public static $modules = ['system', 'layout_discovery', 'layout_test'];
+  public static $modules = ['system', 'layout_test'];
 
   /**
    * The layout plugin manager.
@@ -45,6 +46,9 @@ public function testRenderLayout($layout_id, $config, $regions, $html) {
     // Assume each layout is contained by a form, in order to ensure the
     // building of the layout does not interfere with form processing.
     $form_state = new FormState();
+    $form_object = $this->prophesize(FormInterface::class);
+    $form_state->setFormObject($form_object->reveal());
+
     $form_builder = $this->container->get('form_builder');
     $form_builder->prepareForm('the_form_id', $built, $form_state);
     $form_builder->processForm('the_form_id', $built, $form_state);
diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
index 8dd7e77..45aa24c 100644
--- a/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php
@@ -2,6 +2,8 @@
 
 namespace Drupal\Tests\Core\Config\Entity;
 
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Layout\LayoutPluginManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -59,6 +61,11 @@ public function testGetTargetBundle() {
    * @covers ::setTargetBundle
    */
   public function testSetTargetBundle() {
+    $layout_plugin_manager = $this->prophesize(LayoutPluginManagerInterface::class);
+    $container = new ContainerBuilder();
+    $container->set('plugin.manager.core.layout', $layout_plugin_manager->reveal());
+    \Drupal::setContainer($container);
+
     $mock = $this->getMockForAbstractClass('\Drupal\Core\Entity\EntityDisplayBase', [], '', FALSE);
     $reflection = new \ReflectionProperty($mock, 'bundle');
     $reflection->setAccessible(TRUE);
diff --git a/core/tests/Drupal/Tests/Core/Entity/Display/EntityFormDisplayTest.php b/core/tests/Drupal/Tests/Core/Entity/Display/EntityFormDisplayTest.php
new file mode 100644
index 0000000..0d8177e
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Entity/Display/EntityFormDisplayTest.php
@@ -0,0 +1,226 @@
+<?php
+
+namespace Drupal\Tests\Core\Entity\Display;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\Entity\EntityFormDisplay;
+use Drupal\Core\Entity\EntityFieldManagerInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\WidgetPluginManager;
+use Drupal\Core\Form\FormState;
+use Drupal\Core\Layout\LayoutDefault;
+use Drupal\Core\Layout\LayoutDefinition;
+use Drupal\Core\Layout\LayoutPluginManagerInterface;
+use Drupal\Core\Render\RendererInterface;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @coversDefaultClass \Drupal\Core\Entity\Entity\EntityFormDisplay
+ * @group Entity
+ */
+class EntityFormDisplayTest extends UnitTestCase {
+
+  /**
+   * The entity field manager.
+   *
+   * @var \Drupal\Core\Entity\EntityFieldManagerInterface|\Prophecy\Prophecy\ProphecyInterface
+   */
+  protected $entityFieldManager;
+
+  /**
+   * A layout definition.
+   *
+   * @var \Drupal\Core\Layout\LayoutDefinition
+   */
+  protected $pluginDefinition;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->pluginDefinition = new LayoutDefinition([
+      'library' => 'system/drupal.layout.twocol',
+      'theme_hook' => 'layout__twocol',
+      'regions' => [
+        'left' => [
+          'label' => 'Left',
+        ],
+        'right' => [
+          'label' => 'Right',
+        ],
+      ],
+    ]);
+    $layout_plugin = new LayoutDefault([], 'two_column', $this->pluginDefinition);
+
+    $layout_plugin_manager = $this->prophesize(LayoutPluginManagerInterface::class);
+    $layout_plugin_manager->getDefinition('unknown', FALSE)->willReturn(NULL);
+    $layout_plugin_manager->getDefinition('two_column', FALSE)->willReturn($this->pluginDefinition);
+    $layout_plugin_manager->createInstance('two_column', [])->willReturn($layout_plugin);
+
+    $renderer = $this->prophesize(RendererInterface::class);
+
+    $entity_type = $this->prophesize(EntityTypeInterface::class);
+    $entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE);
+
+    $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
+    $entity_type_manager->getDefinition('the_entity_type_id')->willReturn($entity_type->reveal());
+
+    $widget_manager = $this->prophesize(WidgetPluginManager::class);
+
+    $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class);
+
+    $container = new ContainerBuilder();
+    $container->set('entity_field.manager', $this->entityFieldManager->reveal());
+    $container->set('entity_type.manager', $entity_type_manager->reveal());
+    $container->set('plugin.manager.field.widget', $widget_manager->reveal());
+    $container->set('renderer', $renderer->reveal());
+    $container->set('plugin.manager.core.layout', $layout_plugin_manager->reveal());
+    \Drupal::setContainer($container);
+  }
+
+  /**
+   * @covers ::applyLayout
+   * @covers ::getFields
+   */
+  public function testApplyLayout() {
+    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
+    $non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
+
+    $definitions = [];
+    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
+    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
+
+    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn([]);
+
+    $build = [
+      'test1' => [
+        '#markup' => 'Test1',
+      ],
+      'test2' => [
+        '#markup' => 'Test2',
+        '#group' => 'existing_group',
+      ],
+      'field_layout' => [
+        '#markup' => 'Field created through the UI happens to be named "Layout"',
+      ],
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+    ];
+
+    $display = new EntityFormDisplay(
+      [
+        'targetEntityType' => 'the_entity_type_id',
+        'bundle' => 'the_entity_type_bundle',
+        'layout_id' => 'two_column',
+        'layout_settings' => [],
+        'content' => [
+          'test1' => [
+            'region' => 'right',
+          ],
+          'test2' => [
+            'region' => 'left',
+          ],
+          'field_layout' => [
+            'region' => 'right',
+          ],
+          'non_configurable_field' => [
+            'region' => 'left',
+          ],
+        ],
+      ],
+      'entity_form_display'
+    );
+
+    $expected = [
+      'test1' => [
+        '#markup' => 'Test1',
+        '#group' => 'right',
+      ],
+      'test2' => [
+        '#markup' => 'Test2',
+        '#group' => 'existing_group',
+      ],
+      'field_layout' => [
+        '#markup' => 'Field created through the UI happens to be named "Layout"',
+        '#group' => 'right',
+      ],
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+      'layout' => [
+        'left' => [
+          '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'],
+          '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'],
+        ],
+        'right' => [
+          '#process' => ['\Drupal\Core\Render\Element\RenderElement::processGroup'],
+          '#pre_render' => ['\Drupal\Core\Render\Element\RenderElement::preRenderGroup'],
+        ],
+        '#settings' => [],
+        '#layout' => $this->pluginDefinition,
+        '#theme' => 'layout__twocol',
+        '#attached' => [
+          'library' => [
+            'system/drupal.layout.twocol',
+          ],
+        ],
+      ],
+    ];
+
+    $build = $display->applyLayout($build, new FormState(), []);
+    $this->assertEquals($expected, $build);
+    $this->assertSame($expected, $build);
+  }
+
+  /**
+   * @covers ::applyLayout
+   * @covers ::getFields
+   */
+  public function testApplyLayoutEmpty() {
+    $definitions = [];
+    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
+    $non_configurable_field_definition->isDisplayConfigurable('form')->willReturn(FALSE);
+    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
+    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
+    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn([]);
+
+    $build = [
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+    ];
+
+    $display = new EntityFormDisplay(
+      [
+        'targetEntityType' => 'the_entity_type_id',
+        'bundle' => 'the_entity_type_bundle',
+        'layout_id' => 'two_column',
+        'layout_settings' => [],
+        'content' => [
+          'test1' => [
+            'region' => 'right',
+          ],
+          'non_configurable_field' => [
+            'region' => 'left',
+          ],
+        ],
+      ],
+      'entity_form_display'
+    );
+
+    $expected = [
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+    ];
+    $build = $display->applyLayout($build, new FormState(), []);
+    $this->assertSame($expected, $build);
+  }
+
+}
diff --git a/core/tests/Drupal/Tests/Core/Entity/Display/EntityViewDisplayTest.php b/core/tests/Drupal/Tests/Core/Entity/Display/EntityViewDisplayTest.php
new file mode 100644
index 0000000..9650ab5
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Entity/Display/EntityViewDisplayTest.php
@@ -0,0 +1,169 @@
+<?php
+
+namespace Drupal\Tests\Core\Entity\Display;
+
+use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\Core\Entity\Entity\EntityViewDisplay;
+use Drupal\Core\Entity\EntityFieldManagerInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Entity\EntityTypeManagerInterface;
+use Drupal\Core\Entity\FieldableEntityInterface;
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\FormatterPluginManager;
+use Drupal\Core\Layout\LayoutDefault;
+use Drupal\Core\Layout\LayoutDefinition;
+use Drupal\Core\Layout\LayoutPluginManagerInterface;
+use Drupal\Core\Render\RendererInterface;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @coversDefaultClass \Drupal\Core\Entity\Entity\EntityViewDisplay
+ * @group Entity
+ */
+class EntityViewDisplayTest extends UnitTestCase {
+
+  /**
+   * The entity field manager.
+   *
+   * @var \Drupal\Core\Entity\EntityFieldManagerInterface|\Prophecy\Prophecy\ProphecyInterface
+   */
+  protected $entityFieldManager;
+
+  /**
+   * A layout definition.
+   *
+   * @var \Drupal\Core\Layout\LayoutDefinition
+   */
+  protected $pluginDefinition;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->pluginDefinition = new LayoutDefinition([
+      'library' => 'system/drupal.layout.twocol',
+      'theme_hook' => 'layout__twocol',
+      'regions' => [
+        'left' => [
+          'label' => 'Left',
+        ],
+        'right' => [
+          'label' => 'Right',
+        ],
+      ],
+    ]);
+    $layout_plugin = new LayoutDefault([], 'two_column', $this->pluginDefinition);
+
+    $layout_plugin_manager = $this->prophesize(LayoutPluginManagerInterface::class);
+    $layout_plugin_manager->getDefinition('unknown', FALSE)->willReturn(NULL);
+    $layout_plugin_manager->getDefinition('two_column', FALSE)->willReturn($this->pluginDefinition);
+    $layout_plugin_manager->createInstance('two_column', [])->willReturn($layout_plugin);
+
+    $renderer = $this->prophesize(RendererInterface::class);
+
+    $entity_type = $this->prophesize(EntityTypeInterface::class);
+    $entity_type->entityClassImplements(FieldableEntityInterface::class)->willReturn(TRUE);
+
+    $entity_type_manager = $this->prophesize(EntityTypeManagerInterface::class);
+    $entity_type_manager->getDefinition('the_entity_type_id')->willReturn($entity_type->reveal());
+
+    $formatter_manager = $this->prophesize(FormatterPluginManager::class);
+
+    $this->entityFieldManager = $this->prophesize(EntityFieldManagerInterface::class);
+
+    $container = new ContainerBuilder();
+    $container->set('entity_field.manager', $this->entityFieldManager->reveal());
+    $container->set('entity_type.manager', $entity_type_manager->reveal());
+    $container->set('plugin.manager.field.formatter', $formatter_manager->reveal());
+    $container->set('renderer', $renderer->reveal());
+    $container->set('plugin.manager.core.layout', $layout_plugin_manager->reveal());
+    \Drupal::setContainer($container);
+  }
+
+  /**
+   * @covers ::applyLayout
+   * @covers ::getFields
+   */
+  public function testApplyLayout() {
+    $non_configurable_field_definition = $this->prophesize(FieldDefinitionInterface::class);
+    $non_configurable_field_definition->isDisplayConfigurable('view')->willReturn(FALSE);
+
+    $definitions = [];
+    $definitions['non_configurable_field'] = $non_configurable_field_definition->reveal();
+    $definitions['non_configurable_field_with_extra_field'] = $non_configurable_field_definition->reveal();
+    $this->entityFieldManager->getFieldDefinitions('the_entity_type_id', 'the_entity_type_bundle')->willReturn($definitions);
+
+    $extra_fields = [];
+    $extra_fields['non_configurable_field_with_extra_field'] = [
+      'label' => 'This non-configurable field is also defined in hook_entity_extra_field_info()',
+    ];
+    $this->entityFieldManager->getExtraFields('the_entity_type_id', 'the_entity_type_bundle')->willReturn($extra_fields);
+
+    $build = [
+      'test1' => [
+        '#markup' => 'Test1',
+      ],
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+      'non_configurable_field_with_extra_field' => [
+        '#markup' => 'Non-configurable with extra field',
+      ],
+    ];
+
+    $display = new EntityViewDisplay(
+      [
+        'targetEntityType' => 'the_entity_type_id',
+        'bundle' => 'the_entity_type_bundle',
+        'layout_id' => 'two_column',
+        'layout_settings' => [],
+        'content' => [
+          'test1' => [
+            'region' => 'right',
+          ],
+          'non_configurable_field' => [
+            'region' => 'left',
+          ],
+          'non_configurable_field_with_extra_field' => [
+            'region' => 'left',
+          ],
+        ],
+      ],
+      'entity_view_display'
+    );
+
+    $expected = [
+      'non_configurable_field' => [
+        '#markup' => 'Non-configurable',
+      ],
+      'layout' => [
+        'left' => [
+          'non_configurable_field_with_extra_field' => [
+            '#markup' => 'Non-configurable with extra field',
+          ],
+        ],
+        'right' => [
+          'test1' => [
+            '#markup' => 'Test1',
+          ],
+        ],
+        '#settings' => [],
+        '#layout' => $this->pluginDefinition,
+        '#theme' => 'layout__twocol',
+        '#attached' => [
+          'library' => [
+            'system/drupal.layout.twocol',
+          ],
+        ],
+      ],
+    ];
+
+    $method_ref = new \ReflectionMethod($display, 'applyLayout');
+    $method_ref->setAccessible(TRUE);
+    $method_ref->invokeArgs($display, [&$build]);
+    $this->assertEquals($expected, $build);
+  }
+
+}
diff --git a/core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig b/core/themes/stable/templates/layout/layout--onecol.html.twig
similarity index 54%
rename from core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig
rename to core/themes/stable/templates/layout/layout--onecol.html.twig
index 69fed03..34b58ee 100644
--- a/core/modules/layout_discovery/layouts/onecol/layout--onecol.html.twig
+++ b/core/themes/stable/templates/layout/layout--onecol.html.twig
@@ -10,15 +10,4 @@
  * @ingroup themeable
  */
 #}
-{%
-set classes = [
-'layout--onecol',
-]
-%}
-{% if content %}
-<div{{ attributes.addClass(classes) }}>
-  <div class="layout-region layout-region--content">
-    {{ content }}
-  </div>
-</div>
-{% endif %}
+{{ content }}
diff --git a/core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig b/core/themes/stable/templates/layout/layout--twocol.html.twig
similarity index 74%
rename from core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig
rename to core/themes/stable/templates/layout/layout--twocol.html.twig
index efebf0f..8e54d30 100644
--- a/core/modules/layout_discovery/layouts/twocol/layout--twocol.html.twig
+++ b/core/themes/stable/templates/layout/layout--twocol.html.twig
@@ -17,10 +17,6 @@ set classes = [
 %}
 {% if content %}
   <div{{ attributes.addClass(classes) }}>
-    <div class="layout-region layout-region--fullwidth">
-      {{ content.top }}
-    </div>
-
     <div class="layout-region layout-region--left">
       {{ content.left }}
     </div>
@@ -28,9 +24,5 @@ set classes = [
     <div class="layout-region layout-region--right">
       {{ content.right }}
     </div>
-
-    <div class="layout-region layout-region--fullwidth">
-      {{ content.bottom }}
-    </div>
   </div>
 {% endif %}
diff --git a/core/modules/layout_discovery/templates/layout.html.twig b/core/themes/stable/templates/layout/layout.html.twig
similarity index 100%
rename from core/modules/layout_discovery/templates/layout.html.twig
rename to core/themes/stable/templates/layout/layout.html.twig
