Title: [268885] trunk/Source/WebInspectorUI
Revision
268885
Author
[email protected]
Date
2020-10-22 13:09:03 -0700 (Thu, 22 Oct 2020)

Log Message

Web Inspector: REGRESSION(r266074): Sources: icon for non-_javascript_ breakpoints doesn't change when breakpoints are globally disabled
https://bugs.webkit.org/show_bug.cgi?id=218064

Reviewed by Joseph Pecoraro.

* UserInterface/Models/Breakpoint.js:
(WI.Breakpoint.prototype.get resolved): Added.
* UserInterface/Models/_javascript_Breakpoint.js:
(WI._javascript_Breakpoint.prototype.get resolved):
Add `get resolved` to the base class based on `WI.debuggerManager.breakpointsEnabled`. Use
it in the subclass as part of the result.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.updateStatus):
(WI.BreakpointTreeElement.prototype._dataUpdated):
* UserInterface/Views/BreakpointTreeElement.css:
(.item.breakpoint .status > .status-image:not(.resolved)): Added.
* UserInterface/Views/_javascript_BreakpointTreeElement.css:
(.item.breakpoint._javascript_ .status > .status-image): Deleted.
(.item.breakpoint._javascript_ .status > .status-image.resolved): Deleted.
* UserInterface/Views/_javascript_BreakpointTreeElement.js:
(WI._javascript_BreakpointTreeElement.prototype.updateStatus): Deleted.
Eliminate unnecessary protected function now that all breakpoints have a `get resolved`.
Drive-by: inline CSS class name constants.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (268884 => 268885)


--- trunk/Source/WebInspectorUI/ChangeLog	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/ChangeLog	2020-10-22 20:09:03 UTC (rev 268885)
@@ -1,3 +1,30 @@
+2020-10-22  Devin Rousso  <[email protected]>
+
+        Web Inspector: REGRESSION(r266074): Sources: icon for non-_javascript_ breakpoints doesn't change when breakpoints are globally disabled
+        https://bugs.webkit.org/show_bug.cgi?id=218064
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Models/Breakpoint.js:
+        (WI.Breakpoint.prototype.get resolved): Added.
+        * UserInterface/Models/_javascript_Breakpoint.js:
+        (WI._javascript_Breakpoint.prototype.get resolved):
+        Add `get resolved` to the base class based on `WI.debuggerManager.breakpointsEnabled`. Use
+        it in the subclass as part of the result.
+
+        * UserInterface/Views/BreakpointTreeElement.js:
+        (WI.BreakpointTreeElement.prototype.updateStatus):
+        (WI.BreakpointTreeElement.prototype._dataUpdated):
+        * UserInterface/Views/BreakpointTreeElement.css:
+        (.item.breakpoint .status > .status-image:not(.resolved)): Added.
+        * UserInterface/Views/_javascript_BreakpointTreeElement.css:
+        (.item.breakpoint._javascript_ .status > .status-image): Deleted.
+        (.item.breakpoint._javascript_ .status > .status-image.resolved): Deleted.
+        * UserInterface/Views/_javascript_BreakpointTreeElement.js:
+        (WI._javascript_BreakpointTreeElement.prototype.updateStatus): Deleted.
+        Eliminate unnecessary protected function now that all breakpoints have a `get resolved`.
+        Drive-by: inline CSS class name constants.
+
 2020-10-20  Devin Rousso  <[email protected]>
 
         Web Inspector: REGRESSION(r266074): Uncaught Exception: undefined is not an object (evaluating 'this._allListenersBreakpoint.disabled')

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js	2020-10-22 20:09:03 UTC (rev 268885)
@@ -96,6 +96,12 @@
         return false;
     }
 
+    get resolved()
+    {
+        // Overridden by subclasses if needed.
+        return WI.debuggerManager.breakpointsEnabled;
+    }
+
     get disabled()
     {
         return this._disabled;

Modified: trunk/Source/WebInspectorUI/UserInterface/Models/_javascript_Breakpoint.js (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Models/_javascript_Breakpoint.js	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/_javascript_Breakpoint.js	2020-10-22 20:09:03 UTC (rev 268885)
@@ -189,7 +189,7 @@
 
     get resolved()
     {
-        return this._resolved;
+        return super.resolved && this._resolved;
     }
 
     set resolved(resolved)

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css	2020-10-22 20:09:03 UTC (rev 268885)
@@ -50,6 +50,10 @@
     fill: var(--breakpoint-color-disabled);
 }
 
+.item.breakpoint .status > .status-image:not(.resolved) {
+    filter: grayscale();
+}
+
 .item.breakpoint.paused .icon {
     content: url(../Images/TypeIcons.svg#PausedBreakpoint-light);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js	2020-10-22 20:09:03 UTC (rev 268885)
@@ -49,7 +49,7 @@
         this._listenerSet.register(WI.debuggerManager, WI.DebuggerManager.Event.ProbeSetRemoved, this._probeSetRemoved);
 
         this.status = WI.ImageUtilities.useSVGSymbol("Images/Breakpoint.svg");
-        this.status.className = WI.BreakpointTreeElement.StatusImageElementStyleClassName;
+        this.status.className = "status-image";
 
         this._listenerSet.register(this.status, "mousedown", this._statusImageElementMouseDown);
         this._listenerSet.register(this.status, "click", this._statusImageElementClicked);
@@ -138,9 +138,10 @@
         if (!this.status)
             return;
 
-        this.status.classList.toggle(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName, this._breakpoint.disabled);
+        this.status.classList.toggle("resolved", this._breakpoint.resolved);
+        this.status.classList.toggle("disabled", this._breakpoint.disabled);
         if (this._breakpoint.editable)
-            this.status.classList.toggle(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName, this._breakpoint.autoContinue);
+            this.status.classList.toggle("auto-continue", this._breakpoint.autoContinue);
     }
 
     // Private
@@ -191,9 +192,9 @@
 
     _dataUpdated()
     {
-        if (this.element.classList.contains(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName)) {
+        if (this.element.classList.contains("data-updated")) {
             clearTimeout(this._removeIconAnimationTimeoutIdentifier);
-            this.element.classList.remove(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+            this.element.classList.remove("data-updated");
             // We want to restart the animation, which can only be done by removing the class,
             // performing layout, and re-adding the class. Try adding class back on next run loop.
             window.requestAnimationFrame(this._dataUpdated.bind(this));
@@ -200,9 +201,9 @@
             return;
         }
 
-        this.element.classList.add(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+        this.element.classList.add("data-updated");
         this._removeIconAnimationTimeoutIdentifier = setTimeout(() => {
-            this.element.classList.remove(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
+            this.element.classList.remove("data-updated");
         }, WI.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration);
     }
 
@@ -218,9 +219,4 @@
     }
 };
 
-WI.BreakpointTreeElement.StatusImageElementStyleClassName = "status-image";
-WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName = "auto-continue";
-WI.BreakpointTreeElement.StatusImageDisabledStyleClassName = "disabled";
-WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName = "data-updated";
-
 WI.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration = 400; // milliseconds

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.css (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.css	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.css	2020-10-22 20:09:03 UTC (rev 268885)
@@ -23,14 +23,6 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-.item.breakpoint._javascript_ .status > .status-image {
-    filter: grayscale();
-}
-
-.item.breakpoint._javascript_ .status > .status-image.resolved {
-    filter: none;
-}
-
 body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus-within .item.breakpoint._javascript_.selected .status > .status-image.resolved {
     stroke: var(--selected-foreground-color);
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.js (268884 => 268885)


--- trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.js	2020-10-22 19:31:27 UTC (rev 268884)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/_javascript_BreakpointTreeElement.js	2020-10-22 20:09:03 UTC (rev 268885)
@@ -52,18 +52,6 @@
         return {text: [this.breakpoint.contentIdentifier]};
     }
 
-    // Protected
-
-    updateStatus()
-    {
-        super.updateStatus();
-
-        if (!this.status)
-            return;
-
-        this.status.classList.toggle("resolved", this.breakpoint.resolved && WI.debuggerManager.breakpointsEnabled);
-    }
-
     // Private
 
     _updateTitles()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to