diff --git a/core/modules/book/book.module b/core/modules/book/book.module
index 106a57a..d368f6c 100644
--- a/core/modules/book/book.module
+++ b/core/modules/book/book.module
@@ -183,6 +183,7 @@ function book_menu() {
     'access callback' => '_book_outline_access',
     'access arguments' => array(1),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'weight' => 2,
     'file' => 'book.pages.inc',
   );
diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index 6f2795a..e9ad2e9 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -278,6 +278,7 @@ function comment_menu() {
     'page arguments' => array(1),
     'access arguments' => array('administer comments'),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEX_INLINE,
     'file' => 'comment.admin.inc',
     'weight' => 2,
   );
@@ -933,11 +934,6 @@ function comment_links(Comment $comment, Node $node) {
   $links = array();
   if ($node->comment == COMMENT_NODE_OPEN) {
     if (user_access('administer comments') && user_access('post comments')) {
-      $links['comment-delete'] = array(
-        'title' => t('delete'),
-        'href' => "comment/{$comment->id()}/delete",
-        'html' => TRUE,
-      );
       $links['comment-edit'] = array(
         'title' => t('edit'),
         'href' => "comment/{$comment->id()}/edit",
diff --git a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
index dab8dc4..26d7b10 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentRenderController.php
@@ -99,6 +99,10 @@ protected function alterBuild(array &$build, EntityInterface $comment, EntityDis
         $build['#suffix'] = str_repeat('</div>', $comment->divs_final);
       }
     }
+
+    if (!empty($comment->cid)) {
+      $build['#contextual_links']['comment'] = array('comment', array($comment->cid));
+    }
   }
 
 }
diff --git a/core/modules/contact/contact.module b/core/modules/contact/contact.module
index 6e22fe7..62b7b16 100644
--- a/core/modules/contact/contact.module
+++ b/core/modules/contact/contact.module
@@ -119,6 +119,7 @@ function contact_menu() {
     'page callback' => 'contact_personal_page',
     'page arguments' => array(1),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'access callback' => '_contact_personal_tab_access',
     'access arguments' => array(1),
     'weight' => 2,
diff --git a/core/modules/node/templates/node.tpl.php b/core/modules/node/templates/node.tpl.php
index 196d26f..c76d205 100644
--- a/core/modules/node/templates/node.tpl.php
+++ b/core/modules/node/templates/node.tpl.php
@@ -38,7 +38,7 @@
  *   appears in the template.
  * - $title_suffix (array): An array containing additional output populated by
  *   modules, intended to be displayed after the main title tag that appears in
- *   the template.
+ *   the template (such as contextual menus).
  *
  * Other variables:
  * - $node: Full node entity. Contains data that may not be safe.
diff --git a/core/modules/openid/openid.module b/core/modules/openid/openid.module
index 6d31124..86e9c56 100644
--- a/core/modules/openid/openid.module
+++ b/core/modules/openid/openid.module
@@ -30,6 +30,7 @@ function openid_menu() {
     'access callback' => 'entity_page_access',
     'access arguments' => array(1, 'update'),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'file' => 'openid.pages.inc',
   );
   $items['user/%user/openid/delete'] = array(
diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module
index 53da612..952d04a 100644
--- a/core/modules/shortcut/shortcut.module
+++ b/core/modules/shortcut/shortcut.module
@@ -148,6 +148,7 @@ function shortcut_menu() {
     'access callback' => 'shortcut_set_switch_access',
     'access arguments' => array(1),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'file' => 'shortcut.admin.inc',
   );
 
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php b/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php
index ce8cb03..6531f45 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/TermRenderController.php
@@ -54,6 +54,9 @@ protected function getBuildDefaults(EntityInterface $entity, $view_mode, $langco
   protected function alterBuild(array &$build, EntityInterface $entity, EntityDisplay $display, $view_mode, $langcode = NULL) {
     parent::alterBuild($build, $entity, $display, $view_mode, $langcode);
     $build['#attached']['css'][] = drupal_get_path('module', 'taxonomy') . '/taxonomy.css';
+    if (!empty($entity->tid)) {
+      $build['#contextual_links']['taxonomy'] = array('taxonomy/term', array($entity->tid));
+    }
   }
 
 }
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 4b1a2b1..0b1e866 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -300,6 +300,7 @@ function taxonomy_menu() {
     'access callback' => 'entity_page_access',
     'access arguments' => array(2, 'update'),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'weight' => 10,
     'file' => 'taxonomy.admin.inc',
   );
@@ -310,6 +311,7 @@ function taxonomy_menu() {
     'access callback' => 'entity_page_access',
     'access arguments' => array(2, 'delete'),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'weight' => 11,
     'file' => 'taxonomy.admin.inc',
   );
diff --git a/core/modules/taxonomy/templates/taxonomy-term.tpl.php b/core/modules/taxonomy/templates/taxonomy-term.tpl.php
index 712e83c..f044015 100644
--- a/core/modules/taxonomy/templates/taxonomy-term.tpl.php
+++ b/core/modules/taxonomy/templates/taxonomy-term.tpl.php
@@ -12,6 +12,9 @@
  *   given element.
  * - $url: Direct url of the current term.
  * - $label: Name of the current term.
+ * - $title_suffix (array): An array containing additional output populated
+ *   by modules, intended to be displayed after the main title tag that
+ *   appears in the template (such as contextual menus).
  * - $attributes: An instance of Attributes class that can be manipulated as an
  *    array and printed as a string.
  *    It includes the 'class' information, which includes:
@@ -42,6 +45,7 @@
   <?php if (!$page): ?>
     <h2><a href="<?php print $url; ?>"><?php print $label; ?></a></h2>
   <?php endif; ?>
+  <?php print render($title_suffix); ?>
 
   <div class="content">
     <?php print render($content); ?>
diff --git a/core/modules/tracker/tracker.module b/core/modules/tracker/tracker.module
index 30a0dbb..be3e809 100644
--- a/core/modules/tracker/tracker.module
+++ b/core/modules/tracker/tracker.module
@@ -60,6 +60,7 @@ function tracker_menu() {
     'access callback' => '_tracker_user_access',
     'access arguments' => array(1),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'file' => 'tracker.pages.inc',
   );
   $items['user/%user/track/content'] = array(
diff --git a/core/modules/translation/translation.module b/core/modules/translation/translation.module
index a864120..bcb9704 100644
--- a/core/modules/translation/translation.module
+++ b/core/modules/translation/translation.module
@@ -61,7 +61,7 @@ function translation_menu() {
     'access callback' => '_translation_tab_access',
     'access arguments' => array(1),
     'type' => MENU_LOCAL_TASK,
-    'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
+    'context' => MENU_CONTEXT_INLINE,
     'weight' => 2,
     'file' => 'translation.pages.inc',
   );
diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module
index e005b94..e59491a 100644
--- a/core/modules/translation_entity/translation_entity.module
+++ b/core/modules/translation_entity/translation_entity.module
@@ -151,7 +151,7 @@ function translation_entity_menu() {
         'page callback' => 'translation_entity_overview',
         'page arguments' => array($entity_position),
         'type' => MENU_LOCAL_TASK,
-        'context' => MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE,
+        'context' => MENU_CONTEXT_INLINE,
         'weight' => 2,
       ) + $item;
 
diff --git a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
index 21e914d..6dc6df5 100644
--- a/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
+++ b/core/modules/user/lib/Drupal/user/Plugin/Core/Entity/User.php
@@ -19,6 +19,7 @@
  *   label = @Translation("User"),
  *   module = "user",
  *   controller_class = "Drupal\user\UserStorageController",
+ *   render_controller_class = "Drupal\user\UserRenderController",
  *   access_controller_class = "Drupal\user\UserAccessController",
  *   form_controller_class = {
  *     "profile" = "Drupal\user\ProfileFormController",
diff --git a/core/modules/user/lib/Drupal/user/UserRenderController.php b/core/modules/user/lib/Drupal/user/UserRenderController.php
new file mode 100644
index 0000000..6aecf61
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/UserRenderController.php
@@ -0,0 +1,31 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\user\UserRenderController.
+ */
+
+namespace Drupal\user;
+
+use Drupal\Core\Entity\EntityInterface;
+use Drupal\Core\Entity\EntityRenderController;
+use Drupal\entity\Plugin\Core\Entity\EntityDisplay;
+
+/**
+ * Render controller for users.
+ */
+class UserRenderController extends EntityRenderController {
+
+  /**
+   * Overrides Drupal\Core\Entity\EntityRenderController::alterBuild().
+   */
+  protected function alterBuild(array &$build, EntityInterface $entity, EntityDisplay $display, $view_mode, $langcode = NULL) {
+    parent::alterBuild($build, $entity, $display, $view_mode, $langcode);
+    // Avoid contextual links on compact display, when the user information
+    // is present as part of some other content.
+    if (!empty($entity->uid) && $view_mode != 'compact') {
+      $build['#contextual_links']['user'] = array('user', array($entity->uid));
+    }
+  }
+
+}
diff --git a/core/modules/user/templates/user.tpl.php b/core/modules/user/templates/user.tpl.php
index 617d310..0758fdd 100644
--- a/core/modules/user/templates/user.tpl.php
+++ b/core/modules/user/templates/user.tpl.php
@@ -14,6 +14,9 @@
  *
  * Available variables:
  *   - $content: An array of content items. Use render() to print them.
+ *   - $title_suffix (array): An array containing additional output populated
+ *     by modules, intended to be displayed after the main title tag that
+ *     appears in the template (such as contextual menus).
  *   - Field variables: for each field instance attached to the user a
  *     corresponding variable is defined; e.g., $account->field_example has a
  *     variable $field_example defined. When needing to access a field's raw
@@ -27,6 +30,7 @@
  * @ingroup themeable
  */
 ?>
-<article class="profile"<?php print $attributes; ?>>
+<article class="<?php print $attributes['class']; ?> profile"<?php print $attributes; ?>>
+  <?php print render($title_suffix); ?>
   <?php print render($content); ?>
 </article>
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 19dc974..d7893e0 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1076,6 +1076,7 @@ function user_menu() {
     'access callback' => 'entity_page_access',
     'access arguments' => array(1, 'update'),
     'type' => MENU_LOCAL_TASK,
+    'context' => MENU_CONTEXT_INLINE,
     'file' => 'user.pages.inc',
   );
   return $items;
diff --git a/core/themes/bartik/templates/node.tpl.php b/core/themes/bartik/templates/node.tpl.php
index d32f9ac..9e814ee 100644
--- a/core/themes/bartik/templates/node.tpl.php
+++ b/core/themes/bartik/templates/node.tpl.php
@@ -38,7 +38,7 @@
  *   appears in the template.
  * - $title_suffix (array): An array containing additional output populated by
  *   modules, intended to be displayed after the main title tag that appears in
- *   the template.
+ *   the template (such as contextual menus).
  *
  * Other variables:
  * - $node: Full node entity. Contains data that may not be safe.
