Changeset 223952 in webkit
- Timestamp:
- Oct 25, 2017 12:39:05 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r223947 r223952 1 2017-10-25 Devin Rousso <webkit@devinrousso.com> 2 3 Web Inspector: preserve Recordings for each Canvas after closing the Canvas tab 4 https://bugs.webkit.org/show_bug.cgi?id=178767 5 <rdar://problem/35167239> 6 7 Reviewed by Brian Burg. 8 9 * inspector/canvas/resources/recording-utilities.js: 10 (TestPage.registerInitializer.window.startRecording): 11 Add assertions that the recording is added to the canvas' RecordingCollection. 12 1 13 2017-10-24 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/LayoutTests/inspector/canvas/resources/recording-utilities.js
r222888 r223952 105 105 106 106 let recording = event.data.recording; 107 InspectorTest.assert(recording.source === canvas, "Recording should be of the given canvas."); 107 108 InspectorTest.assert(recording.source.contextType === type, `Recording should be of a canvas with type "${type}".`); 109 InspectorTest.assert(recording.source.recordingCollection.items.has(recording), "Recording should be in the canvas' list of recordings."); 108 110 109 111 return recording.actions.then(() => { -
trunk/Source/WebInspectorUI/ChangeLog
r223948 r223952 1 2017-10-25 Devin Rousso <webkit@devinrousso.com> 2 3 Web Inspector: preserve Recordings for each Canvas after closing the Canvas tab 4 https://bugs.webkit.org/show_bug.cgi?id=178767 5 <rdar://problem/35167239> 6 7 Reviewed by Brian Burg. 8 9 * UserInterface/Test.html: 10 Include CollectionTypes for tests. 11 12 * UserInterface/Controllers/CanvasManager.js: 13 (WI.CanvasManager.prototype.recordingFinished): 14 15 * UserInterface/Models/Canvas.js: 16 (WI.Canvas): 17 (WI.Canvas.prototype.get recordingCollection): 18 19 * UserInterface/Models/CollectionTypes.js: 20 (WI.CanvasCollection): 21 (WI.RecordingCollection): 22 23 * UserInterface/Views/CanvasContentView.js: 24 (WI.CanvasContentView.prototype.initialLayout): 25 (WI.CanvasContentView.prototype._addRecording): 26 (WI.CanvasContentView.prototype._recordingStopped): 27 28 * UserInterface/Views/CanvasTabContentView.js: 29 (WI.CanvasTabContentView.prototype.attached): 30 (WI.CanvasTabContentView.prototype._recordingAdded): 31 1 32 2017-10-24 Joseph Pecoraro <pecoraro@apple.com> 2 33 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
r223920 r223952 155 155 return; 156 156 157 let recording = recordingPayload ? WI.Recording.fromPayload(recordingPayload) : null 157 let recording = recordingPayload ? WI.Recording.fromPayload(recordingPayload) : null; 158 158 if (recording) { 159 159 recording.source = canvas; 160 160 recording.createDisplayName(); 161 162 canvas.recordingCollection.add(recording); 161 163 } 162 164 -
trunk/Source/WebInspectorUI/UserInterface/Models/Canvas.js
r223920 r223952 44 44 this._cssCanvasClientNodes = null; 45 45 this._shaderProgramCollection = new WI.Collection(WI.Collection.TypeVerifier.ShaderProgram); 46 this._recordingCollection = new WI.RecordingCollection; 46 47 47 48 this._nextShaderProgramDisplayNumber = 1; … … 110 111 get contextAttributes() { return this._contextAttributes; } 111 112 get shaderProgramCollection() { return this._shaderProgramCollection; } 113 get recordingCollection() { return this._recordingCollection; } 112 114 113 115 get isRecording() -
trunk/Source/WebInspectorUI/UserInterface/Models/CollectionTypes.js
r223011 r223952 26 26 WI.CanvasCollection = class CanvasCollection extends WI.Collection 27 27 { 28 constructor(canvases )28 constructor(canvases = []) 29 29 { 30 30 super((item) => item instanceof WI.Canvas); … … 34 34 } 35 35 }; 36 37 WI.RecordingCollection = class RecordingCollection extends WI.Collection 38 { 39 constructor(recordings = []) 40 { 41 super((item) => item instanceof WI.Recording); 42 43 for (let recording of recordings) 44 this.add(recording); 45 } 46 }; -
trunk/Source/WebInspectorUI/UserInterface/Test.html
r223929 r223952 116 116 <script src="Models/CollectionEntry.js"></script> 117 117 <script src="Models/CollectionEntryPreview.js"></script> 118 <script src="Models/CollectionTypes.js"></script> 118 119 <script src="Models/Color.js"></script> 119 120 <script src="Models/ConsoleCommandResultMessage.js"></script> -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
r223918 r223952 129 129 this._recordingSelectElement.addEventListener("change", this._handleRecordingSelectElementChange.bind(this)); 130 130 131 for (let recording of this.representedObject.recordingCollection.items) 132 this._addRecording(recording); 133 131 134 let flexibleSpaceElement = footer.appendChild(document.createElement("div")); 132 135 flexibleSpaceElement.className = "flexible-space"; … … 231 234 } 232 235 236 _addRecording(recording) 237 { 238 let optionElement = this._recordingSelectElement.appendChild(document.createElement("option")); 239 optionElement.textContent = recording.displayName; 240 241 this._recordingOptionElementMap.set(optionElement, recording); 242 243 let recordingCount = this._recordingSelectElement.options.length; 244 this._recordingSelectText.textContent = WI.UIString("View Recordings... (%d)").format(recordingCount); 245 this._recordingSelectContainer.classList.remove("hidden"); 246 247 this._recordingSelectElement.selectedIndex = -1; 248 } 249 233 250 _toggleRecording(event) 234 251 { … … 254 271 return; 255 272 256 const subtitle = null; 257 let recordingTreeElement = new WI.GeneralTreeElement(["recording"], recording.displayName, subtitle, recording); 258 recordingTreeElement.tooltip = ""; // Tree element tooltips aren't needed in a popover. 259 260 let optionElement = this._recordingSelectElement.appendChild(document.createElement("option")); 261 optionElement.textContent = recording.displayName; 262 263 this._recordingOptionElementMap.set(optionElement, recording); 264 265 let recordingCount = this._recordingSelectElement.options.length; 266 this._recordingSelectText.textContent = WI.UIString("View Recordings... (%d)").format(recordingCount); 267 this._recordingSelectContainer.classList.remove("hidden"); 268 269 WI.showRepresentedObject(event.data.recording); 273 this._addRecording(recording); 270 274 } 271 275 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js
r223921 r223952 152 152 this._canvasCollection = new WI.CanvasCollection(WI.canvasManager.canvases); 153 153 154 for (let canvas of this._canvasCollection.items) 154 for (let canvas of this._canvasCollection.items) { 155 155 this._canvasTreeOutline.appendChild(new WI.CanvasTreeElement(canvas)); 156 157 for (let recording of canvas.recordingCollection.items) 158 this._recordingAdded(recording, {suppressShowRecording: true}); 159 } 156 160 } 157 161 … … 265 269 } 266 270 267 _recordingAdded(recording )271 _recordingAdded(recording, options = {}) 268 272 { 269 273 const subtitle = null; … … 278 282 this._canvasTreeOutline.appendChild(recordingTreeElement); 279 283 280 this.showRepresentedObject(recording); 281 this._updateActionIndex(0, {suppressNavigationSidebarUpdate: true}); 284 if (!options.suppressShowRecording) { 285 this.showRepresentedObject(recording); 286 this._updateActionIndex(0, {suppressNavigationSidebarUpdate: true}); 287 } 282 288 } 283 289
Note: See TracChangeset
for help on using the changeset viewer.