Changeset 242511 in webkit
- Timestamp:
- Mar 5, 2019, 2:05:15 PM (6 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r242510 r242511 1 2019-03-05 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Canvas: remove event listeners once a recording is ready 4 https://bugs.webkit.org/show_bug.cgi?id=195324 5 6 Reviewed by Matt Baker. 7 8 * UserInterface/Models/Recording.js: 9 (WI.Recording): 10 (WI.Recording.prototype.async swizzle): 11 (WI.Recording.prototype.async _process): 12 13 * UserInterface/Views/RecordingActionTreeElement.js: 14 (WI.RecordingActionTreeElement): 15 (WI.RecordingActionTreeElement.prototype._handleValidityChanged): 16 17 * UserInterface/Views/CanvasSidebarPanel.js: 18 (WI.CanvasSidebarPanel.prototype.set recording): 19 (WI.CanvasSidebarPanel.prototype._handleRecordingProcessedAction): 20 21 * UserInterface/Views/RecordingContentView.js: 22 (WI.RecordingContentView.prototype.initialLayout): 23 (WI.RecordingContentView.prototype._handleRecordingProcessedAction): 24 1 25 2019-03-05 Joseph Pecoraro <pecoraro@apple.com> 2 26 -
trunk/Source/WebInspectorUI/UserInterface/Models/Recording.js
r240471 r242511 37 37 this._displayName = WI.UIString("Recording"); 38 38 39 this._swizzle = [];39 this._swizzle = null; 40 40 this._actions = [new WI.RecordingInitialStateAction].concat(...this._frames.map((frame) => frame.actions)); 41 41 this._visualActionIndexes = []; … … 296 296 async swizzle(index, type) 297 297 { 298 if (!this._swizzle) 299 this._swizzle = {}; 300 298 301 if (typeof this._swizzle[index] !== "object") 299 302 this._swizzle[index] = {}; … … 531 534 } 532 535 536 this._swizzle = null; 533 537 this._processContext = null; 534 538 this._processing = false; -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasSidebarPanel.js
r242049 r242511 115 115 return; 116 116 117 if (this._recording) { 118 this._recording.removeEventListener(WI.Recording.Event.ProcessedAction, this._handleRecordingProcessedAction, this); 119 this._recording.removeEventListener(WI.Recording.Event.StartProcessingFrame, this._handleRecordingStartProcessingFrame, this); 120 } 117 if (this._recording) 118 this._recording.removeEventListener(null, null, this); 121 119 122 120 if (recording) … … 125 123 this._recording = recording; 126 124 127 if (this._recording ) {125 if (this._recording && !this._recording.ready) { 128 126 this._recording.addEventListener(WI.Recording.Event.ProcessedAction, this._handleRecordingProcessedAction, this); 129 127 this._recording.addEventListener(WI.Recording.Event.StartProcessingFrame, this._handleRecordingStartProcessingFrame, this); … … 580 578 this._createRecordingActionTreeElement(action, index, isInitialStateAction ? this._recordingTreeOutline : this._recordingTreeOutline.children.lastValue); 581 579 582 if (this._recording.ready && !this._recording[WI.CanvasSidebarPanel.SelectedActionSymbol]) 583 this.action = this._recording.actions[0]; 584 585 if (action === this._recording.actions.lastValue && this._recordingProcessingOptionsContainer) { 586 this._recordingProcessingOptionsContainer.remove(); 587 this._recordingProcessingOptionsContainer = null; 580 if (this._recording.ready) { 581 this._recording.removeEventListener(null, null, this); 582 583 if (!this._recording[WI.CanvasSidebarPanel.SelectedActionSymbol]) 584 this.action = this._recording.actions[0]; 585 586 if (this._recordingProcessingOptionsContainer) { 587 this._recordingProcessingOptionsContainer.remove(); 588 this._recordingProcessingOptionsContainer = null; 589 } 588 590 } 589 591 } -
trunk/Source/WebInspectorUI/UserInterface/Views/RecordingActionTreeElement.js
r237777 r242511 39 39 this._copyText = copyText; 40 40 41 this.representedObject.addEventListener(WI.RecordingAction.Event.ValidityChanged, this._handleValidityChanged, this); 41 if (this.representedObject.valid) 42 this.representedObject.addEventListener(WI.RecordingAction.Event.ValidityChanged, this._handleValidityChanged, this); 42 43 } 43 44 … … 454 455 { 455 456 this.addClassName("invalid"); 457 458 this.representedObject.removeEventListener(null, null, this); 456 459 } 457 460 }; -
trunk/Source/WebInspectorUI/UserInterface/Views/RecordingContentView.js
r242017 r242511 168 168 this._sliderElement.max = 0; 169 169 170 this.representedObject.addEventListener(WI.Recording.Event.ProcessedAction, this._handleRecordingProcessedAction, this); 170 if (!this.representedObject.ready) 171 this.representedObject.addEventListener(WI.Recording.Event.ProcessedAction, this._handleRecordingProcessedAction, this); 171 172 } 172 173 … … 487 488 this._sliderElement.max = this.representedObject.visualActionIndexes.length; 488 489 this._updateSliderValue(); 490 491 if (this.representedObject.ready) 492 this.representedObject.removeEventListener(null, null, this); 489 493 } 490 494 };
Note:
See TracChangeset
for help on using the changeset viewer.