Bug 202957 - Web Inspector: Local Resource Overrides: automatically create an image/font local override when dragging content over a non-overridden resource
Summary: Web Inspector: Local Resource Overrides: automatically create an image/font l...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Devin Rousso
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-10-14 15:05 PDT by Devin Rousso
Modified: 2019-10-15 15:28 PDT (History)
6 users (show)

See Also:


Attachments
Patch (31.72 KB, patch)
2019-10-14 16:40 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff
Patch (31.95 KB, patch)
2019-10-15 09:53 PDT, Devin Rousso
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Devin Rousso 2019-10-14 15:05:46 PDT
Dragging/Dropping an image/font over a non-overridden resource content view should automatically create a local override for that resource, populate it's content with the dragged/dropped file, and show it.  This saves the user from having to click on the "Create Local Override" navigation item for non-text resources (which aren't editable in Web Inspector anyways, so they'd have to drag/drop).
Comment 1 Devin Rousso 2019-10-14 16:40:43 PDT
Created attachment 380937 [details]
Patch
Comment 2 Joseph Pecoraro 2019-10-14 19:11:45 PDT
Comment on attachment 380937 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=380937&action=review

r=me

> Source/WebInspectorUI/UserInterface/Views/DropZoneView.js:75
> +    set text(text)

Might as well add a getter?

> Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js:70
> +                this._importLocalResourceOverrideButtonNavigationItem.enabled = true;

I assume enabled is the default. Maybe this line can be removed.

> Source/WebInspectorUI/UserInterface/Views/ResourceContentView.js:77
>                  this._removeLocalResourceOverrideButtonNavigationItem.enabled = true;

Probably this one too then.
Comment 3 Devin Rousso 2019-10-15 09:52:42 PDT
Comment on attachment 380937 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=380937&action=review

>> Source/WebInspectorUI/UserInterface/Views/DropZoneView.js:75
>> +    set text(text)
> 
> Might as well add a getter?

I'd rather wait until it's actually needed.  We have a lot of getters all over that aren't ever used, and just add code "bloat".  Plus, I kinda like the idea of "preventing" callers from getting data out of a `WI.DropZoneView` (at least from the API surface), as it's not really a place where one should be keeping data.
Comment 4 Devin Rousso 2019-10-15 09:53:42 PDT
Created attachment 380996 [details]
Patch
Comment 5 WebKit Commit Bot 2019-10-15 10:15:47 PDT
Comment on attachment 380996 [details]
Patch

Clearing flags on attachment: 380996

Committed r251144: <https://trac.webkit.org/changeset/251144>
Comment 6 WebKit Commit Bot 2019-10-15 10:15:48 PDT
All reviewed patches have been landed.  Closing bug.
Comment 7 Ling Ho 2019-10-15 15:28:38 PDT
<rdar://problem/56296743>