diff --git a/core/config/schema/core.data_types.schema.yml b/core/config/schema/core.data_types.schema.yml
index 2b86cd7..ec1d462 100644
--- a/core/config/schema/core.data_types.schema.yml
+++ b/core/config/schema/core.data_types.schema.yml
@@ -289,6 +289,31 @@ 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'
+
+condition.plugin:
+  type: mapping
+  label: 'Condition'
+  mapping:
+    id:
+      type: string
+      label: 'ID'
+    negate:
+      type: boolean
+      label: 'Negate'
+    uuid:
+      type: string
+      label: 'UUID'
+    context_assignments:
+      type: sequence
+      label: 'Context assignments'
+      sequence:
+        - type: string
diff --git a/core/lib/Drupal/Core/Condition/ConditionAccessResolverTrait.php b/core/lib/Drupal/Core/Condition/ConditionAccessResolverTrait.php
new file mode 100644
index 0000000..f5723e8
--- /dev/null
+++ b/core/lib/Drupal/Core/Condition/ConditionAccessResolverTrait.php
@@ -0,0 +1,76 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Condition\ConditionAccessResolverTrait.
+ */
+
+namespace Drupal\Core\Condition;
+
+use Drupal\Component\Plugin\ConfigurablePluginInterface;
+use Drupal\Component\Plugin\ContextAwarePluginInterface;
+use Drupal\Component\Plugin\Exception\PluginException;
+
+/**
+ * Resolves a set of conditions.
+ */
+trait ConditionAccessResolverTrait {
+
+  /**
+   * Wraps the context handler.
+   *
+   * @return \Drupal\Core\Plugin\Context\ContextHandlerInterface
+   */
+  protected function contextHandler() {
+    return \Drupal::service('context.handler');
+  }
+
+  /**
+   * Resolves the given conditions based on the condition logic ('and'/'or').
+   *
+   * @param \Drupal\Core\Condition\ConditionInterface[] $conditions
+   *   A set of conditions.
+   * @param string $condition_logic
+   *   The logic used to compute access, either 'and' or 'or'.
+   * @param \Drupal\Component\Plugin\Context\ContextInterface[] $contexts
+   *   (optional) An array of contexts to set on the conditions.
+   *
+   * @return bool
+   *   Whether these conditions grant or deny access.
+   */
+  protected function resolveConditions($conditions, $condition_logic, $contexts = array()) {
+    foreach ($conditions as $condition) {
+      if ($condition instanceof ContextAwarePluginInterface) {
+        $assignments = array();
+        if ($condition instanceof ConfigurablePluginInterface) {
+          $configuration = $condition->getConfiguration();
+          if (isset($configuration['context_assignments'])) {
+            $assignments = array_flip($configuration['context_assignments']);
+          }
+        }
+        $this->contextHandler()->applyContextMapping($condition, $contexts, $assignments);
+      }
+
+      try {
+        $pass = $condition->execute();
+      }
+      catch (PluginException $e) {
+        // If a condition is missing context, consider that a fail.
+        $pass = FALSE;
+      }
+
+      // If a condition fails and all conditions were required, deny access.
+      if (!$pass && $condition_logic == 'and') {
+        return FALSE;
+      }
+      // If a condition passes and one condition was required, grant access.
+      elseif ($pass && $condition_logic == 'or') {
+        return TRUE;
+      }
+    }
+
+    // If no conditions passed and one condition was required, deny access.
+    return $condition_logic == 'and';
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Condition/ConditionPluginBag.php b/core/lib/Drupal/Core/Condition/ConditionPluginBag.php
new file mode 100644
index 0000000..acb0fce
--- /dev/null
+++ b/core/lib/Drupal/Core/Condition/ConditionPluginBag.php
@@ -0,0 +1,43 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Core\Condition\ConditionPluginBag.
+ */
+
+namespace Drupal\Core\Condition;
+
+use Drupal\Core\Plugin\DefaultPluginBag;
+
+/**
+ * Provides a collection of condition plugins.
+ */
+class ConditionPluginBag extends DefaultPluginBag {
+
+  /**
+   * {@inheritdoc}
+   *
+   * @return \Drupal\Core\Condition\ConditionInterface
+   */
+  public function &get($instance_id) {
+    return parent::get($instance_id);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getConfiguration() {
+    $configuration = parent::getConfiguration();
+    // Remove configuration if it matches the defaults.
+    foreach ($configuration as $instance_id => $instance_config) {
+      $default_config = array();
+      $default_config['id'] = $instance_id;
+      $default_config += $this->get($instance_id)->defaultConfiguration();
+      if ($default_config === $instance_config) {
+        unset($configuration[$instance_id]);
+      }
+    }
+    return $configuration;
+  }
+
+}
diff --git a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
index 2f250ba..279ef0f 100644
--- a/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
+++ b/core/lib/Drupal/Core/Condition/ConditionPluginBase.php
@@ -37,7 +37,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
     $form['negate'] = array(
       '#type' => 'checkbox',
       '#title' => $this->t('Negate the condition.'),
-      '#default_value' => isset($this->configuration['negate']) ? $this->configuration['negate'] : FALSE,
+      '#default_value' => $this->configuration['negate'],
     );
     return $form;
   }
@@ -83,7 +83,9 @@ public function setConfiguration(array $configuration) {
    * {@inheritdoc}
    */
   public function defaultConfiguration() {
-    return array();
+    return array(
+      'negate' => FALSE,
+    );
   }
 
   /**
diff --git a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
index 5fdc33a..4381b6d 100644
--- a/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
+++ b/core/modules/aggregator/src/Plugin/Block/AggregatorFeedBlock.php
@@ -100,7 +100,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     // Only grant access to users with the 'access news feeds' permission.
     return $account->hasPermission('access news feeds');
   }
diff --git a/core/modules/block/block.module b/core/modules/block/block.module
index ceffa1f..a6f8f2c 100644
--- a/core/modules/block/block.module
+++ b/core/modules/block/block.module
@@ -12,22 +12,6 @@
 use Symfony\Component\HttpFoundation\Request;
 
 /**
- * Shows this block on every page except the listed pages.
- */
-const BLOCK_VISIBILITY_NOTLISTED = 0;
-
-/**
- * Shows this block on only the listed pages.
- */
-const BLOCK_VISIBILITY_LISTED = 1;
-
-/**
- * Shows this block if the associated PHP code returns TRUE.
- */
-const BLOCK_VISIBILITY_PHP = 2;
-
-
-/**
  * Implements hook_help().
  */
 function block_help($route_name, Request $request) {
@@ -391,10 +375,11 @@ function template_preprocess_block(&$variables) {
  */
 function block_user_role_delete($role) {
   foreach (entity_load_multiple('block') as $block) {
-    $visibility = $block->get('visibility');
-    if (isset($visibility['roles']['roles'][$role->id()])) {
-      unset($visibility['roles']['roles'][$role->id()]);
-      $block->set('visibility', $visibility);
+    /** @var $block \Drupal\block\BlockInterface */
+    $visibility = $block->getVisibility();
+    if (isset($visibility['user_role']['roles'][$role->id()])) {
+      unset($visibility['user_role']['roles'][$role->id()]);
+      $block->getPlugin()->setVisibilityConfig('user_role', $visibility['user_role']);
       $block->save();
     }
   }
@@ -421,10 +406,11 @@ function block_menu_delete(Menu $menu) {
 function block_language_entity_delete(Language $language) {
   // Remove the block visibility settings for the deleted language.
   foreach (entity_load_multiple('block') as $block) {
-    $visibility = $block->get('visibility');
+    /** @var $block \Drupal\block\BlockInterface */
+    $visibility = $block->getVisibility();
     if (isset($visibility['language']['langcodes'][$language->id()])) {
       unset($visibility['language']['langcodes'][$language->id()]);
-      $block->set('visibility', $visibility);
+      $block->getPlugin()->setVisibilityConfig('language', $visibility['language']);
       $block->save();
     }
   }
diff --git a/core/modules/block/src/BlockAccessController.php b/core/modules/block/src/BlockAccessController.php
index 3bd9fb3..0089470 100644
--- a/core/modules/block/src/BlockAccessController.php
+++ b/core/modules/block/src/BlockAccessController.php
@@ -8,53 +8,19 @@
 namespace Drupal\block;
 
 use Drupal\Core\Entity\EntityAccessController;
-use Drupal\Core\Entity\EntityControllerInterface;
 use Drupal\Core\Entity\EntityInterface;
-use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\Core\Session\AccountInterface;
-use Drupal\Core\Path\AliasManagerInterface;
-use Drupal\Component\Utility\Unicode;
-use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
  * Provides a Block access controller.
  */
-class BlockAccessController extends EntityAccessController implements EntityControllerInterface {
-
-  /**
-   * The node grant storage.
-   *
-   * @var \Drupal\Core\Path\AliasManagerInterface
-   */
-  protected $aliasManager;
-
-  /**
-   * Constructs a BlockAccessController object.
-   *
-   * @param \Drupal\Core\Entity\EntityTypeInterface $entity_type
-   *   The entity type definition.
-   * @param \Drupal\Core\Path\AliasManagerInterface $alias_manager
-   *   The alias manager.
-   */
-  public function __construct(EntityTypeInterface $entity_type, AliasManagerInterface $alias_manager) {
-    parent::__construct($entity_type);
-    $this->aliasManager = $alias_manager;
-  }
-
-  /**
-   * {@inheritdoc}
-   */
-  public static function createInstance(ContainerInterface $container, EntityTypeInterface $entity_type) {
-    return new static(
-      $entity_type,
-      $container->get('path.alias_manager')
-    );
-  }
+class BlockAccessController extends EntityAccessController {
 
   /**
    * {@inheritdoc}
    */
   protected function checkAccess(EntityInterface $entity, $operation, $langcode, AccountInterface $account) {
+    /** @var $entity \Drupal\block\BlockInterface */
     if ($operation != 'view') {
       return parent::checkAccess($entity, $operation, $langcode, $account);
     }
@@ -64,65 +30,8 @@ protected function checkAccess(EntityInterface $entity, $operation, $langcode, A
       return FALSE;
     }
 
-    // User role access handling.
-    // If a block has no roles associated, it is displayed for every role.
-    // For blocks with roles associated, if none of the user's roles matches
-    // the settings from this block, access is denied.
-    $visibility = $entity->get('visibility');
-    if (!empty($visibility['role']['roles']) && !array_intersect(array_filter($visibility['role']['roles']), $account->getRoles())) {
-      // No match.
-      return FALSE;
-    }
-
-    // Page path handling.
-    // Limited visibility blocks must list at least one page.
-    if (!empty($visibility['path']['visibility']) && $visibility['path']['visibility'] == BLOCK_VISIBILITY_LISTED && empty($visibility['path']['pages'])) {
-      return FALSE;
-    }
-
-    // Match path if necessary.
-    if (!empty($visibility['path']['pages'])) {
-      // Assume there are no matches until one is found.
-      $page_match = FALSE;
-
-      // Convert path to lowercase. This allows comparison of the same path
-      // with different case. Ex: /Page, /page, /PAGE.
-      $pages = drupal_strtolower($visibility['path']['pages']);
-      if ($visibility['path']['visibility'] < BLOCK_VISIBILITY_PHP) {
-        // Compare the lowercase path alias (if any) and internal path.
-        $path = current_path();
-        $path_alias = Unicode::strtolower($this->aliasManager->getAliasByPath($path));
-        $page_match = drupal_match_path($path_alias, $pages) || (($path != $path_alias) && drupal_match_path($path, $pages));
-        // When $block->visibility has a value of 0
-        // (BLOCK_VISIBILITY_NOTLISTED), the block is displayed on all pages
-        // except those listed in $block->pages. When set to 1
-        // (BLOCK_VISIBILITY_LISTED), it is displayed only on those pages
-        // listed in $block->pages.
-        $page_match = !($visibility['path']['visibility'] xor $page_match);
-      }
-
-      // If there are page visibility restrictions and this page does not
-      // match, deny access.
-      if (!$page_match) {
-        return FALSE;
-      }
-    }
-
-    // Language visibility settings.
-    if (!empty($visibility['language']['langcodes']) && array_filter($visibility['language']['langcodes'])) {
-      if (empty($visibility['language']['langcodes'][\Drupal::languageManager()->getCurrentLanguage($visibility['language']['language_type'])->id])) {
-        return FALSE;
-      }
-    }
-
-    // If the plugin denies access, then deny access. Apply plugin access checks
-    // last, because it's almost certainly cheaper to first apply Block's own
-    // visibility checks.
-    if (!$entity->getPlugin()->access($account)) {
-      return FALSE;
-    }
-
-    return TRUE;
+    // Delegate to the plugin.
+    return $entity->getPlugin()->access($account);
   }
 
 }
diff --git a/core/modules/block/src/BlockBase.php b/core/modules/block/src/BlockBase.php
index 56b1662..982559b 100644
--- a/core/modules/block/src/BlockBase.php
+++ b/core/modules/block/src/BlockBase.php
@@ -7,6 +7,9 @@
 
 namespace Drupal\block;
 
+use Drupal\Core\Condition\ConditionAccessResolverTrait;
+use Drupal\Core\Condition\ConditionPluginBag;
+use Drupal\Core\Plugin\Context\Context;
 use Drupal\Core\Plugin\ContextAwarePluginBase;
 use Drupal\block\BlockInterface;
 use Drupal\Component\Utility\Unicode;
@@ -15,6 +18,9 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheableInterface;
 use Drupal\Core\Session\AccountInterface;
+use Drupal\node\Entity\Node;
+use Drupal\user\Entity\User;
+use Symfony\Cmf\Component\Routing\RouteObjectInterface;
 
 /**
  * Defines a base block implementation that most blocks plugins will extend.
@@ -27,6 +33,22 @@
  */
 abstract class BlockBase extends ContextAwarePluginBase implements BlockPluginInterface {
 
+  use ConditionAccessResolverTrait;
+
+  /**
+   * The condition plugin bag.
+   *
+   * @var \Drupal\Core\Condition\ConditionPluginBag
+   */
+  protected $conditionBag;
+
+  /**
+   * The condition plugin manager.
+   *
+   * @var \Drupal\Core\Executable\ExecutableManagerInterface
+   */
+  protected $conditionPluginManager;
+
   /**
    * {@inheritdoc}
    */
@@ -54,7 +76,9 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
    * {@inheritdoc}
    */
   public function getConfiguration() {
-    return $this->configuration;
+    return array(
+      'visibility' => $this->getVisibilityConditions()->getConfiguration(),
+    ) + $this->configuration;
   }
 
   /**
@@ -75,6 +99,20 @@ public function setConfiguration(array $configuration) {
    *   An associative array with the default configuration.
    */
   protected function baseConfigurationDefaults() {
+    // @todo Allow list of conditions to be configured.
+    $visibility = array();
+    if (\Drupal::moduleHandler()->moduleExists('system')) {
+      $visibility['request_path'] = array('id' => 'request_path');
+    }
+    if (\Drupal::moduleHandler()->moduleExists('user')) {
+      $visibility['user_role'] = array('id' => 'user_role');
+    }
+    if (\Drupal::moduleHandler()->moduleExists('node')) {
+      $visibility['node_type'] = array('id' => 'node_type');
+    }
+    if (\Drupal::moduleHandler()->moduleExists('language')) {
+      $visibility['language'] = array('id' => 'language');
+    }
     return array(
       'id' => $this->getPluginId(),
       'label' => '',
@@ -84,6 +122,7 @@ protected function baseConfigurationDefaults() {
         'max_age' => 0,
         'contexts' => array(),
       ),
+      'visibility' => $visibility,
     );
   }
 
@@ -112,6 +151,65 @@ public function calculateDependencies() {
    * {@inheritdoc}
    */
   public function access(AccountInterface $account) {
+    if ($this->resolveConditions($this->getVisibilityConditions(), 'and', $this->getConditionContexts()) === FALSE) {
+      return FALSE;
+    }
+    return $this->blockAccess($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() {
+    // @todo Move these hardcoded contexts into an event flow.
+    $context = new Context(array(
+      'type' => 'entity:user',
+      'label' => $this->t('Current user'),
+    ));
+    $context->setContextValue(User::load(\Drupal::currentUser()->id()));
+    $contexts['user'] = $context;
+
+    $language = \Drupal::languageManager()->getCurrentLanguage();
+    $context = new Context(array(
+      'type' => 'language',
+      'label' => $this->t('Current language'),
+    ));
+    $context->setContextValue($language);
+    $contexts['language'] = $context;
+
+    // @todo Use RouteMatch after https://drupal.org/node/2238217.
+    $request = \Drupal::request();
+    if ($request->attributes->has(RouteObjectInterface::ROUTE_OBJECT) && ($route_contexts = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)->getOption('parameters')) && isset($route_contexts['node'])) {
+      $context = new Context($route_contexts['node']);
+      if ($request->attributes->has('node')) {
+        $context->setContextValue($request->attributes->get('node'));
+      }
+      $contexts['node'] = $context;
+    }
+    elseif ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'node.add') {
+      $node_type = $request->attributes->get('node_type');
+      $context = new Context(array('type' => 'entity:node'));
+      $context->setContextValue(Node::create(array('type' => $node_type->id())));
+      $contexts['node'] = $context;
+    }
+    return $contexts;
+  }
+
+  /**
+   * Indicates whether the block should be shown.
+   *
+   * @param \Drupal\Core\Session\AccountInterface $account
+   *   The user session for which to check access.
+   *
+   * @return bool
+   *   TRUE if the block should be shown, or FALSE otherwise.
+   *
+   * @see self::access()
+   */
+  protected function blockAccess(AccountInterface $account) {
     // By default, the block is visible unless user-configured rules indicate
     // that it should be hidden.
     return TRUE;
@@ -197,6 +295,16 @@ public function buildConfigurationForm(array $form, array &$form_state) {
       $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));
     }
 
+    // @todo Use vertical tabs here.
+    $form['visibility'] = array(
+      '#type' => 'fieldgroup',
+      '#title' => $this->t('Visibility'),
+    );
+    foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
+      $form['visibility'][$condition_id] = $condition->buildConfigurationForm(array(), $form_state);
+      $form['visibility'][$condition_id]['#type'] = 'details';
+      $form['visibility'][$condition_id]['#title'] = $condition->getPluginDefinition()['label'];
+    }
     // Add plugin-specific settings for this block type.
     $form += $this->blockForm($form, $form_state);
     return $form;
@@ -221,6 +329,15 @@ public function validateConfigurationForm(array &$form, array &$form_state) {
     // Transform the #type = checkboxes value to a numerically indexed array.
     $form_state['values']['cache']['contexts'] = array_values(array_filter($form_state['values']['cache']['contexts']));
 
+    foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
+      // Allow the condition to validate the form.
+      $condition_values = array(
+        'values' => &$form_state['values']['visibility'][$condition_id],
+      );
+      $condition->validateConfigurationForm($form, $condition_values);
+
+    }
+
     $this->blockValidate($form, $form_state);
   }
 
@@ -244,6 +361,13 @@ public function submitConfigurationForm(array &$form, array &$form_state) {
       $this->configuration['label_display'] = $form_state['values']['label_display'];
       $this->configuration['provider'] = $form_state['values']['provider'];
       $this->configuration['cache'] = $form_state['values']['cache'];
+      foreach ($this->getVisibilityConditions() as $condition_id => $condition) {
+        // Allow the condition to submit the form.
+        $condition_values = array(
+          'values' => &$form_state['values']['visibility'][$condition_id],
+        );
+        $condition->submitConfigurationForm($form, $condition_values);
+      }
       $this->blockSubmit($form, $form_state);
     }
   }
@@ -332,4 +456,40 @@ public function isCacheable() {
     return $max_age === Cache::PERMANENT || $max_age > 0;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getVisibilityConditions() {
+    if (!isset($this->conditionBag)) {
+      $this->conditionBag = new ConditionPluginBag($this->conditionPluginManager(), $this->configuration['visibility']);
+    }
+    return $this->conditionBag;
+  }
+
+  /**
+   * {@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;
+  }
 }
diff --git a/core/modules/block/src/BlockForm.php b/core/modules/block/src/BlockForm.php
index 866f1b8..af8641c 100644
--- a/core/modules/block/src/BlockForm.php
+++ b/core/modules/block/src/BlockForm.php
@@ -10,9 +10,6 @@
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Entity\EntityForm;
 use Drupal\Core\Entity\EntityManagerInterface;
-use Drupal\Core\Language\LanguageInterface;
-use Drupal\Core\Language\LanguageManagerInterface;
-use Drupal\language\ConfigurableLanguageManagerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 
 /**
@@ -35,23 +32,13 @@ class BlockForm extends EntityForm {
   protected $storage;
 
   /**
-   * The language manager.
-   *
-   * @var \Drupal\Core\Language\LanguageManagerInterface
-   */
-  protected $languageManager;
-
-  /**
    * Constructs a BlockForm object.
    *
    * @param \Drupal\Core\Entity\EntityManagerInterface $entity_manager
    *   The entity manager.
-   * @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
-   *   The language manager.
    */
-  public function __construct(EntityManagerInterface $entity_manager, LanguageManagerInterface $language_manager) {
+  public function __construct(EntityManagerInterface $entity_manager) {
     $this->storage = $entity_manager->getStorage('block');
-    $this->languageManager = $language_manager;
   }
 
   /**
@@ -59,8 +46,7 @@ public function __construct(EntityManagerInterface $entity_manager, LanguageMana
    */
   public static function create(ContainerInterface $container) {
     return new static(
-      $container->get('entity.manager'),
-      $container->get('language_manager')
+      $container->get('entity.manager')
     );
   }
 
@@ -94,122 +80,6 @@ public function form(array $form, array &$form_state) {
       '#disabled' => !$entity->isNew(),
     );
 
-    // Visibility settings.
-    $form['visibility'] = array(
-      '#type' => 'vertical_tabs',
-      '#title' => $this->t('Visibility settings'),
-      '#attached' => array(
-        'library' => array(
-          'block/drupal.block',
-        ),
-      ),
-      '#tree' => TRUE,
-      '#weight' => 10,
-      '#parents' => array('visibility'),
-    );
-
-    // Per-path visibility.
-    $form['visibility']['path'] = array(
-      '#type' => 'details',
-      '#title' => $this->t('Pages'),
-      '#group' => 'visibility',
-      '#weight' => 0,
-    );
-
-    // @todo remove this access check and inject it in some other way. In fact
-    //   this entire visibility settings section probably needs a separate user
-    //   interface in the near future.
-    $visibility = $entity->get('visibility');
-    $access = $this->currentUser()->hasPermission('use PHP for settings');
-    if (!empty($visibility['path']['visibility']) && $visibility['path']['visibility'] == BLOCK_VISIBILITY_PHP && !$access) {
-      $form['visibility']['path']['visibility'] = array(
-        '#type' => 'value',
-        '#value' => BLOCK_VISIBILITY_PHP,
-      );
-      $form['visibility']['path']['pages'] = array(
-        '#type' => 'value',
-        '#value' => !empty($visibility['path']['pages']) ? $visibility['path']['pages'] : '',
-      );
-    }
-    else {
-      $options = array(
-        BLOCK_VISIBILITY_NOTLISTED => $this->t('All pages except those listed'),
-        BLOCK_VISIBILITY_LISTED => $this->t('Only the listed pages'),
-      );
-      $description = $this->t("Specify pages by using their paths. Enter one path per line. The '*' character is a wildcard. Example paths are %user for the current user's page and %user-wildcard for every user page. %front is the front page.", array('%user' => 'user', '%user-wildcard' => 'user/*', '%front' => '<front>'));
-
-      $form['visibility']['path']['visibility'] = array(
-        '#type' => 'radios',
-        '#title' => $this->t('Show block on specific pages'),
-        '#options' => $options,
-        '#default_value' => !empty($visibility['path']['visibility']) ? $visibility['path']['visibility'] : BLOCK_VISIBILITY_NOTLISTED,
-      );
-      $form['visibility']['path']['pages'] = array(
-        '#type' => 'textarea',
-        '#title' => '<span class="visually-hidden">' . $this->t('Pages') . '</span>',
-        '#default_value' => !empty($visibility['path']['pages']) ? $visibility['path']['pages'] : '',
-        '#description' => $description,
-      );
-    }
-
-    // Configure the block visibility per language.
-    if ($this->languageManager->isMultilingual() && $this->languageManager instanceof ConfigurableLanguageManagerInterface) {
-      $language_types = $this->languageManager->getLanguageTypes();
-
-      // Fetch languages.
-      $languages = $this->languageManager->getLanguages(LanguageInterface::STATE_ALL);
-      $langcodes_options = array();
-      foreach ($languages as $language) {
-        // @todo $language->name is not wrapped with t(), it should be replaced
-        //   by CMI translation implementation.
-        $langcodes_options[$language->id] = $language->name;
-      }
-      $form['visibility']['language'] = array(
-        '#type' => 'details',
-        '#title' => $this->t('Languages'),
-        '#group' => 'visibility',
-        '#weight' => 5,
-      );
-      // If there are multiple configurable language types, let the user pick
-      // which one should be applied to this visibility setting. This way users
-      // can limit blocks by interface language or content language for example.
-      $info = $this->languageManager->getDefinedLanguageTypesInfo();
-      $language_type_options = array();
-      foreach ($language_types as $type_key) {
-        $language_type_options[$type_key] = $info[$type_key]['name'];
-      }
-      $form['visibility']['language']['language_type'] = array(
-        '#type' => 'radios',
-        '#title' => $this->t('Language type'),
-        '#options' => $language_type_options,
-        '#default_value' => !empty($visibility['language']['language_type']) ? $visibility['language']['language_type'] : reset($language_types),
-        '#access' => count($language_type_options) > 1,
-      );
-      $form['visibility']['language']['langcodes'] = array(
-        '#type' => 'checkboxes',
-        '#title' => $this->t('Show this block only for specific languages'),
-        '#default_value' => !empty($visibility['language']['langcodes']) ? $visibility['language']['langcodes'] : array(),
-        '#options' => $langcodes_options,
-        '#description' => $this->t('Show this block only for the selected language(s). If you select no languages, the block will be visible in all languages.'),
-      );
-    }
-
-    // Per-role visibility.
-    $role_options = array_map('check_plain', user_role_names());
-    $form['visibility']['role'] = array(
-      '#type' => 'details',
-      '#title' => $this->t('Roles'),
-      '#group' => 'visibility',
-      '#weight' => 10,
-    );
-    $form['visibility']['role']['roles'] = array(
-      '#type' => 'checkboxes',
-      '#title' => $this->t('Show block for specific roles'),
-      '#default_value' => !empty($visibility['role']['roles']) ? $visibility['role']['roles'] : array(),
-      '#options' => $role_options,
-      '#description' => $this->t('Show this block only for the selected role(s). If you select no roles, the block will be visible to all users.'),
-    );
-
     // Theme settings.
     if ($entity->get('theme')) {
       $form['theme'] = array(
@@ -276,8 +146,6 @@ protected function actions(array $form, array &$form_state) {
   public function validate(array $form, array &$form_state) {
     parent::validate($form, $form_state);
 
-    // Remove empty lines from the role visibility list.
-    $form_state['values']['visibility']['role']['roles'] = array_filter($form_state['values']['visibility']['role']['roles']);
     // The Block Entity form puts all block plugin form elements in the
     // settings form element, so just pass that to the block for validation.
     $settings = array(
@@ -324,21 +192,6 @@ public function submit(array $form, array &$form_state) {
   }
 
   /**
-   * {@inheritdoc}
-   */
-  public function buildEntity(array $form, array &$form_state) {
-    $entity = parent::buildEntity($form, $form_state);
-
-    // visibility__active_tab is Form API state and not configuration.
-    // @todo Fix vertical tabs.
-    $visibility = $entity->get('visibility');
-    unset($visibility['visibility__active_tab']);
-    $entity->set('visibility', $visibility);
-
-    return $entity;
-  }
-
-  /**
    * Generates a unique machine name for a block.
    *
    * @param \Drupal\block\BlockInterface $block
diff --git a/core/modules/block/src/BlockInterface.php b/core/modules/block/src/BlockInterface.php
index de0d9de..fd1544e 100644
--- a/core/modules/block/src/BlockInterface.php
+++ b/core/modules/block/src/BlockInterface.php
@@ -31,5 +31,6 @@
    *   The plugin instance for this block.
    */
   public function getPlugin();
+  public function getVisibility();
 
 }
diff --git a/core/modules/block/src/BlockPluginInterface.php b/core/modules/block/src/BlockPluginInterface.php
index f45ecc5..58ecc8c 100644
--- a/core/modules/block/src/BlockPluginInterface.php
+++ b/core/modules/block/src/BlockPluginInterface.php
@@ -140,4 +140,35 @@ public function blockSubmit($form, &$form_state);
    */
   public function getMachineNameSuggestion();
 
+  /**
+   * Gets conditions for this block.
+   *
+   * @return \Drupal\Core\Condition\ConditionInterface[]|\Drupal\Core\Condition\ConditionPluginBag
+   *   An array 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/modules/block/src/Entity/Block.php b/core/modules/block/src/Entity/Block.php
index de6c971..547b9ff 100644
--- a/core/modules/block/src/Entity/Block.php
+++ b/core/modules/block/src/Entity/Block.php
@@ -87,13 +87,6 @@ class Block extends ConfigEntityBase implements BlockInterface, EntityWithPlugin
   protected $pluginBag;
 
   /**
-   * The visibility settings.
-   *
-   * @var array
-   */
-  protected $visibility;
-
-  /**
    * {@inheritdoc}
    */
   public function getPlugin() {
@@ -145,7 +138,6 @@ public function toArray() {
       'weight',
       'plugin',
       'settings',
-      'visibility',
     );
     foreach ($names as $name) {
       $properties[$name] = $this->get($name);
@@ -194,4 +186,11 @@ public function getListCacheTags() {
     return array('theme' => $this->theme);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getVisibility() {
+    return $this->getPlugin()->getVisibilityConditions()->getConfiguration();
+  }
+
 }
diff --git a/core/modules/block/src/Tests/BlockInterfaceTest.php b/core/modules/block/src/Tests/BlockInterfaceTest.php
index 0b71146..35df3e8 100644
--- a/core/modules/block/src/Tests/BlockInterfaceTest.php
+++ b/core/modules/block/src/Tests/BlockInterfaceTest.php
@@ -44,6 +44,18 @@ public function testBlockInterface() {
       'label' => 'Custom Display Message',
     );
     $expected_configuration = array(
+      'visibility' => array(
+        'request_path' => array(
+          'id' => 'request_path',
+          'pages' => '',
+          'negate' => FALSE,
+        ),
+        'user_role' => array(
+          'id' => 'user_role',
+          'roles' => array(),
+          'negate' => FALSE,
+        ),
+      ),
       'id' => 'test_block_instantiation',
       'label' => 'Custom Display Message',
       'provider' => 'block_test',
@@ -55,6 +67,7 @@ public function testBlockInterface() {
       'display_message' => 'no message set',
     );
     // Initial configuration of the block at construction time.
+    /** @var $display_block \Drupal\block\BlockPluginInterface */
     $display_block = $manager->createInstance('test_block_instantiation', $configuration);
     $this->assertIdentical($display_block->getConfiguration(), $expected_configuration, 'The block was configured correctly.');
 
@@ -124,7 +137,10 @@ public function testBlockInterface() {
     );
     $form_state = array();
     // Ensure there are no form elements that do not belong to the plugin.
-    $this->assertIdentical($display_block->buildConfigurationForm(array(), $form_state), $expected_form, 'Only the expected form elements were present.');
+    $actual_form = $display_block->buildConfigurationForm(array(), $form_state);
+    // Remove the visibility section, as that just tests condition plugins.
+    unset($actual_form['visibility']);
+    $this->assertIdentical($actual_form, $expected_form, 'Only the expected form elements were present.');
 
     $expected_build = array(
       '#children' => 'My custom display message.',
diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php
index 246e92c..7984345 100644
--- a/core/modules/block/src/Tests/BlockLanguageTest.php
+++ b/core/modules/block/src/Tests/BlockLanguageTest.php
@@ -57,11 +57,11 @@ 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('visibility[language][langcodes][en]', 'Language visibility field is visible.');
+    $this->assertField('settings[visibility][language][langcodes][en]', 'Language visibility field is visible.');
 
     // Enable a standard block and set the visibility setting for one language.
     $edit = array(
-      'visibility[language][langcodes][en]' => TRUE,
+      'settings[visibility][language][langcodes][en]' => TRUE,
       'id' => strtolower($this->randomName(8)),
       'region' => 'sidebar_first',
     );
@@ -100,7 +100,7 @@ public function testLanguageBlockVisibilityLanguageDelete() {
     $block = $this->drupalPlaceBlock('system_powered_by_block', $edit);
 
     // Check that we have the language in config after saving the setting.
-    $visibility = $block->get('visibility');
+    $visibility = $block->getVisibility();
     $language = $visibility['language']['langcodes']['fr'];
     $this->assertTrue('fr' === $language, 'Language is set in the block configuration.');
 
@@ -110,7 +110,7 @@ public function testLanguageBlockVisibilityLanguageDelete() {
     // Check that the language is no longer stored in the configuration after
     // it is deleted.
     $block = entity_load('block', $block->id());
-    $visibility = $block->get('visibility');
+    $visibility = $block->getVisibility();
     $this->assertTrue(empty($visibility['language']['langcodes']['fr']), 'Language is no longer not set in the block configuration after deleting the block.');
   }
 
diff --git a/core/modules/block/src/Tests/BlockStorageUnitTest.php b/core/modules/block/src/Tests/BlockStorageUnitTest.php
index 65d67f6..60cbf94 100644
--- a/core/modules/block/src/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/src/Tests/BlockStorageUnitTest.php
@@ -99,6 +99,13 @@ protected function createTests() {
       'region' => '-1',
       'plugin' => 'test_html',
       'settings' => array(
+        'visibility' => array(
+          'request_path' => array(
+            'id' => 'request_path',
+            'pages' => '',
+            'negate' => FALSE,
+          ),
+        ),
         'id' => 'test_html',
         'label' => '',
         'provider' => 'block_test',
@@ -108,7 +115,6 @@ protected function createTests() {
           'contexts' => array(),
         ),
       ),
-      'visibility' => NULL,
     );
     $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 882863d..741fab1 100644
--- a/core/modules/block/src/Tests/BlockTest.php
+++ b/core/modules/block/src/Tests/BlockTest.php
@@ -40,8 +40,9 @@ function testBlockVisibility() {
     );
     // Set the block to be hidden on any user path, and to be shown only to
     // authenticated users.
-    $edit['visibility[path][pages]'] = 'user*';
-    $edit['visibility[role][roles][' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
+    $edit['settings[visibility][request_path][pages]'] = 'user*';
+    $edit['settings[visibility][request_path][negate]'] = TRUE;
+    $edit['settings[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');
 
@@ -65,8 +66,7 @@ function testBlockVisibility() {
   }
 
   /**
-   * Test block visibility when using "pages" restriction but leaving
-   * "pages" textarea empty
+   * Test block visibility when leaving "pages" textarea empty.
    */
   function testBlockVisibilityListedEmpty() {
     $block_name = 'system_powered_by_block';
@@ -78,7 +78,7 @@ function testBlockVisibilityListedEmpty() {
       'id' => strtolower($this->randomName(8)),
       'region' => 'sidebar_first',
       'settings[label]' => $title,
-      'visibility[path][visibility]' => BLOCK_VISIBILITY_LISTED,
+      'settings[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 232c64a..ea4a909 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,17 +6,13 @@ langcode: en
 region: '-1'
 plugin: test_html
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
   label: 'Test HTML block'
   provider: block_test
   label_display: 'hidden'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types: {  }
 dependencies:
   module:
     - block_test
diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
index 85856a3..9a4db70 100644
--- a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
+++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestBlockInstantiation.php
@@ -32,7 +32,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $account->hasPermission('access content');
   }
 
diff --git a/core/modules/block/tests/src/BlockBaseTest.php b/core/modules/block/tests/src/BlockBaseTest.php
index 913130b..6fddb58 100644
--- a/core/modules/block/tests/src/BlockBaseTest.php
+++ b/core/modules/block/tests/src/BlockBaseTest.php
@@ -9,7 +9,7 @@
 
 use Drupal\block_test\Plugin\Block\TestBlockInstantiation;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
-use Drupal\Core\Transliteration\PHPTransliteration;
+use Drupal\Core\Executable\ExecutableManagerInterface;
 use Drupal\Tests\UnitTestCase;
 
 /**
@@ -33,24 +33,92 @@ public static function getInfo() {
    * @see \Drupal\block\BlockBase::getMachineNameSuggestion().
    */
   public function testGetMachineNameSuggestion() {
+    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
     $transliteraton = $this->getMockBuilder('Drupal\Core\Transliteration\PHPTransliteration')
       // @todo Inject the module handler into PHPTransliteration.
       ->setMethods(array('readLanguageOverrides'))
       ->getMock();
 
     $container = new ContainerBuilder();
+    $container->set('module_handler', $module_handler);
     $container->set('transliteration', $transliteraton);
     \Drupal::setContainer($container);
 
     $config = array();
-    $definition = array('admin_label' => 'Admin label', 'provider' => 'block_test');
+    $definition = array(
+      'admin_label' => 'Admin label',
+      'provider' => 'block_test',
+    );
     $block_base = new TestBlockInstantiation($config, 'test_block_instantiation', $definition);
     $this->assertEquals('adminlabel', $block_base->getMachineNameSuggestion());
 
     // Test with more unicodes.
-    $definition = array('admin_label' =>'über åwesome', 'provider' => 'block_test');
+    $definition = array(
+      'admin_label' => 'über åwesome',
+      'provider' => 'block_test',
+    );
     $block_base = new TestBlockInstantiation($config, 'test_block_instantiation', $definition);
     $this->assertEquals('uberawesome', $block_base->getMachineNameSuggestion());
   }
 
+  /**
+   * Tests initialising the condition plugins initialisation.
+   */
+  public function testCondtionsBagInitialisation() {
+    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $module_handler->expects($this->exactly(4))
+      ->method('moduleExists')
+      ->will($this->returnValueMap(array(
+        array('system', TRUE),
+        array('user', TRUE),
+        array('node', TRUE),
+        array('language', TRUE),
+      )));
+    $container = new ContainerBuilder();
+    $container->set('module_handler', $module_handler);
+    \Drupal::setContainer($container);
+    $config = array();
+    $definition = array(
+      'admin_label' => 'Admin label',
+      'provider' => 'block_test',
+    );
+
+    $plugin_manager = $this->getMock('Drupal\Core\Executable\ExecutableManagerInterface');
+
+    $block_base = new FakeBlock($plugin_manager, $config, 'test_block_instantiation', $definition);
+    $conditions_bag = $block_base->getVisibilityConditions();
+
+    $this->assertEquals(4, $conditions_bag->count(), "There are 4 condition plugins");
+
+    $instance_id = $this->randomName();
+    $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.");
+  }
+
+}
+
+/**
+ * A fake Block for testing condition plugin config.
+ */
+class FakeBlock extends TestBlockInstantiation {
+
+  protected $mockPluginManager;
+
+  public function __construct(ExecutableManagerInterface $plugin_manager, array $configuration, $plugin_id, $plugin_definition) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition);
+    $this->mockPluginManager = $plugin_manager;
+  }
+
+  protected function conditionPluginManager() {
+    return $this->mockPluginManager;
+  }
+
 }
diff --git a/core/modules/forum/src/Plugin/Block/ForumBlockBase.php b/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
index d7dfc31..6a5b492 100644
--- a/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
+++ b/core/modules/forum/src/Plugin/Block/ForumBlockBase.php
@@ -56,7 +56,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $account->hasPermission('access content');
   }
 
diff --git a/core/modules/language/config/schema/language.schema.yml b/core/modules/language/config/schema/language.schema.yml
index a10dc3d..584a715 100644
--- a/core/modules/language/config/schema/language.schema.yml
+++ b/core/modules/language/config/schema/language.schema.yml
@@ -123,3 +123,11 @@ language.settings:
                         language_show:
                           type: boolean
                           label: 'Show language selector on create and edit pages'
+
+condition.plugin.language:
+  type: condition.plugin
+  mapping:
+    langcodes:
+      type: sequence
+      sequence:
+        - type: string
diff --git a/core/modules/language/src/Plugin/Block/LanguageBlock.php b/core/modules/language/src/Plugin/Block/LanguageBlock.php
index 4a6c7bc..42d5bf3 100644
--- a/core/modules/language/src/Plugin/Block/LanguageBlock.php
+++ b/core/modules/language/src/Plugin/Block/LanguageBlock.php
@@ -66,7 +66,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $this->languageManager->isMultilingual();
   }
 
diff --git a/core/modules/language/src/Plugin/Condition/Language.php b/core/modules/language/src/Plugin/Condition/Language.php
index 3f12a06..575065c 100644
--- a/core/modules/language/src/Plugin/Condition/Language.php
+++ b/core/modules/language/src/Plugin/Condition/Language.php
@@ -8,7 +8,7 @@
 namespace Drupal\language\Plugin\Condition;
 
 use Drupal\Core\Condition\ConditionPluginBase;
-use Drupal\Core\Language\Language as Lang;
+use Drupal\Core\Language\LanguageInterface;
 
 /**
  * Provides a 'Language' condition.
@@ -32,23 +32,23 @@ public function buildConfigurationForm(array $form, array &$form_state) {
     $form = parent::buildConfigurationForm($form, $form_state);
     if (\Drupal::languageManager()->isMultilingual()) {
       // Fetch languages.
-      $languages = language_list(Lang::STATE_ALL);
+      $languages = language_list(LanguageInterface::STATE_ALL);
       $langcodes_options = array();
       foreach ($languages as $language) {
-        $langcodes_options[$language->id] = $language->label();
+        $langcodes_options[$language->id] = $language->getName();
       }
       $form['langcodes'] = array(
         '#type' => 'checkboxes',
         '#title' => t('Language selection'),
-        '#default_value' => !empty($this->configuration['langcodes']) ? $this->configuration['langcodes'] : array(),
+        '#default_value' => $this->configuration['langcodes'],
         '#options' => $langcodes_options,
         '#description' => t('Select languages to enforce. If none are selected, all languages will be allowed.'),
       );
     }
     else {
-      $form['language']['langcodes'] = array(
+      $form['langcodes'] = array(
         '#type' => 'value',
-        '#value' => !empty($this->configuration['langcodes']) ? $this->configuration['langcodes'] : array()
+        '#value' => $this->configuration['langcodes'],
       );
     }
     return $form;
@@ -66,7 +66,7 @@ public function submitConfigurationForm(array &$form, array &$form_state) {
    * {@inheritdoc}
    */
   public function summary() {
-    $language_list = language_list(Lang::STATE_ALL);
+    $language_list = language_list(LanguageInterface::STATE_ALL);
     $selected = $this->configuration['langcodes'];
     // Reduce the language list to an array of language names.
     $language_names = array_reduce($language_list, function(&$result, $item) use ($selected) {
@@ -96,12 +96,20 @@ public function summary() {
    * {@inheritdoc}
    */
   public function evaluate() {
+    if (empty($this->configuration['langcodes']) && !$this->configuration['negate']) {
+      return TRUE;
+    }
+
     $language = $this->getContextValue('language');
     // Language visibility settings.
-    if (!empty($this->configuration['langcodes'])) {
-      return !empty($this->configuration['langcodes'][$language->id]);
-    }
-    return TRUE;
+    return !empty($this->configuration['langcodes'][$language->id]);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultConfiguration() {
+    return array('langcodes' => array()) + parent::defaultConfiguration();
   }
 
 }
diff --git a/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml b/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml
index e4c269c..46c2e9f 100644
--- a/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml
+++ b/core/modules/migrate_drupal/config/install/migrate.migration.d6_block.yml
@@ -45,9 +45,6 @@ process:
   region: region
   theme: theme
   label: title
-  'visibility.path.visibility': visibility
-  'visibility.path.pages': pages
-  'visibility.role.roles': roles
   weight: weight
   settings:
     plugin: d6_block_settings
@@ -55,6 +52,9 @@ process:
       - @plugin
       - delta
       - settings
+      - visibility
+  'settings.visibility.request_path.pages': pages
+  'settings.visibility.user_role.roles': roles
 destination:
   plugin: entity:block
 migration_dependencies:
diff --git a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php
index a804352..94ea600 100644
--- a/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php
+++ b/core/modules/migrate_drupal/src/Plugin/migrate/process/d6/BlockSettings.php
@@ -24,8 +24,9 @@ class BlockSettings extends ProcessPluginBase {
    * Set the block configuration.
    */
   public function transform($value, MigrateExecutable $migrate_executable, Row $row, $destination_property) {
-    list($plugin, $delta, $old_settings) = $value;
+    list($plugin, $delta, $old_settings, $visibility) = $value;
     $settings = array();
+    $settings['visibility']['request_path']['negate'] = !$visibility;
     switch ($plugin) {
       case 'aggregator_feed_block':
         list(, $id) = explode('-', $delta);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
index 800e784..313e780 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
@@ -75,6 +75,7 @@ public function setUp() {
    * Test the block settings migration.
    */
   public function testBlockMigration() {
+    /** @var $blocks \Drupal\block\BlockInterface[] */
     $blocks = entity_load_multiple('block');
     $this->assertEqual(count($blocks), 11);
 
@@ -83,36 +84,36 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_user);
     $this->assertEqual('left', $test_block_user->get('region'));
     $this->assertEqual('garland', $test_block_user->get('theme'));
-    $visibility = $test_block_user->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_user->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(0, $test_block_user->weight);
 
     $test_block_user_1 = $blocks['user_1'];
     $this->assertNotNull($test_block_user_1);
     $this->assertEqual('left', $test_block_user_1->get('region'));
     $this->assertEqual('garland', $test_block_user_1->get('theme'));
-    $visibility = $test_block_user_1->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_user_1->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(0, $test_block_user_1->weight);
 
     $test_block_user_2 = $blocks['user_2'];
     $this->assertNotNull($test_block_user_2);
     $this->assertEqual('', $test_block_user_2->get('region'));
     $this->assertEqual('garland', $test_block_user_2->get('theme'));
-    $visibility = $test_block_user_2->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_user_2->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-3, $test_block_user_2->weight);
 
     $test_block_user_3 = $blocks['user_3'];
     $this->assertNotNull($test_block_user_3);
     $this->assertEqual('', $test_block_user_3->get('region'));
     $this->assertEqual('garland', $test_block_user_3->get('theme'));
-    $visibility = $test_block_user_3->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_user_3->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-1, $test_block_user_3->weight);
 
     // Check system block
@@ -120,9 +121,9 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_system);
     $this->assertEqual('footer', $test_block_system->get('region'));
     $this->assertEqual('garland', $test_block_system->get('theme'));
-    $visibility = $test_block_system->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_system->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-5, $test_block_system->weight);
 
     // Check comment block
@@ -130,9 +131,9 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_comment);
     $this->assertEqual('', $test_block_comment->get('region'));
     $this->assertEqual('garland', $test_block_comment->get('theme'));
-    $visibility = $test_block_comment->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_comment->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-6, $test_block_comment->weight);
 
     // Check menu blocks
@@ -140,18 +141,18 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_menu);
     $this->assertEqual('header', $test_block_menu->get('region'));
     $this->assertEqual('garland', $test_block_menu->get('theme'));
-    $visibility = $test_block_menu->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_menu->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-5, $test_block_menu->weight);
 
     $test_block_menu_1 = $blocks['menu_1'];
     $this->assertNotNull($test_block_menu_1);
     $this->assertEqual('', $test_block_menu_1->get('region'));
     $this->assertEqual('garland', $test_block_menu_1->get('theme'));
-    $visibility = $test_block_menu_1->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_menu_1->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-5, $test_block_menu_1->weight);
 
     // Check node block
@@ -159,9 +160,9 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_node);
     $this->assertEqual('', $test_block_node->get('region'));
     $this->assertEqual('garland', $test_block_node->get('theme'));
-    $visibility = $test_block_node->get('visibility');
-    $this->assertEqual(0, $visibility['path']['visibility']);
-    $this->assertEqual('', $visibility['path']['pages']);
+    $visibility = $test_block_node->getVisibility();
+    $this->assertEqual(TRUE, $visibility['request_path']['negate']);
+    $this->assertEqual('', $visibility['request_path']['pages']);
     $this->assertEqual(-4, $test_block_node->weight);
 
     // Check custom blocks
@@ -169,18 +170,18 @@ public function testBlockMigration() {
     $this->assertNotNull($test_block_block);
     $this->assertEqual('content', $test_block_block->get('region'));
     $this->assertEqual('garland', $test_block_block->get('theme'));
-    $visibility = $test_block_block->get('visibility');
-    $this->assertEqual(1, $visibility['path']['visibility']);
-    $this->assertEqual('<front>', $visibility['path']['pages']);
+    $visibility = $test_block_block->getVisibility();
+    $this->assertEqual(FALSE, $visibility['request_path']['negate']);
+    $this->assertEqual('<front>', $visibility['request_path']['pages']);
     $this->assertEqual(0, $test_block_block->weight);
 
     $test_block_block_1 = $blocks['block_1'];
     $this->assertNotNull($test_block_block_1);
     $this->assertEqual('right', $test_block_block_1->get('region'));
     $this->assertEqual('bluemarine', $test_block_block_1->get('theme'));
-    $visibility = $test_block_block_1->get('visibility');
-    $this->assertEqual(1, $visibility['path']['visibility']);
-    $this->assertEqual('node', $visibility['path']['pages']);
+    $visibility = $test_block_block_1->getVisibility();
+    $this->assertEqual(FALSE, $visibility['request_path']['negate']);
+    $this->assertEqual('node', $visibility['request_path']['pages']);
     $this->assertEqual(-4, $test_block_block_1->weight);
   }
 }
diff --git a/core/modules/node/config/schema/node.schema.yml b/core/modules/node/config/schema/node.schema.yml
index 4e8a55c..8ebe374 100644
--- a/core/modules/node/config/schema/node.schema.yml
+++ b/core/modules/node/config/schema/node.schema.yml
@@ -137,3 +137,11 @@ block.settings.node_syndicate_block:
     block_count:
       type: integer
       label: 'Block count'
+
+condition.plugin.node_type:
+  type: condition.plugin
+  mapping:
+    bundles:
+      type: sequence
+      sequence:
+        - type: string
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 6174a13..a311051 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -937,71 +937,6 @@ function node_get_recent($number = 10) {
 }
 
 /**
- * Implements hook_form_FORM_ID_alter() for block_form().
- *
- * Adds node-type specific visibility options to block configuration form.
- */
-function node_form_block_form_alter(&$form, &$form_state) {
-  $block = $form_state['controller']->getEntity();
-  $visibility = $block->get('visibility');
-  $form['visibility']['node_type'] = array(
-    '#type' => 'details',
-    '#title' => t('Content types'),
-    '#group' => 'visibility',
-    '#weight' => 5,
-  );
-  $form['visibility']['node_type']['types'] = array(
-    '#type' => 'checkboxes',
-    '#title' => t('Show block for specific content types'),
-    '#default_value' => !empty($visibility['node_type']['types']) ? $visibility['node_type']['types'] : array(),
-    '#options' => node_type_get_names(),
-    '#description' => t('Show this block only on pages that display content of the given type(s). If you select no types, there will be no type-specific limitation.'),
-  );
-}
-
-/**
- * Implements hook_block_access().
- *
- * Checks the content type specific visibility settings and removes the block
- * if the visibility conditions are not met.
- */
-function node_block_access(Block $block, $operation, AccountInterface $account, $langcode) {
-  // Only affect access when viewing the block.
-  if ($operation != 'view') {
-    return;
-  }
-  $visibility = $block->get('visibility');
-  if (!empty($visibility)) {
-    if (!empty($visibility['node_type']['types'])) {
-      $allowed_types = array_filter($visibility['node_type']['types']);
-    }
-    if (empty($allowed_types)) {
-      // There are no node types selected in visibility settings so there is
-      // nothing to do.
-      // @see node_form_block_form_alter()
-      return;
-    }
-
-    // For blocks with node types associated, if the node type does not match
-    // the settings from this block, deny access to it.
-    $request = \Drupal::request();
-    if ($node = $request->attributes->get('node')) {
-      // Page has node.
-      return in_array($node->bundle(), $allowed_types);
-    }
-    // This is a node creation page.
-    // $request->attributes->has('node_type') would also match administration
-    // configuration pages, which the previous URI path options did not.
-    if ($request->attributes->get(RouteObjectInterface::ROUTE_NAME) == 'node.add') {
-      $node_type = $request->attributes->get('node_type');
-      return in_array($node_type->id(), $allowed_types);
-    }
-
-    return FALSE;
-  }
-}
-
-/**
  * Page callback: Generates and prints an RSS feed.
  *
  * Generates an RSS feed from an array of node IDs, and prints it with an HTTP
diff --git a/core/modules/node/src/Plugin/Block/SyndicateBlock.php b/core/modules/node/src/Plugin/Block/SyndicateBlock.php
index efc1bdf..ace314a 100644
--- a/core/modules/node/src/Plugin/Block/SyndicateBlock.php
+++ b/core/modules/node/src/Plugin/Block/SyndicateBlock.php
@@ -33,7 +33,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $account->hasPermission('access content');
   }
 
diff --git a/core/modules/node/src/Plugin/Condition/NodeType.php b/core/modules/node/src/Plugin/Condition/NodeType.php
index 74cdf5d..d2f726b 100644
--- a/core/modules/node/src/Plugin/Condition/NodeType.php
+++ b/core/modules/node/src/Plugin/Condition/NodeType.php
@@ -37,8 +37,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
       '#title' => t('Node types'),
       '#type' => 'checkboxes',
       '#options' => $options,
-      '#required' => TRUE,
-      '#default_value' => isset($this->configuration['bundles']) ? $this->configuration['bundles'] : array(),
+      '#default_value' => $this->configuration['bundles'],
     );
     return $form;
   }
@@ -46,17 +45,6 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   /**
    * {@inheritdoc}
    */
-  public function validateConfigurationForm(array &$form, array &$form_state) {
-    foreach ($form_state['values']['bundles'] as $bundle) {
-      if (!in_array($bundle, array_keys(node_type_get_types()))) {
-        form_set_error('bundles', $form_state, t('You have chosen an invalid node bundle, please check your selection and try again.'));
-      }
-    }
-  }
-
-  /**
-   * {@inheritdoc}
-   */
   public function submitConfigurationForm(array &$form, array &$form_state) {
     $this->configuration['bundles'] = array_filter($form_state['values']['bundles']);
     parent::submitConfigurationForm($form, $form_state);
@@ -80,8 +68,18 @@ public function summary() {
    * {@inheritdoc}
    */
   public function evaluate() {
+    if (empty($this->configuration['bundles']) && !$this->configuration['negate']) {
+      return TRUE;
+    }
     $node = $this->getContextValue('node');
     return !empty($this->configuration['bundles'][$node->getType()]);
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function defaultConfiguration() {
+    return array('bundles' => array()) + parent::defaultConfiguration();
+  }
+
 }
diff --git a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
index 148ec23..e806bc9 100644
--- a/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
+++ b/core/modules/node/src/Tests/NodeBlockFunctionalTest.php
@@ -128,14 +128,14 @@ public function testRecentNodeBlock() {
     $block = $this->drupalPlaceBlock('system_powered_by_block', array(
       'visibility' => array(
         'node_type' => array(
-          'types' => array(
+          'bundles' => array(
             'article' => 'article',
           ),
         ),
       ),
     ));
-    $visibility = $block->get('visibility');
-    $this->assertTrue(isset($visibility['node_type']['types']['article']), 'Visibility settings were saved to configuration');
+    $visibility = $block->getVisibility();
+    $this->assertTrue(isset($visibility['node_type']['bundles']['article']), 'Visibility settings were saved to configuration');
 
     // Create a page node.
     $node5 = $this->drupalCreateNode(array('uid' => $this->adminUser->id(), 'type' => 'page'));
diff --git a/core/modules/search/src/Plugin/Block/SearchBlock.php b/core/modules/search/src/Plugin/Block/SearchBlock.php
index c2e3e51..64b3096 100644
--- a/core/modules/search/src/Plugin/Block/SearchBlock.php
+++ b/core/modules/search/src/Plugin/Block/SearchBlock.php
@@ -26,7 +26,7 @@ class SearchBlock extends BlockBase {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $account->hasPermission('search content');
   }
 
diff --git a/core/modules/search/src/Tests/SearchBlockTest.php b/core/modules/search/src/Tests/SearchBlockTest.php
index d4e45db..311f69a 100644
--- a/core/modules/search/src/Tests/SearchBlockTest.php
+++ b/core/modules/search/src/Tests/SearchBlockTest.php
@@ -63,9 +63,9 @@ protected function testSearchFormBlock() {
     $this->assertResponse(200);
     $this->assertText('Your search yielded no results');
 
-    $visibility = $block->get('visibility');
-    $visibility['path']['pages'] = 'search';
-    $block->set('visibility', $visibility);
+    $visibility = $block->getVisibility();
+    $visibility['request_path']['pages'] = 'search';
+    $block->getPlugin()->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 bd3f8fd..7fb269d 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -427,11 +427,14 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
         'max_age' => 0,
       ),
     );
-    foreach (array('region', 'id', 'theme', 'plugin', 'visibility', 'weight') as $key) {
+    foreach (array('region', 'id', 'theme', 'plugin', 'weight') 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;
+    }
     $values['settings'] = $settings;
     $block = entity_create('block', $values);
     $block->save();
diff --git a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
index 1a19761..3bdacac 100644
--- a/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
+++ b/core/modules/statistics/src/Plugin/Block/StatisticsPopularBlock.php
@@ -55,7 +55,7 @@ public function defaultConfiguration() {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     if ($account->hasPermission('access content')) {
       $daytop = $this->configuration['top_day_num'];
       if (!$daytop || !($result = statistics_title_list('daycount', $daytop)) || !($this->day_list = node_title_list($result, t("Today's:")))) {
diff --git a/core/modules/system/config/schema/system.schema.yml b/core/modules/system/config/schema/system.schema.yml
index 8c08c10..c3e3bc3 100644
--- a/core/modules/system/config/schema/system.schema.yml
+++ b/core/modules/system/config/schema/system.schema.yml
@@ -367,3 +367,9 @@ block.settings.system_branding_block:
     use_site_slogan:
       type: boolean
       label: 'Use site slogan'
+
+condition.plugin.request_path:
+  type: condition.plugin
+  mapping:
+    pages:
+      type: string
diff --git a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php b/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
index d15cfc6..e99787c 100644
--- a/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
+++ b/core/modules/system/src/Plugin/Block/SystemHelpBlock.php
@@ -78,7 +78,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     $this->help = $this->getActiveHelp($this->request);
     return (bool) $this->help;
   }
diff --git a/core/modules/system/src/Plugin/Condition/RequestPath.php b/core/modules/system/src/Plugin/Condition/RequestPath.php
index 7923554..2043b77 100644
--- a/core/modules/system/src/Plugin/Condition/RequestPath.php
+++ b/core/modules/system/src/Plugin/Condition/RequestPath.php
@@ -87,7 +87,7 @@ public static function create(ContainerInterface $container, array $configuratio
    * {@inheritdoc}
    */
   public function defaultConfiguration() {
-    return array('pages' => '');
+    return array('pages' => '') + parent::defaultConfiguration();
   }
 
   /**
@@ -134,6 +134,9 @@ public function evaluate() {
     // Convert path to lowercase. This allows comparison of the same path
     // with different case. Ex: /Page, /page, /PAGE.
     $pages = Unicode::strtolower($this->configuration['pages']);
+    if (!$pages) {
+      return TRUE;
+    }
 
     $request = $this->requestStack->getCurrentRequest();
     // Compare the lowercase path alias (if any) and internal path.
@@ -142,4 +145,5 @@ public function evaluate() {
 
     return $this->pathMatcher->matchPath($path_alias, $pages) || (($path != $path_alias) && $this->pathMatcher->matchPath($path, $pages));
   }
+
 }
diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
index f310b24..a22dfb2 100644
--- a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
+++ b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
@@ -67,8 +67,7 @@ function testPageCacheTags() {
     // Place a block, but only make it visible on full node page 2.
     $block = $this->drupalPlaceBlock('views_block:comments_recent-block_1', array(
       'visibility' => array(
-        'path' => array(
-          'visibility' => BLOCK_VISIBILITY_LISTED,
+        'request_path' => array(
           'pages' => 'node/' . $node_2->id(),
         ),
       )
diff --git a/core/modules/system/tests/modules/form_test/src/Plugin/Block/RedirectFormBlock.php b/core/modules/system/tests/modules/form_test/src/Plugin/Block/RedirectFormBlock.php
index 9703f4c..21b79b3 100644
--- a/core/modules/system/tests/modules/form_test/src/Plugin/Block/RedirectFormBlock.php
+++ b/core/modules/system/tests/modules/form_test/src/Plugin/Block/RedirectFormBlock.php
@@ -66,7 +66,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return TRUE;
   }
 
diff --git a/core/modules/user/config/schema/user.schema.yml b/core/modules/user/config/schema/user.schema.yml
index 70d8581..44762ed 100644
--- a/core/modules/user/config/schema/user.schema.yml
+++ b/core/modules/user/config/schema/user.schema.yml
@@ -162,3 +162,11 @@ search.plugin.user_search:
   label: 'User search'
   sequence:
     - type: undefined
+
+condition.plugin.user_role:
+  type: condition.plugin
+  mapping:
+    roles:
+      type: sequence
+      sequence:
+        - type: string
diff --git a/core/modules/user/src/Plugin/Block/UserLoginBlock.php b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
index 01e1ebd..2cd54f4 100644
--- a/core/modules/user/src/Plugin/Block/UserLoginBlock.php
+++ b/core/modules/user/src/Plugin/Block/UserLoginBlock.php
@@ -25,7 +25,7 @@ class UserLoginBlock extends BlockBase {
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     $route_name = \Drupal::request()->attributes->get(RouteObjectInterface::ROUTE_NAME);
     return ($account->isAnonymous() && !in_array($route_name, array('user.register', 'user.login', 'user.logout')));
   }
diff --git a/core/modules/user/src/Plugin/Condition/UserRole.php b/core/modules/user/src/Plugin/Condition/UserRole.php
index 8724489..c0383c7 100644
--- a/core/modules/user/src/Plugin/Condition/UserRole.php
+++ b/core/modules/user/src/Plugin/Condition/UserRole.php
@@ -35,7 +35,6 @@ public function buildConfigurationForm(array $form, array &$form_state) {
       '#default_value' => $this->configuration['roles'],
       '#options' => array_map('\Drupal\Component\Utility\String::checkPlain', user_role_names()),
       '#description' => $this->t('If you select no roles, the condition will evaluate to TRUE for all users.'),
-      '#required' => TRUE,
     );
     return $form;
   }
@@ -46,7 +45,7 @@ public function buildConfigurationForm(array $form, array &$form_state) {
   public function defaultConfiguration() {
     return array(
       'roles' => array(),
-    );
+    ) + parent::defaultConfiguration();
   }
 
   /**
@@ -81,8 +80,11 @@ public function summary() {
    * {@inheritdoc}
    */
   public function evaluate() {
+    if (empty($this->configuration['roles']) && !$this->configuration['negate']) {
+      return TRUE;
+    }
     $user = $this->getContextValue('user');
-    return (bool) array_intersect($this->configuration['roles'], $user->getRoles());
+    return array_intersect($this->configuration['roles'], $user->getRoles());
   }
 
 }
diff --git a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
index b0bfdba..5a63e76 100644
--- a/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
+++ b/core/modules/views/src/Plugin/Block/ViewsBlockBase.php
@@ -91,7 +91,7 @@ public static function create(ContainerInterface $container, array $configuratio
   /**
    * {@inheritdoc}
    */
-  public function access(AccountInterface $account) {
+  protected function blockAccess(AccountInterface $account) {
     return $this->view->access($this->displayID);
   }
 
diff --git a/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php b/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
index dd2d2e8..0475e23 100644
--- a/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
+++ b/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
@@ -109,11 +109,14 @@ protected function createBlock($plugin_id, array $settings = array()) {
         'max_age' => 0,
       ),
     );
-    foreach (array('region', 'id', 'theme', 'plugin', 'visibility', 'weight') as $key) {
+    foreach (array('region', 'id', 'theme', 'plugin', 'weight') 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;
+    }
     $values['settings'] = $settings;
     $block = entity_create('block', $values);
     $block->save();
diff --git a/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php b/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php
index eb46cb3..34a0b99 100644
--- a/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php
+++ b/core/modules/views/tests/src/Plugin/Block/ViewsBlockTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views\Tests\Plugin\Block {
 
+use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Tests\UnitTestCase;
 use Drupal\views\Plugin\Block\ViewsBlock;
 use Drupal\block\Plugin\views\display\Block;
@@ -71,6 +72,10 @@ public static function getInfo() {
    */
   protected function setUp() {
     parent::setUp(); // TODO: Change the autogenerated stub
+    $module_handler = $this->getMock('Drupal\Core\Extension\ModuleHandlerInterface');
+    $container = new ContainerBuilder();
+    $container->set('module_handler', $module_handler);
+    \Drupal::setContainer($container);
 
     $this->executable = $this->getMockBuilder('Drupal\views\ViewExecutable')
       ->disableOriginalConstructor()
@@ -128,6 +133,10 @@ 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());
   }
@@ -150,6 +159,10 @@ 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/modules/views_ui/src/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
index 3384b0f..1a405d9 100644
--- a/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
@@ -120,9 +120,9 @@ function testWizardMixedDefaultOverriddenDisplays() {
     // presence/absence of the view's title in both the page and the block).
     $this->drupalPlaceBlock("views_block:{$view['id']}-block_1", array(
       'visibility' => array(
-        'path' => array(
-          'visibility' => BLOCK_VISIBILITY_NOTLISTED,
+        'request_path' => array(
           'pages' => $view['page[path]'],
+          'negate' => TRUE,
         ),
       ),
     ));
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 5d5c2c1..ab167ad 100644
--- a/core/profiles/minimal/config/install/block.block.stark_admin.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_admin.yml
@@ -6,17 +6,18 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:admin'
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
   label: Administration
   provider: system
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types: {  }
 dependencies:
   entity:
     - system.menu.admin
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 91ba3e0..adeed2b 100644
--- a/core/profiles/minimal/config/install/block.block.stark_login.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_login.yml
@@ -6,17 +6,18 @@ langcode: en
 region: sidebar_first
 plugin: user_login_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
   label: 'User login'
   provider: user
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types: {  }
 dependencies:
   module:
     - user
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 36481b3..8783843 100644
--- a/core/profiles/minimal/config/install/block.block.stark_tools.yml
+++ b/core/profiles/minimal/config/install/block.block.stark_tools.yml
@@ -6,17 +6,18 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:tools'
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
   label: Tools
   provider: system
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types: {  }
 dependencies:
   entity:
     - system.menu.tools
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 23cc5d0..cdb1aaf 100644
--- a/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_breadcrumbs.yml
@@ -6,19 +6,19 @@ langcode: en
 region: '-1'
 plugin: system_breadcrumb_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_breadcrumb_block
   label: Breadcrumbs
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 dd89d12..a7b20eb 100644
--- a/core/profiles/standard/config/install/block.block.bartik_content.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_content.yml
@@ -6,19 +6,19 @@ langcode: en
 region: content
 plugin: system_main_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_main_block
   label: 'Main page content'
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 ef96ea9..42e8e2a 100644
--- a/core/profiles/standard/config/install/block.block.bartik_footer.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_footer.yml
@@ -6,19 +6,19 @@ langcode: en
 region: footer
 plugin: 'system_menu_block:footer'
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: 'system_menu_block:footer'
   label: 'Footer menu'
   provider: system
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   entity:
     - system.menu.footer
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 3e139c6..a4734d1 100644
--- a/core/profiles/standard/config/install/block.block.bartik_help.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_help.yml
@@ -6,19 +6,19 @@ langcode: en
 region: help
 plugin: system_help_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_help_block
   label: 'System Help'
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 1465ce8..120c4ac 100644
--- a/core/profiles/standard/config/install/block.block.bartik_login.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_login.yml
@@ -6,19 +6,19 @@ langcode: en
 region: sidebar_first
 plugin: user_login_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: user_login_block
   label: 'User login'
   provider: user
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - user
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 c722231..1962279 100644
--- a/core/profiles/standard/config/install/block.block.bartik_powered.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_powered.yml
@@ -6,19 +6,19 @@ langcode: en
 region: footer
 plugin: system_powered_by_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_powered_by_block
   label: 'Powered by Drupal'
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 7b00a70..1fec301 100644
--- a/core/profiles/standard/config/install/block.block.bartik_search.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_search.yml
@@ -6,19 +6,19 @@ langcode: en
 region: sidebar_first
 plugin: search_form_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: search_form_block
   label: Search
   provider: search
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - search
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 12efff1..6e6b7e4 100644
--- a/core/profiles/standard/config/install/block.block.bartik_tools.yml
+++ b/core/profiles/standard/config/install/block.block.bartik_tools.yml
@@ -6,19 +6,19 @@ langcode: en
 region: sidebar_first
 plugin: 'system_menu_block:tools'
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: 'system_menu_block:tools'
   label: Tools
   provider: system
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   entity:
     - system.menu.tools
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 844a546..cfc69f1 100644
--- a/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml
+++ b/core/profiles/standard/config/install/block.block.seven_breadcrumbs.yml
@@ -6,19 +6,19 @@ langcode: en
 region: '-1'
 plugin: system_breadcrumb_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_breadcrumb_block
   label: Breadcrumbs
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 ec7a432..bfdbf8c 100644
--- a/core/profiles/standard/config/install/block.block.seven_content.yml
+++ b/core/profiles/standard/config/install/block.block.seven_content.yml
@@ -6,19 +6,19 @@ langcode: en
 region: content
 plugin: system_main_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_main_block
   label: 'Main page content'
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 f54a908..245077f 100644
--- a/core/profiles/standard/config/install/block.block.seven_help.yml
+++ b/core/profiles/standard/config/install/block.block.seven_help.yml
@@ -6,19 +6,19 @@ langcode: en
 region: help
 plugin: system_help_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: system_help_block
   label: 'System Help'
   provider: system
   label_display: '0'
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - system
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 9f4578c..430da80 100644
--- a/core/profiles/standard/config/install/block.block.seven_login.yml
+++ b/core/profiles/standard/config/install/block.block.seven_login.yml
@@ -6,19 +6,19 @@ langcode: en
 region: content
 plugin: user_login_block
 settings:
+  visibility:
+    request_path:
+      id: request_path
+      pages: ''
+    user_role:
+      id: user_role
+      roles: {  }
+    node_type:
+      id: node_type
+  id: user_login_block
   label: 'User login'
   provider: user
   label_display: visible
-visibility:
-  path:
-    visibility: 0
-    pages: ''
-  role:
-    roles: {  }
-  node_type:
-    types:
-      article: '0'
-      page: '0'
 dependencies:
   module:
     - user
diff --git a/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
new file mode 100644
index 0000000..dc676c5
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Condition/ConditionAccessResolverTraitTest.php
@@ -0,0 +1,107 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\Condition\ConditionAccessResolverTraitTest.
+ */
+
+namespace Drupal\Tests\Core\Condition;
+
+use Drupal\Core\Condition\ConditionAccessResolverTrait;
+use Drupal\Component\Plugin\Exception\PluginException;
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * Tests resolving a set of conditions.
+ *
+ * @coversDefaultClass \Drupal\Core\Condition\ConditionAccessResolverTrait
+ *
+ * @group Drupal
+ * @group Condition
+ */
+class ConditionAccessResolverTraitTest extends UnitTestCase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function getInfo() {
+    return array(
+      'name' => 'Tests resolving a set of conditions',
+      'description' => '',
+      'group' => 'Condition',
+    );
+  }
+
+  /**
+   * Tests the resolveConditions() method.
+   *
+   * @covers ::resolveConditions
+   *
+   * @dataProvider providerTestResolveConditions
+   */
+  public function testResolveConditions($conditions, $logic, $expected) {
+    $trait_object = new TestConditionAccessResolverTrait();
+    $this->assertEquals($expected, $trait_object->resolveConditions($conditions, $logic));
+  }
+
+  public function providerTestResolveConditions() {
+    $data = array();
+
+    $condition_true = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_true->expects($this->any())
+      ->method('execute')
+      ->will($this->returnValue(TRUE));
+    $condition_false = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_false->expects($this->any())
+      ->method('execute')
+      ->will($this->returnValue(FALSE));
+    $condition_exception = $this->getMock('Drupal\Core\Condition\ConditionInterface');
+    $condition_exception->expects($this->any())
+      ->method('execute')
+      ->will($this->throwException(new PluginException()));
+
+    $conditions = array();
+    $data[] = array($conditions, 'and', TRUE);
+    $data[] = array($conditions, 'or', FALSE);
+
+    $conditions = array($condition_false);
+    $data[] = array($conditions, 'or', FALSE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_true);
+    $data[] = array($conditions, 'or', TRUE);
+    $data[] = array($conditions, 'and', TRUE);
+
+    $conditions = array($condition_true, $condition_false);
+    $data[] = array($conditions, 'or', TRUE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_exception);
+    $data[] = array($conditions, 'or', FALSE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_true, $condition_exception);
+    $data[] = array($conditions, 'or', TRUE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_exception, $condition_true);
+    $data[] = array($conditions, 'or', TRUE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_false, $condition_exception);
+    $data[] = array($conditions, 'or', FALSE);
+    $data[] = array($conditions, 'and', FALSE);
+
+    $conditions = array($condition_exception, $condition_false);
+    $data[] = array($conditions, 'or', FALSE);
+    $data[] = array($conditions, 'and', FALSE);
+    return $data;
+  }
+
+}
+
+class TestConditionAccessResolverTrait {
+  use \Drupal\Core\Condition\ConditionAccessResolverTrait {
+    resolveConditions as public;
+  }
+}
diff --git a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
index d162042..fa7c80c 100644
--- a/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
+++ b/core/tests/Drupal/Tests/Core/Plugin/ContextHandlerTest.php
@@ -16,7 +16,7 @@
 /**
  * Tests the ContextHandler class.
  *
- * @coversDefaultClass \Drupal\Core\Plugin\ContextHandler
+ * @coversDefaultClass \Drupal\Core\Plugin\Context\ContextHandler
  *
  * @group Drupal
  * @group Plugin
