⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 268885 in webkit


Ignore:
Timestamp:
Oct 22, 2020, 1:09:03 PM (6 years ago)
Author:
Devin Rousso
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/JavaScriptBreakpoint.js:

(WI.JavaScriptBreakpoint.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/JavaScriptBreakpointTreeElement.css:

(.item.breakpoint.javascript .status > .status-image): Deleted.
(.item.breakpoint.javascript .status > .status-image.resolved): Deleted.

  • UserInterface/Views/JavaScriptBreakpointTreeElement.js:

(WI.JavaScriptBreakpointTreeElement.prototype.updateStatus): Deleted.
Eliminate unnecessary protected function now that all breakpoints have a get resolved.
Drive-by: inline CSS class name constants.

Location:
trunk/Source/WebInspectorUI
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r268786 r268885  
     12020-10-22  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: REGRESSION(r266074): Sources: icon for non-JavaScript breakpoints doesn't change when breakpoints are globally disabled
     4        https://bugs.webkit.org/show_bug.cgi?id=218064
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * UserInterface/Models/Breakpoint.js:
     9        (WI.Breakpoint.prototype.get resolved): Added.
     10        * UserInterface/Models/JavaScriptBreakpoint.js:
     11        (WI.JavaScriptBreakpoint.prototype.get resolved):
     12        Add `get resolved` to the base class based on `WI.debuggerManager.breakpointsEnabled`. Use
     13        it in the subclass as part of the result.
     14
     15        * UserInterface/Views/BreakpointTreeElement.js:
     16        (WI.BreakpointTreeElement.prototype.updateStatus):
     17        (WI.BreakpointTreeElement.prototype._dataUpdated):
     18        * UserInterface/Views/BreakpointTreeElement.css:
     19        (.item.breakpoint .status > .status-image:not(.resolved)): Added.
     20        * UserInterface/Views/JavaScriptBreakpointTreeElement.css:
     21        (.item.breakpoint.javascript .status > .status-image): Deleted.
     22        (.item.breakpoint.javascript .status > .status-image.resolved): Deleted.
     23        * UserInterface/Views/JavaScriptBreakpointTreeElement.js:
     24        (WI.JavaScriptBreakpointTreeElement.prototype.updateStatus): Deleted.
     25        Eliminate unnecessary protected function now that all breakpoints have a `get resolved`.
     26        Drive-by: inline CSS class name constants.
     27
    1282020-10-20  Devin Rousso  <drousso@apple.com>
    229
  • trunk/Source/WebInspectorUI/UserInterface/Models/Breakpoint.js

    r266534 r268885  
    9797    }
    9898
     99    get resolved()
     100    {
     101        // Overridden by subclasses if needed.
     102        return WI.debuggerManager.breakpointsEnabled;
     103    }
     104
    99105    get disabled()
    100106    {
  • trunk/Source/WebInspectorUI/UserInterface/Models/JavaScriptBreakpoint.js

    r266534 r268885  
    190190    get resolved()
    191191    {
    192         return this._resolved;
     192        return super.resolved && this._resolved;
    193193    }
    194194
  • trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.css

    r266074 r268885  
    5151}
    5252
     53.item.breakpoint .status > .status-image:not(.resolved) {
     54    filter: grayscale();
     55}
     56
    5357.item.breakpoint.paused .icon {
    5458    content: url(../Images/TypeIcons.svg#PausedBreakpoint-light);
  • trunk/Source/WebInspectorUI/UserInterface/Views/BreakpointTreeElement.js

    r268626 r268885  
    5050
    5151        this.status = WI.ImageUtilities.useSVGSymbol("Images/Breakpoint.svg");
    52         this.status.className = WI.BreakpointTreeElement.StatusImageElementStyleClassName;
     52        this.status.className = "status-image";
    5353
    5454        this._listenerSet.register(this.status, "mousedown", this._statusImageElementMouseDown);
     
    139139            return;
    140140
    141         this.status.classList.toggle(WI.BreakpointTreeElement.StatusImageDisabledStyleClassName, this._breakpoint.disabled);
     141        this.status.classList.toggle("resolved", this._breakpoint.resolved);
     142        this.status.classList.toggle("disabled", this._breakpoint.disabled);
    142143        if (this._breakpoint.editable)
    143             this.status.classList.toggle(WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName, this._breakpoint.autoContinue);
     144            this.status.classList.toggle("auto-continue", this._breakpoint.autoContinue);
    144145    }
    145146
     
    192193    _dataUpdated()
    193194    {
    194         if (this.element.classList.contains(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName)) {
     195        if (this.element.classList.contains("data-updated")) {
    195196            clearTimeout(this._removeIconAnimationTimeoutIdentifier);
    196             this.element.classList.remove(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
     197            this.element.classList.remove("data-updated");
    197198            // We want to restart the animation, which can only be done by removing the class,
    198199            // performing layout, and re-adding the class. Try adding class back on next run loop.
     
    201202        }
    202203
    203         this.element.classList.add(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
     204        this.element.classList.add("data-updated");
    204205        this._removeIconAnimationTimeoutIdentifier = setTimeout(() => {
    205             this.element.classList.remove(WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName);
     206            this.element.classList.remove("data-updated");
    206207        }, WI.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration);
    207208    }
     
    219220};
    220221
    221 WI.BreakpointTreeElement.StatusImageElementStyleClassName = "status-image";
    222 WI.BreakpointTreeElement.StatusImageAutoContinueStyleClassName = "auto-continue";
    223 WI.BreakpointTreeElement.StatusImageDisabledStyleClassName = "disabled";
    224 WI.BreakpointTreeElement.ProbeDataUpdatedStyleClassName = "data-updated";
    225 
    226222WI.BreakpointTreeElement.ProbeDataUpdatedAnimationDuration = 400; // milliseconds
  • trunk/Source/WebInspectorUI/UserInterface/Views/JavaScriptBreakpointTreeElement.css

    r266074 r268885  
    2323 * THE POSSIBILITY OF SUCH DAMAGE.
    2424 */
    25 
    26 .item.breakpoint.javascript .status > .status-image {
    27     filter: grayscale();
    28 }
    29 
    30 .item.breakpoint.javascript .status > .status-image.resolved {
    31     filter: none;
    32 }
    3325
    3426body:not(.window-inactive, .window-docked-inactive) .tree-outline:focus-within .item.breakpoint.javascript.selected .status > .status-image.resolved {
  • trunk/Source/WebInspectorUI/UserInterface/Views/JavaScriptBreakpointTreeElement.js

    r268626 r268885  
    5353    }
    5454
    55     // Protected
    56 
    57     updateStatus()
    58     {
    59         super.updateStatus();
    60 
    61         if (!this.status)
    62             return;
    63 
    64         this.status.classList.toggle("resolved", this.breakpoint.resolved && WI.debuggerManager.breakpointsEnabled);
    65     }
    66 
    6755    // Private
    6856
Note: See TracChangeset for help on using the changeset viewer.