diff --git a/core/includes/menu.inc b/core/includes/menu.inc
index ef9f7e2..6a0bbfc 100644
--- a/core/includes/menu.inc
+++ b/core/includes/menu.inc
@@ -220,6 +220,12 @@
 const MENU_CONTEXT_INLINE = 0x0002;
 
 /**
+ * Internal menu flag: Local task should be displayed in page context for users
+ * who do not have access to contextual links.
+ */
+const MENU_CONTEXT_PAGE_FALLBACK = 0x0004;
+
+/**
  * @} End of "defgroup menu_context_types".
  */
 
@@ -1871,9 +1877,10 @@ function menu_local_tasks($level = 0) {
 
     // Get all tabs (also known as local tasks) and the root page.
     $result = db_select('menu_router', NULL, array('fetch' => PDO::FETCH_ASSOC))
+      ->addTag('menu_local_tasks')
       ->fields('menu_router')
       ->condition('tab_root', $router_item['tab_root'])
-      ->condition('context', MENU_CONTEXT_INLINE, '<>')
+      ->where('context = 0 OR (context & ' . (MENU_CONTEXT_PAGE | MENU_CONTEXT_PAGE_FALLBACK) . ') > 0')
       ->orderBy('weight')
       ->orderBy('title')
       ->execute();
@@ -2121,8 +2128,7 @@ function menu_contextual_links($module, $parent_path, $args) {
     $data[$root_path] = db_select('menu_router', 'm')
       ->fields('m')
       ->condition('tab_parent', $router_item['tab_root'])
-      ->condition('context', MENU_CONTEXT_NONE, '<>')
-      ->condition('context', MENU_CONTEXT_PAGE, '<>')
+      ->where('(context & ' . MENU_CONTEXT_INLINE . ') > 0')
       ->orderBy('weight')
       ->orderBy('title')
       ->execute()
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index 76e39ba..14fecb7 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -5,6 +5,8 @@
  * Adds contextual links to perform actions related to elements on a page.
  */
 
+use Drupal\Core\Database\Query\SelectInterface;
+
 /**
  * Implements hook_toolbar().
  */
@@ -224,3 +226,9 @@ function contextual_pre_render_links($element) {
   return $element;
 }
 
+function contextual_query_menu_local_tasks_alter(SelectInterface $query) {
+  if (user_access('access contextual links')) {
+    $query->where('context = 0 OR (context & ' . MENU_CONTEXT_PAGE . ') > 0');
+  }
+}
+
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index ff073ae..c2880e6 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1769,7 +1769,7 @@ function node_menu() {
     'access arguments' => array('update', 1),
     'weight' => 0,
     'type' => MENU_LOCAL_TASK,
-    'context' => MENU_CONTEXT_INLINE,
+    'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE_FALLBACK,
     'file' => 'node.pages.inc',
   );
   $items['node/%node/delete'] = array(
diff --git a/core/modules/system/system.api.php b/core/modules/system/system.api.php
index 484ee93..07e693c 100644
--- a/core/modules/system/system.api.php
+++ b/core/modules/system/system.api.php
@@ -819,20 +819,21 @@ function hook_menu_get_item_alter(&$router_item, $path, $original_map) {
  *     this menu item (as a result of other properties), then the menu link is
  *     always expanded, equivalent to its 'always expanded' checkbox being set
  *     in the UI.
- *   - "context": (optional) Defines the context a tab may appear in. By
- *     default, all tabs are only displayed as local tasks when being rendered
- *     in a page context. All tabs that should be accessible as contextual links
- *     in page region containers outside of the parent menu item's primary page
- *     context should be registered using one of the following contexts:
- *     - MENU_CONTEXT_PAGE: (default) The tab is displayed as local task for the
- *       page context only.
- *     - MENU_CONTEXT_INLINE: The tab is displayed as contextual link outside of
- *       the primary page context only.
+ *   - "context": (optional) One or a combination of the following contexts:
+ *     - MENU_CONTEXT_PAGE: (default) The tab is displayed as a local task.
+ *     - MENU_CONTEXT_INLINE: The tab is displayed as a contextual link.
+ *     - MENU_CONTEXT_PAGE_FALLBACK: The tab is displayed as a local task only
+ *       for users unable to access contextual links.
  *     Contexts can be combined. For example, to display a tab both on a page
  *     and inline, a menu router item may specify:
  *     @code
  *       'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
  *     @endcode
+ *     Or, to display a tab as inline and also on a page for users who cannot
+ *     access inline tabs, a menu router item may specify:
+ *     @code
+ *       'context' => MENU_CONTEXT_INLINE | MENU_CONTEXT_PAGE_FALLBACK,
+ *     @endcode
  *   - "tab_parent": For local task menu items, the path of the task's parent
  *     item; defaults to the same path without the last component (e.g., the
  *     default parent for 'admin/people/create' is 'admin/people').
