Bug 1369719 - Avoid searching value attribute in menuitem r?mconley
MozReview-Commit-ID: 1wDspUsCJVq
--- a/browser/components/preferences/in-content-new/findInPage.js
+++ b/browser/components/preferences/in-content-new/findInPage.js
@@ -288,17 +288,19 @@ var gSearchResultsPane = {
// Access key are presented
let complexTextNodesResult = this.highlightMatches(accessKeyTextNodes, nodeSizes, allNodeText.toLowerCase(), searchPhrase);
// Searching some elements, such as xul:button, have a 'label' attribute that contains the user-visible text.
let labelResult = this.stringMatchesFilters(nodeObject.getAttribute("label"), searchPhrase);
// Searching some elements, such as xul:label, store their user-visible text in a "value" attribute.
- let valueResult = this.stringMatchesFilters(nodeObject.getAttribute("value"), searchPhrase);
+ // Value will be skipped for menuitem since value in menuitem could represent index number to distinct each item.
+ let valueResult = nodeObject.tagName !== "menuitem" ?
+ this.stringMatchesFilters(nodeObject.getAttribute("value"), searchPhrase) : false;
// 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);
}