Bug 1335905 - Add a preffed off search feature to about:preferences. r?jaws, r?mconley draft
authorFirefox <manotejmeka@gmail.com>
Thu, 16 Feb 2017 20:57:41 -0500
changeset 486798 824451f35ab9d3e3ef60bce0ae327763014c0d5e
parent 486797 4be0f69a012f9a66d75b90c907c6fa03ba96af4e
child 486799 5505de47dfe2b23248bebb300785b7b91f7888eb
push id46062
push userbmo:manotejmeka@gmail.com
push dateMon, 20 Feb 2017 00:32:40 +0000
reviewersjaws, mconley
bugs1335905
milestone54.0a1
Bug 1335905 - Add a preffed off search feature to about:preferences. r?jaws, r?mconley MozReview-Commit-ID: 2Nc65ar2COH
browser/components/preferences/in-content/SearchEach.js
--- a/browser/components/preferences/in-content/SearchEach.js
+++ b/browser/components/preferences/in-content/SearchEach.js
@@ -147,21 +147,18 @@ function nodeRecursion(nodeObject, searc
             // if (getLabelAttribute(nodeObject,word)){
             //     console.log(nodeObject)
             //     foundIn = true
             // }
         });
 
         //  Label tag that does not have textCont but text is in Value attr
         listOfWords.forEach(function(word) {
-            let boolAns = getValueAttribute(nodeObject, word);
+            let boolAns = getValueAttribute(nodeObject, word, findSelection);
             foundIn = foundIn || boolAns;
-            if (boolAns) {
-                searchWord(nodeObject, nodeObject.value, word, findSelection)
-            }
             // if (getLabelAttribute(nodeObject,word)){
             //     console.log(nodeObject)
             //     foundIn = true
             // }
         });
     }
     for (let i = 0; i < nodeObject.childElementCount; i++) {
         let boolAns = nodeRecursion(nodeObject.childNodes[i], searchPhrase, findSelection);
@@ -264,28 +261,28 @@ function getLabelAttribute(nodeObject, s
         // creatSpanTag.classList.add("search-bubble-text");
         // creatSpanTag.innerHTML = searchPhrase;
        //  nodeObject.appendChild(creatSpanTag);
         return true;
     }
     return false;
 }
 
-function getValueAttribute(nodeObject, searchPhrase) {
+function getValueAttribute(nodeObject, searchPhrase, findSelection) {
     if (typeof nodeObject.value == "string" && nodeObject.value != ""
     && stringMatchesFilters(nodeObject.value, searchPhrase)) {
         console.log("Found it in value", nodeObject);
-        nodeObject.textContent = nodeObject.value
-        nodeObject.innerHTML = nodeObject.value
+        //nodeObject.textContent = nodeObject.value
+        //nodeObject.innerHTML = nodeObject.value
         // nodeObject.classList.add("search-bubble");
 
-        // var creatSpanTag = document.createElement("span");
-        // creatSpanTag.classList.add("search-bubble-text");
-        // creatSpanTag.innerHTML = searchPhrase;
-       //  nodeObject.appendChild(creatSpanTag);
+        //var createTextNode = document.createTextNode(nodeObject.value);
+        //nodeObject.appendChild(createTextNode);
+        //console.log(nodeObject, nodeObject.childNodes[0])
+        //searchWord(nodeObject.childNodes[0], nodeObject.value, word, findSelection)
         return true;
     }
     return false;
 }
 
 
 function getSelectionController() {
     //  Yuck. See bug 138068.