Title: [242315] trunk/Source/WebInspectorUI
Revision
242315
Author
[email protected]
Date
2019-03-02 12:50:08 -0800 (Sat, 02 Mar 2019)

Log 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):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (242314 => 242315)


--- trunk/Source/WebInspectorUI/ChangeLog	2019-03-02 20:32:11 UTC (rev 242314)
+++ trunk/Source/WebInspectorUI/ChangeLog	2019-03-02 20:50:08 UTC (rev 242315)
@@ -1,5 +1,28 @@
 2019-03-02  Devin Rousso  <[email protected]>
 
+        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):
+
+2019-03-02  Devin Rousso  <[email protected]>
+
         Web Inspector: Debugger: don't enable breakpoints when source location changes
         https://bugs.webkit.org/show_bug.cgi?id=195081
         <rdar://problem/48422701>

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (242314 => 242315)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2019-03-02 20:32:11 UTC (rev 242314)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2019-03-02 20:50:08 UTC (rev 242315)
@@ -250,9 +250,14 @@
         if (WI.debuggerManager.paused)
             this._debuggerDidPause(null);
 
-        if (WI.timelineManager.isCapturing() && WI.debuggerManager.breakpointsDisabledTemporarily)
-            this._timelineCapturingWillStart(null);
+        if (WI.debuggerManager.breakpointsDisabledTemporarily) {
+            if (WI.timelineManager.isCapturing())
+                this._timelineCapturingWillStart();
 
+            if (WI.auditManager.runningState === WI.AuditManager.RunningState.Active || WI.auditManager.runningState === WI.AuditManager.RunningState.Stopping)
+                this._handleAuditManagerTestScheduled();
+        }
+
         this._updateBreakpointsDisabledBanner();
     }
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css (242314 => 242315)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css	2019-03-02 20:32:11 UTC (rev 242314)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.css	2019-03-02 20:50:08 UTC (rev 242315)
@@ -62,6 +62,10 @@
     border-bottom: 1px solid var(--border-color);
 }
 
+.sidebar > .panel.navigation.sources > .content > .warning-banner + .warning-banner {
+    display: none;
+}
+
 .sidebar > .panel.navigation.sources > .content > .details-section {
     padding-bottom: 1px;
     font-size: 11px;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js (242314 => 242315)


--- trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js	2019-03-02 20:32:11 UTC (rev 242314)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/SourcesNavigationSidebarPanel.js	2019-03-02 20:50:08 UTC (rev 242315)
@@ -94,6 +94,7 @@
         this._debuggerStepOutButtonItem.enabled = false;
 
         this._timelineRecordingWarningElement = null;
+        this._auditTestWarningElement = null;
         this._breakpointsDisabledWarningElement = null;
 
         this._pauseReasonTreeOutline = null;
@@ -256,6 +257,9 @@
         WI.timelineManager.addEventListener(WI.TimelineManager.Event.CapturingWillStart, this._handleTimelineCapturingWillStart, this);
         WI.timelineManager.addEventListener(WI.TimelineManager.Event.CapturingStopped, this._handleTimelineCapturingStopped, this);
 
+        WI.auditManager.addEventListener(WI.AuditManager.Event.TestScheduled, this._handleAuditManagerTestScheduled, this);
+        WI.auditManager.addEventListener(WI.AuditManager.Event.TestCompleted, this._handleAuditManagerTestCompleted, this);
+
         WI.cssManager.addEventListener(WI.CSSManager.Event.StyleSheetAdded, this._handleCSSStyleSheetAdded, this);
 
         WI.targetManager.addEventListener(WI.TargetManager.Event.TargetAdded, this._handleTargetAdded, this);
@@ -315,9 +319,14 @@
         if (WI.debuggerManager.paused)
             this._handleDebuggerPaused();
 
-        if (WI.timelineManager.isCapturing() && WI.debuggerManager.breakpointsDisabledTemporarily)
-            this._handleTimelineCapturingWillStart();
+        if (WI.debuggerManager.breakpointsDisabledTemporarily) {
+            if (WI.timelineManager.isCapturing())
+                this._handleTimelineCapturingWillStart();
 
+            if (WI.auditManager.runningState === WI.AuditManager.RunningState.Active || WI.auditManager.runningState === WI.AuditManager.RunningState.Stopping)
+                this._handleAuditManagerTestScheduled();
+        }
+
         this._updateBreakpointsDisabledBanner();
     }
 
@@ -348,6 +357,7 @@
         WI.DOMBreakpoint.removeEventListener(null, null, this);
         WI.consoleManager.removeEventListener(null, null, this);
         WI.timelineManager.removeEventListener(null, null, this);
+        WI.auditManager.removeEventListener(null, null, this);
         WI.cssManager.removeEventListener(null, null, this);
         WI.targetManager.removeEventListener(null, null, this);
         WI.notifications.removeEventListener(null, null, this);
@@ -925,9 +935,16 @@
             this._addIssue(issue);
     }
 
+    _updateTemporarilyDisabledBreakpointsButtons()
+    {
+        let breakpointsDisabledTemporarily = WI.debuggerManager.breakpointsDisabledTemporarily;
+        this._debuggerBreakpointsButtonItem.enabled = !breakpointsDisabledTemporarily;
+        this._debuggerPauseResumeButtonItem.enabled = !breakpointsDisabledTemporarily;
+    }
+
     _updateBreakpointsDisabledBanner()
     {
-        if (!WI.debuggerManager.breakpointsEnabled && !this._timelineRecordingWarningElement) {
+        if (!WI.debuggerManager.breakpointsEnabled && !this._timelineRecordingWarningElement && !this._auditTestWarningElement) {
             if (!this._breakpointsDisabledWarningElement) {
                 let enableBreakpointsButton = document.createElement("button");
                 enableBreakpointsButton.textContent = WI.UIString("Enable Breakpoints");
@@ -1607,8 +1624,7 @@
 
     _handleTimelineCapturingWillStart(event)
     {
-        this._debuggerBreakpointsButtonItem.enabled = false;
-        this._debuggerPauseResumeButtonItem.enabled = false;
+        this._updateTemporarilyDisabledBreakpointsButtons();
 
         if (!this._timelineRecordingWarningElement) {
             let stopRecordingButton = document.createElement("button");
@@ -1629,8 +1645,7 @@
 
     _handleTimelineCapturingStopped(event)
     {
-        this._debuggerBreakpointsButtonItem.enabled = true;
-        this._debuggerPauseResumeButtonItem.enabled = true;
+        this._updateTemporarilyDisabledBreakpointsButtons();
 
         if (this._timelineRecordingWarningElement) {
             this._timelineRecordingWarningElement.remove();
@@ -1640,6 +1655,39 @@
         this._updateBreakpointsDisabledBanner();
     }
 
+    _handleAuditManagerTestScheduled(event)
+    {
+        this._updateTemporarilyDisabledBreakpointsButtons();
+
+        if (!this._auditTestWarningElement) {
+            let stopAuditButton = document.createElement("button");
+            stopAuditButton.textContent = WI.UIString("Stop Audit");
+            stopAuditButton.addEventListener("click", (event) => {
+                WI.auditManager.stop();
+            });
+
+            this._auditTestWarningElement = document.createElement("div");
+            this._auditTestWarningElement.classList.add("warning-banner");
+            this._auditTestWarningElement.append(WI.UIString("Debugger disabled during Audit"), document.createElement("br"), stopAuditButton);
+        }
+
+        this.contentView.element.insertBefore(this._auditTestWarningElement, this.contentView.element.firstChild);
+
+        this._updateBreakpointsDisabledBanner();
+    }
+
+    _handleAuditManagerTestCompleted(event)
+    {
+        this._updateTemporarilyDisabledBreakpointsButtons();
+
+        if (this._auditTestWarningElement) {
+            this._auditTestWarningElement.remove();
+            this._auditTestWarningElement = null;
+        }
+
+        this._updateBreakpointsDisabledBanner();
+    }
+
     _handleCSSStyleSheetAdded(event)
     {
         let styleSheet = event.data.styleSheet;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to