diff --git a/core/lib/Drupal/Component/Plugin/Context/ContextInterface.php b/core/lib/Drupal/Component/Plugin/Context/ContextInterface.php
index ab092ed..754b65e 100644
--- a/core/lib/Drupal/Component/Plugin/Context/ContextInterface.php
+++ b/core/lib/Drupal/Component/Plugin/Context/ContextInterface.php
@@ -8,7 +8,30 @@
 namespace Drupal\Component\Plugin\Context;
 
 /**
- * A generic context interface for wrapping data a plugin needs to operate.
+ * Interface for Drupal-specific plugin context management.
+ *
+ * Contexts are very similar to dependency injection but they have a human
+ * readable name and other features usable on the UI. Contexts must have a
+ * definition and might have a value.
+ *
+ * For example, when a block is configured to be visible on a page displaying a
+ * node of a particular type, the condition plugin needs a node to check its
+ * type. In a typical page flow, this is supplied by the routing system when
+ * on a node page but it could equally come from a views result etc. The
+ * condition plugin is implemented as a context aware plugin. The plugin
+ * context is set by
+ * \Drupal\Component\Plugin\ContextAwarePluginBase::setContext(). The
+ * $context argument passed to setContext() needs to have
+ * $this->getContextDefinition()->getDataType() == 'entity:node' as defined
+ * on the \Drupal\node\Plugin\Condition\NodeType plugin annotation otherwise
+ * the NodeType plugin will not be considered for UI or runtime purposes.
+ *
+ * When in the UI, this context is enough. However, when actually checking a
+ * block visibility then a node is required by the NodeType plugin, this is the
+ * value of the context as set by the setContextValue() on this interface. For
+ * the example above,
+ * \Drupal\block\EventSubscriber\NodeRouteContext::determineBlockContext sets
+ * the "node" context together with an appropriate value.
  */
 interface ContextInterface {
 
diff --git a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php
index cf1a470..9fb1d2a 100644
--- a/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php
+++ b/core/lib/Drupal/Core/DependencyInjection/Compiler/RegisterKernelListenersPass.php
@@ -19,7 +19,6 @@ public function process(ContainerBuilder $container) {
     $definition = $container->getDefinition('event_dispatcher');
 
     $event_subscriber_info = [];
-    $priority = [];
     foreach ($container->findTaggedServiceIds('event_subscriber') as $id => $attributes) {
 
       // We must assume that the class value has been correctly filled, even if the service is created by a factory
@@ -34,23 +33,28 @@ public function process(ContainerBuilder $container) {
       // Get all subscribed events.
       foreach ($class::getSubscribedEvents() as $event_name => $params) {
         if (is_string($params)) {
-          $event_subscriber_info[$event_name][] = array($id, $params);
-          $priority[$event_name][] = 0;
+          $priority = 0;
+          $event_subscriber_info[$event_name][$priority][] = array($id, $params, $priority);
         }
         elseif (is_string($params[0])) {
-          $event_subscriber_info[$event_name][] = array($id, $params[0]);
-          $priority[$event_name][] = isset($params[1]) ? $params[1] : 0;
+          $priority = isset($params[1]) ? $params[1] : 0;
+          $event_subscriber_info[$event_name][$priority][] = array($id, $params[0], $priority);
         }
         else {
           foreach ($params as $listener) {
-            $event_subscriber_info[$event_name][] = array($id, $listener[0]);
-            $priority[$event_name][] = isset($listener[1]) ? $listener[1] : 0;
+            $priority = isset($listener[1]) ? $listener[1] : 0;
+            $event_subscriber_info[$event_name][$priority][] = array($id, $listener[0], $priority);
           }
         }
       }
     }
-    foreach ($priority as $event_name => $sort) {
-      array_multisort($sort, SORT_NUMERIC, SORT_DESC, $event_subscriber_info[$event_name]);
+    // It would be better if $event_subscriber_info would be a flat array of
+    // listeners and priorities would be stored in parallel and
+    // array_multisort'd together but right now event subscribers must run in
+    // the order they're defined in YAML when they have the same weight.
+    foreach (array_keys($event_subscriber_info) as $event_name) {
+      krsort($event_subscriber_info[$event_name]);
+      $event_subscriber_info[$event_name] = call_user_func_array('array_merge', $event_subscriber_info[$event_name]);
     }
     $definition->addArgument($event_subscriber_info);
   }
diff --git a/core/lib/Drupal/Core/EventSubscriber/AccessRouteSubscriber.php b/core/lib/Drupal/Core/EventSubscriber/AccessRouteSubscriber.php
index 240073b..66798c2 100644
--- a/core/lib/Drupal/Core/EventSubscriber/AccessRouteSubscriber.php
+++ b/core/lib/Drupal/Core/EventSubscriber/AccessRouteSubscriber.php
@@ -51,7 +51,6 @@ public function onRoutingRouteAlterSetAccessCheck(RouteBuildEvent $event) {
    * @return array
    *   An array of event listener definitions.
    */
-  static function getSubscribedEvents() {
     // Setting very low priority to ensure access checks are run after alters.
     $events[RoutingEvents::ALTER][] = array('onRoutingRouteAlterSetAccessCheck', -1000);
 
