Bug 1302556 - Remove the workaround from FinderHighlighter.jsm. r=mikedeboer
MozReview-Commit-ID: hRErA7mmz3
--- 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