Bug 1335730 - delete the map entry when a window unloads and is tracked by the FinderHighlighter. r?jaws draft
authorMike de Boer <mdeboer@mozilla.com>
Mon, 06 Feb 2017 16:25:33 +0100
changeset 479361 d592209854bf13b60453eccb5bd519d3fa8f649f
parent 479360 98741f1b7d451b01eb1b973248a9ad7d26d1f43d
child 544665 4a295e0ffc990dff312a314809394855e91280f5
push id44234
push usermdeboer@mozilla.com
push dateMon, 06 Feb 2017 15:27:18 +0000
reviewersjaws
bugs1335730
milestone54.0a1
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
@@ -473,22 +473,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