Changeset 239420 in webkit


Ignore:
Timestamp:
Dec 19, 2018 7:56:27 PM (5 years ago)
Author:
Devin Rousso
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):

Location:
trunk/Source/WebInspectorUI
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebInspectorUI/ChangeLog

    r239413 r239420  
     12018-12-19  Devin Rousso  <drousso@apple.com>
     2
     3        Web Inspector: Canvas: the recording auto-capture input shouldn't start focused
     4        https://bugs.webkit.org/show_bug.cgi?id=192454
     5
     6        Reviewed by Joseph Pecoraro.
     7
     8        * UserInterface/Views/CanvasOverviewContentView.js:
     9        (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel):
     10        (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged):
     11
    1122018-12-19  Nikita Vasilyev  <nvasilyev@apple.com>
    213
  • trunk/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js

    r238829 r239420  
    210210        let label = frameCount === 1 ? WI.UIString("Record first %s frame") : WI.UIString("Record first %s frames");
    211211
     212        let active = document.activeElement === this._recordingAutoCaptureFrameCountInputElement;
    212213        let selectionStart = this._recordingAutoCaptureFrameCountInputElement.selectionStart;
    213214        let selectionEnd = this._recordingAutoCaptureFrameCountInputElement.selectionEnd;
     
    222223        this._recordingAutoCaptureNavigationItem.label = fragment;
    223224
    224         this._recordingAutoCaptureFrameCountInputElement.selectionStart = selectionStart;
    225         this._recordingAutoCaptureFrameCountInputElement.selectionEnd = selectionEnd;
    226         this._recordingAutoCaptureFrameCountInputElement.direction = direction;
     225        if (active) {
     226            this._recordingAutoCaptureFrameCountInputElement.selectionStart = selectionStart;
     227            this._recordingAutoCaptureFrameCountInputElement.selectionEnd = selectionEnd;
     228            this._recordingAutoCaptureFrameCountInputElement.direction = direction;
     229        }
    227230    }
    228231
     
    271274    _handleCanvasRecordingAutoCaptureFrameCountChanged(event)
    272275    {
    273         this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value;
     276        // Only update the value if it is different to prevent mangling the selection.
     277        if (parseInt(this._recordingAutoCaptureFrameCountInputElement.value) !== WI.settings.canvasRecordingAutoCaptureFrameCount.value)
     278            this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value;
    274279
    275280        this._updateRecordingAutoCaptureCheckboxLabel(WI.settings.canvasRecordingAutoCaptureFrameCount.value);
Note: See TracChangeset for help on using the changeset viewer.