Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.505
diff -u -p -r1.505 theme.inc
--- includes/theme.inc	17 Aug 2009 19:14:39 -0000	1.505
+++ includes/theme.inc	19 Aug 2009 02:54:57 -0000
@@ -1229,6 +1229,9 @@ function theme_placeholder($text) {
  * Return a themed set of status and/or error messages. The messages are grouped
  * by type.
  *
+ * An invisible heading identifies the messages for assistive technology. Sighted
+ * users see a colored box. See http://www.w3.org/TR/WCAG-TECHS/H69.html for info.
+ *
  * @param $display
  *   (optional) Set to 'status' or 'error' to display only messages of that type.
  *
@@ -1237,8 +1240,14 @@ function theme_placeholder($text) {
  */
 function theme_status_messages($display = NULL) {
   $output = '';
+  $status_heading = array(
+    'status' => t('Status message'),
+    'error' => t('Error message'),
+    'warning' => t('Warning message'),
+  );
   foreach (drupal_get_messages($display) as $type => $messages) {
     $output .= "<div class=\"messages $type\">\n";
+    $output .= '<h2 class="element-invisible">' . $status_heading[$type] . "</h2>\n";
     if (count($messages) > 1) {
       $output .= " <ul>\n";
       foreach ($messages as $message) {
