Changeset 222656 in webkit


Ignore:
Timestamp:
Sep 29, 2017 11:46:51 AM (7 years ago)
Author:
rniwa@webkit.org
Message:

Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
https://bugs.webkit.org/show_bug.cgi?id=170449
<rdar://problem/31432525>

Reviewed by Wenson Hsieh.

Source/WebCore:

The bug was caused by image types in NSPasteboard or UIPasteboard not being treated as file items in dataTransfer.
Because there is no Web API to get binary data out of dataTransfer unlike text data, we need to treat any image
data as files even if they're entirely in the memory.

This patch introduces the notion of pasteboard types to be treated as files and expose them on dataTransfer.files
as well as dataTransfer.items of type "file". Because in-memory images are stored as TIFF in macOS and websites
don't typically support image/tiff, we convert all such in-memory TIFF images into PNG images ourselves for
a better web compatibility. This is done inside read(PasteboardFileReader&) in PasteboardCocoa.mm.

Note that PasteboardFileReader cannot directly have RefPtr<File> as a member variable as code in WebCore/platform
including Pasteboard code is not supposed to depend on WebCore types. WebCorePasteboardFileReader, a subclass of
PasteboardFileReader was introduced to resolve this reverse dependency.

In addition, this patch removes the restriction on dataTransfer.items that it only includes files of the supported
MIME types. This was unwarranted since 1. we don't have any restriction on what an user can drag & drop into a web
page via input element so there is no security benefit in this, and 2. the user should be able to copy & paste
whatever file he/she desires regardless of the MIME type on websites like Google Drive.

Tests: PasteImage

  • CMakeLists.txt:
  • WebCore.xcodeproj/project.pbxproj:
  • WebCore/PlatformMac.cmake:
  • dom/DataTransfer.cpp:

(WebCore::DataTransfer::types const): Now excludes image/gif, image/png, image/jpeg, and image/tiff.
(WebCore::DataTransfer::files const): Add fake files we create for in-memory images but only when there are no real
files in the pasteboard since it's expensive to copy image data across UI/Web processes to create a blob URL.

  • dom/DataTransferItemList.cpp:

(WebCore::DataTransferItemList::ensureItems const): Just expose every file type. If the user had decided to paste
a file, it's okay for the page to access that file regardless of whether it's a zip file, JPEG image, etc...

  • editing/WebCorePasteboardFileReader.cpp:

(WebCorePasteboardFileReader::~WebCorePasteboardFileReader):
(WebCorePasteboardFileReader::read):

  • editing/WebCorePasteboardFileReader.h:

(WebCorePasteboardFileReader):

  • platform/Pasteboard.cpp:

(WebCore::PasteboardImage::PasteboardImage): Moved from platform specific translation units.
(WebCore::PasteboardImage::~PasteboardImage): Ditto.

  • platform/Pasteboard.h:

(PasteboardFileReader): Added.
(* platform/StaticPasteboard.h:
(StaticPasteboard::typesForBindings): Added.
(StaticPasteboard::typesTreatedAsFiles): Added. Returns an empty list we don't support the web content writing image
files into pasteboard at the moment.

  • platform/cocoa/PasteboardCocoa.mm: Added.

(WebCore::PasteboardWebContent::PasteboardWebContent): Moved from PasteboardMac.mm and PasteboardIOS.mm.
(WebCore::PasteboardWebContent::~PasteboardWebContent):
(WebCore::cocoaTypeToImageType): Added.
(WebCore::imageTypeToMIMEType): Added. Pretends to have image/png when the Cocoa type is image/tiff since most of
websites don't support image/tiff.
(WebCore::imageTypeToFakeFilename): Added.
(WebCore::mimeTypeToImageType): Added.
(WebCore::Pasteboard::shouldTreatCocoaTypeAsFile): Added. Pasteboard::typesForBindings excludes the type for which
this function returns true.
(WebCore::Pasteboard::typesTreatedAsFiles): Returns the list of all in-memory image types in the pasteboard.
(WebCore::Pasteboard::read): Added. On macOS, we convert TIFF to PNG for web compatibility. We don't do this rather
memory intensive coercion on iOS where most of apps like Photos put PNG file into the pasteboard in the first place.

  • platform/gtk/PasteboardGtk.cpp:

(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):

  • platform/ios/PasteboardIOS.mm:

(WebCore::addHTMLClipboardTypesForCocoaType):
(WebCore::Pasteboard::typesForBindings):
(WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
(WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::Pasteboard::types): Deleted.

  • platform/ios/PlatformPasteboardIOS.mm:

(WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Add "Files" to dataTransfer.types when there is an in-memory
image type in the pasteboard.

  • platform/mac/PasteboardMac.mm:

(WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
(WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
(WebCore::PasteboardImage::PasteboardImage): Deleted.
(WebCore::PasteboardImage::~PasteboardImage): Deleted.
(WebCore::addHTMLClipboardTypesForCocoaType): Moved the check for the legacy NeXT plain text check here. Also add
"Files" to dataTransfer.types when there is an in-memory image type in the pasteboard.
(WebCore::Pasteboard::typesForBindings): Renamed from types.

  • platform/mac/PlatformPasteboardMac.mm:

(WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Ditto to add "Files".

  • platform/win/PasteboardWin.cpp:

(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):
(WebCore::Pasteboard::read):

  • platform/wpe/PasteboardWPE.cpp:

(WebCore::Pasteboard::typesForBindings): Renamed from types.
(WebCore::Pasteboard::typesTreatedAsFiles):
(WebCore::Pasteboard::read):

Source/WebKit:

Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.

  • UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:

(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.

  • UIProcess/WebPasteboardProxy.h:
  • UIProcess/WebPasteboardProxy.messages.in:
  • WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:

(WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
since WebCore will now create File objects for these pasted files.

Tools:

Added an API test to paste an image from pasteboard. The test is shared between iOS and macOS.

The tests to paste image files are only enabled on macOS since putting files into pasteboard isn't a thing on iOS.

  • TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
  • TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm: Added.

(writeImageDataToPasteboard):
(writeBundleFileToPasteboard):

  • TestWebKitAPI/Tests/WebKitCocoa/paste-image.html: Added.
  • TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-100px.tiff: Added.
  • TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-200px.png: Added.
  • TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-400px.gif: Added.
  • TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-600px.jpg: Added.
  • TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Rebaselined the test now that types contain "Files".
Location:
trunk
Files:
9 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/CMakeLists.txt

    r222595 r222656  
    18001800    editing/VisibleUnits.cpp
    18011801    editing/WebContentReader.cpp
     1802    editing/WebCorePasteboardFileReader.cpp
    18021803    editing/WrapContentsInDummySpanCommand.cpp
    18031804    editing/markup.cpp
  • trunk/Source/WebCore/ChangeLog

    r222654 r222656  
     12017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
     4        https://bugs.webkit.org/show_bug.cgi?id=170449
     5        <rdar://problem/31432525>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        The bug was caused by image types in NSPasteboard or UIPasteboard not being treated as file items in dataTransfer.
     10        Because there is no Web API to get binary data out of dataTransfer unlike text data, we need to treat any image
     11        data as files even if they're entirely in the memory.
     12
     13        This patch introduces the notion of pasteboard types to be treated as files and expose them on dataTransfer.files
     14        as well as dataTransfer.items of type "file". Because in-memory images are stored as TIFF in macOS and websites
     15        don't typically support image/tiff, we convert all such in-memory TIFF images into PNG images ourselves for
     16        a better web compatibility. This is done inside read(PasteboardFileReader&) in PasteboardCocoa.mm.
     17
     18        Note that PasteboardFileReader cannot directly have RefPtr<File> as a member variable as code in WebCore/platform
     19        including Pasteboard code is not supposed to depend on WebCore types. WebCorePasteboardFileReader, a subclass of
     20        PasteboardFileReader was introduced to resolve this reverse dependency.
     21
     22        In addition, this patch removes the restriction on dataTransfer.items that it only includes files of the supported
     23        MIME types. This was unwarranted since 1. we don't have any restriction on what an user can drag & drop into a web
     24        page via input element so there is no security benefit in this, and 2. the user should be able to copy & paste
     25        whatever file he/she desires regardless of the MIME type on websites like Google Drive.
     26
     27        Tests: PasteImage
     28
     29        * CMakeLists.txt:
     30        * WebCore.xcodeproj/project.pbxproj:
     31        * WebCore/PlatformMac.cmake:
     32        * dom/DataTransfer.cpp:
     33        (WebCore::DataTransfer::types const): Now excludes image/gif, image/png, image/jpeg, and image/tiff.
     34        (WebCore::DataTransfer::files const): Add fake files we create for in-memory images but only when there are no real
     35        files in the pasteboard since it's expensive to copy image data across UI/Web processes to create a blob URL.
     36        * dom/DataTransferItemList.cpp:
     37        (WebCore::DataTransferItemList::ensureItems const): Just expose every file type. If the user had decided to paste
     38        a file, it's okay for the page to access that file regardless of whether it's a zip file, JPEG image, etc...
     39        * editing/WebCorePasteboardFileReader.cpp:
     40        (WebCorePasteboardFileReader::~WebCorePasteboardFileReader):
     41        (WebCorePasteboardFileReader::read):
     42        * editing/WebCorePasteboardFileReader.h:
     43        (WebCorePasteboardFileReader):
     44        * platform/Pasteboard.cpp:
     45        (WebCore::PasteboardImage::PasteboardImage): Moved from platform specific translation units.
     46        (WebCore::PasteboardImage::~PasteboardImage): Ditto.
     47        * platform/Pasteboard.h:
     48        (PasteboardFileReader): Added.
     49        (* platform/StaticPasteboard.h:
     50        (StaticPasteboard::typesForBindings): Added.
     51        (StaticPasteboard::typesTreatedAsFiles): Added. Returns an empty list we don't support the web content writing image
     52        files into pasteboard at the moment.
     53        * platform/cocoa/PasteboardCocoa.mm: Added.
     54        (WebCore::PasteboardWebContent::PasteboardWebContent): Moved from PasteboardMac.mm and PasteboardIOS.mm.
     55        (WebCore::PasteboardWebContent::~PasteboardWebContent):
     56        (WebCore::cocoaTypeToImageType): Added.
     57        (WebCore::imageTypeToMIMEType): Added. Pretends to have image/png when the Cocoa type is image/tiff since most of
     58        websites don't support image/tiff.
     59        (WebCore::imageTypeToFakeFilename): Added.
     60        (WebCore::mimeTypeToImageType): Added.
     61        (WebCore::Pasteboard::shouldTreatCocoaTypeAsFile): Added. Pasteboard::typesForBindings excludes the type for which
     62        this function returns true.
     63        (WebCore::Pasteboard::typesTreatedAsFiles): Returns the list of all in-memory image types in the pasteboard.
     64        (WebCore::Pasteboard::read): Added. On macOS, we convert TIFF to PNG for web compatibility. We don't do this rather
     65        memory intensive coercion on iOS where most of apps like Photos put PNG file into the pasteboard in the first place.
     66        * platform/gtk/PasteboardGtk.cpp:
     67        (WebCore::PasteboardImage::PasteboardImage): Deleted.
     68        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
     69        (WebCore::Pasteboard::read):
     70        (WebCore::Pasteboard::typesForBindings): Renamed from types.
     71        (WebCore::Pasteboard::typesTreatedAsFiles):
     72        * platform/ios/PasteboardIOS.mm:
     73        (WebCore::addHTMLClipboardTypesForCocoaType):
     74        (WebCore::Pasteboard::typesForBindings):
     75        (WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
     76        (WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
     77        (WebCore::PasteboardImage::PasteboardImage): Deleted.
     78        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
     79        (WebCore::Pasteboard::types): Deleted.
     80        * platform/ios/PlatformPasteboardIOS.mm:
     81        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Add "Files" to dataTransfer.types when there is an in-memory
     82        image type in the pasteboard.
     83        * platform/mac/PasteboardMac.mm:
     84        (WebCore::PasteboardWebContent::PasteboardWebContent): Deleted.
     85        (WebCore::PasteboardWebContent::~PasteboardWebContent): Deleted.
     86        (WebCore::PasteboardImage::PasteboardImage): Deleted.
     87        (WebCore::PasteboardImage::~PasteboardImage): Deleted.
     88        (WebCore::addHTMLClipboardTypesForCocoaType): Moved the check for the legacy NeXT plain text check here. Also add
     89        "Files" to dataTransfer.types when there is an in-memory image type in the pasteboard.
     90        (WebCore::Pasteboard::typesForBindings): Renamed from types.
     91        * platform/mac/PlatformPasteboardMac.mm:
     92        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType): Ditto to add "Files".
     93        * platform/win/PasteboardWin.cpp:
     94        (WebCore::Pasteboard::typesForBindings): Renamed from types.
     95        (WebCore::Pasteboard::typesTreatedAsFiles):
     96        (WebCore::Pasteboard::read):
     97        * platform/wpe/PasteboardWPE.cpp:
     98        (WebCore::Pasteboard::typesForBindings): Renamed from types.
     99        (WebCore::Pasteboard::typesTreatedAsFiles):
     100        (WebCore::Pasteboard::read):
     101
    11022017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
    2103
  • trunk/Source/WebCore/PlatformMac.cmake

    r222592 r222656  
    322322    platform/cocoa/NetworkExtensionContentFilter.mm
    323323    platform/cocoa/ParentalControlsContentFilter.mm
     324    platform/cocoa/PasteboardCocoa.mm
    324325    platform/cocoa/RuntimeApplicationChecksCocoa.mm
    325326    platform/cocoa/ScrollController.mm
  • trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj

    r222647 r222656  
    43464346                9BDA64D71B975CE5009C4387 /* JSShadowRoot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9B6BC9601B975966005AE1F0 /* JSShadowRoot.cpp */; };
    43474347                9BDA64D81B975CF2009C4387 /* JSShadowRoot.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B6BC9611B975966005AE1F0 /* JSShadowRoot.h */; };
     4348                9BDD18271F7E05F400E8E577 /* WebCorePasteboardFileReader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BDD18261F7E05F400E8E577 /* WebCorePasteboardFileReader.cpp */; };
    43484349                9BE6710B1D5AEB2100345514 /* JSCustomElementRegistry.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BE671091D5AEB0400345514 /* JSCustomElementRegistry.cpp */; };
    43494350                9BE6710C1D5AEB2500345514 /* JSCustomElementRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BE6710A1D5AEB0400345514 /* JSCustomElementRegistry.h */; };
     4351                9BED2CB11F7CC06200666018 /* PasteboardCocoa.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BED2CAF1F7CC06200666018 /* PasteboardCocoa.mm */; };
    43504352                9BF9A8801648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9BF9A87E1648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp */; };
    43514353                9BF9A8811648DD2F001C6B23 /* JSHTMLFormControlsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 9BF9A87F1648DD2F001C6B23 /* JSHTMLFormControlsCollection.h */; };
     
    1278912791                9BD4E9191C462CFC005065BC /* CustomElementRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CustomElementRegistry.h; sourceTree = "<group>"; };
    1279012792                9BD8A95918BEFC7600987E9A /* CollectionIndexCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CollectionIndexCache.cpp; sourceTree = "<group>"; };
     12793                9BDD18251F7E059900E8E577 /* WebCorePasteboardFileReader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebCorePasteboardFileReader.h; sourceTree = "<group>"; };
     12794                9BDD18261F7E05F400E8E577 /* WebCorePasteboardFileReader.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = WebCorePasteboardFileReader.cpp; sourceTree = "<group>"; };
    1279112795                9BE671091D5AEB0400345514 /* JSCustomElementRegistry.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSCustomElementRegistry.cpp; sourceTree = "<group>"; };
    1279212796                9BE6710A1D5AEB0400345514 /* JSCustomElementRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSCustomElementRegistry.h; sourceTree = "<group>"; };
     12797                9BED2CAF1F7CC06200666018 /* PasteboardCocoa.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardCocoa.mm; sourceTree = "<group>"; };
    1279312798                9BF433761F67619B00E1FD71 /* WebContentReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContentReader.h; sourceTree = "<group>"; };
    1279412799                9BF9A87E1648DD2F001C6B23 /* JSHTMLFormControlsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLFormControlsCollection.cpp; sourceTree = "<group>"; };
     
    2060220607                                9B6116491F6A593300E923B8 /* WebContentReader.cpp */,
    2060320608                                9BF433761F67619B00E1FD71 /* WebContentReader.h */,
     20609                                9BDD18261F7E05F400E8E577 /* WebCorePasteboardFileReader.cpp */,
     20610                                9BDD18251F7E059900E8E577 /* WebCorePasteboardFileReader.h */,
    2060420611                                93309DD4099E64910056E581 /* WrapContentsInDummySpanCommand.cpp */,
    2060520612                                93309DD5099E64910056E581 /* WrapContentsInDummySpanCommand.h */,
     
    2177421781                                A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */,
    2177521782                                A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */,
     21783                                9BED2CAF1F7CC06200666018 /* PasteboardCocoa.mm */,
    2177621784                                52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */,
    2177721785                                CDA29A081CBD99F400901CCF /* PlaybackSessionInterface.h */,
     
    3349033498                                F55B3DC91251F12D003EF269 /* PasswordInputType.cpp in Sources */,
    3349133499                                2EE02A1F1F7324280006AF72 /* Pasteboard.cpp in Sources */,
     33500                                9BED2CB11F7CC06200666018 /* PasteboardCocoa.mm in Sources */,
    3349233501                                E453901E0EAFCACA003695C8 /* PasteboardIOS.mm in Sources */,
    3349333502                                4B2709830AF2E5E00065127F /* PasteboardMac.mm in Sources */,
     
    3442734436                                CD225C0B1C46FBF400140761 /* WebCoreNSURLSession.mm in Sources */,
    3442834437                                B50F5B810E96CD9900AD71A6 /* WebCoreObjCExtras.mm in Sources */,
     34438                                9BDD18271F7E05F400E8E577 /* WebCorePasteboardFileReader.cpp in Sources */,
    3442934439                                E180810E16FCECDF00B80D07 /* WebCoreResourceHandleAsDelegate.mm in Sources */,
    3443034440                                E152551616FD2350003D7ADB /* WebCoreResourceHandleAsOperationQueueDelegate.mm in Sources */,
  • trunk/Source/WebCore/dom/DataTransfer.cpp

    r222595 r222656  
    3939#include "Pasteboard.h"
    4040#include "StaticPasteboard.h"
     41#include "WebCorePasteboardFileReader.h"
    4142
    4243namespace WebCore {
     
    172173        return { };
    173174
    174     return m_pasteboard->types();
     175    return m_pasteboard->typesForBindings();
    175176}
    176177
     
    196197        for (auto& filename : m_pasteboard->readFilenames())
    197198            m_fileList->append(File::create(filename));
     199        if (m_fileList->isEmpty()) {
     200            for (auto& type : m_pasteboard->typesTreatedAsFiles()) {
     201                WebCorePasteboardFileReader reader(type);
     202                m_pasteboard->read(reader);
     203                if (reader.file)
     204                    m_fileList->append(reader.file.releaseNonNull());
     205            }
     206        }
    198207    }
    199208    return *m_fileList;
  • trunk/Source/WebCore/dom/DataTransferItemList.cpp

    r222422 r222656  
    132132    }
    133133
    134     for (auto& file : m_dataTransfer.files().files()) {
    135         auto type = File::contentTypeForFile(file->path()).convertToASCIILowercase();
    136         if (isSupportedType(type) || file->isDirectory())
    137             items.append(DataTransferItem::create(m_weakPtrFactory.createWeakPtr(*const_cast<DataTransferItemList*>(this)), type, file.copyRef()));
    138     }
     134    for (auto& file : m_dataTransfer.files().files())
     135        items.append(DataTransferItem::create(m_weakPtrFactory.createWeakPtr(*const_cast<DataTransferItemList*>(this)), file->type(), file.copyRef()));
    139136
    140137    m_items = WTFMove(items);
  • trunk/Source/WebCore/editing/wpe/EditorWPE.cpp

    r222595 r222656  
    3939    chosePlainText = false;
    4040
    41     Vector<String> types = pasteboard.types();
     41    Vector<String> types = pasteboard.typesForBindings();
    4242    if (types.isEmpty())
    4343        return nullptr;
  • trunk/Source/WebCore/platform/Pasteboard.cpp

    r222595 r222656  
    3535
    3636namespace WebCore {
     37
     38// Making this non-inline so that WebKit 2's decoding doesn't have to include Image.h.
     39PasteboardImage::PasteboardImage() = default;
     40PasteboardImage::~PasteboardImage() = default;
    3741
    3842bool isSafeTypeForDOMToReadAndWrite(const String& type)
  • trunk/Source/WebCore/platform/Pasteboard.h

    r222595 r222656  
    6767
    6868struct PasteboardWebContent {
    69 #if !(PLATFORM(GTK) || PLATFORM(WIN) || PLATFORM(WPE))
     69#if PLATFORM(COCOA)
    7070    WEBCORE_EXPORT PasteboardWebContent();
    7171    WEBCORE_EXPORT ~PasteboardWebContent();
     
    147147};
    148148
     149struct PasteboardFileReader {
     150    PasteboardFileReader(const String& type)
     151        : type(type)
     152    { }
     153    virtual ~PasteboardFileReader() = default;
     154
     155    virtual void read(const String&, Ref<SharedBuffer>&&) = 0;
     156
     157    const String type;
     158};
     159
    149160// FIXME: We need to ensure that the contents of sameOriginCustomData are not accessible across different origins.
    150161struct PasteboardCustomData {
     
    185196
    186197    virtual bool hasData();
    187     virtual Vector<String> types();
     198    virtual Vector<String> typesForBindings();
     199    virtual Vector<String> typesTreatedAsFiles();
    188200    virtual String readStringForBindings(const String& type);
    189201
     
    194206    virtual void read(PasteboardPlainText&);
    195207    virtual void read(PasteboardWebContentReader&);
     208    virtual void read(PasteboardFileReader&);
    196209
    197210    virtual void write(const PasteboardURL&);
     
    235248    explicit Pasteboard(const String& pasteboardName);
    236249
     250    static bool shouldTreatCocoaTypeAsFile(const String&);
    237251    WEBCORE_EXPORT static NSArray *supportedFileUploadPasteboardTypes();
    238252    const String& name() const { return m_pasteboardName; }
  • trunk/Source/WebCore/platform/StaticPasteboard.h

    r222595 r222656  
    4242
    4343    bool hasData() final;
    44     Vector<String> types() final { return m_types; }
     44    Vector<String> typesForBindings() final { return m_types; }
     45    Vector<String> typesTreatedAsFiles() final { return { }; }
    4546    String readStringForBindings(const String& type) final;
    4647
  • trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp

    r222595 r222656  
    6464#endif
    6565
    66 // Making this non-inline so that WebKit 2's decoding doesn't have to include Image.h.
    67 PasteboardImage::PasteboardImage()
    68 {
    69 }
    70 
    71 PasteboardImage::~PasteboardImage()
    72 {
    73 }
    74 
    7566Pasteboard::Pasteboard(SelectionData& selectionData)
    7667    : m_selectionData(selectionData)
     
    252243}
    253244
     245void Pasteboard::read(PasteboardFileReader&)
     246{
     247}
     248
    254249bool Pasteboard::hasData()
    255250{
     
    258253}
    259254
    260 Vector<String> Pasteboard::types()
     255Vector<String> Pasteboard::typesForBindings()
    261256{
    262257    readFromClipboard();
     
    284279
    285280    return types;
     281}
     282
     283Vector<String> Pasteboard::typesTreatedAsFiles()
     284{
     285    return { };
    286286}
    287287
  • trunk/Source/WebCore/platform/ios/PasteboardIOS.mm

    r222595 r222656  
    9999WEBCORE_EXPORT NSString *WebArchivePboardType = @"Apple Web Archive pasteboard type";
    100100
    101 // Making this non-inline so that WebKit 2's decoding doesn't have to include SharedBuffer.h.
    102 PasteboardWebContent::PasteboardWebContent()
    103 {
    104 }
    105 
    106 PasteboardWebContent::~PasteboardWebContent()
    107 {
    108 }
    109    
    110 // Making this non-inline so that WebKit 2's decoding doesn't have to include Image.h.
    111 PasteboardImage::PasteboardImage()
    112 {
    113 }
    114 
    115 PasteboardImage::~PasteboardImage()
    116 {
    117 }
    118 
    119101Pasteboard::Pasteboard()
    120102    : m_changeCount(0)
     
    418400        return;
    419401    }
     402    if (Pasteboard::shouldTreatCocoaTypeAsFile(cocoaType)) {
     403        resultTypes.add(ASCIILiteral("Files"));
     404        return;
     405    }
    420406    String utiType = utiTypeFromCocoaType(cocoaType);
    421407    if (!utiType.isEmpty()) {
     
    436422}
    437423
    438 Vector<String> Pasteboard::types()
     424Vector<String> Pasteboard::typesForBindings()
    439425{
    440426    Vector<String> types;
  • trunk/Source/WebCore/platform/ios/PlatformPasteboardIOS.mm

    r222597 r222656  
    432432        return ASCIILiteral("text/uri-list");
    433433
     434    if (Pasteboard::shouldTreatCocoaTypeAsFile(platformType))
     435        return ASCIILiteral("Files");
     436
    434437    return nullptr;
    435438}
  • trunk/Source/WebCore/platform/mac/PasteboardMac.mm

    r222595 r222656  
    7171const char WebURLsWithTitlesPboardType[] = "WebURLsWithTitlesPboardType";
    7272
    73 // Making this non-inline so that WebKit 2's decoding doesn't have to include SharedBuffer.h.
    74 PasteboardWebContent::PasteboardWebContent()
    75 {
    76 }
    77 
    78 PasteboardWebContent::~PasteboardWebContent()
    79 {
    80 }
    81 
    82 // Making this non-inline so that WebKit 2's decoding doesn't have to include Image.h.
    83 PasteboardImage::PasteboardImage()
    84 {
    85 }
    86 
    87 PasteboardImage::~PasteboardImage()
    88 {
    89 }
    90 
    9173static const Vector<String> writableTypesForURL()
    9274{
     
    555537static void addHTMLClipboardTypesForCocoaType(ListHashSet<String>& resultTypes, const String& cocoaType, const String& pasteboardName)
    556538{
     539    if (cocoaType == "NeXT plain ascii pasteboard type")
     540        return; // Skip this ancient type that gets auto-supplied by some system conversion.
     541
    557542    // UTI may not do these right, so make sure we get the right, predictable result
    558543    if (cocoaType == String(NSStringPboardType) || cocoaType == String(NSPasteboardTypeString)) {
     
    574559        return;
    575560    }
     561    if (Pasteboard::shouldTreatCocoaTypeAsFile(cocoaType)) {
     562        resultTypes.add(ASCIILiteral("Files"));
     563        return;
     564    }
    576565    String utiType = utiTypeFromCocoaType(cocoaType);
    577566    if (!utiType.isEmpty()) {
     
    610599}
    611600
    612 Vector<String> Pasteboard::types()
     601Vector<String> Pasteboard::typesForBindings()
    613602{
    614603    Vector<String> types;
     
    627616
    628617    ListHashSet<String> result;
    629     // FIXME: This loop could be split into two stages. One which adds all the HTML5 specified types
    630     // and a second which adds all the extra types from the cocoa clipboard (which is Mac-only behavior).
    631     for (size_t i = 0; i < types.size(); i++) {
    632         if (types[i] == "NeXT plain ascii pasteboard type")
    633             continue;   // skip this ancient type that gets auto-supplied by some system conversion
    634 
    635         addHTMLClipboardTypesForCocoaType(result, types[i], m_pasteboardName);
    636     }
     618    for (auto& cocoaType : types)
     619        addHTMLClipboardTypesForCocoaType(result, cocoaType, m_pasteboardName);
    637620
    638621    copyToVector(result, types);
  • trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm

    r222595 r222656  
    106106        return ASCIILiteral("text/html");
    107107
    108     if (platformType == String(NSFilenamesPboardType) || platformType == String(NSFilesPromisePboardType))
     108    if (platformType == String(NSFilenamesPboardType) || platformType == String(NSFilesPromisePboardType) || Pasteboard::shouldTreatCocoaTypeAsFile(platformType))
    109109        return ASCIILiteral("Files");
    110110
  • trunk/Source/WebCore/platform/win/PasteboardWin.cpp

    r222595 r222656  
    244244}
    245245
    246 Vector<String> Pasteboard::types()
     246Vector<String> Pasteboard::typesForBindings()
    247247{
    248248    ListHashSet<String> results;
     
    276276    copyToVector(results, vector);
    277277    return vector;
     278}
     279
     280Vector<String> Pasteboard::typesTreatedAsFiles()
     281{
     282    return { };
    278283}
    279284
     
    10511056}
    10521057
     1058void Pasteboard::read(PasteboardFileReader&)
     1059{
     1060}
     1061
    10531062void Pasteboard::write(const PasteboardImage&)
    10541063{
  • trunk/Source/WebCore/platform/wpe/PasteboardWPE.cpp

    r222595 r222656  
    5050}
    5151
    52 Vector<String> Pasteboard::types()
     52Vector<String> Pasteboard::typesForBindings()
    5353{
    5454    Vector<String> types;
    5555    platformStrategies()->pasteboardStrategy()->getTypes(types);
    5656    return types;
     57}
     58
     59Vector<String> Pasteboard::typesTreatedAsFiles()
     60{
     61    return { };
    5762}
    5863
     
    8388{
    8489    notImplemented();
     90}
     91
     92void Pasteboard::read(PasteboardFileReader&)
     93{
    8594}
    8695
  • trunk/Source/WebKit/ChangeLog

    r222654 r222656  
     12017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
     4        https://bugs.webkit.org/show_bug.cgi?id=170449
     5        <rdar://problem/31432525>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Add sandbox extensions for files in the pasteboard to make copying & pasting image files work.
     10        This is what we do for drag & drop but we should consider adding a mechanism to rekoke the extension in the future.
     11
     12        * UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
     13        (WebKit::WebPasteboardProxy::getPasteboardPathnamesForType): Add sandbox extensions to the pasted files.
     14        * UIProcess/WebPasteboardProxy.h:
     15        * UIProcess/WebPasteboardProxy.messages.in:
     16        * WebProcess/WebCoreSupport/WebPlatformStrategies.cpp:
     17        (WebKit::WebPlatformStrategies::getPathnamesForType): Consume the sandbox tokens sent by the UI process permanently
     18        since WebCore will now create File objects for these pasted files.
     19
    1202017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
    221
  • trunk/Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm

    r222595 r222656  
    2626#import "config.h"
    2727#import "WebPasteboardProxy.h"
     28
     29#import "SandboxExtension.h"
    2830#import "WebProcessProxy.h"
    29 
    3031#import <WebCore/Color.h>
    3132#import <WebCore/PlatformPasteboard.h>
     
    4243}
    4344
    44 void WebPasteboardProxy::getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames)
    45 {
    46     PlatformPasteboard(pasteboardName).getPathnamesForType(pathnames, pasteboardType);
     45void WebPasteboardProxy::getPasteboardPathnamesForType(IPC::Connection& connection, const String& pasteboardName, const String& pasteboardType,
     46    Vector<String>& pathnames, SandboxExtension::HandleArray& sandboxExtensions)
     47{
     48    for (auto* webProcessProxy : m_webProcessProxyList) {
     49        if (!webProcessProxy->hasConnection(connection))
     50            continue;
     51
     52        PlatformPasteboard(pasteboardName).getPathnamesForType(pathnames, pasteboardType);
     53
     54#if PLATFORM(MAC)
     55        // On iOS, files are copied into app's container upon paste.
     56        sandboxExtensions.allocate(pathnames.size());
     57        for (size_t i = 0; i < pathnames.size(); i++) {
     58            auto& filename = pathnames[i];
     59            if (![[NSFileManager defaultManager] fileExistsAtPath:filename])
     60                continue;
     61            SandboxExtension::createHandle(filename, SandboxExtension::Type::ReadOnly, sandboxExtensions[i]);
     62        }
     63#endif
     64    }
    4765}
    4866
  • trunk/Source/WebKit/UIProcess/WebPasteboardProxy.h

    r222595 r222656  
    2727
    2828#include "MessageReceiver.h"
     29#include "SandboxExtension.h"
    2930#include "SharedMemory.h"
    3031#include <wtf/Forward.h>
     
    8384    void getNumberOfFiles(const String& pasteboardName, uint64_t& numberOfFiles);
    8485    void getPasteboardTypes(const String& pasteboardName, Vector<String>& pasteboardTypes);
    85     void getPasteboardPathnamesForType(const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames);
     86    void getPasteboardPathnamesForType(IPC::Connection&, const String& pasteboardName, const String& pasteboardType, Vector<String>& pathnames, SandboxExtension::HandleArray&);
    8687    void getPasteboardStringForType(const String& pasteboardName, const String& pasteboardType, String&);
    8788    void getPasteboardBufferForType(const String& pasteboardName, const String& pasteboardType, SharedMemory::Handle&, uint64_t& size);
  • trunk/Source/WebKit/UIProcess/WebPasteboardProxy.messages.in

    r222595 r222656  
    4343    GetNumberOfFiles(String pasteboardName) -> (uint64_t numberOfFiles)
    4444    GetPasteboardTypes(String pasteboardName) -> (Vector<String> types)
    45     GetPasteboardPathnamesForType(String pasteboardName, String pasteboardType) -> (Vector<String> pathnames)
     45    GetPasteboardPathnamesForType(String pasteboardName, String pasteboardType) -> (Vector<String> pathnames, WebKit::SandboxExtension::HandleArray sandboxExtensions) WantsConnection
    4646    GetPasteboardStringForType(String pasteboardName, String pasteboardType) -> (String string)
    4747    GetPasteboardBufferForType(String pasteboardName, String pasteboardType) -> (WebKit::SharedMemory::Handle handle, uint64_t size)
  • trunk/Source/WebKit/WebProcess/WebCoreSupport/WebPlatformStrategies.cpp

    r222595 r222656  
    193193void WebPlatformStrategies::getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType, const String& pasteboardName)
    194194{
    195     WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::GetPasteboardPathnamesForType(pasteboardName, pasteboardType), Messages::WebPasteboardProxy::GetPasteboardPathnamesForType::Reply(pathnames), 0);
     195    SandboxExtension::HandleArray sandboxExtensionsHandleArray;
     196    WebProcess::singleton().parentProcessConnection()->sendSync(Messages::WebPasteboardProxy::GetPasteboardPathnamesForType(pasteboardName, pasteboardType),
     197        Messages::WebPasteboardProxy::GetPasteboardPathnamesForType::Reply(pathnames, sandboxExtensionsHandleArray), 0);
     198    ASSERT(pathnames.size() == sandboxExtensionsHandleArray.size());
     199    for (size_t i = 0; i < sandboxExtensionsHandleArray.size(); i++) {
     200        if (RefPtr<SandboxExtension> extension = SandboxExtension::create(sandboxExtensionsHandleArray[i]))
     201            extension->consumePermanently();
     202    }
    196203}
    197204
  • trunk/Tools/ChangeLog

    r222654 r222656  
     12017-09-28  Ryosuke Niwa  <rniwa@webkit.org>
     2
     3        Image pasting is not working on tineye.com / gmail.com / GitHub.com due to lack of support for DataTransfer.items
     4        https://bugs.webkit.org/show_bug.cgi?id=170449
     5        <rdar://problem/31432525>
     6
     7        Reviewed by Wenson Hsieh.
     8
     9        Added an API test to paste an image from pasteboard. The test is shared between iOS and macOS.
     10
     11        The tests to paste image files are only enabled on macOS since putting files into pasteboard isn't a thing on iOS.
     12
     13        * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
     14        * TestWebKitAPI/Tests/WebKitCocoa/PasteImage.mm: Added.
     15        (writeImageDataToPasteboard):
     16        (writeBundleFileToPasteboard):
     17        * TestWebKitAPI/Tests/WebKitCocoa/paste-image.html: Added.
     18        * TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-100px.tiff: Added.
     19        * TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-200px.png: Added.
     20        * TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-400px.gif: Added.
     21        * TestWebKitAPI/Tests/WebKitCocoa/sunset-in-cupertino-600px.jpg: Added.
     22        * TestWebKitAPI/Tests/ios/DataInteractionTests.mm: Rebaselined the test now that types contain "Files".
     23
    1242017-09-29  Wenson Hsieh  <wenson_hsieh@apple.com>
    225
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r222633 r222656  
    545545                9BD4239A1E04BD9800200395 /* AttributedSubstringForProposedRangeWithImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BD423991E04BD9800200395 /* AttributedSubstringForProposedRangeWithImage.mm */; };
    546546                9BD4239C1E04C01C00200395 /* chinese-character-with-image.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */; };
     547                9BD6D3A21F7B218300BD4962 /* sunset-in-cupertino-100px.tiff in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD6D3A11F7B202100BD4962 /* sunset-in-cupertino-100px.tiff */; };
     548                9BD6D3A31F7B218300BD4962 /* sunset-in-cupertino-200px.png in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD6D3A01F7B202000BD4962 /* sunset-in-cupertino-200px.png */; };
     549                9BD6D3A41F7B218300BD4962 /* sunset-in-cupertino-400px.gif in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD6D39F1F7B202000BD4962 /* sunset-in-cupertino-400px.gif */; };
     550                9BD6D3A51F7B218300BD4962 /* sunset-in-cupertino-600px.jpg in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD6D39E1F7B201E00BD4962 /* sunset-in-cupertino-600px.jpg */; };
     551                9BD6D3A71F7B21DC00BD4962 /* paste-image.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = 9BD6D3A61F7B21CC00BD4962 /* paste-image.html */; };
     552                9BDCCD871F7D0B0700009A18 /* PasteImage.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9BDCCD851F7D0B0700009A18 /* PasteImage.mm */; };
    547553                9C64DC321D76198A004B598E /* YouTubePluginReplacement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9C64DC311D76198A004B598E /* YouTubePluginReplacement.cpp */; };
    548554                A10F047E1E3AD29C00C95E19 /* NSFileManagerExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = A10F047C1E3AD29C00C95E19 /* NSFileManagerExtras.mm */; };
     
    969975                                A57A34F216AF6B2B00C2501F /* PageVisibilityStateWithWindowChanges.html in Copy Resources */,
    970976                                A1409AD91E7254D4004949D9 /* password-protected.pages in Copy Resources */,
     977                                9BD6D3A71F7B21DC00BD4962 /* paste-image.html in Copy Resources */,
    971978                                3FCC4FE81EC4E8CA0076E37C /* PictureInPictureDelegate.html in Copy Resources */,
    972979                                F415086D1DA040C50044BE9B /* play-audio-on-click.html in Copy Resources */,
     
    992999                                E194E1BD177E53C7009C4D4E /* StopLoadingFromDidReceiveResponse.html in Copy Resources */,
    9931000                                515BE16F1D428BB100DD7C68 /* StoreBlobToBeDeleted.html in Copy Resources */,
     1001                                9BD6D3A21F7B218300BD4962 /* sunset-in-cupertino-100px.tiff in Copy Resources */,
     1002                                9BD6D3A31F7B218300BD4962 /* sunset-in-cupertino-200px.png in Copy Resources */,
     1003                                9BD6D3A41F7B218300BD4962 /* sunset-in-cupertino-400px.gif in Copy Resources */,
     1004                                9BD6D3A51F7B218300BD4962 /* sunset-in-cupertino-600px.jpg in Copy Resources */,
    9941005                                CD59F53519E9110D00CF1835 /* test-mse.mp4 in Copy Resources */,
    9951006                                C95984F71E36BCEF002C0D45 /* test-without-audio-track.mp4 in Copy Resources */,
     
    14931504                9BD423991E04BD9800200395 /* AttributedSubstringForProposedRangeWithImage.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AttributedSubstringForProposedRangeWithImage.mm; sourceTree = "<group>"; };
    14941505                9BD4239B1E04BFD000200395 /* chinese-character-with-image.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = "chinese-character-with-image.html"; sourceTree = "<group>"; };
     1506                9BD6D39E1F7B201E00BD4962 /* sunset-in-cupertino-600px.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = "sunset-in-cupertino-600px.jpg"; sourceTree = "<group>"; };
     1507                9BD6D39F1F7B202000BD4962 /* sunset-in-cupertino-400px.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = "sunset-in-cupertino-400px.gif"; sourceTree = "<group>"; };
     1508                9BD6D3A01F7B202000BD4962 /* sunset-in-cupertino-200px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "sunset-in-cupertino-200px.png"; sourceTree = "<group>"; };
     1509                9BD6D3A11F7B202100BD4962 /* sunset-in-cupertino-100px.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; path = "sunset-in-cupertino-100px.tiff"; sourceTree = "<group>"; };
     1510                9BD6D3A61F7B21CC00BD4962 /* paste-image.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = "paste-image.html"; sourceTree = "<group>"; };
     1511                9BDCCD851F7D0B0700009A18 /* PasteImage.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteImage.mm; sourceTree = "<group>"; };
    14951512                9C64DC311D76198A004B598E /* YouTubePluginReplacement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = YouTubePluginReplacement.cpp; sourceTree = "<group>"; };
    14961513                A10F047C1E3AD29C00C95E19 /* NSFileManagerExtras.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NSFileManagerExtras.mm; sourceTree = "<group>"; };
     
    19892006                                CEA6CF2219CCF5BD0064F5A7 /* OpenAndCloseWindow.mm */,
    19902007                                CEBCA12E1E3A660100C73293 /* OverrideContentSecurityPolicy.mm */,
     2008                                9BDCCD851F7D0B0700009A18 /* PasteImage.mm */,
    19912009                                3FCC4FE41EC4E8520076E37C /* PictureInPictureDelegate.mm */,
    19922010                                83BAEE8C1EF4625500DDE894 /* PluginLoadClientPolicies.mm */,
     
    22812299                                CEBCA1371E3A803400C73293 /* page-without-csp.html */,
    22822300                                A1409AD81E7254AC004949D9 /* password-protected.pages */,
     2301                                9BD6D3A61F7B21CC00BD4962 /* paste-image.html */,
    22832302                                3FCC4FE61EC4E87E0076E37C /* PictureInPictureDelegate.html */,
    22842303                                F415086C1DA040C10044BE9B /* play-audio-on-click.html */,
     
    22912310                                F4F405BB1D4C0CF8007A9707 /* skinny-autoplaying-video-with-audio.html */,
    22922311                                515BE16E1D4288FF00DD7C68 /* StoreBlobToBeDeleted.html */,
     2312                                9BD6D3A11F7B202100BD4962 /* sunset-in-cupertino-100px.tiff */,
     2313                                9BD6D3A01F7B202000BD4962 /* sunset-in-cupertino-200px.png */,
     2314                                9BD6D39F1F7B202000BD4962 /* sunset-in-cupertino-400px.gif */,
     2315                                9BD6D39E1F7B201E00BD4962 /* sunset-in-cupertino-600px.jpg */,
    22932316                                2E9896141D8F092B00739892 /* text-and-password-inputs.html */,
    22942317                                F41AB9951EF4692C0083FA08 /* textarea-to-input.html */,
     
    33403363                                7C83E0511D0A641800FEBCF3 /* ParsedContentRange.cpp in Sources */,
    33413364                                7CCE7F0A1A411AE600447C4C /* PasteboardNotifications.mm in Sources */,
     3365                                9BDCCD871F7D0B0700009A18 /* PasteImage.mm in Sources */,
    33423366                                7C83E0531D0A643A00FEBCF3 /* PendingAPIRequestURL.cpp in Sources */,
    33433367                                3FCC4FE51EC4E8520076E37C /* PictureInPictureDelegate.mm in Sources */,
  • trunk/Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm

    r222595 r222656  
    15581558    // File URLs should never be exposed directly to web content, so DataTransfer.getData should return an empty string here.
    15591559    checkJSONWithLogging([webView stringByEvaluatingJavaScript:@"output.value"], @{
    1560         @"dragover": @{ @"text/uri-list" : @"" },
    1561         @"drop": @{ @"text/uri-list" : @"" }
     1560        @"dragover": @{ @"Files": @"", @"text/uri-list" : @"" },
     1561        @"drop": @{ @"Files": @"", @"text/uri-list" : @"" }
    15621562    });
    15631563}
Note: See TracChangeset for help on using the changeset viewer.