Title: [238169] trunk/Source/WebInspectorUI
Revision
238169
Author
drou...@apple.com
Date
2018-11-14 04:01:31 -0800 (Wed, 14 Nov 2018)

Log Message

Web Inspector: Canvas: don't start with auto-capture enabled
https://bugs.webkit.org/show_bug.cgi?id=191553

Reviewed by Matt Baker.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
(WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
(WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
* UserInterface/Views/CanvasOverviewContentView.css:
(.navigation-bar > .item.canvas-recording-auto-capture > label > input):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (238168 => 238169)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-11-14 09:26:23 UTC (rev 238168)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-11-14 12:01:31 UTC (rev 238169)
@@ -1,5 +1,19 @@
 2018-11-14  Devin Rousso  <drou...@apple.com>
 
+        Web Inspector: Canvas: don't start with auto-capture enabled
+        https://bugs.webkit.org/show_bug.cgi?id=191553
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/CanvasOverviewContentView.js:
+        (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount):
+        (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureInputElementSize):
+        (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput):
+        * UserInterface/Views/CanvasOverviewContentView.css:
+        (.navigation-bar > .item.canvas-recording-auto-capture > label > input):
+
+2018-11-14  Devin Rousso  <drou...@apple.com>
+
         Web Inspector: Network Graphs are missing minimum sizes, might have no graph at all
         https://bugs.webkit.org/show_bug.cgi?id=191208
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css (238168 => 238169)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css	2018-11-14 09:26:23 UTC (rev 238168)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.css	2018-11-14 12:01:31 UTC (rev 238169)
@@ -181,8 +181,10 @@
 .navigation-bar > .item.canvas-recording-auto-capture > label > input {
     width: 1.5em;
     min-width: 1.5em;
-    margin: 0 4px;
+    margin: 0 var(--recording-auto-capture-input-margin); 
     text-align: center;
+
+    --recording-auto-capture-input-margin: 4px; /* Keep this in sync with `recordingAutoCaptureInputMargin`. */
 }
 
 .navigation-bar > .item.canvas-recording-auto-capture > label > input::-webkit-inner-spin-button {

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js (238168 => 238169)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js	2018-11-14 09:26:23 UTC (rev 238168)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js	2018-11-14 12:01:31 UTC (rev 238169)
@@ -202,8 +202,11 @@
         let frameCount = parseInt(this._recordingAutoCaptureFrameCountInputElement.value);
         console.assert(!isNaN(frameCount) && frameCount >= 0);
 
-        let enabled = frameCount && !!this._recordingAutoCaptureNavigationItem.checked;
+        if (this._recordingAutoCaptureNavigationItem.checked)
+            frameCount = Math.max(1, frameCount);
 
+        let enabled = frameCount > 0 && !!this._recordingAutoCaptureNavigationItem.checked;
+
         WI.canvasManager.setRecordingAutoCaptureFrameCount(enabled, frameCount);
     }
 
@@ -221,17 +224,21 @@
                 this._recordingAutoCaptureFrameCountInputElement.__cachedFont = computedStyle.font;
             }
 
+            const recordingAutoCaptureInputMargin = 8; // Keep this in sync with `--recording-auto-capture-input-margin`.
+
             context.font = this._recordingAutoCaptureFrameCountInputElement.__cachedFont;
             let textMetrics = context.measureText(this._recordingAutoCaptureFrameCountInputElement.value);
-            this._recordingAutoCaptureFrameCountInputElement.style.setProperty("width", (textMetrics.width + 8) + "px");
+            this._recordingAutoCaptureFrameCountInputElement.style.setProperty("width", (textMetrics.width + recordingAutoCaptureInputMargin) + "px");
         });
 
-        this._recordingAutoCaptureNavigationItem.checked = !!frameCount;
+        return frameCount;
     }
 
     _handleRecordingAutoCaptureInput(event)
     {
-        this._updateRecordingAutoCaptureInputElementSize();
+        let frameCount = this._updateRecordingAutoCaptureInputElementSize();
+        this._recordingAutoCaptureNavigationItem.checked = !!frameCount;
+
         this._setRecordingAutoCaptureFrameCount();
     }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to