Bug 1335730 - delete the map entry when a window unloads and is tracked by the FinderHighlighter. r=jaws
authorMike de Boer <mdeboer@mozilla.com>
Mon, 06 Feb 2017 16:25:33 +0100
changeset 340943 9a087f3a376703d2b5d0eb7dd22dcdf748fe49f5
parent 340942 93b5ddfa8698431ba6a229e66782150bc681d5ba
child 340944 53023771039ea8c799ac1b5a382f987066aeebfe
push id36961
push usermdeboer@mozilla.com
push dateMon, 06 Feb 2017 17:31:57 +0000
treeherderautoland@9a087f3a3767 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1335730
milestone54.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 1335730 - delete the map entry when a window unloads and is tracked by the FinderHighlighter. r=jaws MozReview-Commit-ID: 7vJ4HQwNnPp
toolkit/modules/FinderHighlighter.jsm
--- a/toolkit/modules/FinderHighlighter.jsm
+++ b/toolkit/modules/FinderHighlighter.jsm
@@ -475,22 +475,20 @@ FinderHighlighter.prototype = {
    * When the current page is refreshed or navigated away from, the CanvasFrame
    * contents is not valid anymore, i.e. all anonymous content is destroyed.
    * We need to clear the references we keep, which'll make sure we redraw
    * everything when the user starts to find in page again.
    */
   onLocationChange() {
     let window = this.finder._getWindow();
     this.hide(window);
-    let dict = this.getForWindow(window);
     this.clear(window);
-    dict.currentFoundRange = dict.lastIteratorParams = dict.previousFoundRange =
-      dict.previousUpdatedRange = null;
+    this._removeRangeOutline(window);
 
-    this._removeRangeOutline(window);
+    gWindows.delete(window.top);
   },
 
   /**
    * When `kModalHighlightPref` pref changed during a session, this callback is
    * invoked. When modal highlighting is turned off, we hide the CanvasFrame
    * contents.
    *
    * @param {Boolean} useModalHighlight