Bug 1302556 - Remove the workaround from FinderHighlighter.jsm. r=mikedeboer draft
authorMarkus Stange <mstange@themasta.com>
Tue, 13 Sep 2016 18:21:46 -0400
changeset 414612 7ab80f3e73bf57d922c063ba3969740ea24f273c
parent 414611 0cfaf085c9d97e57f322c7adf59a36ba9f4e5ff2
child 415748 1aac1a7fadf0f9450c0c6c13687619e6a073c502
push id29721
push userbmo:mstange@themasta.com
push dateFri, 16 Sep 2016 20:54:58 +0000
reviewersmikedeboer
bugs1302556
milestone51.0a1
Bug 1302556 - Remove the workaround from FinderHighlighter.jsm. r=mikedeboer MozReview-Commit-ID: hRErA7mmz3
toolkit/modules/FinderHighlighter.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -881,21 +881,18 @@ FinderHighlighter.prototype = {
       }
       dict.modalHighlightOutline = null;
     }
 
     // Abort when there's no text to highlight.
     if (!textContent.length)
       return;
 
-    let container, outlineBox;
+    let outlineBox;
     if (rebuildOutline) {
-      // The outline needs to be sitting inside a container, otherwise the anonymous
-      // content API won't find it by its ID later...
-      container = document.createElementNS(kNSHTML, "div");
       // Create the main (yellow) highlight outline box.
       outlineBox = document.createElementNS(kNSHTML, "div");
       outlineBox.setAttribute("id", kModalOutlineId);
     }
 
     const kModalOutlineTextId = kModalOutlineId + "-text";
     let i = 0;
     for (let rect of rects) {
@@ -930,21 +927,20 @@ FinderHighlighter.prototype = {
         // activate the transitions.
         outlineAnonNode.setAttributeForElement(kModalOutlineId, "style", outlineStyle);
         outlineAnonNode.setAttributeForElement(kModalOutlineTextId, "style", textStyle);
         outlineAnonNode.setTextContentForElement(kModalOutlineTextId, text);
       }
     }
 
     if (rebuildOutline) {
-      container.appendChild(outlineBox);
       dict.modalHighlightOutline = kDebug ?
         mockAnonymousContentNode((document.body ||
-          document.documentElement).appendChild(container.firstChild)) :
-        document.insertAnonymousContent(container);
+          document.documentElement).appendChild(outlineBox)) :
+        document.insertAnonymousContent(outlineBox);
     }
   },
 
   /**
    * Add a range to the list of ranges to highlight on, or cut out of, the dimmed
    * background.
    *
    * @param {nsIDOMRange}  range  Range object that should be inspected