Bug 1530015, remove box object usage from preferences page find, and instead iterate over anonymous nodes, r=jaws
authorNeil Deakin <neil@mozilla.com>
Fri, 01 Mar 2019 12:27:01 -0500
changeset 519981 bc5daa250f8a86bde24db54e9b242b98c3560777
parent 519980 aa8dea3c0f43cf09a7edb3b1573d0657df3a1c3a
child 519982 63908a1890a03509eb8176562b46fa484b71673e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1530015
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1530015, remove box object usage from preferences page find, and instead iterate over anonymous nodes, r=jaws
browser/components/preferences/in-content/findInPage.js
--- a/browser/components/preferences/in-content/findInPage.js
+++ b/browser/components/preferences/in-content/findInPage.js
@@ -335,24 +335,31 @@ 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;
       }
 
-      // Collecting data from boxObject / label / description
+      // Collecting data from anonymous content / label / description
       let nodeSizes = [];
       let allNodeText = "";
       let runningSize = 0;
-      let accessKeyTextNodes = this.textNodeDescendants(nodeObject.boxObject);
+
+      let accessKeyTextNodes = [];
+      let anons = document.getAnonymousNodes(nodeObject);
+      if (anons) {
+        for (let anon of anons) {
+          accessKeyTextNodes.push(...this.textNodeDescendants(anon));
+        }
+      }
 
       if (nodeObject.tagName == "label" || nodeObject.tagName == "description") {
-        accessKeyTextNodes.push(...this.textNodeDescendants(nodeObject));
+        accessKeyTextNodes.push(...simpleTextNodes);
       }
 
       for (let node of accessKeyTextNodes) {
         runningSize += node.textContent.length;
         allNodeText += node.textContent;
         nodeSizes.push(runningSize);
       }