From d1df49f1d358b612c4ff3e142864476b8b49da4d Mon Sep 17 00:00:00 2001 From: "sspitzer@mozilla.org" Date: Tue, 4 Dec 2007 22:19:38 -0800 Subject: [PATCH] fix for bug #406355: New autocomplete has a11y issues The "faabar" wasn't friendly to screer readers, and would either just say what the user typed in the url bar or nothing at all. now, screen readers will read the title, url and type ("tag" or "bookmark") for each autocomplete result. r=gavin, a=blocking-firefox3+ --- browser/base/content/urlbarBindings.xml | 25 +++++++++++++++++++ .../chrome/browser/places/places.properties | 11 ++++++++ toolkit/content/widgets/autocomplete.xml | 21 +++++++++++++++- 3 files changed, 56 insertions(+), 1 deletion(-) diff --git a/browser/base/content/urlbarBindings.xml b/browser/base/content/urlbarBindings.xml index e348fe96d6f..70dd84f21ca 100644 --- a/browser/base/content/urlbarBindings.xml +++ b/browser/base/content/urlbarBindings.xml @@ -320,6 +320,12 @@ 0 + + Cc["@mozilla.org/intl/stringbundle;1"]. + getService(Ci.nsIStringBundleService). + createBundle("chrome://browser/locale/places/places.properties"); + + + + + + + + + ") to text to be spoke aloud + // by screen readers. convert "tag" and "bookmark" to the localized versions, + // but don't do anything for "favicon" (the default) + if (aType != "favicon") { + label += " " + this._bundle.GetStringFromName(aType + "ResultLabel"); + } + return label; + ]]> + + + diff --git a/browser/locales/en-US/chrome/browser/places/places.properties b/browser/locales/en-US/chrome/browser/places/places.properties index f008af2bd85..b8925f81378 100644 --- a/browser/locales/en-US/chrome/browser/places/places.properties +++ b/browser/locales/en-US/chrome/browser/places/places.properties @@ -106,3 +106,14 @@ recentTagsTitle=Recent Tags OrganizerQueryHistory=History OrganizerQueryDownloads=Downloads OrganizerQueryAllBookmarks=All Bookmarks + +# LOCALIZATION NOTE (tagResultLabel) : +# This is what we use to form the label (for screen readers) +# for url bar autocomplete results of type "tag" +# See createResultLabel() in urlbarBindings.xml +tagResultLabel=Tag +# LOCALIZATION NOTE (bookmarkResultLabel) : +# This is what we use to form the label (for screen readers) +# for url bar autocomplete results of type "bookmark" +# See createResultLabel() in urlbarBindings.xml +bookmarkResultLabel=Bookmark diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml index cac3dbae248..ec3906829f2 100644 --- a/toolkit/content/widgets/autocomplete.xml +++ b/toolkit/content/widgets/autocomplete.xml @@ -1092,7 +1092,7 @@ - + + + + ") is related to the class of the image, + // and is not "visible" text so don't use it for the label (for accessibility). + return title + " " + url; + ]]> + + + null