Index: misc/autocomplete.js =================================================================== RCS file: /cvs/drupal/drupal/misc/autocomplete.js,v retrieving revision 1.37 diff -u -p -r1.37 autocomplete.js --- misc/autocomplete.js 13 Jun 2010 05:31:02 -0000 1.37 +++ misc/autocomplete.js 7 Nov 2010 22:06:49 -0000 @@ -15,6 +15,9 @@ Drupal.behaviors.autocomplete = { var input = $('#' + this.id.substr(0, this.id.length - 13)) .attr('autocomplete', 'OFF')[0]; $(input.form).submit(Drupal.autocompleteSubmit); + $(input).parent().attr('role', 'application'); + $(input).attr('aria-autocomplete', 'list'); + $(input).parent().append($('').attr('id', $(input).attr('id') + '-autocomplete-aria-live')); new Drupal.jsAC(input, acdb[uri]); }); } @@ -36,6 +39,7 @@ Drupal.autocompleteSubmit = function () Drupal.jsAC = function (input, db) { var ac = this; this.input = input; + this.ariaLive = $('#' + $(input).attr('id') + '-autocomplete-aria-live'); this.db = db; $(this.input) @@ -141,6 +145,7 @@ Drupal.jsAC.prototype.highlight = functi } $(node).addClass('selected'); this.selected = node; + $(this.ariaLive).html($(this.selected).html()); }; /** @@ -149,6 +154,7 @@ Drupal.jsAC.prototype.highlight = functi Drupal.jsAC.prototype.unhighlight = function (node) { $(node).removeClass('selected'); this.selected = false; + $(this.ariaLive).empty(); }; /** @@ -166,6 +172,7 @@ Drupal.jsAC.prototype.hidePopup = functi $(popup).fadeOut('fast', function () { $(popup).remove(); }); } this.selected = false; + $(this.ariaLive).empty(); }; /** @@ -217,6 +224,7 @@ Drupal.jsAC.prototype.found = function ( if (this.popup) { if (ul.children().size()) { $(this.popup).empty().append(ul).show(); + $(this.ariaLive).html(Drupal.t('Autocomplete popup')); } else { $(this.popup).css({ visibility: 'hidden' });