| Summary: | Web Inspector: use `WI.DropZoneView` instead of `handleFileDrop` | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||||
| Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | hi, inspector-bugzilla-changes, joepeck, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Devin Rousso
2020-08-13 23:33:21 PDT
Created attachment 406573 [details]
Patch
Comment on attachment 406573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406573&action=review r=me > Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js:104 > + WI.FileUtilities.readJSON(files, (result) => WI.auditManager.processJSON(result)) Style: Semicolon. > Source/WebInspectorUI/UserInterface/Views/GraphicsTabContentView.js:154 > + WI.FileUtilities.readJSON(files, (result) => WI.canvasManager.processJSON(result)) Style: Semicolon. > Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js:135 > + dropZoneShouldAppearForDragEvent(dropZone, event) > + { > + return event.dataTransfer.types.includes("Files"); > + } Given so many of these are the same, maybe could make an alternate convenience delegate to make this pattern simpler: dropZoneShouldAppearForDragEventWithFiles() { return true; } And `WI.DropZoneView` could check this delegate first. Probably unimportant. > Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js:388 > + WI.FileUtilities.readJSON(files, (result) => WI.timelineManager.processJSON(result)) Style: Semicolon. Comment on attachment 406573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406573&action=review >> Source/WebInspectorUI/UserInterface/Views/AuditTabContentView.js:104 >> + WI.FileUtilities.readJSON(files, (result) => WI.auditManager.processJSON(result)) > > Style: Semicolon. ... crap >> Source/WebInspectorUI/UserInterface/Views/GraphicsTabContentView.js:154 >> + WI.FileUtilities.readJSON(files, (result) => WI.canvasManager.processJSON(result)) > > Style: Semicolon. crap >> Source/WebInspectorUI/UserInterface/Views/TimelineTabContentView.js:388 >> + WI.FileUtilities.readJSON(files, (result) => WI.timelineManager.processJSON(result)) > > Style: Semicolon. CRAP Comment on attachment 406573 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=406573&action=review >> Source/WebInspectorUI/UserInterface/Views/NetworkTabContentView.js:135 >> + } > > Given so many of these are the same, maybe could make an alternate convenience delegate to make this pattern simpler: > > dropZoneShouldAppearForDragEventWithFiles() > { > return true; > } > > And `WI.DropZoneView` could check this delegate first. Probably unimportant. Eh, sure, but I think we've covered most (if not all) of the bases with this patch already, so meh. I kinda like the verbosity/explicitness :) Created attachment 406621 [details]
Patch
Committed r265707: <https://trac.webkit.org/changeset/265707> All reviewed patches have been landed. Closing bug and clearing flags on attachment 406621 [details]. *** Bug 215492 has been marked as a duplicate of this bug. *** |