Bug 171177 - File inputs only accept UTI types that can be inserted into contenteditable areas when dropping
Summary: File inputs only accept UTI types that can be inserted into contenteditable a...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Wenson Hsieh
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-04-22 16:55 PDT by Wenson Hsieh
Modified: 2017-04-22 20:54 PDT (History)
6 users (show)

See Also:


Attachments
Patch (7.59 KB, patch)
2017-04-22 17:56 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff
Minor renaming (7.54 KB, patch)
2017-04-22 18:05 PDT, Wenson Hsieh
aestes: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ews112 for mac-elcapitan (1.79 MB, application/zip)
2017-04-22 19:32 PDT, Build Bot
no flags Details
Fix Win/GTK builds (9.02 KB, patch)
2017-04-22 19:38 PDT, Wenson Hsieh
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.