Title: [236848] trunk/Source/WebInspectorUI
Revision
236848
Author
[email protected]
Date
2018-10-04 13:58:14 -0700 (Thu, 04 Oct 2018)

Log Message

Web Inspector: REGRESSION(r236540): Uncaught Exception: TypeError: pauseReasonBreakpointTreeElement.removeStatusImage is not a function.
https://bugs.webkit.org/show_bug.cgi?id=190230

Reviewed by Matt Baker.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel._removeBreakpoint):
Leverage existing `status` getter/setter for creating/removing the breakpoint icon element.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement):
(WI.BreakpointTreeElement.prototype.populateContextMenu):
(WI.BreakpointTreeElement.prototype._updateStatus):
(WI.BreakpointTreeElement.prototype.removeStatusImage): Deleted.

* UserInterface/Views/DOMBreakpointTreeElement.js:
(WI.DOMBreakpointTreeElement):
(WI.DOMBreakpointTreeElement.prototype.onattach):
(WI.DOMBreakpointTreeElement.prototype.ondetach):
(WI.DOMBreakpointTreeElement.prototype._updateStatus):

* UserInterface/Views/EventBreakpointTreeElement.js:
(WI.EventBreakpointTreeElement):
(WI.EventBreakpointTreeElement.prototype.onattach):
(WI.EventBreakpointTreeElement.prototype.ondetach):
(WI.EventBreakpointTreeElement.prototype._updateStatus):

* UserInterface/Views/XHRBreakpointTreeElement.js:
(WI.XHRBreakpointTreeElement):
(WI.XHRBreakpointTreeElement.prototype.onattach):
(WI.XHRBreakpointTreeElement.prototype.ondetach):
(WI.XHRBreakpointTreeElement.prototype._updateStatus):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (236847 => 236848)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-10-04 20:58:14 UTC (rev 236848)
@@ -1,3 +1,38 @@
+2018-10-04  Devin Rousso  <[email protected]>
+
+        Web Inspector: REGRESSION(r236540): Uncaught Exception: TypeError: pauseReasonBreakpointTreeElement.removeStatusImage is not a function.
+        https://bugs.webkit.org/show_bug.cgi?id=190230
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WI.DebuggerSidebarPanel._removeBreakpoint):
+        Leverage existing `status` getter/setter for creating/removing the breakpoint icon element.
+
+        * UserInterface/Views/BreakpointTreeElement.js:
+        (WI.BreakpointTreeElement):
+        (WI.BreakpointTreeElement.prototype.populateContextMenu):
+        (WI.BreakpointTreeElement.prototype._updateStatus):
+        (WI.BreakpointTreeElement.prototype.removeStatusImage): Deleted.
+
+        * UserInterface/Views/DOMBreakpointTreeElement.js:
+        (WI.DOMBreakpointTreeElement):
+        (WI.DOMBreakpointTreeElement.prototype.onattach):
+        (WI.DOMBreakpointTreeElement.prototype.ondetach):
+        (WI.DOMBreakpointTreeElement.prototype._updateStatus):
+
+        * UserInterface/Views/EventBreakpointTreeElement.js:
+        (WI.EventBreakpointTreeElement):
+        (WI.EventBreakpointTreeElement.prototype.onattach):
+        (WI.EventBreakpointTreeElement.prototype.ondetach):
+        (WI.EventBreakpointTreeElement.prototype._updateStatus):
+
+        * UserInterface/Views/XHRBreakpointTreeElement.js:
+        (WI.XHRBreakpointTreeElement):
+        (WI.XHRBreakpointTreeElement.prototype.onattach):
+        (WI.XHRBreakpointTreeElement.prototype.ondetach):
+        (WI.XHRBreakpointTreeElement.prototype._updateStatus):
+
 2018-10-04  Dan Bernstein  <[email protected]>
 
         WebInspectorUI part of [Xcode] Update some build settings as recommended by Xcode 10

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js (236847 => 236848)


--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2018-10-04 20:58:14 UTC (rev 236848)
@@ -48,17 +48,15 @@
         this._listenerSet.register(WI.debuggerManager, WI.DebuggerManager.Event.ProbeSetAdded, this._probeSetAdded);
         this._listenerSet.register(WI.debuggerManager, WI.DebuggerManager.Event.ProbeSetRemoved, this._probeSetRemoved);
 
-        this._statusImageElement = document.createElement("img");
-        this._statusImageElement.className = WI.BreakpointTreeElement.StatusImageElementStyleClassName;
-        this._listenerSet.register(this._statusImageElement, "mousedown", this._statusImageElementMouseDown);
-        this._listenerSet.register(this._statusImageElement, "click", this._statusImageElementClicked);
+        this.status = document.createElement("img");
+        this.status.className = WI.BreakpointTreeElement.StatusImageElementStyleClassName;
+        this._listenerSet.register(this.status, "mousedown", this._statusImageElementMouseDown);
+        this._listenerSet.register(this.status, "click", this._statusImageElementClicked);
 
         if (!title)
             this._updateTitles();
         this._updateStatus();
 
-        this.status = this._statusImageElement;
-
         this._iconAnimationLayerElement = document.createElement("span");
         this.iconElement.appendChild(this._iconAnimationLayerElement);
         this.tooltipHandledSeparately = true;
@@ -125,17 +123,11 @@
 
     populateContextMenu(contextMenu, event)
     {
-        WI.breakpointPopoverController.appendContextMenuItems(contextMenu, this._breakpoint, this._statusImageElement);
+        WI.breakpointPopoverController.appendContextMenuItems(contextMenu, this._breakpoint, this.status);
 
         super.populateContextMenu(contextMenu, event);
     }
 
-    removeStatusImage()
-    {
-        this._statusImageElement.remove();
-        this._statusImageElement = null;
-    }
-
     // Private
 
     _updateTitles()
@@ -163,23 +155,23 @@
 
     _updateStatus()
     {
-        if (!this._statusImageElement)
+        if (!this.status)
             return;
 
         if (this._breakpoint.disabled)
-            this._statusImageElement.classList.add(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName);
+            this.status.classList.add(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName);
         else
-            this._statusImageElement.classList.remove(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName);
+            this.status.classList.remove(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName);
 
         if (this._breakpoint.autoContinue)
-            this._statusImageElement.classList.add(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
+            this.status.classList.add(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
         else
-            this._statusImageElement.classList.remove(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
+            this.status.classList.remove(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName);
 
         if (this._breakpoint.resolved && WI.debuggerManager.breakpointsEnabled)
-            this._statusImageElement.classList.add(WI.BreakpointTreeElement.StatusImageResolvedStyleClassName);
+            this.status.classList.add(WI.BreakpointTreeElement.StatusImageResolvedStyleClassName);
         else
-            this._statusImageElement.classList.remove(WI.BreakpointTreeElement.StatusImageResolvedStyleClassName);
+            this.status.classList.remove(WI.BreakpointTreeElement.StatusImageResolvedStyleClassName);
     }
 
     _addProbeSet(probeSet)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js (236847 => 236848)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DOMBreakpointTreeElement.js	2018-10-04 20:58:14 UTC (rev 236848)
@@ -38,9 +38,9 @@
         const subtitle = null;
         super(["breakpoint", "dom", className], title, subtitle, breakpoint);
 
-        this._statusImageElement = document.createElement("img");
-        this._statusImageElement.classList.add("status-image", "resolved");
-        this.status = this._statusImageElement;
+        this.status = document.createElement("img");
+        this.status.classList.add("status-image", "resolved");
+
         this.tooltipHandledSeparately = true;
 
         breakpoint.addEventListener(WI.DOMBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
@@ -75,9 +75,9 @@
         this._boundStatusImageElementFocused = this._statusImageElementFocused.bind(this);
         this._boundStatusImageElementMouseDown = this._statusImageElementMouseDown.bind(this);
 
-        this._statusImageElement.addEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.addEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.addEventListener("click", this._boundStatusImageElementClicked);
+        this.status.addEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
     }
 
     ondetach()
@@ -84,9 +84,9 @@
     {
         super.ondetach();
 
-        this._statusImageElement.removeEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.removeEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.removeEventListener("click", this._boundStatusImageElementClicked);
+        this.status.removeEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
 
         this._boundStatusImageElementClicked = null;
         this._boundStatusImageElementFocused = null;
@@ -154,6 +154,6 @@
 
     _updateStatus()
     {
-        this._statusImageElement.classList.toggle("disabled", this.representedObject.disabled);
+        this.status.classList.toggle("disabled", this.representedObject.disabled);
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (236847 => 236848)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2018-10-04 20:58:14 UTC (rev 236848)
@@ -521,7 +521,7 @@
         if (this._pauseReasonTreeOutline) {
             let pauseReasonBreakpointTreeElement = this._pauseReasonTreeOutline.getCachedTreeElement(breakpoint);
             if (pauseReasonBreakpointTreeElement)
-                pauseReasonBreakpointTreeElement.removeStatusImage();
+                pauseReasonBreakpointTreeElement.status = null;
         }
 
         let breakpointTreeElement = this._breakpointsContentTreeOutline.getCachedTreeElement(breakpoint);

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/EventBreakpointTreeElement.js (236847 => 236848)


--- trunk/Source/WebInspectorUI/UserInterface/Views/EventBreakpointTreeElement.js	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/EventBreakpointTreeElement.js	2018-10-04 20:58:14 UTC (rev 236848)
@@ -39,10 +39,11 @@
         const subtitle = null;
         super(classNames, title, subtitle, breakpoint);
 
-        this._statusImageElement = document.createElement("img");
-        this._statusImageElement.classList.add("status-image", "resolved");
-        this.status = this._statusImageElement;
+        this.status = document.createElement("img");
+        this.status.classList.add("status-image", "resolved");
 
+        this.tooltipHandledSeparately = true;
+
         breakpoint.addEventListener(WI.EventBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
 
         this._updateStatus();
@@ -58,9 +59,9 @@
         this._boundStatusImageElementFocused = this._statusImageElementFocused.bind(this);
         this._boundStatusImageElementMouseDown = this._statusImageElementMouseDown.bind(this);
 
-        this._statusImageElement.addEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.addEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.addEventListener("click", this._boundStatusImageElementClicked);
+        this.status.addEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
     }
 
     ondetach()
@@ -67,9 +68,9 @@
     {
         super.ondetach();
 
-        this._statusImageElement.removeEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.removeEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.removeEventListener("click", this._boundStatusImageElementClicked);
+        this.status.removeEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
 
         this._boundStatusImageElementClicked = null;
         this._boundStatusImageElementFocused = null;
@@ -151,6 +152,6 @@
 
     _updateStatus()
     {
-        this._statusImageElement.classList.toggle("disabled", this.representedObject.disabled);
+        this.status.classList.toggle("disabled", this.representedObject.disabled);
     }
 };

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js (236847 => 236848)


--- trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js	2018-10-04 20:47:32 UTC (rev 236847)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/XHRBreakpointTreeElement.js	2018-10-04 20:58:14 UTC (rev 236848)
@@ -43,9 +43,9 @@
 
         super(["breakpoint", "xhr", className], title, subtitle, breakpoint);
 
-        this._statusImageElement = document.createElement("img");
-        this._statusImageElement.classList.add("status-image", "resolved");
-        this.status = this._statusImageElement;
+        this.status = document.createElement("img");
+        this.status.classList.add("status-image", "resolved");
+
         this.tooltipHandledSeparately = true;
 
         breakpoint.addEventListener(WI.XHRBreakpoint.Event.DisabledStateDidChange, this._updateStatus, this);
@@ -63,9 +63,9 @@
         this._boundStatusImageElementFocused = this._statusImageElementFocused.bind(this);
         this._boundStatusImageElementMouseDown = this._statusImageElementMouseDown.bind(this);
 
-        this._statusImageElement.addEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.addEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.addEventListener("click", this._boundStatusImageElementClicked);
+        this.status.addEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.addEventListener("mousedown", this._boundStatusImageElementMouseDown);
     }
 
     ondetach()
@@ -72,9 +72,9 @@
     {
         super.ondetach();
 
-        this._statusImageElement.removeEventListener("click", this._boundStatusImageElementClicked);
-        this._statusImageElement.removeEventListener("focus", this._boundStatusImageElementFocused);
-        this._statusImageElement.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
+        this.status.removeEventListener("click", this._boundStatusImageElementClicked);
+        this.status.removeEventListener("focus", this._boundStatusImageElementFocused);
+        this.status.removeEventListener("mousedown", this._boundStatusImageElementMouseDown);
 
         this._boundStatusImageElementClicked = null;
         this._boundStatusImageElementFocused = null;
@@ -143,6 +143,6 @@
 
     _updateStatus()
     {
-        this._statusImageElement.classList.toggle("disabled", this.representedObject.disabled);
+        this.status.classList.toggle("disabled", this.representedObject.disabled);
     }
 };
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to