Index: modules/search/search.module =================================================================== RCS file: /cvs/drupal/drupal/modules/search/search.module,v retrieving revision 1.303 diff -u -p -r1.303 search.module --- modules/search/search.module 23 Jul 2009 20:58:26 -0000 1.303 +++ modules/search/search.module 16 Aug 2009 22:46:42 -0000 @@ -1106,6 +1106,17 @@ function search_box(&$form_state, $form_ '#default_value' => '', '#attributes' => array('title' => t('Enter the terms you wish to search for.')), ); + // Add an h2 heading to search_theme_form, not search_block_form which already + // get an h2 in block.tpl.php. Headings allow screen-reader and keyboard only + // users to navigate to or skip menus and content sections. This heading is + // invisible because the search form is visually apparent to sighted users. + // See http://www.webaim.org/techniques/css/invisiblecontent/ for information. + // Level h2 is appropriate (as opposed to h3 or h4) because, like navigation + // menus, the search often precedes or follows the page title or site title h1. + // See http://www.w3.org/TR/WCAG-TECHS/H69.html and H42.html for more info. + if ($form_id == 'search_theme_form') { + $form[$form_id]['#prefix'] = '

' . t('Search') . '

'; + } $form['submit'] = array('#type' => 'submit', '#value' => t('Search')); $form['#submit'][] = 'search_box_form_submit';