Bug 1369704 - Menulist items aren't highlighted r?mconley
MozReview-Commit-ID: 3rrWq4zhBhF
--- 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