From 77a9ea02cac92ff9a1d03136652591fc5be68dda Mon Sep 17 00:00:00 2001
From: Alex Pott <alex.a.pott@googlemail.com>
Date: Thu, 24 Jul 2014 14:23:04 +0100
Subject: [PATCH] Issue #1800614 by falcon03, mgifford, LinL | jessebeach:
 Improve the responsive toolbar accessibility.

---
 .../toolbar/templates/toolbar.html.twig        | 18 ++++++++++--------
 core/modules/toolbar/toolbar.module            |  8 +++++---
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/core/modules/toolbar/templates/toolbar.html.twig b/core/modules/toolbar/templates/toolbar.html.twig
index bcd33640ea66..4572b9d7543d 100644
--- a/core/modules/toolbar/templates/toolbar.html.twig
+++ b/core/modules/toolbar/templates/toolbar.html.twig
@@ -22,24 +22,26 @@
  * @ingroup themeable
  */
 #}
-<nav{{ attributes }}>
-  <div{{ toolbar_attributes }}>
+<div{{ attributes }}>
+  <nav{{ toolbar_attributes }}>
     <h2 class="visually-hidden">{{ toolbar_heading }}</h2>
     {% for tab in tabs %}
       <div{{ tab.attributes }}>{{ tab.link }}</div>
     {% endfor %}
-  </div>
+  </nav>
   {% for tray in trays %}
     {% spaceless %}
     <div{{ tray.attributes }}>
-      <div class="toolbar-lining clearfix">
-        {% if tray.label %}
+    {% if tray.label %}
+      <nav class="toolbar-lining clearfix" role="navigation" aria-label="{{ tray.label }}">
           <h3 class="toolbar-tray-name visually-hidden">{{ tray.label }}</h3>
-        {% endif %}
+    {% else %}
+      <nav class="toolbar-lining clearfix" role="navigation">
+    {% endif %}
         {{ tray.links }}
-      </div>
+      </nav>
     </div>
     {% endspaceless %}
   {% endfor %}
   {{ remainder }}
-</nav>
+</div>
diff --git a/core/modules/toolbar/toolbar.module b/core/modules/toolbar/toolbar.module
index c80387238cf2..d8e536339808 100644
--- a/core/modules/toolbar/toolbar.module
+++ b/core/modules/toolbar/toolbar.module
@@ -79,15 +79,17 @@ function toolbar_element_info() {
       // tests listing which produces a checkbox with attribute id="toolbar"
       'id' => 'toolbar-administration',
       'class' => array('toolbar'),
-      'role' => 'navigation',
-      'aria-label' => t('Site administration'),
+      'role' => 'group',
+      'aria-label' => t('Site administration toolbar'),
     ),
     // Metadata for the administration bar.
     '#bar' => array(
       '#heading' => t('Toolbar items'),
       '#attributes' => array(
         'id' => 'toolbar-bar',
-        'class' => array('toolbar-bar', 'clearfix'),
+        'class' => array('toolbar-bar', 'clearfix',),
+        'role' => 'navigation',
+        'aria-label' => t('Toolbar items'),
       ),
     ),
   );
-- 
GitLab