From 7debbaba5ec0ea0a28fdd1f10e98c02db610979e Mon Sep 17 00:00:00 2001 From: Olli Pettay Date: Sun, 3 Jun 2012 16:06:35 +0300 Subject: [PATCH] Bug 758894 - 'Highlight all' feature causes zombie compartments, r=mano --- toolkit/content/widgets/findbar.xml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/toolkit/content/widgets/findbar.xml b/toolkit/content/widgets/findbar.xml index 3471ba11500..2b1457c5fdb 100644 --- a/toolkit/content/widgets/findbar.xml +++ b/toolkit/content/widgets/findbar.xml @@ -942,14 +942,14 @@ return textFound; if (aHighlight) { - this._searchRange = doc.createRange(); - this._searchRange.selectNodeContents(doc.body); + var searchRange = doc.createRange(); + searchRange.selectNodeContents(doc.body); - this._startPt = this._searchRange.cloneRange(); - this._startPt.collapse(true); + var startPt = searchRange.cloneRange(); + startPt.collapse(true); - this._endPt = this._searchRange.cloneRange(); - this._endPt.collapse(false); + var endPt = searchRange.cloneRange(); + endPt.collapse(false); var retRange = null; var finder = Components.classes["@mozilla.org/embedcomp/rangefind;1"] @@ -958,11 +958,11 @@ finder.caseSensitive = this._shouldBeCaseSensitive(aWord); - while ((retRange = finder.Find(aWord, this._searchRange, - this._startPt, this._endPt))) { + while ((retRange = finder.Find(aWord, searchRange, + startPt, endPt))) { this._highlight(retRange, controller); - this._startPt = retRange.cloneRange(); - this._startPt.collapse(false); + startPt = retRange.cloneRange(); + startPt.collapse(false); textFound = true; }