diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml
index 1094a53..c3d0ed2 100644
--- a/core/config/schema/core.data_types.schema.yml
+++ b/core/config/schema/core.data_types.schema.yml
@@ -291,12 +291,6 @@ block_settings:
     view_mode:
       type: string
       label: 'View mode'
-    visibility:
-      type: sequence
-      label: 'Visibility Conditions'
-      sequence:
-        - type: condition.plugin.[id]
-          label: 'Visibility Condition'
     provider:
       type: string
       label: 'Provider'
diff --git a/core/lib/Drupal/Core/Annotation/ContextDefinition.php b/core/lib/Drupal/Core/Annotation/ContextDefinition.php
index 1a6b00a..a532cae 100644
--- a/core/lib/Drupal/Core/Annotation/ContextDefinition.php
+++ b/core/lib/Drupal/Core/Annotation/ContextDefinition.php
@@ -8,6 +8,7 @@
 namespace Drupal\Core\Annotation;
 
 use Drupal\Component\Annotation\Plugin;
+use Drupal\Core\StringTranslation\TranslationWrapper;
 
 /**
  * @defgroup plugin_context Annotation for context definition
@@ -94,9 +95,17 @@ public function __construct(array $values) {
     $values += array(
       'required' => TRUE,
       'multiple' => FALSE,
-      'label' => NULL,
-      'description' => NULL,
     );
+    // Annotation classes extract data from passed annotation classes directly
+    // used in the classes they pass to.
+    foreach (['label', 'description'] as $key) {
+      if (isset($values[$key]) && $values[$key] instanceof TranslationWrapper) {
+        $values[$key] = (string) $values[$key]->get();
+      }
+      else {
+        $values[$key] = NULL;
+      }
+    }
     if (isset($values['class']) && !in_array('Drupal\Core\Plugin\Context\ContextDefinitionInterface', class_implements($values['class']))) {
       throw new \Exception('ContextDefinition class must implement \Drupal\Core\Plugin\Context\ContextDefinitionInterface.');
     }
diff --git a/core/lib/Drupal/Core/Block/BlockBase.php b/core/lib/Drupal/Core/Block/BlockBase.php
index 2be3670..dfd4573 100644
--- a/core/lib/Drupal/Core/Block/BlockBase.php
+++ b/core/lib/Drupal/Core/Block/BlockBase.php
@@ -8,13 +8,7 @@
 namespace Drupal\Core\Block;
 
 use Drupal\block\BlockInterface;
-use Drupal\block\Event\BlockConditionContextEvent;
-use Drupal\block\Event\BlockEvents;
-use Drupal\Component\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\Access\AccessResult;
-use Drupal\Core\Condition\ConditionAccessResolverTrait;
-use Drupal\Core\Condition\ConditionPluginCollection;
-use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\ContextAwarePluginBase;
 use Drupal\Component\Utility\Unicode;
@@ -35,22 +29,6 @@
  */
 abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginInterface {
 
-  use ConditionAccessResolverTrait;
-
-  /**
-   * The condition plugin collection.
-   *
-   * @var \Drupal\Core\Condition\ConditionPluginCollection
-   */
-  protected $conditionCollection;
-
-  /**
-   * The condition plugin manager.
-   *
-   * @var \Drupal\Core\Executable\ExecutableManagerInterface
-   */
-  protected $conditionPluginManager;
-
   /**
    * The transliteration service.
    *
@@ -84,9 +62,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
    * {@inheritdoc}
    */
   public function getConfiguration() {
-    return array(
-      'visibility' => $this->getVisibilityConditions()->getConfiguration(),
-    ) + $this->configuration;
+    return $this->configuration;
   }
 
   /**
@@ -107,13 +83,6 @@ public function setConfiguration(array $configuration) {
    *   An associative array with the default configuration.
    */
   protected function baseConfigurationDefaults() {
-    // @todo Allow list of conditions to be configured in
-    //   https://drupal.org/node/2284687.
-    $visibility = array_map(function ($definition) {
-      return array('id' => $definition['id']);
-    }, $this->conditionPluginManager()->getDefinitions());
-    unset($visibility['current_theme']);
-
     return array(
       'id' => $this->getPluginId(),
       'label' => '',
@@ -123,7 +92,6 @@ protected function baseConfigurationDefaults() {
         'max_age' => 0,
         'contexts' => array(),
       ),
-      'visibility' => $visibility,
     );
   }
 
@@ -152,25 +120,8 @@ public function calculateDependencies() {
    * {@inheritdoc}
    */
   public function access(AccountInterface $account) {
-    // @todo Add in a context mapping until the UI supports configuring them,
-    //   see https://drupal.org/node/2284687.
-    $mappings['user_role']['current_user'] = 'user';
-
-    $conditions = $this->getVisibilityConditions();
-    $contexts = $this->getConditionContexts();
-    foreach ($conditions as $condition_id => $condition) {
-      if ($condition instanceof ContextAwarePluginInterface) {
-        if (!isset($mappings[$condition_id])) {
-          $mappings[$condition_id] = array();
-        }
-        $this->contextHandler()->applyContextMapping($condition, $contexts, $mappings[$condition_id]);
-      }
-    }
-    // This should not be hardcoded to an uncacheable access check result, but
-    // in order to fix that, we need condition plugins to return cache contexts,
-    // otherwise it will be impossible to determine by which cache contexts the
     // result should be varied.
-    if ($this->resolveConditions($conditions, 'and', $contexts, $mappings) !== FALSE && $this->blockAccess($account)) {
+    if ($this->blockAccess($account)) {
       $access = AccessResult::allowed();
     }
     else {
@@ -180,18 +131,6 @@ public function access(AccountInterface $account) {
   }
 
   /**
-   * Gets the values for all defined contexts.
-   *
-   * @return \Drupal\Component\Plugin\Context\ContextInterface[]
-   *   An array of set contexts, keyed by context name.
-   */
-  protected function getConditionContexts() {
-    $conditions = $this->getVisibilityConditions();
-    $this->eventDispatcher()->dispatch(BlockEvents::CONDITION_CONTEXT, new BlockConditionContextEvent($conditions));
-    return $conditions->getConditionContexts();
-  }
-
-  /**
    * Indicates whether the block should be shown.
    *
    * @param \Drupal\Core\Session\AccountInterface $account
@@ -287,53 +226,6 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
       $form['cache']['contexts']['#description'] .= ' ' . t('This block is <em>always</em> varied by the following contexts: %required-context-list.', array('%required-context-list' => $required_context_list));
     }
 
-    $form['visibility_tabs'] = array(
-      '#type' => 'vertical_tabs',
-      '#title' => $this->t('Visibility'),
-      '#parents' => array('visibility_tabs'),
-      '#attached' => array(
-        'library' => array(
-          'block/drupal.block',
-        ),
-      ),
-    );
-    foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
-      $condition_form = $condition->buildConfigurationForm(array(), $form_state);
-      $condition_form['#type'] = 'details';
-      $condition_form['#title'] = $condition->getPluginDefinition()['label'];
-      $condition_form['#group'] = 'visibility_tabs';
-      $form['visibility'][$condition_id] = $condition_form;
-    }
-
-    // @todo Determine if there is a better way to rename the conditions.
-    if (isset($form['visibility']['node_type'])) {
-      $form['visibility']['node_type']['#title'] = $this->t('Content types');
-      $form['visibility']['node_type']['bundles']['#title'] = $this->t('Content types');
-      $form['visibility']['node_type']['negate']['#type'] = 'value';
-      $form['visibility']['node_type']['negate']['#title_display'] = 'invisible';
-      $form['visibility']['node_type']['negate']['#value'] = $form['visibility']['node_type']['negate']['#default_value'];
-    }
-    if (isset($form['visibility']['user_role'])) {
-      $form['visibility']['user_role']['#title'] = $this->t('Roles');
-      unset($form['visibility']['user_role']['roles']['#description']);
-      $form['visibility']['user_role']['negate']['#type'] = 'value';
-      $form['visibility']['user_role']['negate']['#value'] = $form['visibility']['user_role']['negate']['#default_value'];
-    }
-    if (isset($form['visibility']['request_path'])) {
-      $form['visibility']['request_path']['#title'] = $this->t('Pages');
-      $form['visibility']['request_path']['negate']['#type'] = 'radios';
-      $form['visibility']['request_path']['negate']['#title_display'] = 'invisible';
-      $form['visibility']['request_path']['negate']['#default_value'] = (int) $form['visibility']['request_path']['negate']['#default_value'];
-      $form['visibility']['request_path']['negate']['#options'] = array(
-        $this->t('Show for the listed pages'),
-        $this->t('Hide for the listed pages'),
-      );
-    }
-    if (isset($form['visibility']['language'])) {
-      $form['visibility']['language']['negate']['#type'] = 'value';
-      $form['visibility']['language']['negate']['#value'] = $form['visibility']['language']['negate']['#default_value'];
-    }
-
     // Add plugin-specific settings for this block type.
     $form += $this->blockForm($form, $form_state);
     return $form;
@@ -362,15 +254,6 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
     $contexts = $form_state->getValue(array('cache', 'contexts'));
     $form_state->setValue(array('cache', 'contexts'), array_values(array_filter($contexts)));
 
-    foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
-      // Allow the condition to validate the form.
-      $condition_values = (new FormState())
-        ->setValues($form_state->getValue(['visibility', $condition_id]));
-      $condition->validateConfigurationForm($form, $condition_values);
-      // Update the original form values.
-      $form_state->setValue(['visibility', $condition_id], $condition_values->getValues());
-    }
-
     $this->blockValidate($form, $form_state);
   }
 
@@ -394,14 +277,6 @@ public function submitConfigurationForm(array &$form, FormStateInterface $form_s
       $this->configuration['label_display'] = $form_state->getValue('label_display');
       $this->configuration['provider'] = $form_state->getValue('provider');
       $this->configuration['cache'] = $form_state->getValue('cache');
-      foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
-        // Allow the condition to submit the form.
-        $condition_values = (new FormState())
-          ->setValues($form_state->getValue(['visibility', $condition_id]));
-        $condition->submitConfigurationForm($form, $condition_values);
-        // Update the original form values.
-        $form_state->setValue(['visibility', $condition_id], $condition_values->getValues());
-      }
       $this->blockSubmit($form, $form_state);
     }
   }
@@ -503,61 +378,4 @@ public function isCacheable() {
     return $max_age === Cache::PERMANENT || $max_age > 0;
   }
 
-  /**
-   * {@inheritdoc}
-   */
-  public function getVisibilityConditions() {
-    if (!isset($this->conditionCollection)) {
-      $this->conditionCollection = new ConditionPluginCollection($this->conditionPluginManager(), $this->configuration['visibility']);
-    }
-    return $this->conditionCollection;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function getVisibilityCondition($instance_id) {
-    return $this->getVisibilityConditions()->get($instance_id);
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public function setVisibilityConfig($instance_id, array $configuration) {
-    $this->getVisibilityConditions()->setInstanceConfiguration($instance_id, $configuration);
-    return $this;
-  }
-
-  /**
-   * Gets the condition plugin manager.
-   *
-   * @return \Drupal\Core\Executable\ExecutableManagerInterface
-   *   The condition plugin manager.
-   */
-  protected function conditionPluginManager() {
-    if (!isset($this->conditionPluginManager)) {
-      $this->conditionPluginManager = \Drupal::service('plugin.manager.condition');
-    }
-    return $this->conditionPluginManager;
-  }
-
-  /**
-   * Wraps the event dispatcher.
-   *
-   * @return \Symfony\Component\EventDispatcher\EventDispatcherInterface
-   *   The event dispatcher.
-   */
-  protected function eventDispatcher() {
-    return \Drupal::service('event_dispatcher');
-  }
-
-  /**
-   * Wraps the context handler.
-   *
-   * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface
-   */
-  protected function contextHandler() {
-    return \Drupal::service('context.handler');
-  }
-
 }
diff --git a/core/lib/Drupal/Core/Block/BlockPluginInterface.php b/core/lib/Drupal/Core/Block/BlockPluginInterface.php
index 01f97ad..f63a955 100644
--- a/core/lib/Drupal/Core/Block/BlockPluginInterface.php
+++ b/core/lib/Drupal/Core/Block/BlockPluginInterface.php
@@ -7,7 +7,6 @@
 
 namespace Drupal\Core\Block;
 
-use Drupal\Component\Plugin\Context\ContextInterface;
 use Drupal\Component\Plugin\DerivativeInspectionInterface;
 use Drupal\Core\Cache\CacheableInterface;
 use Drupal\Component\Plugin\PluginInspectionInterface;
@@ -143,35 +142,4 @@ public function blockSubmit($form, FormStateInterface $form_state);
    */
   public function getMachineNameSuggestion();
 
-  /**
-   * Gets conditions for this block.
-   *
-   * @return \Drupal\Core\Condition\ConditionInterface[]|\Drupal\Core\Condition\ConditionPluginCollection
-   *   An array or collection of configured condition plugins.
-   */
-  public function getVisibilityConditions();
-
-  /**
-   * Gets a visibility condition plugin instance.
-   *
-   * @param string $instance_id
-   *   The condition plugin instance ID.
-   *
-   * @return \Drupal\Core\Condition\ConditionInterface
-   *   A condition plugin.
-   */
-  public function getVisibilityCondition($instance_id);
-
-  /**
-   * Sets the visibility condition configuration.
-   *
-   * @param string $instance_id
-   *   The condition instance ID.
-   * @param array $configuration
-   *   The condition configuration.
-   *
-   * @return $this
-   */
-  public function setVisibilityConfig($instance_id, array $configuration);
-
 }
diff --git a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
index ed28d69..68e0f35 100644
--- a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
+++ b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
@@ -41,6 +41,11 @@ public function isNegated() {
    * {@inheritdoc}
    */
   public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
+    $temporary = $form_state->getTemporary();
+    $contexts = isset($temporary['gathered_contexts']) ? $temporary['gathered_contexts'] : [];
+
+    $form['context_mapping'] = $this->addContextAssignmentElement($contexts);
+    $form['context_mapping']['#weight'] = -100;
     $form['negate'] = array(
       '#type' => 'checkbox',
       '#title' => $this->t('Negate the condition'),
@@ -59,6 +64,7 @@ public function validateConfigurationForm(array &$form, FormStateInterface $form
    * {@inheritdoc}
    */
   public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
+    $this->saveContextConfiguration($form_state->getValue('context_mapping'));
     $this->configuration['negate'] = $form_state->getValue('negate');
   }
 
diff --git a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
index 1fec193..2d43499 100644
--- a/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
+++ b/core/lib/Drupal/Core/Plugin/ContextAwarePluginBase.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Core\Plugin;
 
+use Drupal\Component\Plugin\ConfigurablePluginInterface;
 use Drupal\Component\Plugin\ContextAwarePluginBase as ComponentContextAwarePluginBase;
 use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Core\DependencyInjection\DependencySerializationTrait;
@@ -49,4 +50,75 @@ public function setContext($name, ComponentContextInterface $context) {
     parent::setContext($name, $context);
   }
 
+  /**
+   * Returns the form element for picking relevant context of this plugin.
+   *
+   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
+   *   An array of contexts.
+   *
+   * @return array
+   *   A form element for assigning context.
+   */
+  protected function addContextAssignmentElement(array $contexts) {
+    $element = [];
+    foreach ($this->getContextDefinitions() as $name => $context_definition) {
+      $options = [];
+      $element['#tree'] = TRUE;
+      foreach ($this->contextHandler()->getMatchingContexts($contexts, $context_definition) as $context_id => $context) {
+        $options[$context_id] = $context->getContextDefinition()->getLabel();
+        $element[$name] = [
+          '#type' => 'value',
+          '#value' => $context_id,
+        ];
+      }
+
+      if (count($options) > 1) {
+        $configuration = $this instanceof ConfigurablePluginInterface ? $this->getConfiguration() : $this->configuration;
+        $element[$name] = array(
+          '#title' => $context_definition->getLabel(),
+          '#type' => 'select',
+          '#required' => $context_definition->isRequired(),
+          '#options' => $options,
+          '#default_value' => !empty($configuration['context_mapping'][$name]) ? $configuration['context_mapping'][$name] : '',
+        );
+      }
+    }
+    return $element;
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * @return \Drupal\Core\Plugin\Context\ContextDefinitionInterface[]
+   */
+  public function getContextDefinitions() {
+    return parent::getContextDefinitions();
+  }
+
+  /**
+   * Handles the submission for assigning a context to a given slot.
+   *
+   * @param array $assignments
+   *   An array of assignments.
+   */
+  protected function saveContextConfiguration($assignments) {
+    if ($this instanceof ConfigurablePluginInterface) {
+      $configuration = $this->getConfiguration();
+      $configuration['context_mapping'] = $assignments;
+      $this->setConfiguration($configuration);
+    }
+    else {
+      $this->configuration['context_mapping'] = $assignments;
+    }
+  }
+
+  /**
+   * Wraps the context handler.
+   *
+   * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface
+   */
+  protected function contextHandler() {
+    return \Drupal::service('context.handler');
+  }
+
 }
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index 83f4a40..458473b 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -323,7 +323,7 @@ function block_configurable_language_delete(ConfigurableLanguageInterface $langu
     $visibility = $block->getVisibility();
     if (isset($visibility['language']['langcodes'][$language->id()])) {
       unset($visibility['language']['langcodes'][$language->id()]);
-      $block->getPlugin()->setVisibilityConfig('language', $visibility['language']);
+      $block->setVisibilityConfig('language', $visibility['language']);
       $block->save();
     }
   }
diff --git a/core/modules/block/config/schema/block.schema.yml b/core/modules/block/config/schema/block.schema.yml
index c142f89..1e6b823 100644
--- a/core/modules/block/config/schema/block.schema.yml
+++ b/core/modules/block/config/schema/block.schema.yml
@@ -24,6 +24,12 @@ block.block.*:
       label: 'Plugin'
     settings:
       type: block.settings.[%parent.plugin]
+    visibility:
+      type: sequence
+      label: 'Visibility Conditions'
+      sequence:
+        - type: condition.plugin.[id]
+          label: 'Visibility Condition'
 
 block.settings.*:
   type: block_settings
diff --git a/core/modules/block/js/block.js b/core/modules/block/js/block.js
index 3affe12..c25842f 100644
--- a/core/modules/block/js/block.js
+++ b/core/modules/block/js/block.js
@@ -26,10 +26,10 @@ function checkboxesSummary(context) {
         return vals.join(', ');
       }
 
-      $('#edit-settings-visibility-node-type, #edit-settings-visibility-language, #edit-settings-visibility-user-role').drupalSetSummary(checkboxesSummary);
+      $('#edit-visibility-node-type, #edit-visibility-language, #edit-visibility-user-role').drupalSetSummary(checkboxesSummary);
 
-      $('#edit-settings-visibility-request-path').drupalSetSummary(function (context) {
-        var $pages = $(context).find('textarea[name="settings[visibility][request_path][pages]"]');
+      $('#edit-visibility-request-path').drupalSetSummary(function (context) {
+        var $pages = $(context).find('textarea[name="visibility[request_path][pages]"]');
         if (!$pages.val()) {
           return Drupal.t('Not restricted');
         }
diff --git a/core/modules/block/src/BlockAccessControlHandler.php b/core/modules/block/src/BlockAccessControlHandler.php
index 8bfa365..b815c41 100644
--- a/core/modules/block/src/BlockAccessControlHandler.php
+++ b/core/modules/block/src/BlockAccessControlHandler.php
@@ -7,23 +7,75 @@
 
 namespace Drupal\block;
 
+use Drupal\Component\Plugin\ContextAwarePluginInterface;
+use Drupal\Component\Plugin\Exception\ContextException;
 use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Condition\ConditionAccessResolverTrait;
 use Drupal\Core\Entity\EntityAccessControlHandler;
+use Drupal\Core\Entity\EntityHandlerInterface;
 use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityTypeInterface;
+use Drupal\Core\Executable\ExecutableManagerInterface;
+use Drupal\Core\Plugin\Context\ContextHandlerInterface;
 use Drupal\Core\Session\AccountInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Defines the access control handler for the block entity type.
  *
  * @see \Drupal\block\Entity\Block
  */
-class BlockAccessControlHandler extends EntityAccessControlHandler {
+class BlockAccessControlHandler extends EntityAccessControlHandler implements EntityHandlerInterface {
+
+  use ConditionAccessResolverTrait;
+
+  /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Executable\ExecutableManagerInterface
+   */
+  protected $manager;
+
+  /**
+   * The plugin context handler.
+   *
+   * @var \Drupal\Core\Plugin\Context\ContextHandlerInterface
+   */
+  protected $contextHandler;
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
+    return new static(
+      $entity_type,
+      $container->get('plugin.manager.condition'),
+      $container->get('context.handler')
+    );
+  }
+
+  /**
+   * Constructs the block access control handler instance
+   *
+   * @param EntityTypeInterface $entity_type
+   *   The entity type definition.
+   * @param ExecutableManagerInterface $manager
+   *   The ConditionManager for checking visibility of blocks.
+   * @param ContextHandlerInterface $context_handler
+   *   The ContextHandler for applying contexts to conditions properly.
+   */
+  public function __construct(EntityTypeInterface $entity_type, ExecutableManagerInterface $manager, ContextHandlerInterface $context_handler) {
+    parent::__construct($entity_type);
+    $this->manager = $manager;
+    $this->contextHandler = $context_handler;
+  }
+
 
   /**
    * {@inheritdoc}
    */
   protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
-    /** @var $entity \Drupal\block\BlockInterface */
+    /** @var \Drupal\block\BlockInterface $entity */
     if ($operation != 'view') {
       return parent::checkAccess($entity, $operation, $langcode, $account);
     }
@@ -33,8 +85,32 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
       return AccessResult::forbidden()->cacheUntilEntityChanges($entity);
     }
     else {
-      // Delegate to the plugin.
-      return $entity->getPlugin()->access($account)->cacheUntilEntityChanges($entity);
+      $contexts = $entity->getAvailableContexts();
+      $conditions = [];
+      foreach ($entity->getVisibilityConditions() as $condition_id => $condition) {
+        if ($condition instanceof ContextAwarePluginInterface) {
+          try {
+            $this->contextHandler->applyContextMapping($condition, $contexts);
+          }
+          catch (ContextException $e) {
+            $access = AccessResult::forbidden();
+            return $access->setCacheable(FALSE)->cacheUntilEntityChanges($entity);
+          }
+        }
+        $conditions[$condition_id] = $condition;
+      }
+      // This should not be hardcoded to an uncacheable access check result, but
+      // in order to fix that, we need condition plugins to return cache contexts,
+      // otherwise it will be impossible to determine by which cache contexts the
+      // result should be varied.
+      if ($this->resolveConditions($conditions, 'and') !== FALSE) {
+        // Delegate to the plugin.
+        $access = $entity->getPlugin()->access($account);
+      }
+      else {
+        $access = AccessResult::forbidden();
+      }
+      return $access->setCacheable(FALSE)->cacheUntilEntityChanges($entity);
     }
   }
 
diff --git a/core/modules/block/src/BlockForm.php b/core/modules/block/src/BlockForm.php
index 73e7ea4..380b930 100644
--- a/core/modules/block/src/BlockForm.php
+++ b/core/modules/block/src/BlockForm.php
@@ -7,11 +7,16 @@
 
 namespace Drupal\block;
 
+use Drupal\block\Event\BlockContextEvent;
+use Drupal\block\Event\BlockEvents;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
+use Drupal\Core\Executable\ExecutableManagerInterface;
 use Drupal\Core\Form\FormState;
 use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Language\LanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Provides form for block instance forms.
@@ -33,13 +38,43 @@ class BlockForm extends EntityForm {
   protected $storage;
 
   /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Condition\ConditionManager
+   */
+  protected $manager;
+
+  /**
+   * The event dispatcher service.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface
+   */
+  protected $dispatcher;
+
+  /**
+   * The language manager service.
+   *
+   * @var \Drupal\Core\Language\LanguageManagerInterface
+   */
+  protected $language;
+
+  /**
    * Constructs a BlockForm object.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
+   * @param \Drupal\Core\Executable\ExecutableManagerInterface $manager
+   *   The ConditionManager for building the visibility UI.
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
+   *   The EventDispatcher for gathering administrative contexts.
+   * @param \Drupal\Core\Language\LanguageManagerInterface $language
+   *   The language manager.
    */
-  public function __construct(EntityManagerInterface $entity_manager) {
+  public function __construct(EntityManagerInterface $entity_manager, ExecutableManagerInterface $manager, EventDispatcherInterface $dispatcher, LanguageManagerInterface $language) {
     $this->storage = $entity_manager->getStorage('block');
+    $this->manager = $manager;
+    $this->dispatcher = $dispatcher;
+    $this->language = $language;
   }
 
   /**
@@ -47,7 +82,10 @@ public function __construct(EntityManagerInterface $entity_manager) {
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('entity.manager')
+      $container->get('entity.manager'),
+      $container->get('plugin.manager.condition'),
+      $container->get('event_dispatcher'),
+      $container->get('language_manager')
     );
   }
 
@@ -63,8 +101,15 @@ public function form(array $form, FormStateInterface $form_state) {
     }
     $form_state->set('block_theme', $theme);
 
+    // Store the gathered contexts in the form state for other objects to use
+    // during form building.
+    $temporary = $form_state->getTemporary();
+    $temporary['gathered_contexts'] = $this->dispatcher->dispatch(BlockEvents::ADMINISTRATIVE_CONTEXT, new BlockContextEvent())->getContexts();
+    $form_state->setTemporary($temporary);
+
     $form['#tree'] = TRUE;
     $form['settings'] = $entity->getPlugin()->buildConfigurationForm(array(), $form_state);
+    $form = $this->buildVisibilityInterface($form, $form_state);
 
     // If creating a new block, calculate a safe default machine name.
     $form['id'] = array(
@@ -121,6 +166,7 @@ public function form(array $form, FormStateInterface $form_state) {
     $form['#attached']['css'] = array(
       drupal_get_path('module', 'block') . '/css/block.admin.css',
     );
+
     return $form;
   }
 
@@ -133,6 +179,83 @@ public function themeSwitch($form, FormStateInterface $form_state) {
   }
 
   /**
+   * Helper function for building the visibility UI form.
+   *
+   * @param array $form
+   *   An associative array containing the structure of the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   *
+   * @return array
+   *   The form array with the visibility UI added in.
+   */
+  protected function buildVisibilityInterface(array $form, FormStateInterface $form_state) {
+    $form['settings']['visibility_tabs'] = [
+      '#type' => 'vertical_tabs',
+      '#title' => $this->t('Visibility'),
+      '#parents' => ['visibility_tabs'],
+      '#attached' => [
+        'library' => [
+          'block/drupal.block',
+        ],
+      ],
+    ];
+    // @todo Allow list of conditions to be configured in
+    //   https://drupal.org/node/2284687.
+    $visibility = $this->entity->getVisibility();
+    foreach ($this->manager->getDefinitions() as $condition_id => $defintion) {
+      // Don't display the current theme condition.
+      if ($condition_id == 'current_theme') {
+        continue;
+      }
+      // Don't display the language condition until we have multiple languages.
+      if ($condition_id == 'language') {
+        if (!$this->language->isMultilingual()) {
+          continue;
+        }
+      }
+      /** @var \Drupal\Core\Condition\ConditionInterface $condition */
+      $condition = $this->manager->createInstance($condition_id, isset($visibility[$condition_id]) ? $visibility[$condition_id] : array());
+      $form_state->set(['conditions', $condition_id], $condition);
+      $condition_form = $condition->buildConfigurationForm([], $form_state);
+      $condition_form['#type'] = 'details';
+      $condition_form['#title'] = $condition->getPluginDefinition()['label'];
+      $condition_form['#group'] = 'visibility_tabs';
+      $form['visibility'][$condition_id] = $condition_form;
+    }
+
+    // @todo Determine if there is a better way to rename the conditions.
+    if (isset($form['visibility']['node_type'])) {
+      $form['visibility']['node_type']['#title'] = $this->t('Content types');
+      $form['visibility']['node_type']['bundles']['#title'] = $this->t('Content types');
+      $form['visibility']['node_type']['negate']['#type'] = 'value';
+      $form['visibility']['node_type']['negate']['#title_display'] = 'invisible';
+      $form['visibility']['node_type']['negate']['#value'] = $form['visibility']['node_type']['negate']['#default_value'];
+    }
+    if (isset($form['visibility']['user_role'])) {
+      $form['visibility']['user_role']['#title'] = $this->t('Roles');
+      unset($form['visibility']['user_role']['roles']['#description']);
+      $form['visibility']['user_role']['negate']['#type'] = 'value';
+      $form['visibility']['user_role']['negate']['#value'] = $form['visibility']['user_role']['negate']['#default_value'];
+    }
+    if (isset($form['visibility']['request_path'])) {
+      $form['visibility']['request_path']['#title'] = $this->t('Pages');
+      $form['visibility']['request_path']['negate']['#type'] = 'radios';
+      $form['visibility']['request_path']['negate']['#title_display'] = 'invisible';
+      $form['visibility']['request_path']['negate']['#default_value'] = (int) $form['visibility']['request_path']['negate']['#default_value'];
+      $form['visibility']['request_path']['negate']['#options'] = [
+        $this->t('Show for the listed pages'),
+        $this->t('Hide for the listed pages'),
+      ];
+    }
+    if (isset($form['visibility']['language'])) {
+      $form['visibility']['language']['negate']['#type'] = 'value';
+      $form['visibility']['language']['negate']['#value'] = $form['visibility']['language']['negate']['#default_value'];
+    }
+    return $form;
+  }
+
+  /**
    * {@inheritdoc}
    */
   protected function actions(array $form, FormStateInterface $form_state) {
@@ -154,6 +277,36 @@ public function validate(array $form, FormStateInterface $form_state) {
     $this->entity->getPlugin()->validateConfigurationForm($form, $settings);
     // Update the original form values.
     $form_state->setValue('settings', $settings->getValues());
+    $this->validateVisibility($form, $form_state);
+  }
+
+  /**
+   * Helper function to independently validate the visibility UI.
+   *
+   * @param array $form
+   *   A nested array form elements comprising the form.
+   * @param \Drupal\Core\Form\FormStateInterface $form_state
+   *   The current state of the form.
+   */
+  protected function validateVisibility(array $form, FormStateInterface $form_state) {
+    // Validate visibility condition settings.
+    foreach ($form_state->getValue('visibility') as $condition_id => $values) {
+      if ($this->validateConditionValues($values)) {
+        // Allow the condition to validate the form.
+        $condition = $form_state->get(['conditions', $condition_id]);
+        $condition_values = (new FormState())
+          ->setValues($values);
+        $condition->validateConfigurationForm($form, $condition_values);
+        // Update the original form values.
+        $form_state->setValue(['visibility', $condition_id], $condition_values->getValues());
+      }
+      else {
+        $form_state->unsetValue(['visibility', $condition_id]);
+      }
+    }
+    if (!$form_state->hasValue('visibility')) {
+      $form_state->setValue('visibility', []);
+    }
   }
 
   /**
@@ -173,6 +326,21 @@ public function submitForm(array &$form, FormStateInterface $form_state) {
     // Update the original form values.
     $form_state->setValue('settings', $settings->getValues());
 
+    // Submit visibility condition settings.
+    foreach ($form_state->getValue('visibility') as $condition_id => $values) {
+      if ($this->validateConditionValues($values)) {
+        // Allow the condition to submit the form.
+        $condition = $form_state->get(['conditions', $condition_id]);
+        $condition_values = (new FormState())
+          ->setValues($values);
+        $condition->submitConfigurationForm($form, $condition_values);
+        // Update the original form values.
+        $form_state->setValue(['visibility', $condition_id], $condition->getConfiguration());
+      }
+    }
+
+    $entity->set('visibility', $form_state->getValue('visibility'));
+
     // Save the settings of the plugin.
     $entity->save();
 
@@ -218,4 +386,30 @@ public function getUniqueMachineName(BlockInterface $block) {
     return $machine_default;
   }
 
+  /**
+   * Attempts to determine if a set of values are relevant for a condition.
+   *
+   * @todo Move this somewhere more generic than the block form.
+   *
+   * @param array $values
+   *   The values of a particular condition plugin configuration.
+   *
+   * @return bool
+   *   TRUE if the values are valid, FALSE otherwise.
+   */
+  protected function validateConditionValues(array $values) {
+    // Remove the context mapping.
+    // @todo Why?
+    unset($values['context_mapping']);
+
+    // Recursively remove empty values.
+    $values = array_filter(array_map(function ($value) {
+      if (is_array($value)) {
+        $value = $this->validateConditionValues($value);
+      }
+      return $value;
+    }, $values));
+    return !empty($values);
+  }
+
 }
diff --git a/core/modules/block/src/BlockInterface.php b/core/modules/block/src/BlockInterface.php
index 432e799..09ca0db 100644
--- a/core/modules/block/src/BlockInterface.php
+++ b/core/modules/block/src/BlockInterface.php
@@ -40,4 +40,51 @@ public function getPlugin();
    */
   public function getVisibility();
 
+  /**
+   * Gets conditions for this block.
+   *
+   * @return \Drupal\Core\Condition\ConditionInterface[]|\Drupal\Core\Condition\ConditionPluginCollection
+   *   An array or collection of configured condition plugins.
+   */
+  public function getVisibilityConditions();
+
+  /**
+   * Gets a visibility condition plugin instance.
+   *
+   * @param string $instance_id
+   *   The condition plugin instance ID.
+   *
+   * @return \Drupal\Core\Condition\ConditionInterface
+   *   A condition plugin.
+   */
+  public function getVisibilityCondition($instance_id);
+
+  /**
+   * Sets the visibility condition configuration.
+   *
+   * @param string $instance_id
+   *   The condition instance ID.
+   * @param array $configuration
+   *   The condition configuration.
+   *
+   * @return $this
+   */
+  public function setVisibilityConfig($instance_id, array $configuration);
+
+  /**
+   * Get all available contexts.
+   *
+   * @return \Drupal\Component\Plugin\Context\ContextInterface[]
+   *   An array of set contexts, keyed by context name.
+   */
+  public function getAvailableContexts();
+
+  /**
+   * Set the contexts that are available for use within the block entity.
+   *
+   * @param array $contexts
+   * @return mixed
+   */
+  public function setAvailableContexts(array $contexts);
+
 }
diff --git a/core/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php
index 6f7f276..fc8d1f8 100644
--- a/core/modules/block/src/Entity/Block.php
+++ b/core/modules/block/src/Entity/Block.php
@@ -7,13 +7,18 @@
 
 namespace Drupal\block\Entity;
 
-use Drupal\Core\Cache\Cache;
+use Drupal\Component\Plugin\ContextAwarePluginInterface;
+use Drupal\Core\Condition\ConditionPluginCollection;
 use Drupal\Core\Config\Entity\ConfigEntityBase;
 use Drupal\block\BlockPluginCollection;
 use Drupal\block\BlockInterface;
+use Drupal\block\Event\BlockContextEvent;
+use Drupal\block\Event\BlockEvents;
 use Drupal\Core\Config\Entity\ConfigEntityInterface;
 use Drupal\Core\Entity\EntityWithPluginCollectionInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
+use Drupal\Core\Entity\EntityWithPluginBagsInterface;
+use Drupal\Core\Cache\Cache;
 
 /**
  * Defines a Block configuration entity class.
@@ -78,6 +83,13 @@ class Block extends ConfigEntityBase implements BlockInterface, EntityWithPlugin
   protected $plugin;
 
   /**
+   * The visibility settings for this block.
+   *
+   * @var array
+   */
+  protected $visibility = array();
+
+  /**
    * The plugin collection that holds the block plugin for this entity.
    *
    * @var \Drupal\block\BlockPluginCollection
@@ -85,6 +97,27 @@ class Block extends ConfigEntityBase implements BlockInterface, EntityWithPlugin
   protected $pluginCollection;
 
   /**
+   * The available contexts for this block and its visibility conditions.
+   *
+   * @var array
+   */
+  protected $contexts = array();
+
+  /**
+   * The visibility collection.
+   *
+   * @var \Drupal\Core\Condition\ConditionPluginCollection
+   */
+  protected $visibilityCollection;
+
+  /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Executable\ExecutableManagerInterface
+   */
+  protected $conditionPluginManager;
+
+  /**
    * {@inheritdoc}
    */
   public function getPlugin() {
@@ -186,8 +219,61 @@ public function getCacheTags() {
   /**
    * {@inheritdoc}
    */
+  public function setAvailableContexts(array $contexts) {
+    $this->contexts = $contexts;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getAvailableContexts() {
+    return $this->contexts;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
   public function getVisibility() {
-    return $this->getPlugin()->getVisibilityConditions()->getConfiguration();
+    return $this->getVisibilityConditions()->getConfiguration();
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function setVisibilityConfig($instance_id, array $configuration) {
+    $this->getVisibilityConditions()->setInstanceConfiguration($instance_id, $configuration);
+    return $this;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getVisibilityConditions() {
+    if (!isset($this->visibilityCollection)) {
+      $this->visibilityCollection = new ConditionPluginCollection($this->conditionPluginManager(), $this->get('visibility'));
+    }
+    return $this->visibilityCollection;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getVisibilityCondition($instance_id) {
+    return $this->getVisibilityConditions()->get($instance_id);
+  }
+
+  /**
+   * Gets the condition plugin manager.
+   *
+   * @return \Drupal\Core\Executable\ExecutableManagerInterface
+   *   The condition plugin manager.
+   */
+  protected function conditionPluginManager() {
+    $this->conditionPluginManager;
+    if (!isset($this->conditionPluginManager)) {
+      $this->conditionPluginManager = \Drupal::service('plugin.manager.condition');
+    }
+    return $this->conditionPluginManager;
   }
 
 }
diff --git a/core/modules/block/src/Event/BlockConditionContextEvent.php b/core/modules/block/src/Event/BlockConditionContextEvent.php
deleted file mode 100644
index af155b7..0000000
--- a/core/modules/block/src/Event/BlockConditionContextEvent.php
+++ /dev/null
@@ -1,39 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\block\Event\BlockContextEvent.
- */
-
-namespace Drupal\block\Event;
-
-use Drupal\Core\Condition\ConditionPluginCollection;
-use Symfony\Component\EventDispatcher\Event;
-
-/**
- * Wraps block conditions in order for event subscribers to add context.
- *
- * @see \Drupal\block\Event\BlockEvents::CONDITION_CONTEXT
- */
-class BlockConditionContextEvent extends Event {
-
-  /**
-   * @var \Drupal\Core\Condition\ConditionPluginCollection
-   */
-  protected $conditions;
-
-  /**
-   * @param \Drupal\Core\Condition\ConditionPluginCollection $conditions
-   */
-  public function __construct(ConditionPluginCollection $conditions) {
-    $this->conditions = $conditions;
-  }
-
-  /**
-   * @return \Drupal\Core\Block\BlockPluginInterface
-   */
-  public function getConditions() {
-    return $this->conditions;
-  }
-
-}
diff --git a/core/modules/block/src/Event/BlockContextEvent.php b/core/modules/block/src/Event/BlockContextEvent.php
new file mode 100644
index 0000000..4889835
--- /dev/null
+++ b/core/modules/block/src/Event/BlockContextEvent.php
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\block\Event\BlockContextEvent.
+ */
+
+namespace Drupal\block\Event;
+
+use Drupal\Core\Plugin\Context\ContextInterface;
+use Symfony\Component\EventDispatcher\Event;
+
+/**
+ * Wraps block contexts in order for event subscribers to add context.
+ *
+ * @see \Drupal\block\Event\BlockEvents::ACTIVE_CONTEXT
+ * @see \Drupal\block\Event\BlockEvents::ADMINISTRATIVE_CONTEXT
+ */
+class BlockContextEvent extends Event {
+
+  /**
+   * The array of available contexts for blocks.
+   *
+   * @var array
+   */
+  protected $contexts = array();
+
+  public function setContext($name, ContextInterface $context) {
+    $this->contexts[$name] = $context;
+  }
+
+  public function getContexts() {
+    return $this->contexts;
+  }
+
+}
diff --git a/core/modules/block/src/Event/BlockEvents.php b/core/modules/block/src/Event/BlockEvents.php
index 8d71c07..22d3e90 100644
--- a/core/modules/block/src/Event/BlockEvents.php
+++ b/core/modules/block/src/Event/BlockEvents.php
@@ -16,8 +16,16 @@
    * Name of the event when gathering condition context for a block plugin.
    *
    * @see \Drupal\Core\Block\BlockBase::getConditionContexts()
-   * @see \Drupal\block\Event\BlockConditionContextEvent
+   * @see \Drupal\block\Event\BlockContextEvent
    */
-  const CONDITION_CONTEXT = 'block.condition_context';
+  const ACTIVE_CONTEXT = 'block.active_context';
+
+  /**
+   * Name of the event when gathering contexts for plugin configuration.
+   *
+   * @see \Drupal\block\BlockForm::form()
+   * @see \Drupal\block\Event\BlockContextEvent
+   */
+  const ADMINISTRATIVE_CONTEXT = 'block.administrative_context';
 
 }
diff --git a/core/modules/block/src/EventSubscriber/BlockConditionContextSubscriberBase.php b/core/modules/block/src/EventSubscriber/BlockConditionContextSubscriberBase.php
deleted file mode 100644
index 9fc2e87..0000000
--- a/core/modules/block/src/EventSubscriber/BlockConditionContextSubscriberBase.php
+++ /dev/null
@@ -1,61 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\block\EventSubscriber\BlockContextSubscriberBase.
- */
-
-namespace Drupal\block\EventSubscriber;
-
-use Drupal\block\Event\BlockConditionContextEvent;
-use Drupal\block\Event\BlockEvents;
-use Drupal\Component\Plugin\Context\ContextInterface;
-use Symfony\Component\EventDispatcher\EventSubscriberInterface;
-
-/**
- * Provides a base class for block context subscribers.
- */
-abstract class BlockConditionContextSubscriberBase implements EventSubscriberInterface {
-
-  /**
-   * @var \Drupal\Core\Condition\ConditionPluginCollection
-   */
-  protected $conditions;
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function getSubscribedEvents() {
-    $events[BlockEvents::CONDITION_CONTEXT][] = 'onBlockConditionContext';
-    return $events;
-  }
-
-  /**
-   * Subscribes to the event and delegates to the subclass.
-   */
-  public function onBlockConditionContext(BlockConditionContextEvent $event) {
-    $this->conditions = $event->getConditions();
-    $this->determineBlockContext();
-  }
-
-  /**
-   * Determines the contexts for a given block.
-   */
-  abstract protected function determineBlockContext();
-
-  /**
-   * Sets the condition context for a given name.
-   *
-   * @param string $name
-   *   The name of the context.
-   * @param \Drupal\Component\Plugin\Context\ContextInterface $context
-   *   The context to add.
-   *
-   * @return $this
-   */
-  public function addContext($name, ContextInterface $context) {
-    $this->conditions->addContext($name, $context);
-    return $this;
-  }
-
-}
diff --git a/core/modules/block/src/EventSubscriber/BlockContextSubscriberBase.php b/core/modules/block/src/EventSubscriber/BlockContextSubscriberBase.php
new file mode 100644
index 0000000..8973560
--- /dev/null
+++ b/core/modules/block/src/EventSubscriber/BlockContextSubscriberBase.php
@@ -0,0 +1,56 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\block\EventSubscriber\BlockContextSubscriberBase.
+ */
+
+namespace Drupal\block\EventSubscriber;
+
+use Drupal\block\Event\BlockContextEvent;
+use Drupal\block\Event\BlockEvents;
+use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+
+/**
+ * Provides a base class for block context subscribers.
+ */
+abstract class BlockContextSubscriberBase implements EventSubscriberInterface {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getSubscribedEvents() {
+    $events[BlockEvents::ACTIVE_CONTEXT][] = 'onBlockActiveContext';
+    $events[BlockEvents::ADMINISTRATIVE_CONTEXT][] = 'onBlockAdministrativeContext';
+    return $events;
+  }
+
+  /**
+   * Determines the available run-time contexts.
+   */
+  abstract public function onBlockActiveContext(BlockContextEvent $event);
+
+  /**
+   * Determine available configuration-time contexts.
+   *
+   * This allows empty contexts to be returned at configuration time in order
+   * to properly configure plugins. This also opens the door to multiple
+   * context availability during both administration and run time in order to
+   * provide nuanced configuration options. Empty context definitions can be
+   * added in this way:
+   * @code
+   *   $context = new Context(new ContextDefinition('entity:node'));
+   *   $event->setContext('node', $context);
+   * @endcode
+   *
+   * The above example would create a new empty node context definition inside
+   * of a Context object which can be added by an arbitrary name on the event
+   * for the block UI to use to determine which plugins are available, and what
+   * their default/available context(s) might be.
+   *
+   * @param BlockContextEvent $event
+   *   The Event to which we can register available contexts.
+   */
+  abstract public function onBlockAdministrativeContext(BlockContextEvent $event);
+
+}
diff --git a/core/modules/block/src/EventSubscriber/CurrentLanguageContext.php b/core/modules/block/src/EventSubscriber/CurrentLanguageContext.php
index 4584172..bc26b00 100644
--- a/core/modules/block/src/EventSubscriber/CurrentLanguageContext.php
+++ b/core/modules/block/src/EventSubscriber/CurrentLanguageContext.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\EventSubscriber;
 
+use Drupal\block\Event\BlockContextEvent;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\Context\ContextDefinition;
@@ -15,7 +16,7 @@
 /**
  * Sets the current language as a context.
  */
-class CurrentLanguageContext extends BlockConditionContextSubscriberBase {
+class CurrentLanguageContext extends BlockContextSubscriberBase {
 
   use StringTranslationTrait;
 
@@ -39,10 +40,24 @@ public function __construct(LanguageManagerInterface $language_manager) {
   /**
    * {@inheritdoc}
    */
-  protected function determineBlockContext() {
-    $context = new Context(new ContextDefinition('language', $this->t('Current language')));
-    $context->setContextValue($this->languageManager->getCurrentLanguage());
-    $this->addContext('language', $context);
+  public function onBlockActiveContext(BlockContextEvent $event) {
+    // Add a context for each language type.
+    $language_types = $this->languageManager->getLanguageTypes();
+    $info = $this->languageManager->getDefinedLanguageTypesInfo();
+    foreach ($language_types as $type_key) {
+      if (isset($info[$type_key]['name'])) {
+        $context = new Context(new ContextDefinition('language', $info[$type_key]['name']));
+        $context->setContextValue($this->languageManager->getCurrentLanguage($type_key));
+        $event->setContext($type_key, $context);
+      }
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function onBlockAdministrativeContext(BlockContextEvent $event) {
+    $this->onBlockActiveContext($event);
   }
 
 }
diff --git a/core/modules/block/src/EventSubscriber/CurrentUserContext.php b/core/modules/block/src/EventSubscriber/CurrentUserContext.php
index 2a5a19e..659395b 100644
--- a/core/modules/block/src/EventSubscriber/CurrentUserContext.php
+++ b/core/modules/block/src/EventSubscriber/CurrentUserContext.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\EventSubscriber;
 
+use Drupal\block\Event\BlockContextEvent;
 use Drupal\Core\Entity\EntityManagerInterface;
 use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\Context\ContextDefinition;
@@ -16,7 +17,7 @@
 /**
  * Sets the current user as a context.
  */
-class CurrentUserContext extends BlockConditionContextSubscriberBase {
+class CurrentUserContext extends BlockContextSubscriberBase {
 
   use StringTranslationTrait;
 
@@ -50,12 +51,23 @@ public function __construct(AccountInterface $account, EntityManagerInterface $e
   /**
    * {@inheritdoc}
    */
-  protected function determineBlockContext() {
+  public function onBlockActiveContext(BlockContextEvent $event) {
     $current_user = $this->userStorage->load($this->account->id());
 
     $context = new Context(new ContextDefinition('entity:user', $this->t('Current user')));
     $context->setContextValue($current_user);
-    $this->addContext('current_user', $context);
+    $event->setContext('current_user', $context);
+  }
+
+  /**
+   * {@inheritdoc}
+   *
+   * Since administrative contexts are not executed against and any user object
+   * will work, and we always have a current user, we can simply execute the
+   * active context method.
+   */
+  public function onBlockAdministrativeContext(BlockContextEvent $event) {
+    $this->onBlockActiveContext($event);
   }
 
 }
diff --git a/core/modules/block/src/EventSubscriber/NodeRouteContext.php b/core/modules/block/src/EventSubscriber/NodeRouteContext.php
index c1bd2bf..cfa06a0 100644
--- a/core/modules/block/src/EventSubscriber/NodeRouteContext.php
+++ b/core/modules/block/src/EventSubscriber/NodeRouteContext.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\EventSubscriber;
 
+use Drupal\block\Event\BlockContextEvent;
 use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\Context\ContextDefinition;
 use Drupal\Core\Routing\RouteMatchInterface;
@@ -15,7 +16,7 @@
 /**
  * Sets the current node as a context on node routes.
  */
-class NodeRouteContext extends BlockConditionContextSubscriberBase {
+class NodeRouteContext extends BlockContextSubscriberBase {
 
   /**
    * The route match object.
@@ -37,20 +38,28 @@ public function __construct(RouteMatchInterface $route_match) {
   /**
    * {@inheritdoc}
    */
-  protected function determineBlockContext() {
+  public function onBlockActiveContext(BlockContextEvent $event) {
     if (($route_object = $this->routeMatch->getRouteObject()) && ($route_contexts = $route_object->getOption('parameters')) && isset($route_contexts['node'])) {
       $context = new Context(new ContextDefinition($route_contexts['node']['type']));
       if ($node = $this->routeMatch->getParameter('node')) {
         $context->setContextValue($node);
       }
-      $this->addContext('node', $context);
+      $event->setContext('node', $context);
     }
     elseif ($this->routeMatch->getRouteName() == 'node.add') {
       $node_type = $this->routeMatch->getParameter('node_type');
       $context = new Context(new ContextDefinition('entity:node'));
       $context->setContextValue(Node::create(array('type' => $node_type->id())));
-      $this->addContext('node', $context);
+      $event->setContext('node', $context);
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function onBlockAdministrativeContext(BlockContextEvent $event) {
+    $context = new Context(new ContextDefinition('entity:node'));
+    $event->setContext('node', $context);
+  }
+
 }
diff --git a/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php b/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php
index 9ae99ed..b9dd808 100644
--- a/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php
+++ b/core/modules/block/src/Plugin/DisplayVariant/FullPageVariant.php
@@ -9,13 +9,18 @@
 
 use Drupal\Core\Block\MainContentBlockPluginInterface;
 use Drupal\Core\Display\PageVariantInterface;
+use Drupal\block\Event\BlockContextEvent;
+use Drupal\block\Event\BlockEvents;
+use Drupal\Component\Plugin\ContextAwarePluginInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityViewBuilderInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Display\VariantBase;
+use Drupal\Core\Plugin\Context\ContextHandlerInterface;
 use Drupal\Core\Routing\RouteMatchInterface;
 use Drupal\Core\Theme\ThemeNegotiatorInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
 
 /**
  * Provides a display variant that represents the full page.
@@ -86,13 +91,19 @@ class FullPageVariant extends VariantBase implements PageVariantInterface, Conta
    *   The current route match.
    * @param \Drupal\Core\Theme\ThemeNegotiatorInterface $theme_negotiator
    *   The theme negotiator.
+   * @param \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher
+   *   The event dispatcher.
+   * @param \Drupal\Core\Plugin\Context\ContextHandlerInterface $context_handler
+   *   The plugin context handler.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $block_storage, EntityViewBuilderInterface $block_view_builder, RouteMatchInterface $route_match, ThemeNegotiatorInterface $theme_negotiator) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, EntityStorageInterface $block_storage, EntityViewBuilderInterface $block_view_builder, RouteMatchInterface $route_match, ThemeNegotiatorInterface $theme_negotiator, EventDispatcherInterface $dispatcher, ContextHandlerInterface $context_handler) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->blockStorage = $block_storage;
     $this->blockViewBuilder = $block_view_builder;
     $this->routeMatch = $route_match;
     $this->themeNegotiator = $theme_negotiator;
+    $this->dispatcher = $dispatcher;
+    $this->contextHandler = $context_handler;
   }
 
   /**
@@ -106,7 +117,9 @@ public static function create(ContainerInterface $container, array $configuratio
       $container->get('entity.manager')->getStorage('block'),
       $container->get('entity.manager')->getViewBuilder('block'),
       $container->get('current_route_match'),
-      $container->get('theme.negotiator')
+      $container->get('theme.negotiator'),
+      $container->get('event_dispatcher'),
+      $container->get('context.handler')
     );
   }
 
@@ -136,12 +149,20 @@ public function build() {
     $main_content_block_displayed = FALSE;
 
     $build = array();
+
+    $event = new BlockContextEvent();
+    $this->dispatcher->dispatch(BlockEvents::ACTIVE_CONTEXT, $event);
+    $contexts = $event->getContexts();
     // Load all region content assigned via blocks.
     foreach ($this->getRegionAssignments() as $region => $blocks) {
       /** @var $blocks \Drupal\block\BlockInterface[] */
       foreach ($blocks as $key => $block) {
+        $block->setAvailableContexts($contexts);
+        $block_plugin = $block->getPlugin();
+        if ($block_plugin instanceof ContextAwarePluginInterface) {
+          $this->contextHandler->applyContextMapping($block_plugin, $contexts);
+        }
         if ($block->access('view')) {
-          $block_plugin = $block->getPlugin();
           if ($block_plugin instanceof MainContentBlockPluginInterface) {
             $block_plugin->setMainContent($this->mainContent);
             $main_content_block_displayed = TRUE;
diff --git a/core/modules/block/src/Tests/BlockInterfaceTest.php b/core/modules/block/src/Tests/BlockInterfaceTest.php
index 7361f96..3c7ecb0 100644
--- a/core/modules/block/src/Tests/BlockInterfaceTest.php
+++ b/core/modules/block/src/Tests/BlockInterfaceTest.php
@@ -39,7 +39,6 @@ public function testBlockInterface() {
       'label' => 'Custom Display Message',
     );
     $expected_configuration = array(
-      'visibility' => array(),
       'id' => 'test_block_instantiation',
       'label' => 'Custom Display Message',
       'provider' => 'block_test',
diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php
index 380c65c..7c6e637 100644
--- a/core/modules/block/src/Tests/BlockLanguageTest.php
+++ b/core/modules/block/src/Tests/BlockLanguageTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\Tests;
 
+use Drupal\Core\Language\LanguageInterface;
 use Drupal\simpletest\WebTestBase;
 use Drupal\block\Entity\Block;
 
@@ -28,7 +29,7 @@ class BlockLanguageTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('language', 'block');
+  public static $modules = array('language', 'block', 'content_translation');
 
   protected function setUp() {
     parent::setUp();
@@ -53,11 +54,12 @@ public function testLanguageBlockVisibility() {
     $default_theme = \Drupal::config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
 
-    $this->assertField('settings[visibility][language][langcodes][en]', 'Language visibility field is visible.');
+    $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.');
+    $this->assertNoField('visibility[language][context_mapping][language]', 'Language type field is not visible.');
 
     // Enable a standard block and set the visibility setting for one language.
     $edit = array(
-      'settings[visibility][language][langcodes][en]' => TRUE,
+      'visibility[language][langcodes][en]' => TRUE,
       'id' => strtolower($this->randomMachineName(8)),
       'region' => 'sidebar_first',
     );
@@ -86,7 +88,6 @@ public function testLanguageBlockVisibilityLanguageDelete() {
     $edit = array(
       'visibility' => array(
         'language' => array(
-          'language_type' => 'language_interface',
           'langcodes' => array(
             'fr' => 'fr',
           ),
@@ -97,8 +98,7 @@ public function testLanguageBlockVisibilityLanguageDelete() {
 
     // Check that we have the language in config after saving the setting.
     $visibility = $block->getVisibility();
-    $language = $visibility['language']['langcodes']['fr'];
-    $this->assertTrue('fr' === $language, 'Language is set in the block configuration.');
+    $this->assertEqual('fr', $visibility['language']['langcodes']['fr'], 'Language is set in the block configuration.');
 
     // Delete the language.
     $this->drupalPostForm('admin/config/regional/language/delete/fr', array(), t('Delete'));
@@ -110,4 +110,65 @@ public function testLanguageBlockVisibilityLanguageDelete() {
     $this->assertTrue(empty($visibility['language']['langcodes']['fr']), 'Language is no longer not set in the block configuration after deleting the block.');
   }
 
+  /**
+   * Tests block language visibility with different language types.
+   */
+  public function testMultipleLanguageTypes() {
+    // Customize content language settings from their defaults.
+    $edit = [
+      'language_content[configurable]' => TRUE,
+      'language_interface[enabled][language-url]' => FALSE,
+      'language_interface[enabled][language-session]' => TRUE,
+    ];
+    $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
+
+    // Check if the visibility setting is available with a type setting.
+    $default_theme = \Drupal::config('system.theme')->get('default');
+    $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
+    $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.');
+    $this->assertField('visibility[language][context_mapping][language]', 'Language type field is visible.');
+
+    // Enable a standard block and set visibility to French only.
+    $block_id = strtolower($this->randomMachineName(8));
+    $edit = [
+      'visibility[language][context_mapping][language]' => 'language_interface',
+      'visibility[language][langcodes][fr]' => TRUE,
+      'id' => $block_id,
+      'region' => 'sidebar_first',
+    ];
+    $this->drupalPostForm('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme, $edit, t('Save block'));
+
+    // Interface negotiation depends on request arguments.
+    $this->drupalGet('node', ['query' => ['language' => 'en']]);
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+    $this->drupalGet('node', ['query' => ['language' => 'fr']]);
+    $this->assertText('Powered by Drupal', 'The body of the block appears on the page.');
+
+    // Content language does not depend on session/request arguments.
+    // It will fall back on English (site default) and not display the block.
+    $this->drupalGet('en');
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+    $this->drupalGet('fr');
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+
+    // Change visibility to now depend on content language for this block.
+    $edit = [
+      'visibility[language][context_mapping][language]' => 'language_content'
+    ];
+    $this->drupalPostForm('admin/structure/block/manage/' . $block_id, $edit, t('Save block'));
+
+    // Content language negotiation does not depend on request arguments.
+    // It will fall back on English (site default) and not display the block.
+    $this->drupalGet('node', ['query' => ['language' => 'en']]);
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+    $this->drupalGet('node', ['query' => ['language' => 'fr']]);
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+
+    // Content language negotiation depends on path prefix.
+    $this->drupalGet('en');
+    $this->assertNoText('Powered by Drupal', 'The body of the block does not appear on the page.');
+    $this->drupalGet('fr');
+    $this->assertText('Powered by Drupal', 'The body of the block appears on the page.');
+  }
+
 }
diff --git a/core/modules/block/src/Tests/BlockStorageUnitTest.php b/core/modules/block/src/Tests/BlockStorageUnitTest.php
index 5fb4e8b..6d0c928 100644
--- a/core/modules/block/src/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/src/Tests/BlockStorageUnitTest.php
@@ -26,7 +26,7 @@ class BlockStorageUnitTest extends DrupalUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('block', 'block_test', 'system');
+  public static $modules = array('block', 'block_test');
 
   /**
    * The block storage.
@@ -94,7 +94,6 @@ protected function createTests() {
       'provider' => NULL,
       'plugin' => 'test_html',
       'settings' => array(
-        'visibility' => array(),
         'id' => 'test_html',
         'label' => '',
         'provider' => 'block_test',
@@ -104,6 +103,7 @@ protected function createTests() {
           'contexts' => array(),
         ),
       ),
+      'visibility' => array(),
     );
 
     $this->assertIdentical($actual_properties, $expected_properties);
diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php
index 9ce288c..c3b33cb 100644
--- a/core/modules/block/src/Tests/BlockTest.php
+++ b/core/modules/block/src/Tests/BlockTest.php
@@ -35,9 +35,9 @@ function testBlockVisibility() {
     );
     // Set the block to be hidden on any user path, and to be shown only to
     // authenticated users.
-    $edit['settings[visibility][request_path][pages]'] = 'user*';
-    $edit['settings[visibility][request_path][negate]'] = TRUE;
-    $edit['settings[visibility][user_role][roles][' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
+    $edit['visibility[request_path][pages]'] = 'user*';
+    $edit['visibility[request_path][negate]'] = TRUE;
+    $edit['visibility[user_role][roles][' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
     $this->drupalPostForm('admin/structure/block/add/' . $block_name . '/' . $default_theme, $edit, t('Save block'));
     $this->assertText('The block configuration has been saved.', 'Block was saved');
 
@@ -70,7 +70,7 @@ function testBlockVisibilityListedEmpty() {
       'id' => strtolower($this->randomMachineName(8)),
       'region' => 'sidebar_first',
       'settings[label]' => $title,
-      'settings[visibility][request_path][negate]' => TRUE,
+      'visibility[request_path][negate]' => TRUE,
     );
     // Set the block to be hidden on any user path, and to be shown only to
     // authenticated users.
diff --git a/core/modules/block/tests/modules/block_test/config/install/block.block.test_block.yml b/core/modules/block/tests/modules/block_test/config/install/block.block.test_block.yml
index 72510d0..f52790f 100644
--- a/core/modules/block/tests/modules/block_test/config/install/block.block.test_block.yml
+++ b/core/modules/block/tests/modules/block_test/config/install/block.block.test_block.yml
@@ -6,7 +6,6 @@ langcode: en
 region: '-1'
 plugin: test_html
 settings:
-  visibility: {  }
   label: 'Test HTML block'
   provider: block_test
   label_display: 'hidden'
@@ -15,3 +14,4 @@ dependencies:
     - block_test
   theme:
     - stark
+visibility: {  }
diff --git a/core/modules/block/tests/src/Unit/BlockFormTest.php b/core/modules/block/tests/src/Unit/BlockFormTest.php
index 0860f93..6ff0ea8 100644
--- a/core/modules/block/tests/src/Unit/BlockFormTest.php
+++ b/core/modules/block/tests/src/Unit/BlockFormTest.php
@@ -17,6 +17,59 @@
 class BlockFormTest extends UnitTestCase {
 
   /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Executable\ExecutableManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $conditionManager;
+
+  /**
+   * The block storage.
+   *
+   * @var \Drupal\Core\Entity\EntityStorageInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $storage;
+
+  /**
+   * The event dispatcher service.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $dispatcher;
+
+  /**
+   * The language manager service.
+   *
+   * @var \Drupal\Core\Language\LanguageManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $language;
+
+  /**
+   * The entity manager.
+   *
+   * @var \Drupal\Core\Entity\EntityManagerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $entityManager;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+
+    $this->conditionManager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
+    $this->language = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
+    $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+
+    $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
+    $this->storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
+    $this->entityManager->expects($this->any())
+      ->method('getStorage')
+      ->will($this->returnValue($this->storage));
+
+  }
+
+  /**
    * Tests the unique machine name generator.
    *
    * @see \Drupal\block\BlockForm::getUniqueMachineName()
@@ -38,22 +91,11 @@ public function testGetUniqueMachineName() {
       ->method('execute')
       ->will($this->returnValue(array('test', 'other_test', 'other_test_1', 'other_test_2')));
 
-    $block_storage = $this->getMock('Drupal\Core\Config\Entity\ConfigEntityStorageInterface');
-    $block_storage->expects($this->exactly(5))
+    $this->storage->expects($this->exactly(5))
       ->method('getQuery')
       ->will($this->returnValue($query));
 
-    $entity_manager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface');
-
-    $entity_manager->expects($this->any())
-      ->method('getStorage')
-      ->will($this->returnValue($block_storage));
-
-    $language_manager = $this->getMock('Drupal\Core\Language\LanguageManagerInterface');
-
-    $config_factory = $this->getMock('Drupal\Core\Config\ConfigFactoryInterface');
-
-    $block_form_controller = new BlockForm($entity_manager, $language_manager, $config_factory);
+    $block_form_controller = new BlockForm($this->entityManager, $this->conditionManager, $this->dispatcher, $this->language);
 
     // Ensure that the block with just one other instance gets the next available
     // name suggestion.
@@ -71,4 +113,57 @@ public function testGetUniqueMachineName() {
     $this->assertEquals('last_test', $block_form_controller->getUniqueMachineName($last_block));
   }
 
+  /**
+   * @covers ::validateConditionValues
+   *
+   * @dataProvider providerTestClearInvalidConditions
+   */
+  public function testClearInvalidConditions($values, $expected) {
+    $block_form = new TestBlockForm($this->entityManager, $this->conditionManager, $this->dispatcher, $this->language);
+    $this->assertSame($expected, $block_form->validateConditionValues($values));
+  }
+
+  public function providerTestClearInvalidConditions() {
+    $data = [];
+    $data[] = [
+      [],
+      FALSE,
+    ];
+    $data[] = [
+      ['false' => FALSE],
+      FALSE,
+    ];
+    $data[] = [
+      ['true' => TRUE],
+      TRUE,
+    ];
+    $data[] = [
+      ['foo' => 'bar'],
+      TRUE,
+    ];
+    $data[] = [
+      [
+        'pets' => [
+          'dog' => 'Dodger',
+          'cobra' => [
+            'nope' => 0,
+          ],
+        ],
+      ],
+      TRUE,
+    ];
+    return $data;
+  }
+
+}
+
+class TestBlockForm extends BlockForm {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function validateConditionValues(array $values) {
+    return parent::validateConditionValues($values);
+  }
+
 }
diff --git a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php
index 783c2fa..62d61fc 100644
--- a/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php
+++ b/core/modules/block/tests/src/Unit/Plugin/DisplayVariant/FullPageVariantTest.php
@@ -44,6 +44,20 @@ class FullPageVariantTest extends UnitTestCase {
   protected $themeNegotiator;
 
   /**
+   * The event dispatcher.
+   *
+   * @var \Symfony\Component\EventDispatcher\EventDispatcherInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $dispatcher;
+
+  /**
+   * The plugin context handler.
+   *
+   * @var \Drupal\Core\Plugin\Context\ContextHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $contextHandler;
+
+  /**
    * Sets up a display variant plugin for testing.
    *
    * @param array $configuration
@@ -59,8 +73,10 @@ public function setUpDisplayVariant($configuration = array(), $definition = arra
     $this->blockViewBuilder = $this->getMock('Drupal\Core\Entity\EntityViewBuilderInterface');
     $this->routeMatch = $this->getMock('Drupal\Core\Routing\RouteMatchInterface');
     $this->themeNegotiator = $this->getMock('Drupal\Core\Theme\ThemeNegotiatorInterface');
+    $this->dispatcher = $this->getMock('Symfony\Component\EventDispatcher\EventDispatcherInterface');
+    $this->contextHandler = $this->getMock('Drupal\Core\Plugin\Context\ContextHandlerInterface');
     return $this->getMockBuilder('Drupal\block\Plugin\DisplayVariant\FullPageVariant')
-      ->setConstructorArgs(array($configuration, 'test', $definition, $this->blockStorage, $this->blockViewBuilder, $this->routeMatch, $this->themeNegotiator))
+      ->setConstructorArgs(array($configuration, 'test', $definition, $this->blockStorage, $this->blockViewBuilder, $this->routeMatch, $this->themeNegotiator, $this->dispatcher, $this->contextHandler))
       ->setMethods(array('getRegionNames'))
       ->getMock();
   }
diff --git a/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml b/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml
index b8b7827..a39088a 100644
--- a/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml
+++ b/core/modules/block_content/tests/modules/block_content_test/config/install/block.block.foobargorilla.yml
@@ -12,11 +12,6 @@ weight: null
 provider: null
 plugin: 'block_content:fb5e8434-3617-4a1d-a252-8273e95ec30e'
 settings:
-  visibility:
-    request_path:
-      id: request_path
-      pages: ''
-      negate: false
   id: 'block_content:fb5e8434-3617-4a1d-a252-8273e95ec30e'
   label: 'Foobar Gorilla'
   provider: block_content
@@ -27,3 +22,8 @@ settings:
   status: true
   info: ''
   view_mode: default
+visibility:
+  request_path:
+    id: request_path
+    pages: ''
+    negate: false
diff --git a/core/modules/language/src/Plugin/Condition/Language.php b/core/modules/language/src/Plugin/Condition/Language.php
index 0f46dd5..fa09f3b 100644
--- a/core/modules/language/src/Plugin/Condition/Language.php
+++ b/core/modules/language/src/Plugin/Condition/Language.php
@@ -31,23 +31,23 @@ class Language extends ConditionPluginBase {
   public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
     if (\Drupal::languageManager()->isMultilingual()) {
       // Fetch languages.
-      $languages = language_list(LanguageInterface::STATE_CONFIGURABLE);
+      $languages = \Drupal::languageManager()->getLanguages(LanguageInterface::STATE_CONFIGURABLE);
       $langcodes_options = array();
       foreach ($languages as $language) {
         $langcodes_options[$language->getId()] = $language->getName();
       }
       $form['langcodes'] = array(
         '#type' => 'checkboxes',
-        '#title' => t('Language selection'),
+        '#title' => $this->t('Language selection'),
         '#default_value' => $this->configuration['langcodes'],
         '#options' => $langcodes_options,
-        '#description' => t('Select languages to enforce. If none are selected, all languages will be allowed.'),
+        '#description' => $this->t('Select languages to enforce. If none are selected, all languages will be allowed.'),
       );
     }
     else {
       $form['langcodes'] = array(
         '#type' => 'value',
-        '#value' => $this->configuration['langcodes'],
+        '#default_value' => $this->configuration['langcodes'],
       );
     }
     return parent::buildConfigurationForm($form, $form_state);
diff --git a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
index e1f9cb9..cac5b51 100644
--- a/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
+++ b/core/modules/language/src/Tests/LanguageBlockSettingsVisibilityTest.php
@@ -23,9 +23,9 @@ public function testUnnecessaryLanguageSettingsVisibility() {
     $this->drupalLogin($admin_user);
     $this->drupalPostForm('admin/config/regional/language/add', array('predefined_langcode' => 'hu'), t('Add language'));
     $this->drupalGet('admin/structure/block/add/system_menu_block:admin/stark');
-    $this->assertNoFieldByXPath('//input[@id="edit-settings-visibility-language-langcodes-und"]', NULL, '\'Not specified\' option does not appear at block config, language settings section.');
-    $this->assertNoFieldByXpath('//input[@id="edit-settings-visibility-language-langcodes-zxx"]', NULL, '\'Not applicable\' option does not appear at block config, language settings section.');
-    $this->assertFieldByXPath('//input[@id="edit-settings-visibility-language-langcodes-en"]', NULL, '\'English\' option appears at block config, language settings section.');
-    $this->assertFieldByXpath('//input[@id="edit-settings-visibility-language-langcodes-hu"]', NULL, '\'Hungarian\' option appears at block config, language settings section.');
+    $this->assertNoFieldByXPath('//input[@id="edit-visibility-language-langcodes-und"]', NULL, '\'Not specified\' option does not appear at block config, language settings section.');
+    $this->assertNoFieldByXpath('//input[@id="edit-visibility-language-langcodes-zxx"]', NULL, '\'Not applicable\' option does not appear at block config, language settings section.');
+    $this->assertFieldByXPath('//input[@id="edit-visibility-language-langcodes-en"]', NULL, '\'English\' option appears at block config, language settings section.');
+    $this->assertFieldByXpath('//input[@id="edit-visibility-language-langcodes-hu"]', NULL, '\'Hungarian\' option appears at block config, language settings section.');
   }
 }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
index 4b15b05..fb7f6d9 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
@@ -91,8 +91,7 @@ public function testBlockMigration() {
     $this->assertEqual('sidebar_first', $test_block_user->get('region'));
     $this->assertEqual('bartik', $test_block_user->get('theme'));
     $visibility = $test_block_user->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(0, $test_block_user->weight);
 
     $test_block_user_1 = $blocks['user_1'];
@@ -100,8 +99,7 @@ public function testBlockMigration() {
     $this->assertEqual('sidebar_first', $test_block_user_1->get('region'));
     $this->assertEqual('bartik', $test_block_user_1->get('theme'));
     $visibility = $test_block_user_1->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(0, $test_block_user_1->weight);
 
     // Check system block
@@ -110,8 +108,7 @@ public function testBlockMigration() {
     $this->assertEqual('footer', $test_block_system->get('region'));
     $this->assertEqual('bartik', $test_block_system->get('theme'));
     $visibility = $test_block_system->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(-5, $test_block_system->weight);
 
     // Check menu blocks
@@ -120,8 +117,7 @@ public function testBlockMigration() {
     $this->assertEqual('header', $test_block_menu->get('region'));
     $this->assertEqual('bartik', $test_block_menu->get('theme'));
     $visibility = $test_block_menu->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(-5, $test_block_menu->weight);
 
     // Check custom blocks
@@ -130,8 +126,7 @@ public function testBlockMigration() {
     $this->assertEqual('content', $test_block_block->get('region'));
     $this->assertEqual('bartik', $test_block_block->get('theme'));
     $visibility = $test_block_block->getVisibility();
-    $this->assertEqual(FALSE, $visibility['request_path']['negate']);
-    $this->assertEqual('<front>', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(0, $test_block_block->weight);
 
     $test_block_block_1 = $blocks['block_1'];
@@ -139,8 +134,7 @@ public function testBlockMigration() {
     $this->assertEqual('right', $test_block_block_1->get('region'));
     $this->assertEqual('bluemarine', $test_block_block_1->get('theme'));
     $visibility = $test_block_block_1->getVisibility();
-    $this->assertEqual(FALSE, $visibility['request_path']['negate']);
-    $this->assertEqual('node', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(-4, $test_block_block_1->weight);
 
     $test_block_block_2 = $blocks['block_2'];
@@ -148,8 +142,7 @@ public function testBlockMigration() {
     $this->assertEqual('right', $test_block_block_2->get('region'));
     $this->assertEqual('test_theme', $test_block_block_2->get('theme'));
     $visibility = $test_block_block_2->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(-7, $test_block_block_2->weight);
 
     $test_block_block_3 = $blocks['block_3'];
@@ -157,8 +150,7 @@ public function testBlockMigration() {
     $this->assertEqual('left', $test_block_block_3->get('region'));
     $this->assertEqual('test_theme', $test_block_block_3->get('theme'));
     $visibility = $test_block_block_3->getVisibility();
-    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
-    $this->assertEqual('', $visibility['request_path']['pages']);
+    $this->assertTrue(empty($visibility['request_path']));
     $this->assertEqual(-2, $test_block_block_3->weight);
   }
 }
diff --git a/core/modules/search/src/Tests/SearchBlockTest.php b/core/modules/search/src/Tests/SearchBlockTest.php
index cdc7905..9aca60f 100644
--- a/core/modules/search/src/Tests/SearchBlockTest.php
+++ b/core/modules/search/src/Tests/SearchBlockTest.php
@@ -59,7 +59,7 @@ protected function testSearchFormBlock() {
 
     $visibility = $block->getVisibility();
     $visibility['request_path']['pages'] = 'search';
-    $block->getPlugin()->setVisibilityConfig('request_path', $visibility['request_path']);
+    $block->setVisibilityConfig('request_path', $visibility['request_path']);
 
     $this->submitGetForm('', $terms, t('Search'));
     $this->assertResponse(200);
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 730f84f..55212d9 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -381,13 +381,14 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
         'max_age' => 0,
       ),
     );
-    foreach (array('region', 'id', 'theme', 'plugin', 'weight') as $key) {
+    $values = array();
+    foreach (array('region', 'id', 'theme', 'plugin', 'weight', 'visibility') as $key) {
       $values[$key] = $settings[$key];
       // Remove extra values that do not belong in the settings array.
       unset($settings[$key]);
     }
-    foreach ($settings['visibility'] as $id => $visibility) {
-      $settings['visibility'][$id]['id'] = $id;
+    foreach ($values['visibility'] as $id => $visibility) {
+      $values['visibility'][$id]['id'] = $id;
     }
     $values['settings'] = $settings;
     $block = entity_create('block', $values);
diff --git a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
index c26ee66..2c03f23 100644
--- a/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
+++ b/core/modules/views/tests/src/Unit/Plugin/Block/ViewsBlockTest.php
@@ -126,10 +126,6 @@ public function testBuild() {
 
     $definition['provider'] = 'views';
     $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account);
-    $reflector = new \ReflectionClass($plugin);
-    $property = $reflector->getProperty('conditionPluginManager');
-    $property->setAccessible(TRUE);
-    $property->setValue($plugin, $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface'));
 
     $this->assertEquals($build, $plugin->build());
   }
@@ -152,10 +148,6 @@ public function testBuildFailed() {
 
     $definition['provider'] = 'views';
     $plugin = new ViewsBlock($config, $block_id, $definition, $this->executableFactory, $this->storage, $this->account);
-    $reflector = new \ReflectionClass($plugin);
-    $property = $reflector->getProperty('conditionPluginManager');
-    $property->setAccessible(TRUE);
-    $property->setValue($plugin, $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface'));
 
     $this->assertEquals(array(), $plugin->build());
   }
diff --git a/core/profiles/minimal/config/install/block.block.stark_admin.yml b/core/profiles/minimal/config/install/block.block.stark_admin.yml
index 0f3fdd5..ffbc2fb 100644
--- a/core/profiles/minimal/config/install/block.block.stark_admin.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_admin.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:admin'
 settings:
-  visibility: {  }
   label: Administration
   provider: system
   label_display: visible
@@ -22,3 +21,4 @@ dependencies:
     - system
   theme:
     - stark
+visibility: {  }
diff --git a/core/profiles/minimal/config/install/block.block.stark_login.yml b/core/profiles/minimal/config/install/block.block.stark_login.yml
index 9081e1a..41eba3f 100644
--- a/core/profiles/minimal/config/install/block.block.stark_login.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_login.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: user_login_block
 settings:
-  visibility: {  }
   label: 'User login'
   provider: user
   label_display: visible
@@ -15,3 +14,4 @@ dependencies:
     - user
   theme:
     - stark
+visibility: {  }
diff --git a/core/profiles/minimal/config/install/block.block.stark_tools.yml b/core/profiles/minimal/config/install/block.block.stark_tools.yml
index ef8442b..aa82311 100644
--- a/core/profiles/minimal/config/install/block.block.stark_tools.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_tools.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:tools'
 settings:
-  visibility: {  }
   label: Tools
   provider: system
   label_display: visible
@@ -22,3 +21,4 @@ dependencies:
     - system
   theme:
     - stark
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_account_menu.yml b/core/profiles/standard/config/install/block.block.bartik_account_menu.yml
index 1463759..db8f8ec 100644
--- a/core/profiles/standard/config/install/block.block.bartik_account_menu.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_account_menu.yml
@@ -6,7 +6,6 @@ langcode: en
 region: secondary_menu
 plugin: 'system_menu_block:account'
 settings:
-  visibility: { }
   id: 'system_menu_block:account'
   label: 'User account menu'
   provider: system
@@ -23,3 +22,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: { }
diff --git a/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml b/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml
index 2128a61..c89b728 100644
--- a/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml
@@ -6,7 +6,6 @@ langcode: en
 region: '-1'
 plugin: system_breadcrumb_block
 settings:
-  visibility: {  }
   id: system_breadcrumb_block
   label: Breadcrumbs
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_content.yml b/core/profiles/standard/config/install/block.block.bartik_content.yml
index d30a7f3..87d320f 100644
--- a/core/profiles/standard/config/install/block.block.bartik_content.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_content.yml
@@ -6,7 +6,6 @@ langcode: en
 region: content
 plugin: system_main_block
 settings:
-  visibility: {  }
   id: system_main_block
   label: 'Main page content'
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_footer.yml b/core/profiles/standard/config/install/block.block.bartik_footer.yml
index 4132736..43817fd 100644
--- a/core/profiles/standard/config/install/block.block.bartik_footer.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_footer.yml
@@ -6,7 +6,6 @@ langcode: en
 region: footer
 plugin: 'system_menu_block:footer'
 settings:
-  visibility: {  }
   id: 'system_menu_block:footer'
   label: 'Footer menu'
   provider: system
@@ -23,3 +22,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_help.yml b/core/profiles/standard/config/install/block.block.bartik_help.yml
index 3a2f48a..941fa1b 100644
--- a/core/profiles/standard/config/install/block.block.bartik_help.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_help.yml
@@ -6,7 +6,6 @@ langcode: en
 region: help
 plugin: system_help_block
 settings:
-  visibility: {  }
   id: system_help_block
   label: 'System Help'
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_login.yml b/core/profiles/standard/config/install/block.block.bartik_login.yml
index 6d58c23..3a5f543 100644
--- a/core/profiles/standard/config/install/block.block.bartik_login.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_login.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: user_login_block
 settings:
-  visibility: {  }
   id: user_login_block
   label: 'User login'
   provider: user
@@ -16,3 +15,4 @@ dependencies:
     - user
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_main_menu.yml b/core/profiles/standard/config/install/block.block.bartik_main_menu.yml
index 7f847c2..3da0571 100644
--- a/core/profiles/standard/config/install/block.block.bartik_main_menu.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_main_menu.yml
@@ -6,7 +6,6 @@ langcode: en
 region: primary_menu
 plugin: 'system_menu_block:main'
 settings:
-  visibility: {}
   id: 'system_menu_block:main'
   label: 'Main navigation'
   provider: system
@@ -23,3 +22,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {}
diff --git a/core/profiles/standard/config/install/block.block.bartik_powered.yml b/core/profiles/standard/config/install/block.block.bartik_powered.yml
index 106c279..5a9881f 100644
--- a/core/profiles/standard/config/install/block.block.bartik_powered.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_powered.yml
@@ -6,7 +6,6 @@ langcode: en
 region: footer
 plugin: system_powered_by_block
 settings:
-  visibility: {  }
   id: system_powered_by_block
   label: 'Powered by Drupal'
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_search.yml b/core/profiles/standard/config/install/block.block.bartik_search.yml
index ac4130a..af99dea 100644
--- a/core/profiles/standard/config/install/block.block.bartik_search.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_search.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: search_form_block
 settings:
-  visibility: {  }
   id: search_form_block
   label: Search
   provider: search
@@ -16,3 +15,4 @@ dependencies:
     - search
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.bartik_tools.yml b/core/profiles/standard/config/install/block.block.bartik_tools.yml
index 4b102eb..aa24e61 100644
--- a/core/profiles/standard/config/install/block.block.bartik_tools.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_tools.yml
@@ -6,7 +6,6 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:tools'
 settings:
-  visibility: {  }
   id: 'system_menu_block:tools'
   label: Tools
   provider: system
@@ -23,3 +22,4 @@ dependencies:
     - system
   theme:
     - bartik
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml b/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml
index cd7d7ac..8ce13d8 100644
--- a/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml
+++ b/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml
@@ -6,7 +6,6 @@ langcode: en
 region: '-1'
 plugin: system_breadcrumb_block
 settings:
-  visibility: {  }
   id: system_breadcrumb_block
   label: Breadcrumbs
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - seven
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.seven_content.yml b/core/profiles/standard/config/install/block.block.seven_content.yml
index 12c2c5f..dd2bfbe 100644
--- a/core/profiles/standard/config/install/block.block.seven_content.yml
+++ b/core/profiles/standard/config/install/block.block.seven_content.yml
@@ -6,7 +6,6 @@ langcode: en
 region: content
 plugin: system_main_block
 settings:
-  visibility: {  }
   id: system_main_block
   label: 'Main page content'
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - seven
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.seven_help.yml b/core/profiles/standard/config/install/block.block.seven_help.yml
index 1cf9fa3..168e7f0 100644
--- a/core/profiles/standard/config/install/block.block.seven_help.yml
+++ b/core/profiles/standard/config/install/block.block.seven_help.yml
@@ -6,7 +6,6 @@ langcode: en
 region: help
 plugin: system_help_block
 settings:
-  visibility: {  }
   id: system_help_block
   label: 'System Help'
   provider: system
@@ -16,3 +15,4 @@ dependencies:
     - system
   theme:
     - seven
+visibility: {  }
diff --git a/core/profiles/standard/config/install/block.block.seven_login.yml b/core/profiles/standard/config/install/block.block.seven_login.yml
index 321d92b..0a488a7 100644
--- a/core/profiles/standard/config/install/block.block.seven_login.yml
+++ b/core/profiles/standard/config/install/block.block.seven_login.yml
@@ -6,7 +6,6 @@ langcode: en
 region: content
 plugin: user_login_block
 settings:
-  visibility: {  }
   id: user_login_block
   label: 'User login'
   provider: user
@@ -16,3 +15,4 @@ dependencies:
     - user
   theme:
     - seven
+visibility: {  }
diff --git a/core/profiles/standard/src/Tests/StandardTest.php b/core/profiles/standard/src/Tests/StandardTest.php
index 3ba2347..437fcd8 100644
--- a/core/profiles/standard/src/Tests/StandardTest.php
+++ b/core/profiles/standard/src/Tests/StandardTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\standard\Tests;
 
+use Drupal\block\Entity\Block;
 use Drupal\config\Tests\SchemaCheckTestTrait;
 use Drupal\contact\Entity\ContactForm;
 use Drupal\simpletest\WebTestBase;
diff --git a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
index 028ea73..02a7170 100644
--- a/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Block/BlockBaseTest.php
@@ -8,7 +8,6 @@
 namespace Drupal\Tests\Core\Block;
 
 use Drupal\block_test\Plugin\Block\TestBlockInstantiation;
-use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -28,14 +27,6 @@ public function testGetMachineNameSuggestion() {
       ->setMethods(array('readLanguageOverrides'))
       ->getMock();
 
-    $condition_plugin_manager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
-    $condition_plugin_manager->expects($this->atLeastOnce())
-      ->method('getDefinitions')
-      ->will($this->returnValue(array()));
-    $container = new ContainerBuilder();
-    $container->set('plugin.manager.condition', $condition_plugin_manager);
-    \Drupal::setContainer($container);
-
     $config = array();
     $definition = array(
       'admin_label' => 'Admin label',
@@ -55,52 +46,5 @@ public function testGetMachineNameSuggestion() {
     $this->assertEquals('uberawesome', $block_base->getMachineNameSuggestion());
   }
 
-  /**
-   * Tests initializing the condition plugins initialization.
-   */
-  public function testConditionsBagInitialization() {
-    $plugin_manager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
-    $plugin_manager->expects($this->once())
-      ->method('getDefinitions')
-      ->will($this->returnValue(array(
-        'request_path' => array(
-          'id' => 'request_path',
-        ),
-        'user_role' => array(
-          'id' => 'user_role',
-        ),
-        'node_type' => array(
-          'id' => 'node_type',
-        ),
-        'language' => array(
-          'id' => 'language',
-        ),
-      )));
-    $container = new ContainerBuilder();
-    $container->set('plugin.manager.condition', $plugin_manager);
-    \Drupal::setContainer($container);
-    $config = array();
-    $definition = array(
-      'admin_label' => 'Admin label',
-      'provider' => 'block_test',
-    );
-
-    $block_base = new TestBlockInstantiation($config, 'test_block_instantiation', $definition);
-    $conditions_collection = $block_base->getVisibilityConditions();
-
-    $this->assertEquals(4, $conditions_collection->count(), "There are 4 condition plugins");
-
-    $instance_id = $this->randomMachineName();
-    $pages = 'node/1';
-    $condition_config = array('id' => 'request_path', 'pages' => $pages);
-    $block_base->setVisibilityConfig($instance_id, $condition_config);
-
-    $plugin_manager->expects($this->once())->method('createInstance')
-      ->withAnyParameters()->will($this->returnValue('test'));
-
-    $condition = $block_base->getVisibilityCondition($instance_id);
-
-    $this->assertEquals('test', $condition, "The correct condition is returned.");
-  }
-
 }
+
