Changeset 276170 in webkit
- Timestamp:
- Apr 16, 2021, 2:22:00 PM (5 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
UserInterface/Views/CanvasContentView.js (modified) (2 diffs)
-
UserInterface/Views/GraphicsTabContentView.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r276146 r276170 1 2021-04-16 Devin Rousso <drousso@apple.com> 2 3 Web Inspector: REGRESSION(?): Graphics: dropping a recording leaves behind a drop zone view 4 https://bugs.webkit.org/show_bug.cgi?id=224648 5 6 Reviewed by BJ Burg. 7 8 * UserInterface/Views/GraphicsTabContentView.js: 9 (WI.GraphicsTabContentView.prototype.initialLayout): 10 It appears that it's possible for re-entrancy issues in the `WI.View` system since the 11 `_didInitialLayout` flag isn't set until _after_ `initialLayout` returns, meaning that if 12 the logic inside `initialLayout` triggers a synchronous `layout` then that second `layout` 13 won't know that it's already in the middle of an `initialLayout`. In this case, showing the 14 `WI.GraphicsOverviewContentView` causes the navigation sidebar to be shown, which forces a 15 synchronous `layout` from handling `WI.Sidebar.Event.WidthDidChange`. For now, there's no 16 "rush" to show the `WI.GraphicsOverviewContentView` so we delay it by one event loop turn. 17 18 * UserInterface/Views/CanvasContentView.js: 19 (WI.CanvasContentView.prototype.initialLayout): 20 (WI.CanvasContentView.prototype.dropZoneShouldAppearForDragEvent): Deleted. 21 (WI.CanvasContentView.prototype.dropZoneHandleDrop): Deleted. 22 There's no reason to have another `WI.DropZoneView` here since there's already one that 23 covers the entire tab. 24 1 25 2021-04-16 Devin Rousso <drousso@apple.com> 2 26 -
trunk/Source/WebInspectorUI/UserInterface/Views/CanvasContentView.js
r269359 r276170 83 83 } 84 84 85 // DropZoneView delegate86 87 dropZoneShouldAppearForDragEvent(dropZone, event)88 {89 return event.dataTransfer.types.includes("Files");90 }91 92 dropZoneHandleDrop(dropZone, event)93 {94 let files = event.dataTransfer.files;95 if (files.length !== 1) {96 InspectorFrontendHost.beep();97 return;98 }99 100 WI.FileUtilities.readJSON(files, (result) => WI.canvasManager.processJSON(result));101 }102 103 85 // Protected 104 86 … … 184 166 if (isCard) 185 167 this._refreshPixelSize(); 186 187 if (!isCard) {188 let dropZoneView = new WI.DropZoneView(this);189 dropZoneView.text = WI.UIString("Import Recording");190 dropZoneView.targetElement = this.element;191 this.addSubview(dropZoneView);192 }193 168 } 194 169 -
trunk/Source/WebInspectorUI/UserInterface/Views/GraphicsTabContentView.js
r266464 r276170 204 204 205 205 this._overviewContentView = new WI.GraphicsOverviewContentView; 206 this.contentBrowser.showContentView(this._overviewContentView); 206 207 // FIXME: <https://webkit.org/b/224650> (Web Inspector: audit for re-entrancy issues with `initialLayout` and `layout`) 208 setTimeout(() => { 209 this.contentBrowser.showContentView(this._overviewContentView); 210 }); 207 211 208 212 let dropZoneView = new WI.DropZoneView(this);
Note:
See TracChangeset
for help on using the changeset viewer.