Bug 1302556 - Remove the workaround from FinderHighlighter.jsm. r=mikedeboer
authorMarkus Stange <mstange@themasta.com>
Tue, 13 Sep 2016 18:21:46 -0400
changeset 314321 7fb647a90a467cf90057d9153bf508d22719acb0
parent 314320 59935b389c879fb62c572f5283ec43b203a4edfb
child 314322 11f62de653a855b1e96c4e9460e5045917221cb5
push id30718
push userphilringnalda@gmail.com
push dateSat, 17 Sep 2016 20:44:56 +0000
treeherdermozilla-central@eaf5eb6f8fa0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmikedeboer
bugs1302556
milestone51.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 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