Bug 1377845 - Fix TypeError: frame is undefined when resizing sub-dialog window r?scottwu,MattN draft
authorRicky Chien <ricky060709@gmail.com>
Sat, 08 Jul 2017 11:34:54 +0800
changeset 607181 b8119f87027e04c349964730738ac82e5a5db9f7
parent 607180 888c27149f68a8d994d87b4798c0526bbbd8cbf2
child 636976 8a5f3761523b45a352462f33c8dac908d3b4d143
push id67931
push userbmo:rchien@mozilla.com
push dateWed, 12 Jul 2017 02:47:11 +0000
reviewersscottwu, MattN
bugs1377845
milestone56.0a1
Bug 1377845 - Fix TypeError: frame is undefined when resizing sub-dialog window r?scottwu,MattN MozReview-Commit-ID: HjiaIyZHgkL
browser/components/preferences/in-content-new/subdialogs.js
browser/components/preferences/in-content/subdialogs.js
--- a/browser/components/preferences/in-content-new/subdialogs.js
+++ b/browser/components/preferences/in-content-new/subdialogs.js
@@ -323,16 +323,17 @@ SubDialog.prototype = {
     this._overlay.dispatchEvent(new CustomEvent("dialogopen", {
       bubbles: true,
       detail: { dialog: this },
     }));
     this._overlay.style.visibility = "visible";
     this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded
 
     if (this._box.getAttribute("resizable") == "true") {
+      this._onResize = this._onResize.bind(this);
       this._resizeObserver = new MutationObserver(this._onResize);
       this._resizeObserver.observe(this._box, {attributes: true});
     }
 
     this._trapFocus();
 
     // Search within main document and highlight matched keyword.
     gSearchResultsPane.searchWithinNode(this._titleElement, gSearchResultsPane.query);
--- a/browser/components/preferences/in-content/subdialogs.js
+++ b/browser/components/preferences/in-content/subdialogs.js
@@ -323,16 +323,17 @@ SubDialog.prototype = {
     this._overlay.dispatchEvent(new CustomEvent("dialogopen", {
       bubbles: true,
       detail: { dialog: this },
     }));
     this._overlay.style.visibility = "visible";
     this._overlay.style.opacity = ""; // XXX: focus hack continued from _onContentLoaded
 
     if (this._box.getAttribute("resizable") == "true") {
+      this._onResize = this._onResize.bind(this);
       this._resizeObserver = new MutationObserver(this._onResize);
       this._resizeObserver.observe(this._box, {attributes: true});
     }
 
     this._trapFocus();
   },
 
   _onResize(mutations) {