diff --git a/mozilla/modules/libpref/src/init/all.js b/mozilla/modules/libpref/src/init/all.js
index bc110ec7a4d..7a13f5e8012 100644
--- a/mozilla/modules/libpref/src/init/all.js
+++ b/mozilla/modules/libpref/src/init/all.js
@@ -180,6 +180,9 @@ pref("browser.frames.enabled", true);
// form submission
pref("browser.forms.submit.backwards_compatible", true);
+// Number of characters to consider emphasizing for rich autocomplete results
+pref("toolkit.autocomplete.richBoundaryCutoff", 200);
+
pref("toolkit.scrollbox.smoothScroll", true);
pref("toolkit.scrollbox.scrollIncrement", 20);
pref("toolkit.scrollbox.clickToScroll.scrollDelay", 150);
diff --git a/mozilla/toolkit/content/widgets/autocomplete.xml b/mozilla/toolkit/content/widgets/autocomplete.xml
index ccec57c3dc2..b7cf394d532 100644
--- a/mozilla/toolkit/content/widgets/autocomplete.xml
+++ b/mozilla/toolkit/content/widgets/autocomplete.xml
@@ -1115,12 +1115,7 @@
-# note, we rely on the newlines here so that we have
-# a textNode before and after the span. see _setUpDescription()
-# for more details
-
+
@@ -1130,12 +1125,7 @@
-# note, we rely on the newlines here so that we have
-# a textNode before and after the span. see _setUpDescription()
-# for more details
-
-
-
+
@@ -1192,33 +1182,130 @@
+ null
+
+
+
+
+
+
+
+
+
+
+
+ = 0) {
+ // Start the next search from where this one finished
+ startIndex = matchIndex + searchLen;
+ regions.push([matchIndex, startIndex]);
+ }
+ }
+
+ // Sort the regions by start position then end position
+ regions = regions.sort(function(a, b) let (start = a[0] - b[0])
+ start == 0 ? a[1] - b[1] : start);
+
+ // Generate the boundary indices from each region
+ let start = 0;
+ let end = 0;
+ let boundaries = [];
+ let len = regions.length;
+ for (let i = 0; i < len; i++) {
+ // We have a new boundary if the start of the next is past the end
+ let region = regions[i];
+ if (region[0] > end) {
+ // First index is the beginning of match
+ boundaries.push(start);
+ // Second index is the beginning of non-match
+ boundaries.push(end);
+
+ // Track the new region now that we've stored the previous one
+ start = region[0];
+ }
+
+ // Push back the end index for the current or new region
+ end = Math.max(end, region[1]);
+ }
+
+ // Add the last region
+ boundaries.push(start);
+ boundaries.push(end);
+
+ // Put on the end boundary if necessary
+ if (end < aText.length)
+ boundaries.push(aText.length);
+
+ // Skip the first item because it's always 0
+ return boundaries.slice(1);
+ ]]>
+
+
+
+
+
+
+
+
+
+
-
-
@@ -1227,7 +1314,6 @@