Bug 640175 - Search criteria typed in URL Bar doesn't match with the history/Awesomelist content
authorLucas Rocha <lucasr@mozilla.com>
Mon, 01 Aug 2011 11:37:00 -0400
changeset 74056 fc0c60debaaea204df096d81668de3dac24ca070
parent 74055 08327218cb8bd31bd4b91993a63bde497a5f7842
child 74068 8f9746b88447b8990ef45da38791ba5369cec945
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
bugs640175
milestone8.0a1
Bug 640175 - Search criteria typed in URL Bar doesn't match with the history/Awesomelist content
mobile/components/AutoCompleteCache.js
mobile/locales/en-US/chrome/browser.dtd
--- a/mobile/components/AutoCompleteCache.js
+++ b/mobile/components/AutoCompleteCache.js
@@ -295,19 +295,23 @@ AutoCompleteCache.prototype = {
     let usedCache = false;
 
     if (AutoCompleteUtils.query == query && AutoCompleteUtils.cache) {
       // On a cache-hit, give the results right away and fetch in the background
       done(AutoCompleteUtils.cache, RESULT_CACHE);
       usedCache = true;
     } else if (prev) {
       // Otherwise, check if this is the same as the prev search,
-      // and if the previous search was null
+      // and if the previous search was null. We have to special
+      // case 'www.' here due to it being ignore in autocomplete
+      // searches (see bug 461483).
       let prevSearch = prev.searchString;
-      if (prev.matchCount == this.searchEngines.length && (query.indexOf(prevSearch) == 0)) {
+      if (prev.matchCount == this.searchEngines.length &&
+          prevSearch !== "www." &&
+          (query.indexOf(prevSearch) == 0)) {
         done(new cacheResult(query, []), RESULT_NEW);
         usedCache = true;
       }
     }
 
     // Only start a fetch if we think we actually need to update the cache
     if (!usedCache)
       AutoCompleteUtils.fetch(query, done);
--- a/mobile/locales/en-US/chrome/browser.dtd
+++ b/mobile/locales/en-US/chrome/browser.dtd
@@ -99,17 +99,17 @@
 <!ENTITY contextBookmarkLink.label    "Bookmark Link">
 <!ENTITY contextSaveVideo.label       "Save Video">
 <!ENTITY contextShareVideo.label      "Share Video">
 <!ENTITY contextPlayMedia.label       "Play">
 <!ENTITY contextPauseMedia.label      "Pause">
 <!ENTITY contextFullScreen.label      "Full Screen">
 <!ENTITY contextEditBookmark.label    "Edit">
 <!ENTITY contextRemoveBookmark.label  "Remove">
-<!ENTITY contextShortcutBookmark.label "Add Shortcut to Home">
+<!ENTITY contextShortcutBookmark.label "Add to Home Screen">
 
 <!ENTITY pageactions.saveas.pdf      "Save As PDF">
 <!ENTITY pageactions.share.page      "Share Page">
 <!ENTITY pageactions.password.forget "Forget Password">
 <!ENTITY pageactions.quit            "Quit">
 <!ENTITY pageactions.reset           "Clear Site Preferences">
 <!ENTITY pageactions.findInPage      "Find In Page">
 <!ENTITY pageactions.search.addNew   "Add Search Engine">