Title: [265712] trunk/Source/WebInspectorUI
Revision
265712
Author
[email protected]
Date
2020-08-14 15:42:31 -0700 (Fri, 14 Aug 2020)

Log Message

Web Inspector: Assertion Failed: removeEventListener cannot remove frame-main-resource-did-change because it doesn't exist.
https://bugs.webkit.org/show_bug.cgi?id=215496

Reviewed by Joseph Pecoraro.

* UserInterface/Views/ChangesDetailsSidebarPanel.js:
(WI.ChangesDetailsSidebarPanel.prototype.shown):
(WI.ChangesDetailsSidebarPanel.prototype.attached): Added.
(WI.ChangesDetailsSidebarPanel.prototype.detached):
Move event listener to `attach`, which is guaranteed to be called before `detach`.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (265711 => 265712)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-08-14 22:33:47 UTC (rev 265711)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-08-14 22:42:31 UTC (rev 265712)
@@ -1,5 +1,18 @@
 2020-08-14  Devin Rousso  <[email protected]>
 
+        Web Inspector: Assertion Failed: removeEventListener cannot remove frame-main-resource-did-change because it doesn't exist.
+        https://bugs.webkit.org/show_bug.cgi?id=215496
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/ChangesDetailsSidebarPanel.js:
+        (WI.ChangesDetailsSidebarPanel.prototype.shown):
+        (WI.ChangesDetailsSidebarPanel.prototype.attached): Added.
+        (WI.ChangesDetailsSidebarPanel.prototype.detached):
+        Move event listener to `attach`, which is guaranteed to be called before `detach`.
+
+2020-08-14  Devin Rousso  <[email protected]>
+
         Web Inspector: use `WI.DropZoneView` instead of `handleFileDrop`
         https://bugs.webkit.org/show_bug.cgi?id=215493
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js (265711 => 265712)


--- trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js	2020-08-14 22:33:47 UTC (rev 265711)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ChangesDetailsSidebarPanel.js	2020-08-14 22:42:31 UTC (rev 265712)
@@ -44,19 +44,24 @@
     {
         // `shown` may get called before initialLayout when Elements tab is opened.
         // When Changes panel is selected, `shown` is called and this time it's after initialLayout.
-        if (this.didInitialLayout) {
+        if (this.didInitialLayout)
             this.needsLayout();
-            WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
-        }
 
         super.shown();
     }
 
+    attached()
+    {
+        super.attached();
+
+        WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+    }
+
     detached()
     {
+        WI.Frame.removeEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
+
         super.detached();
-
-        WI.Frame.removeEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this);
     }
 
     // Protected
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to