Loading browser/components/preferences/in-content/findInPage.js +12 −15 Original line number Diff line number Diff line Loading @@ -39,22 +39,20 @@ var gSearchResultsPane = { }, /** * Check that the passed string matches the filter arguments. * Check that the text content contains the query string. * * @param String str * to search for filter words in. * @param String filter * is a string containing all of the words to filter on. * @param String content * the text content to be searched * @param String query * the query string * @returns boolean * true when match in string else false * true when the text content contains the query string else false */ stringMatchesFilters(str, filter) { if (!filter || !str) { queryMatchesContent(content, query) { if (!content || !query) { return false; } let searchStr = str.toLowerCase(); let filterStrings = filter.toLowerCase().split(/\s+/); return !filterStrings.some(f => searchStr.indexOf(f) == -1); return content.toLowerCase().includes(query.toLowerCase()); }, categoriesInitialized: false, Loading Loading @@ -350,7 +348,6 @@ var gSearchResultsPane = { nodeObject.tagName == "description" || nodeObject.tagName == "menulist") { let simpleTextNodes = this.textNodeDescendants(nodeObject); for (let node of simpleTextNodes) { let result = this.highlightMatches([node], [node.length], node.textContent.toLowerCase(), searchPhrase); matchesFound = matchesFound || result; Loading @@ -376,15 +373,15 @@ var gSearchResultsPane = { 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); let labelResult = this.queryMatchesContent(nodeObject.getAttribute("label"), searchPhrase); // Searching some elements, such as xul:label, store their user-visible text in a "value" attribute. // 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; this.queryMatchesContent(nodeObject.getAttribute("value"), searchPhrase) : false; // Searching some elements, such as xul:button, buttons to open subdialogs. let keywordsResult = this.stringMatchesFilters(nodeObject.getAttribute("searchkeywords"), searchPhrase); let keywordsResult = this.queryMatchesContent(nodeObject.getAttribute("searchkeywords"), searchPhrase); // Creating tooltips for buttons if (keywordsResult && (nodeObject.tagName === "button" || nodeObject.tagName == "menulist")) { Loading browser/components/preferences/in-content/main.xul +1 −0 Original line number Diff line number Diff line Loading @@ -581,6 +581,7 @@ &backgroundColor2.label; &useSystemColors.label; &underlineLinks.label; &links; &linkColor2.label; &visitedLinkColor2.label;"/> </hbox> Loading browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_4.js +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set location permissions", "permissionsGroup"); await evaluateSearchResults("location permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_8.js +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set camera permissions", "permissionsGroup"); await evaluateSearchResults("camera permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); Loading @@ -23,7 +23,7 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set microphone permissions", "permissionsGroup"); await evaluateSearchResults("microphone permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); Loading @@ -32,6 +32,6 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set notifications permissions", "permissionsGroup"); await evaluateSearchResults("notification permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); Loading
browser/components/preferences/in-content/findInPage.js +12 −15 Original line number Diff line number Diff line Loading @@ -39,22 +39,20 @@ var gSearchResultsPane = { }, /** * Check that the passed string matches the filter arguments. * Check that the text content contains the query string. * * @param String str * to search for filter words in. * @param String filter * is a string containing all of the words to filter on. * @param String content * the text content to be searched * @param String query * the query string * @returns boolean * true when match in string else false * true when the text content contains the query string else false */ stringMatchesFilters(str, filter) { if (!filter || !str) { queryMatchesContent(content, query) { if (!content || !query) { return false; } let searchStr = str.toLowerCase(); let filterStrings = filter.toLowerCase().split(/\s+/); return !filterStrings.some(f => searchStr.indexOf(f) == -1); return content.toLowerCase().includes(query.toLowerCase()); }, categoriesInitialized: false, Loading Loading @@ -350,7 +348,6 @@ var gSearchResultsPane = { nodeObject.tagName == "description" || nodeObject.tagName == "menulist") { let simpleTextNodes = this.textNodeDescendants(nodeObject); for (let node of simpleTextNodes) { let result = this.highlightMatches([node], [node.length], node.textContent.toLowerCase(), searchPhrase); matchesFound = matchesFound || result; Loading @@ -376,15 +373,15 @@ var gSearchResultsPane = { 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); let labelResult = this.queryMatchesContent(nodeObject.getAttribute("label"), searchPhrase); // Searching some elements, such as xul:label, store their user-visible text in a "value" attribute. // 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; this.queryMatchesContent(nodeObject.getAttribute("value"), searchPhrase) : false; // Searching some elements, such as xul:button, buttons to open subdialogs. let keywordsResult = this.stringMatchesFilters(nodeObject.getAttribute("searchkeywords"), searchPhrase); let keywordsResult = this.queryMatchesContent(nodeObject.getAttribute("searchkeywords"), searchPhrase); // Creating tooltips for buttons if (keywordsResult && (nodeObject.tagName === "button" || nodeObject.tagName == "menulist")) { Loading
browser/components/preferences/in-content/main.xul +1 −0 Original line number Diff line number Diff line Loading @@ -581,6 +581,7 @@ &backgroundColor2.label; &useSystemColors.label; &underlineLinks.label; &links; &linkColor2.label; &visitedLinkColor2.label;"/> </hbox> Loading
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_4.js +1 −1 Original line number Diff line number Diff line Loading @@ -21,6 +21,6 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set location permissions", "permissionsGroup"); await evaluateSearchResults("location permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); });
browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_8.js +3 −3 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set camera permissions", "permissionsGroup"); await evaluateSearchResults("camera permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); Loading @@ -23,7 +23,7 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set microphone permissions", "permissionsGroup"); await evaluateSearchResults("microphone permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); }); Loading @@ -32,6 +32,6 @@ add_task(async function() { */ add_task(async function() { await openPreferencesViaOpenPreferencesAPI("paneGeneral", {leaveOpen: true}); await evaluateSearchResults("set notifications permissions", "permissionsGroup"); await evaluateSearchResults("notification permissions", "permissionsGroup"); await BrowserTestUtils.removeTab(gBrowser.selectedTab); });