Title: [239420] trunk/Source/WebInspectorUI
Revision
239420
Author
drou...@apple.com
Date
2018-12-19 19:56:27 -0800 (Wed, 19 Dec 2018)

Log Message

Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
https://bugs.webkit.org/show_bug.cgi?id=192454

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasOverviewContentView.js:
(WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
(WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (239419 => 239420)


--- trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 03:24:28 UTC (rev 239419)
+++ trunk/Source/WebInspectorUI/ChangeLog	2018-12-20 03:56:27 UTC (rev 239420)
@@ -1,3 +1,14 @@
+2018-12-19  Devin Rousso  <drou...@apple.com>
+
+        Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
+        https://bugs.webkit.org/show_bug.cgi?id=192454
+
+        Reviewed by Joseph Pecoraro.
+
+        * UserInterface/Views/CanvasOverviewContentView.js:
+        (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
+        (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
+
 2018-12-19  Nikita Vasilyev  <nvasil...@apple.com>
 
         Web Inspector: Styles: shift-clicking a color-swatch to change formats starts editing the color

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js (239419 => 239420)


--- trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js	2018-12-20 03:24:28 UTC (rev 239419)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js	2018-12-20 03:56:27 UTC (rev 239420)
@@ -209,6 +209,7 @@
 
         let label = frameCount === 1 ? WI.UIString("Record first %s frame") : WI.UIString("Record first %s frames");
 
+        let active = document.activeElement === this._recordingAutoCaptureFrameCountInputElement;
         let selectionStart = this._recordingAutoCaptureFrameCountInputElement.selectionStart;
         let selectionEnd = this._recordingAutoCaptureFrameCountInputElement.selectionEnd;
         let direction = this._recordingAutoCaptureFrameCountInputElement.direction;
@@ -221,9 +222,11 @@
 
         this._recordingAutoCaptureNavigationItem.label = fragment;
 
-        this._recordingAutoCaptureFrameCountInputElement.selectionStart = selectionStart;
-        this._recordingAutoCaptureFrameCountInputElement.selectionEnd = selectionEnd;
-        this._recordingAutoCaptureFrameCountInputElement.direction = direction;
+        if (active) {
+            this._recordingAutoCaptureFrameCountInputElement.selectionStart = selectionStart;
+            this._recordingAutoCaptureFrameCountInputElement.selectionEnd = selectionEnd;
+            this._recordingAutoCaptureFrameCountInputElement.direction = direction;
+        }
     }
 
     _updateRecordingAutoCaptureInputElementSize()
@@ -270,7 +273,9 @@
 
     _handleCanvasRecordingAutoCaptureFrameCountChanged(event)
     {
-        this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value;
+        // Only update the value if it is different to prevent mangling the selection.
+        if (parseInt(this._recordingAutoCaptureFrameCountInputElement.value) !== WI.settings.canvasRecordingAutoCaptureFrameCount.value)
+            this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value;
 
         this._updateRecordingAutoCaptureCheckboxLabel(WI.settings.canvasRecordingAutoCaptureFrameCount.value);
     }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to