Changeset 242315 in webkit


Ignore:
Timestamp:
Mar 2, 2019 12:50:08 PM (5 years ago)
Author:
Devin Rousso
Message:

Web Inspector: Sources: breakpoints should be disabled when an audit is running
https://bugs.webkit.org/show_bug.cgi?id=195105
<rdar://problem/48441373>

Reviewed by Joseph Pecoraro.

  • UserInterface/Views/SourcesNavigationSidebarPanel.js:

(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype.closed):
(WI.SourcesNavigationSidebarPanel.prototype._updateTemporarilyDisabledBreakpointsButtons): Added.
(WI.SourcesNavigationSidebarPanel.prototype._updateBreakpointsDisabledBanner):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped):
(WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestScheduled): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestCompleted): Added.

  • UserInterface/Views/SourcesNavigationSidebarPanel.css:

(.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner): Added.

  • UserInterface/Views/DebuggerSidebarPanel.js:

(WI.DebuggerSidebarPanel):

Location:
trunk/Source/WebInspectorUI
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r242314 r242315  
     12019-03-02  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Sources: breakpoints should be disabled when an audit is running
     4        https://bugs.webkit.org/show_bug.cgi?id=195105
     5        <rdar://problem/48441373>
     6
     7        Reviewed by Joseph Pecoraro.
     8
     9        * UserInterface/Views/SourcesNavigationSidebarPanel.js:
     10        (WI.SourcesNavigationSidebarPanel):
     11        (WI.SourcesNavigationSidebarPanel.prototype.closed):
     12        (WI.SourcesNavigationSidebarPanel.prototype._updateTemporarilyDisabledBreakpointsButtons): Added.
     13        (WI.SourcesNavigationSidebarPanel.prototype._updateBreakpointsDisabledBanner):
     14        (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart):
     15        (WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped):
     16        (WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestScheduled): Added.
     17        (WI.SourcesNavigationSidebarPanel.prototype._handleAuditManagerTestCompleted): Added.
     18        * UserInterface/Views/SourcesNavigationSidebarPanel.css:
     19        (.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner): Added.
     20
     21        * UserInterface/Views/DebuggerSidebarPanel.js:
     22        (WI.DebuggerSidebarPanel):
     23
    1242019-03-02  Devin Rousso  <drousso@apple.com>
    225
  • trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js

    r242049 r242315  
    251251            this._debuggerDidPause(null);
    252252
    253         if (WI.timelineManager.isCapturing() && WI.debuggerManager.breakpointsDisabledTemporarily)
    254             this._timelineCapturingWillStart(null);
     253        if (WI.debuggerManager.breakpointsDisabledTemporarily) {
     254            if (WI.timelineManager.isCapturing())
     255                this._timelineCapturingWillStart();
     256
     257            if (WI.auditManager.runningState === WI.AuditManager.RunningState.Active || WI.auditManager.runningState === WI.AuditManager.RunningState.Stopping)
     258                this._handleAuditManagerTestScheduled();
     259        }
    255260
    256261        this._updateBreakpointsDisabledBanner();
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css

    r242049 r242315  
    6363}
    6464
     65.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner {
     66    display: none;
     67}
     68
    6569.sidebar > .panel.navigation.sources > .content > .details-section {
    6670    padding-bottom: 1px;
  • trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js

    r242049 r242315  
    9595
    9696        this._timelineRecordingWarningElement = null;
     97        this._auditTestWarningElement = null;
    9798        this._breakpointsDisabledWarningElement = null;
    9899
     
    257258        WI.timelineManager.addEventListener(WI.TimelineManager.Event.CapturingStopped, this._handleTimelineCapturingStopped, this);
    258259
     260        WI.auditManager.addEventListener(WI.AuditManager.Event.TestScheduled, this._handleAuditManagerTestScheduled, this);
     261        WI.auditManager.addEventListener(WI.AuditManager.Event.TestCompleted, this._handleAuditManagerTestCompleted, this);
     262
    259263        WI.cssManager.addEventListener(WI.CSSManager.Event.StyleSheetAdded, this._handleCSSStyleSheetAdded, this);
    260264
     
    316320            this._handleDebuggerPaused();
    317321
    318         if (WI.timelineManager.isCapturing() && WI.debuggerManager.breakpointsDisabledTemporarily)
    319             this._handleTimelineCapturingWillStart();
     322        if (WI.debuggerManager.breakpointsDisabledTemporarily) {
     323            if (WI.timelineManager.isCapturing())
     324                this._handleTimelineCapturingWillStart();
     325
     326            if (WI.auditManager.runningState === WI.AuditManager.RunningState.Active || WI.auditManager.runningState === WI.AuditManager.RunningState.Stopping)
     327                this._handleAuditManagerTestScheduled();
     328        }
    320329
    321330        this._updateBreakpointsDisabledBanner();
     
    349358        WI.consoleManager.removeEventListener(null, null, this);
    350359        WI.timelineManager.removeEventListener(null, null, this);
     360        WI.auditManager.removeEventListener(null, null, this);
    351361        WI.cssManager.removeEventListener(null, null, this);
    352362        WI.targetManager.removeEventListener(null, null, this);
     
    926936    }
    927937
     938    _updateTemporarilyDisabledBreakpointsButtons()
     939    {
     940        let breakpointsDisabledTemporarily = WI.debuggerManager.breakpointsDisabledTemporarily;
     941        this._debuggerBreakpointsButtonItem.enabled = !breakpointsDisabledTemporarily;
     942        this._debuggerPauseResumeButtonItem.enabled = !breakpointsDisabledTemporarily;
     943    }
     944
    928945    _updateBreakpointsDisabledBanner()
    929946    {
    930         if (!WI.debuggerManager.breakpointsEnabled && !this._timelineRecordingWarningElement) {
     947        if (!WI.debuggerManager.breakpointsEnabled && !this._timelineRecordingWarningElement && !this._auditTestWarningElement) {
    931948            if (!this._breakpointsDisabledWarningElement) {
    932949                let enableBreakpointsButton = document.createElement("button");
     
    16081625    _handleTimelineCapturingWillStart(event)
    16091626    {
    1610         this._debuggerBreakpointsButtonItem.enabled = false;
    1611         this._debuggerPauseResumeButtonItem.enabled = false;
     1627        this._updateTemporarilyDisabledBreakpointsButtons();
    16121628
    16131629        if (!this._timelineRecordingWarningElement) {
     
    16301646    _handleTimelineCapturingStopped(event)
    16311647    {
    1632         this._debuggerBreakpointsButtonItem.enabled = true;
    1633         this._debuggerPauseResumeButtonItem.enabled = true;
     1648        this._updateTemporarilyDisabledBreakpointsButtons();
    16341649
    16351650        if (this._timelineRecordingWarningElement) {
    16361651            this._timelineRecordingWarningElement.remove();
    16371652            this._timelineRecordingWarningElement = null;
     1653        }
     1654
     1655        this._updateBreakpointsDisabledBanner();
     1656    }
     1657
     1658    _handleAuditManagerTestScheduled(event)
     1659    {
     1660        this._updateTemporarilyDisabledBreakpointsButtons();
     1661
     1662        if (!this._auditTestWarningElement) {
     1663            let stopAuditButton = document.createElement("button");
     1664            stopAuditButton.textContent = WI.UIString("Stop Audit");
     1665            stopAuditButton.addEventListener("click", (event) => {
     1666                WI.auditManager.stop();
     1667            });
     1668
     1669            this._auditTestWarningElement = document.createElement("div");
     1670            this._auditTestWarningElement.classList.add("warning-banner");
     1671            this._auditTestWarningElement.append(WI.UIString("Debugger disabled during Audit"), document.createElement("br"), stopAuditButton);
     1672        }
     1673
     1674        this.contentView.element.insertBefore(this._auditTestWarningElement, this.contentView.element.firstChild);
     1675
     1676        this._updateBreakpointsDisabledBanner();
     1677    }
     1678
     1679    _handleAuditManagerTestCompleted(event)
     1680    {
     1681        this._updateTemporarilyDisabledBreakpointsButtons();
     1682
     1683        if (this._auditTestWarningElement) {
     1684            this._auditTestWarningElement.remove();
     1685            this._auditTestWarningElement = null;
    16381686        }
    16391687
Note: See TracChangeset for help on using the changeset viewer.