WebKit Bugzilla
Attachment 356425 Details for
Bug 192189
: Web Inspector: Canvas: add singular localized string for "Record first %s frames"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192189-20181203154427.patch (text/plain), 9.12 KB, created by
Devin Rousso
on 2018-12-03 15:44:28 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Devin Rousso
Created:
2018-12-03 15:44:28 PST
Size:
9.12 KB
patch
obsolete
>diff --git a/Source/WebInspectorUI/ChangeLog b/Source/WebInspectorUI/ChangeLog >index d603a7ea16e129f8db1c6d01f1b5967bbd33c99c..5aac4480fc231ccc2fcdd0cb8ce48ee2f309328c 100644 >--- a/Source/WebInspectorUI/ChangeLog >+++ b/Source/WebInspectorUI/ChangeLog >@@ -1,3 +1,26 @@ >+2018-12-03 Devin Rousso <drousso@apple.com> >+ >+ Web Inspector: Canvas: add singular localized string for "Record first %s frames" >+ https://bugs.webkit.org/show_bug.cgi?id=192189 >+ >+ Reviewed by Joseph Pecoraro. >+ >+ * UserInterface/Views/CanvasOverviewContentView.js: >+ (WI.CanvasOverviewContentView): >+ (WI.CanvasOverviewContentView.prototype._setRecordingAutoCaptureFrameCount): >+ (WI.CanvasOverviewContentView.prototype._updateRecordingAutoCaptureCheckboxLabel): Added. >+ (WI.CanvasOverviewContentView.prototype._handleRecordingAutoCaptureInput): >+ (WI.CanvasOverviewContentView.prototype._handleCanvasRecordingAutoCaptureFrameCountChanged): >+ (WI.CanvasOverviewContentView.prototype.initialLayout): Deleted. >+ Drive-by: update the auto-capture navigation item when the view is first created so there is >+ no flashing of in the navigation bar (before `initialLayout` is called). >+ >+ * UserInterface/Views/CheckboxNavigationItem.js: >+ (WI.CheckboxNavigationItem): >+ (WI.CheckboxNavigationItem.prototype.set label): Added. >+ >+ * Localizations/en.lproj/localizedStrings.js: >+ > 2018-12-03 Matt Baker <mattbaker@apple.com> > > Web Inspector: REGRESSION(r238599): Multiple Selection: restoring selection when opening WebInspector puts the TreeElement into a permanent selected state >diff --git a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >index 4c7f78679f59e235bcd34343112592c339e45f71..e691e8d1fb6bed5a6051c7d5fb58bc3987bff31d 100644 >--- a/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >+++ b/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js >@@ -701,6 +701,7 @@ localizedStrings["Range Issue"] = "Range Issue"; > localizedStrings["Readonly"] = "Readonly"; > localizedStrings["Reasons for compositing"] = "Reasons for compositing"; > localizedStrings["Reasons for compositing:"] = "Reasons for compositing:"; >+localizedStrings["Record first %s frame"] = "Record first %s frame"; > localizedStrings["Record first %s frames"] = "Record first %s frames"; > localizedStrings["Recording"] = "Recording"; > localizedStrings["Recording %d"] = "Recording %d"; >diff --git a/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js b/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js >index 1b0a00b7a5f644df1eae761a8ddd4f8f6bbf8dd1..671786604f329656c3d6a8b6a47324b5c48087d4 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CanvasOverviewContentView.js >@@ -51,15 +51,14 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value; > this._recordingAutoCaptureFrameCountInputElement.addEventListener("input", this._handleRecordingAutoCaptureInput.bind(this)); > >- let label = document.createDocumentFragment(); >- String.format(WI.UIString("Record first %s frames"), [this._recordingAutoCaptureFrameCountInputElement], String.standardFormatters, label, (a, b) => { >- a.append(b); >- return a; >- }); >- >+ const label = null; > this._recordingAutoCaptureNavigationItem = new WI.CheckboxNavigationItem("canvas-recording-auto-capture", label, !!WI.settings.canvasRecordingAutoCaptureEnabled.value); > this._recordingAutoCaptureNavigationItem.visibilityPriority = WI.NavigationItem.VisibilityPriority.Low; > this._recordingAutoCaptureNavigationItem.addEventListener(WI.CheckboxNavigationItem.Event.CheckedDidChange, this._handleRecordingAutoCaptureCheckedDidChange, this); >+ >+ let frameCount = this._updateRecordingAutoCaptureInputElementSize(); >+ this._setRecordingAutoCaptureFrameCount(frameCount); >+ this._updateRecordingAutoCaptureCheckboxLabel(frameCount); > } > > this._importButtonNavigationItem = new WI.ButtonNavigationItem("import-recording", WI.UIString("Import"), "Images/Import.svg", 15, 15); >@@ -98,16 +97,6 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > > // Protected > >- initialLayout() >- { >- super.initialLayout(); >- >- if (WI.CanvasManager.supportsRecordingAutoCapture()) { >- this._updateRecordingAutoCaptureInputElementSize(); >- this._setRecordingAutoCaptureFrameCount(); >- } >- } >- > contentViewAdded(contentView) > { > contentView.element.addEventListener("mouseenter", this._contentViewMouseEnter); >@@ -198,9 +187,11 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > WI.domManager.hideDOMNodeHighlight(); > } > >- _setRecordingAutoCaptureFrameCount() >+ _setRecordingAutoCaptureFrameCount(frameCount) > { >- let frameCount = parseInt(this._recordingAutoCaptureFrameCountInputElement.value); >+ if (isNaN(frameCount)) >+ frameCount = parseInt(this._recordingAutoCaptureFrameCountInputElement.value); >+ > console.assert(!isNaN(frameCount) && frameCount >= 0); > > if (this._recordingAutoCaptureNavigationItem.checked) >@@ -211,6 +202,30 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > WI.canvasManager.setRecordingAutoCaptureFrameCount(enabled, frameCount); > } > >+ _updateRecordingAutoCaptureCheckboxLabel(frameCount) >+ { >+ if (isNaN(frameCount)) >+ frameCount = parseInt(this._recordingAutoCaptureFrameCountInputElement.value); >+ >+ let label = frameCount === 1 ? WI.UIString("Record first %s frame") : WI.UIString("Record first %s frames"); >+ >+ let selectionStart = this._recordingAutoCaptureFrameCountInputElement.selectionStart; >+ let selectionEnd = this._recordingAutoCaptureFrameCountInputElement.selectionEnd; >+ let direction = this._recordingAutoCaptureFrameCountInputElement.direction; >+ >+ let fragment = document.createDocumentFragment(); >+ String.format(label, [this._recordingAutoCaptureFrameCountInputElement], String.standardFormatters, fragment, (a, b) => { >+ a.append(b); >+ return a; >+ }); >+ >+ this._recordingAutoCaptureNavigationItem.label = fragment; >+ >+ this._recordingAutoCaptureFrameCountInputElement.selectionStart = selectionStart; >+ this._recordingAutoCaptureFrameCountInputElement.selectionEnd = selectionEnd; >+ this._recordingAutoCaptureFrameCountInputElement.direction = direction; >+ } >+ > _updateRecordingAutoCaptureInputElementSize() > { > let frameCount = parseInt(this._recordingAutoCaptureFrameCountInputElement.value); >@@ -240,7 +255,7 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > let frameCount = this._updateRecordingAutoCaptureInputElementSize(); > this._recordingAutoCaptureNavigationItem.checked = !!frameCount; > >- this._setRecordingAutoCaptureFrameCount(); >+ this._setRecordingAutoCaptureFrameCount(frameCount); > } > > _handleRecordingAutoCaptureCheckedDidChange(event) >@@ -256,6 +271,8 @@ WI.CanvasOverviewContentView = class CanvasOverviewContentView extends WI.Collec > _handleCanvasRecordingAutoCaptureFrameCountChanged(event) > { > this._recordingAutoCaptureFrameCountInputElement.value = WI.settings.canvasRecordingAutoCaptureFrameCount.value; >+ >+ this._updateRecordingAutoCaptureCheckboxLabel(WI.settings.canvasRecordingAutoCaptureFrameCount.value); > } > > _handleImportButtonNavigationItemClicked(event) >diff --git a/Source/WebInspectorUI/UserInterface/Views/CheckboxNavigationItem.js b/Source/WebInspectorUI/UserInterface/Views/CheckboxNavigationItem.js >index c89a9d3126cc6b07fb10d37c311b5b10dd3c75e4..6da9106b719e4ce0ea587f4bb00cde688ac60aca 100644 >--- a/Source/WebInspectorUI/UserInterface/Views/CheckboxNavigationItem.js >+++ b/Source/WebInspectorUI/UserInterface/Views/CheckboxNavigationItem.js >@@ -37,9 +37,10 @@ WI.CheckboxNavigationItem = class CheckboxNavigationItem extends WI.NavigationIt > > this._checkboxLabel = this.element.appendChild(document.createElement("label")); > this._checkboxLabel.className = "toggle"; >- this._checkboxLabel.append(label); > this._checkboxLabel.setAttribute("for", this._checkboxElement.id); > this._checkboxLabel.addEventListener("click", this._handleLabelClick.bind(this)); >+ >+ this.label = label; > } > > // Public >@@ -54,6 +55,14 @@ WI.CheckboxNavigationItem = class CheckboxNavigationItem extends WI.NavigationIt > this._checkboxElement.checked = flag; > } > >+ set label(label) >+ { >+ this._checkboxLabel.removeChildren(); >+ >+ if (label); >+ this._checkboxLabel.append(label); >+ } >+ > // Protected > > get additionalClassNames()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192189
:
356071
| 356425