Bug 171177

Summary: File inputs only accept UTI types that can be inserted into contenteditable areas when dropping
Product: WebKit Reporter: Wenson Hsieh <wenson_hsieh>
Component: WebCore Misc.Assignee: Wenson Hsieh <wenson_hsieh>
Status: RESOLVED FIXED    
Severity: Normal CC: aestes, bdakin, buildbot, megan_gardner, thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Minor renaming
aestes: review+, buildbot: commit-queue-
Archive of layout-test-results from ews112 for mac-elcapitan
none
Fix Win/GTK builds none

Description Wenson Hsieh 2017-04-22 16:55:43 PDT
<rdar://problem/31765379>
Comment 1 Wenson Hsieh 2017-04-22 17:56:42 PDT
Created attachment 307915 [details]
Patch
Comment 2 Wenson Hsieh 2017-04-22 18:05:28 PDT
Created attachment 307916 [details]
Minor renaming
Comment 3 Andy Estes 2017-04-22 18:56:19 PDT
Comment on attachment 307916 [details]
Minor renaming

This makes dragging incompatible content a little more expensive now that there's always a hit test in canProcessDrag(). Are you concerned about that?
Comment 4 Wenson Hsieh 2017-04-22 19:03:55 PDT
Thanks for taking a look Andy!

(In reply to Andy Estes from comment #3)
> Comment on attachment 307916 [details]
> Minor renaming
> 
> This makes dragging incompatible content a little more expensive now that
> there's always a hit test in canProcessDrag(). Are you concerned about that?

This is true. But I think in the vast majority of cases, there is compatible content in the pasteboard, and even in the cases where there isn't compatible content, we will end up incurring the same cost as if there were compatible content, which AFAIK isn't an issue currently.
Comment 5 Andy Estes 2017-04-22 19:07:45 PDT
Comment on attachment 307916 [details]
Minor renaming

Actually, can't you just change DragData::containsCompatibleContent() to check for kUTTypeContent? That would avoid the extra hit testing it seems.
Comment 6 Wenson Hsieh 2017-04-22 19:09:20 PDT
(In reply to Andy Estes from comment #5)
> Comment on attachment 307916 [details]
> Minor renaming
> 
> Actually, can't you just change DragData::containsCompatibleContent() to
> check for kUTTypeContent? That would avoid the extra hit testing it seems.

That would work when dragging over file inputs, but that would produce incorrect behavior when dropping into an editable area (for example, a JSON file should not be allowed to drop into a contenteditable).
Comment 7 Andy Estes 2017-04-22 19:32:12 PDT
Comment on attachment 307916 [details]
Minor renaming

I talked to Wenson on IRC and he explained why we can't check for a UTI in containsCompatibleContent() without hit-testing first. Thanks, Wenson!
Comment 8 Build Bot 2017-04-22 19:32:57 PDT
Comment on attachment 307916 [details]
Minor renaming

Attachment 307916 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/3586948

New failing tests:
webrtc/datachannel/basic.html
Comment 9 Build Bot 2017-04-22 19:32:58 PDT
Created attachment 307917 [details]
Archive of layout-test-results from ews112 for mac-elcapitan

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews112  Port: mac-elcapitan  Platform: Mac OS X 10.11.6
Comment 10 Wenson Hsieh 2017-04-22 19:38:43 PDT
Created attachment 307918 [details]
Fix Win/GTK builds
Comment 11 Build Bot 2017-04-22 19:45:54 PDT
Attachment 307918 [details] did not pass style-queue:


ERROR: Source/WebCore/platform/gtk/DragDataGtk.cpp:0:  No copyright message found.  You should have a line: "Copyright [year] <Copyright Owner>"  [legal/copyright] [5]
Total errors found: 1 in 8 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 12 Wenson Hsieh 2017-04-22 20:54:13 PDT
Committed <https://trac.webkit.org/changeset/215669/webkit>. WebRTC, RTL visual viewport, and audio-related test failures/flakiness encountered on EWS seem unrelated.