Changeset 243272 in webkit
- Timestamp:
- Mar 20, 2019 7:27:35 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r243271 r243272 1 2019-03-20 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: Canvas: rework how Canvas.enable/Canvas.disable is used so that events are not sent when the Canvas tab isn't enabled 4 https://bugs.webkit.org/show_bug.cgi?id=195828 5 <rdar://problem/48941756> 6 7 Reviewed by Timothy Hatcher. 8 9 * UserInterface/Controllers/CanvasManager.js: 10 (WI.CanvasManager): 11 (WI.CanvasManager.prototype.initializeTarget): 12 (WI.CanvasManager.prototype.enable): Added. 13 (WI.CanvasManager.prototype.disable): Added. 14 15 * UserInterface/Views/CanvasTabContentView.js: 16 (WI.CanvasTabContentView): 17 (WI.CanvasTabContentView.prototype.closed): Added. 18 19 * UserInterface/Base/Test.js: 20 (WI.contentLoaded): 21 1 22 2019-03-20 Devin Rousso <drousso@apple.com> 2 23 -
trunk/Source/WebInspectorUI/UserInterface/Controllers/CanvasManager.js
r242737 r243272 32 32 super(); 33 33 34 WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this); 35 34 this._enabled = false; 36 35 this._canvasIdentifierMap = new Map; 37 36 this._shaderProgramIdentifierMap = new Map; 38 37 this._importedRecordings = new Set; 38 39 WI.Frame.addEventListener(WI.Frame.Event.MainResourceDidChange, this._mainResourceDidChange, this); 39 40 } 40 41 … … 43 44 initializeTarget(target) 44 45 { 46 if (!this._enabled) 47 return; 48 45 49 if (target.CanvasAgent) { 46 50 target.CanvasAgent.enable(); … … 96 100 97 101 this.dispatchEventToListeners(WI.CanvasManager.Event.RecordingImported, {recording, initiatedByUser: true}); 102 } 103 104 enable() 105 { 106 console.assert(!this._enabled); 107 108 this._enabled = true; 109 110 for (let target of WI.targets) 111 this.initializeTarget(target); 112 } 113 114 disable() 115 { 116 console.assert(this._enabled); 117 118 for (let target of WI.targets) { 119 if (target.CanvasAgent) 120 target.CanvasAgent.disable(); 121 } 122 123 this._canvasIdentifierMap.clear(); 124 this._shaderProgramIdentifierMap.clear(); 125 this._importedRecordings.clear(); 126 127 this._enabled = false; 98 128 } 99 129 -
trunk/Source/WebInspectorUI/UserInterface/Test/Test.js
r240540 r243272 130 130 WI.contentLoaded = function() 131 131 { 132 // Things that would normally get called by the UI, that we still want to do in tests. 133 WI.canvasManager.enable(); 134 132 135 // Signal that the frontend is now ready to receive messages. 133 136 InspectorFrontendAPI.loadCompleted(); -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasTabContentView.js
r240534 r243272 59 59 this.element.addEventListener("dragover", this._handleDragOver.bind(this)); 60 60 this.element.addEventListener("drop", this._handleDrop.bind(this)); 61 62 WI.canvasManager.enable(); 61 63 } 62 64 … … 121 123 122 124 super.hidden(); 125 } 126 127 closed() 128 { 129 WI.canvasManager.disable(); 130 131 super.closed(); 123 132 } 124 133
Note: See TracChangeset
for help on using the changeset viewer.