Bug 1369704 - Menulist items aren't highlighted r?mconley draft
authorRicky Chien <ricky060709@gmail.com>
Sun, 04 Jun 2017 12:52:21 +0800
changeset 589339 b0ebbaa250f3b1010b979a46f0a839d4f256af71
parent 589301 2c6289f56812c30254acfdddabcfec1e149c0336
child 631844 a34ce8d79716e4f53d91b1ab0a26cf9f3cbe6ca8
push id62334
push userbmo:rchien@mozilla.com
push dateTue, 06 Jun 2017 03:03:25 +0000
reviewersmconley
bugs1369704
milestone55.0a1
Bug 1369704 - Menulist items aren't highlighted r?mconley MozReview-Commit-ID: 3rrWq4zhBhF
browser/components/preferences/in-content-new/findInPage.js
--- a/browser/components/preferences/in-content-new/findInPage.js
+++ b/browser/components/preferences/in-content-new/findInPage.js
@@ -8,17 +8,17 @@ var gSearchResultsPane = {
   findSelection: null,
   listSearchTooltips: [],
   searchResultsCategory: null,
   searchInput: null,
 
   init() {
     let controller = this.getSelectionController();
     this.findSelection = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
-    this.findSelection.setColors("currentColor", "#ffe900", "currentColor", "#540ead");
+    this.findSelection.setColors("currentColor", "#ffe900", "currentColor", "#003eaa");
     this.searchResultsCategory = document.getElementById("category-search-results");
 
     this.searchInput = document.getElementById("searchInput");
     this.searchInput.hidden = !Services.prefs.getBoolPref("browser.preferences.search");
     if (!this.searchInput.hidden) {
       this.searchInput.addEventListener("command", this);
       this.searchInput.addEventListener("focus", this);
     }
@@ -298,17 +298,20 @@ var gSearchResultsPane = {
       // Searching some elements, such as xul:button, buttons to open subdialogs.
       let keywordsResult = this.stringMatchesFilters(nodeObject.getAttribute("searchkeywords"), searchPhrase);
 
       // Creating tooltips for buttons
       if (keywordsResult && nodeObject.tagName === "button") {
         this.listSearchTooltips.push(nodeObject);
       }
 
-      if (nodeObject.tagName == "button" && (labelResult || valueResult || keywordsResult)) {
+      if ((nodeObject.tagName == "button" ||
+           nodeObject.tagName == "menulist" ||
+           nodeObject.tagName == "menuitem") &&
+           (labelResult || valueResult || keywordsResult)) {
         nodeObject.setAttribute("highlightable", "true");
       }
 
       matchesFound = matchesFound || complexTextNodesResult || labelResult || valueResult || keywordsResult;
     }
 
     for (let i = 0; i < nodeObject.childNodes.length; i++) {
       // Search only if child node is not hidden