From 60260f2874aafd201ec2edcb93d7b03df81e8882 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?"J.=20Rene=CC=81e=20Beach"?= Date: Wed, 24 Jul 2013 11:38:36 -0400 Subject: [PATCH] Issue #2047175 by jessebeach: Make the status message field discoverable by assistive technology agents; alert AT agent users to error messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: J. ReneĢe Beach --- core/includes/theme.inc | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/core/includes/theme.inc b/core/includes/theme.inc index 7bff76e..d6c81e0 100644 --- a/core/includes/theme.inc +++ b/core/includes/theme.inc @@ -1629,10 +1629,22 @@ function theme_status_messages($variables) { 'warning' => t('Warning message'), ); foreach (drupal_get_messages($display) as $type => $messages) { - $output .= "
\n"; + $output .= "
\n"; + $output .= " aria-label=\"{$status_heading[$type]}\""; + } + + $output .= ">\n"; + + // Add an ARIA role of alert to an inner wrapping div in order to prompt + // an assistive technology user agent to announce the error. + if ($type === 'error') { + $output .= "
\n"; } + if (count($messages) > 1) { $output .= "
    \n"; foreach ($messages as $message) { @@ -1643,6 +1655,10 @@ function theme_status_messages($variables) { else { $output .= $messages[0]; } + // Close the ARIA error alert div. + if ($type === 'error') { + $output .= "
\n"; + } $output .= "
\n"; } return $output; -- 1.7.10.4