On Mac, dataTransfer claims to contain URL list when dropping files
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 06:40:29 +0000 (06:40 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 06:40:29 +0000 (06:40 +0000)
commitfbce58c78bc94ae4cae64bd969b4c9b0b0ca52a7
tree24fc9d41757eb8947366fb0c00356d7e63bea18f
parentaf67ace8b5fcab30f5498b128d1bdaba4ff90999
On Mac, dataTransfer claims to contain URL list when dropping files
https://bugs.webkit.org/show_bug.cgi?id=177219

Reviewed by Wenson Hsieh.

Source/WebCore:

Fixed the bug by removing code which was specifically adding local filenames as URLs in "text/uri-list"
when pasting or dropping files. Neither Chrome nor Firefox exhibit this behavior, and exposing local
filenames reveal sensitive information such as username.

Test: editing/pasteboard/datatransfer-types-dropping-text-file.html

* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::readString):
(WebCore::addHTMLClipboardTypesForCocoaType):
(WebCore::absoluteURLsFromPasteboard): Deleted.

LayoutTests:

Added a regression test. For now, it only runs on Mac WK1.

* editing/pasteboard/datatransfer-types-dropping-text-file-expected.txt: Added.
* editing/pasteboard/datatransfer-types-dropping-text-file.html: Added.
* platform/ios/TestExpectations:
* platform/wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222257 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/datatransfer-types-dropping-text-file-expected.txt [new file with mode: 0644]
LayoutTests/editing/pasteboard/datatransfer-types-dropping-text-file.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
LayoutTests/platform/wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/mac/PasteboardMac.mm