Title: [205651] trunk/Source/WebInspectorUI
Revision
205651
Author
[email protected]
Date
2016-09-08 10:37:53 -0700 (Thu, 08 Sep 2016)

Log Message

Web Inspector: Debugger sidebar should include a warning message breakpoints are disabled
https://bugs.webkit.org/show_bug.cgi?id=156719
<rdar://problem/25787932>

Patch by Joseph Pecoraro <[email protected]> on 2016-09-08
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
New strings for breakpoints disabled warning banner.

* UserInterface/Views/DebuggerSidebarPanel.css:
(.sidebar > .panel.navigation.debugger .warning-banner):
(.sidebar > .panel.navigation.debugger .warning-banner > a):
Generalize the class name to "warning-banner".

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel):
(WebInspector.DebuggerSidebarPanel.prototype._breakpointsEnabledDidChange):
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart):
(WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped):
(WebInspector.DebuggerSidebarPanel.prototype._updateBreakpointsDisabledBanner):
Show / hide a breakpoints disabled warning banner as needed.
Only one banner shows at a time, so either the timing warning
or the generic breakpoints disabled banner will show.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (205650 => 205651)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-09-08 17:23:30 UTC (rev 205650)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-09-08 17:37:53 UTC (rev 205651)
@@ -1,3 +1,29 @@
+2016-09-08  Joseph Pecoraro  <[email protected]>
+
+        Web Inspector: Debugger sidebar should include a warning message breakpoints are disabled
+        https://bugs.webkit.org/show_bug.cgi?id=156719
+        <rdar://problem/25787932>
+
+        Reviewed by Brian Burg.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        New strings for breakpoints disabled warning banner.
+
+        * UserInterface/Views/DebuggerSidebarPanel.css:
+        (.sidebar > .panel.navigation.debugger .warning-banner):
+        (.sidebar > .panel.navigation.debugger .warning-banner > a):
+        Generalize the class name to "warning-banner".
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel):
+        (WebInspector.DebuggerSidebarPanel.prototype._breakpointsEnabledDidChange):
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingWillStart):
+        (WebInspector.DebuggerSidebarPanel.prototype._timelineCapturingStopped):
+        (WebInspector.DebuggerSidebarPanel.prototype._updateBreakpointsDisabledBanner):
+        Show / hide a breakpoints disabled warning banner as needed.
+        Only one banner shows at a time, so either the timing warning
+        or the generic breakpoints disabled banner will show.
+
 2016-09-07  Johan K. Jensen  <[email protected]>
 
         Web Inspector: Show resource timing details in Network waterfall

Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (205650 => 205651)


--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-09-08 17:23:30 UTC (rev 205650)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js	2016-09-08 17:37:53 UTC (rev 205651)
@@ -115,6 +115,7 @@
 localizedStrings["Breakdown"] = "Breakdown";
 localizedStrings["Breakdown of each memory category at the end of the selected time range"] = "Breakdown of each memory category at the end of the selected time range";
 localizedStrings["Breakpoints"] = "Breakpoints";
+localizedStrings["Breakpoints are disabled."] = "Breakpoints are disabled.";
 localizedStrings["Bubbling"] = "Bubbling";
 localizedStrings["Busy"] = "Busy";
 localizedStrings["CSP Hash"] = "CSP Hash";
@@ -303,6 +304,7 @@
 localizedStrings["Enable Breakpoint"] = "Enable Breakpoint";
 localizedStrings["Enable Breakpoints"] = "Enable Breakpoints";
 localizedStrings["Enable all breakpoints (%s)"] = "Enable all breakpoints (%s)";
+localizedStrings["Enable breakpoints."] = "Enable breakpoints.";
 localizedStrings["Enable paint flashing"] = "Enable paint flashing";
 localizedStrings["Encoded"] = "Encoded";
 localizedStrings["Encoding"] = "Encoding";

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css (205650 => 205651)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css	2016-09-08 17:23:30 UTC (rev 205650)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.css	2016-09-08 17:37:53 UTC (rev 205651)
@@ -34,7 +34,7 @@
     right: 0;
 }
 
-.sidebar > .panel.navigation.debugger .timeline-recording-warning {
+.sidebar > .panel.navigation.debugger .warning-banner {
     text-align: center;
     font-size: 11px;
 
@@ -45,7 +45,7 @@
     background-color: hsl(50, 100%, 94%);
 }
 
-.sidebar > .panel.navigation.debugger .timeline-recording-warning > a {
+.sidebar > .panel.navigation.debugger .warning-banner > a {
     text-decoration: underline;
     cursor: pointer;
 }

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (205650 => 205651)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-09-08 17:23:30 UTC (rev 205650)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-09-08 17:37:53 UTC (rev 205651)
@@ -50,12 +50,19 @@
         WebInspector.timelineManager.addEventListener(WebInspector.TimelineManager.Event.CapturingStopped, this._timelineCapturingStopped, this);
 
         this._timelineRecordingWarningElement = document.createElement("div");
-        this._timelineRecordingWarningElement.classList.add("timeline-recording-warning");
+        this._timelineRecordingWarningElement.classList.add("warning-banner");
         this._timelineRecordingWarningElement.append(WebInspector.UIString("Debugger is disabled during a Timeline recording."), " ");
         let stopRecordingLink = this._timelineRecordingWarningElement.appendChild(document.createElement("a"));
         stopRecordingLink.textContent = WebInspector.UIString("Stop recording.");
         stopRecordingLink.addEventListener("click", () => { WebInspector.timelineManager.stopCapturing(); });
 
+        this._breakpointsDisabledWarningElement = document.createElement("div");
+        this._breakpointsDisabledWarningElement.classList.add("warning-banner");
+        this._breakpointsDisabledWarningElement.append(WebInspector.UIString("Breakpoints are disabled."), document.createElement("br"));
+        let enableBreakpointsLink = this._breakpointsDisabledWarningElement.appendChild(document.createElement("a"));
+        enableBreakpointsLink.textContent = WebInspector.UIString("Enable breakpoints.");
+        enableBreakpointsLink.addEventListener("click", () => { WebInspector.debuggerToggleBreakpoints(); });
+
         this._navigationBar = new WebInspector.NavigationBar;
         this.addSubview(this._navigationBar);
 
@@ -185,6 +192,8 @@
 
         if (WebInspector.timelineManager.isCapturing() && WebInspector.debuggerManager.breakpointsDisabledTemporarily)
             this._timelineCapturingWillStart(null);
+
+        this._updateBreakpointsDisabledBanner();
     }
 
     // Public
@@ -325,6 +334,8 @@
     _breakpointsEnabledDidChange(event)
     {
         this._debuggerBreakpointsButtonItem.activated = WebInspector.debuggerManager.breakpointsEnabled;
+
+        this._updateBreakpointsDisabledBanner();
     }
 
     _addBreakpoint(breakpoint)
@@ -443,6 +454,7 @@
         this._debuggerPauseResumeButtonItem.enabled = false;
 
         this.contentView.element.insertBefore(this._timelineRecordingWarningElement, this.contentView.element.firstChild);
+        this._updateBreakpointsDisabledBanner();
     }
 
     _timelineCapturingStopped(event)
@@ -451,8 +463,20 @@
         this._debuggerPauseResumeButtonItem.enabled = true;
 
         this._timelineRecordingWarningElement.remove();
+        this._updateBreakpointsDisabledBanner();
     }
 
+    _updateBreakpointsDisabledBanner()
+    {
+        let breakpointsEnabled = WebInspector.debuggerManager.breakpointsEnabled;
+        let timelineWarningShowing = !!this._timelineRecordingWarningElement.parentElement;
+
+        if (!breakpointsEnabled && !timelineWarningShowing)
+            this.contentView.element.insertBefore(this._breakpointsDisabledWarningElement, this.contentView.element.firstChild);
+        else
+            this._breakpointsDisabledWarningElement.remove();
+    }
+
     _scriptAdded(event)
     {
         this._addScript(event.data.script);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to