<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[230221] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/230221">230221</a></dd>
<dt>Author</dt> <dd>aestes@apple.com</dd>
<dt>Date</dt> <dd>2018-04-03 13:40:12 -0700 (Tue, 03 Apr 2018)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] Prioritize file promises over filenames during drag and drop
https://bugs.webkit.org/show_bug.cgi?id=184237
<rdar://problem/38278076>

Reviewed by Wenson Hsieh.

Source/WebCore:

When performing a drag operation where the pasteboard contains both a file path and a file
promise, we have historically preferred to accept the file path. Some versions of Photos.app
will provide both a low-resolution thumbnail as a file path and its high-resolution
counterpart as a file promise when dragging a photo, and our current logic leads us to
choose the low-quality thumbnail.

This patch changes our logic to prefer file promises over file paths. This matches the
behavior of Finder and ensures we accept high-resolution assets from Photos.app.

Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
write a bogus file path to the pasteboard along with the legitimate file promise.

* platform/mac/DragDataMac.mm:
(WebCore::DragData::asFilenames const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::numberOfFiles const):

Source/WebKit:

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::performDragOperation):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView performDragOperation:]):

Tools:

* DumpRenderTree/mac/EventSendingController.mm:
(-[EventSendingController beginDragWithFilePromises:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragDataMacmm">trunk/Source/WebCore/platform/mac/DragDataMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPasteboardMacmm">trunk/Source/WebCore/platform/mac/PasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPlatformPasteboardMacmm">trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebKitChangeLog">trunk/Source/WebKit/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitUIProcessCocoaWebViewImplmm">trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm</a></li>
<li><a href="#trunkSourceWebKitLegacymacChangeLog">trunk/Source/WebKitLegacy/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitLegacymacWebViewWebViewmm">trunk/Source/WebKitLegacy/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacEventSendingControllermm">trunk/Tools/DumpRenderTree/mac/EventSendingController.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebCore/ChangeLog      2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2018-04-03  Andy Estes  <aestes@apple.com>
+
+        [Mac] Prioritize file promises over filenames during drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=184237
+        <rdar://problem/38278076>
+
+        Reviewed by Wenson Hsieh.
+
+        When performing a drag operation where the pasteboard contains both a file path and a file
+        promise, we have historically preferred to accept the file path. Some versions of Photos.app
+        will provide both a low-resolution thumbnail as a file path and its high-resolution
+        counterpart as a file promise when dragging a photo, and our current logic leads us to
+        choose the low-quality thumbnail.
+
+        This patch changes our logic to prefer file promises over file paths. This matches the
+        behavior of Finder and ensures we accept high-resolution assets from Photos.app.
+
+        Covered by existing file promise drag tests. beginDragWithFilePromises() was updated to
+        write a bogus file path to the pasteboard along with the legitimate file promise.
+
+        * platform/mac/DragDataMac.mm:
+        (WebCore::DragData::asFilenames const):
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::read):
+        (WebCore::Pasteboard::readFilePaths):
+        * platform/mac/PlatformPasteboardMac.mm:
+        (WebCore::PlatformPasteboard::numberOfFiles const):
+
</ins><span class="cx"> 2018-04-03  Mark Lam  <mark.lam@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Fix mis-application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION macro.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragDataMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragDataMac.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragDataMac.mm 2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebCore/platform/mac/DragDataMac.mm    2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -173,12 +173,17 @@
</span><span class="cx"> Vector<String> DragData::asFilenames() const
</span><span class="cx"> {
</span><span class="cx"> #if PLATFORM(MAC)
</span><ins>+    Vector<String> types;
+    platformStrategies()->pasteboardStrategy()->getTypes(types, m_pasteboardName);
+    if (types.contains(String(legacyFilesPromisePasteboardType())))
+        return fileNames();
+
</ins><span class="cx">     Vector<String> results;
</span><span class="cx">     platformStrategies()->pasteboardStrategy()->getPathnamesForType(results, String(legacyFilenamesPasteboardType()), m_pasteboardName);
</span><del>-    if (!results.isEmpty())
-        return results;
</del><ins>+    return results;
+#else
+    return fileNames();
</ins><span class="cx"> #endif
</span><del>-    return fileNames();
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool DragData::containsPlainText() const
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm       2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm  2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -329,6 +329,12 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (types.contains(String(legacyFilesPromisePasteboardType()))) {
+        text.text = joinPathnames(m_promisedFilePaths);
+        text.isURL = false;
+        return;
+    }
+
</ins><span class="cx">     if (types.contains(String(legacyFilenamesPasteboardType()))) {
</span><span class="cx">         Vector<String> pathnames;
</span><span class="cx">         strategy.getPathnamesForType(pathnames, legacyFilenamesPasteboardType(), m_pasteboardName);
</span><span class="lines">@@ -337,12 +343,6 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (types.contains(String(legacyFilesPromisePasteboardType()))) {
-        text.text = joinPathnames(m_promisedFilePaths);
-        text.isURL = false;
-        return;
-    }
-
</del><span class="cx">     // FIXME: The code above looks at the types vector first, but this just gets the string without checking. Why the difference?
</span><span class="cx">     text.text = strategy.stringForType(legacyURLPasteboardType(), m_pasteboardName);
</span><span class="cx">     text.isURL = !text.text.isNull();
</span><span class="lines">@@ -364,6 +364,11 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (policy == WebContentReadingPolicy::AnyType && types.contains(String(legacyFilesPromisePasteboardType()))) {
+        if (m_changeCount != changeCount() || reader.readFilePaths(m_promisedFilePaths))
+            return;
+    }
+
</ins><span class="cx">     if (policy == WebContentReadingPolicy::AnyType && types.contains(String(legacyFilenamesPasteboardType()))) {
</span><span class="cx">         Vector<String> paths;
</span><span class="cx">         strategy.getPathnamesForType(paths, legacyFilenamesPasteboardType(), m_pasteboardName);
</span><span class="lines">@@ -371,11 +376,6 @@
</span><span class="cx">             return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (policy == WebContentReadingPolicy::AnyType && types.contains(String(legacyFilesPromisePasteboardType()))) {
-        if (m_changeCount != changeCount() || reader.readFilePaths(m_promisedFilePaths))
-            return;
-    }
-
</del><span class="cx">     if (types.contains(String(legacyHTMLPasteboardType()))) {
</span><span class="cx">         String string = strategy.stringForType(legacyHTMLPasteboardType(), m_pasteboardName);
</span><span class="cx">         if (m_changeCount != changeCount() || (!string.isNull() && reader.readHTML(string)))
</span><span class="lines">@@ -569,6 +569,9 @@
</span><span class="cx">     Vector<String> types;
</span><span class="cx">     strategy.getTypes(types, m_pasteboardName);
</span><span class="cx"> 
</span><ins>+    if (types.contains(String(legacyFilesPromisePasteboardType())))
+        return m_promisedFilePaths;
+
</ins><span class="cx">     if (types.contains(String(legacyFilenamesPasteboardType()))) {
</span><span class="cx">         Vector<String> filePaths;
</span><span class="cx">         strategy.getPathnamesForType(filePaths, legacyFilenamesPasteboardType(), m_pasteboardName);
</span><span class="lines">@@ -575,9 +578,6 @@
</span><span class="cx">         return filePaths;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (types.contains(String(legacyFilesPromisePasteboardType())))
-        return m_promisedFilePaths;
-    
</del><span class="cx">     return { };
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPlatformPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm       2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebCore/platform/mac/PlatformPasteboardMac.mm  2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -65,14 +65,23 @@
</span><span class="cx"> int PlatformPasteboard::numberOfFiles() const
</span><span class="cx"> {
</span><span class="cx">     Vector<String> files;
</span><del>-    getPathnamesForType(files, String(legacyFilenamesPasteboardType()));
</del><span class="cx"> 
</span><del>-    // FIXME: legacyFilesPromisePasteboardType() contains UTIs, not path names. Also, it's not
-    // guaranteed that the count of UTIs equals the count of files, since some clients only write
-    // unique UTIs.
-    if (!files.size())
</del><ins>+    NSArray *pasteboardTypes = [m_pasteboard types];
+    if ([pasteboardTypes containsObject:legacyFilesPromisePasteboardType()]) {
+        // FIXME: legacyFilesPromisePasteboardType() contains file types, not path names, but in
+        // this case we are only concerned with the count of them. The count of types should equal
+        // the count of files, but this isn't guaranteed as some legacy providers might only write
+        // unique file types.
</ins><span class="cx">         getPathnamesForType(files, String(legacyFilesPromisePasteboardType()));
</span><del>-    return files.size();
</del><ins>+        return files.size();
+    }
+
+    if ([pasteboardTypes containsObject:legacyFilenamesPasteboardType()]) {
+        getPathnamesForType(files, String(legacyFilenamesPasteboardType()));
+        return files.size();
+    }
+
+    return 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void PlatformPasteboard::getPathnamesForType(Vector<String>& pathnames, const String& pasteboardType) const
</span></span></pre></div>
<a id="trunkSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/ChangeLog (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/ChangeLog    2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebKit/ChangeLog       2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2018-04-03  Andy Estes  <aestes@apple.com>
+
+        [Mac] Prioritize file promises over filenames during drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=184237
+        <rdar://problem/38278076>
+
+        Reviewed by Wenson Hsieh.
+
+        * UIProcess/Cocoa/WebViewImpl.mm:
+        (WebKit::WebViewImpl::performDragOperation):
+
</ins><span class="cx"> 2018-04-03  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make SessionStorage work with process swapping.
</span></span></pre></div>
<a id="trunkSourceWebKitUIProcessCocoaWebViewImplmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm       2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm  2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -3699,19 +3699,7 @@
</span><span class="cx">     SandboxExtension::Handle sandboxExtensionHandle;
</span><span class="cx">     SandboxExtension::HandleArray sandboxExtensionForUpload;
</span><span class="cx"> 
</span><del>-    if ([types containsObject:WebCore::legacyFilenamesPasteboardType()]) {
-        NSArray *files = [draggingInfo.draggingPasteboard propertyListForType:WebCore::legacyFilenamesPasteboardType()];
-        if (![files isKindOfClass:[NSArray class]]) {
-            delete dragData;
-            return false;
-        }
-
-        Vector<String> fileNames;
-
-        for (NSString *file in files)
-            fileNames.append(file);
-        m_page->createSandboxExtensionsIfNeeded(fileNames, sandboxExtensionHandle, sandboxExtensionForUpload);
-    } else if (![types containsObject:PasteboardTypes::WebArchivePboardType] && [types containsObject:WebCore::legacyFilesPromisePasteboardType()]) {
</del><ins>+    if (![types containsObject:PasteboardTypes::WebArchivePboardType] && [types containsObject:WebCore::legacyFilesPromisePasteboardType()]) {
</ins><span class="cx">         
</span><span class="cx">         // FIXME: legacyFilesPromisePasteboardType() contains UTIs, not path names. Also, it's not
</span><span class="cx">         // guaranteed that the count of UTIs equals the count of files, since some clients only write
</span><span class="lines">@@ -3760,6 +3748,20 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if ([types containsObject:WebCore::legacyFilenamesPasteboardType()]) {
+        NSArray *files = [draggingInfo.draggingPasteboard propertyListForType:WebCore::legacyFilenamesPasteboardType()];
+        if (![files isKindOfClass:[NSArray class]]) {
+            delete dragData;
+            return false;
+        }
+        
+        Vector<String> fileNames;
+        
+        for (NSString *file in files)
+            fileNames.append(file);
+        m_page->createSandboxExtensionsIfNeeded(fileNames, sandboxExtensionHandle, sandboxExtensionForUpload);
+    }
+
</ins><span class="cx">     m_page->performDragOperation(*dragData, draggingInfo.draggingPasteboard.name, WTFMove(sandboxExtensionHandle), WTFMove(sandboxExtensionForUpload));
</span><span class="cx">     delete dragData;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/ChangeLog  2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog     2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2018-04-03  Andy Estes  <aestes@apple.com>
+
+        [Mac] Prioritize file promises over filenames during drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=184237
+        <rdar://problem/38278076>
+
+        Reviewed by Wenson Hsieh.
+
+        * WebView/WebView.mm:
+        (-[WebView performDragOperation:]):
+
</ins><span class="cx"> 2018-04-03  Chris Dumez  <cdumez@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Drop MainFrame class
</span></span></pre></div>
<a id="trunkSourceWebKitLegacymacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm 2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm    2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -6831,7 +6831,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200
</span><span class="cx">     NSArray* types = draggingInfo.draggingPasteboard.types;
</span><del>-    if (![types containsObject:WebArchivePboardType] && ![types containsObject:legacyFilenamesPasteboardType()] && [types containsObject:legacyFilesPromisePasteboardType()]) {
</del><ins>+    if (![types containsObject:WebArchivePboardType] && [types containsObject:legacyFilesPromisePasteboardType()]) {
</ins><span class="cx">         
</span><span class="cx">         // FIXME: legacyFilesPromisePasteboardType() contains UTIs, not path names. Also, it's not
</span><span class="cx">         // guaranteed that the count of UTIs equals the count of files, since some clients only write
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog    2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Tools/ChangeLog       2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2018-04-03  Andy Estes  <aestes@apple.com>
+
+        [Mac] Prioritize file promises over filenames during drag and drop
+        https://bugs.webkit.org/show_bug.cgi?id=184237
+        <rdar://problem/38278076>
+
+        Reviewed by Wenson Hsieh.
+
+        * DumpRenderTree/mac/EventSendingController.mm:
+        (-[EventSendingController beginDragWithFilePromises:]):
+
</ins><span class="cx"> 2018-04-03  Brady Eidson  <beidson@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Make SessionStorage work with process swapping.
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacEventSendingControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/EventSendingController.mm (230220 => 230221)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/EventSendingController.mm 2018-04-03 20:22:08 UTC (rev 230220)
+++ trunk/Tools/DumpRenderTree/mac/EventSendingController.mm    2018-04-03 20:40:12 UTC (rev 230221)
</span><span class="lines">@@ -469,7 +469,7 @@
</span><span class="cx">     assert(!draggingInfo);
</span><span class="cx"> 
</span><span class="cx">     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithUniqueName];
</span><del>-    [pasteboard declareTypes:@[NSFilesPromisePboardType] owner:nil];
</del><ins>+    [pasteboard declareTypes:@[NSFilesPromisePboardType, NSFilenamesPboardType] owner:nil];
</ins><span class="cx"> 
</span><span class="cx">     NSURL *currentTestURL = [NSURL URLWithString:mainFrame.webView.mainFrameURL];
</span><span class="cx"> 
</span><span class="lines">@@ -493,6 +493,9 @@
</span><span class="cx">     [pasteboard setPropertyList:fileUTIs forType:NSFilesPromisePboardType];
</span><span class="cx">     assert([pasteboard propertyListForType:NSFilesPromisePboardType]);
</span><span class="cx"> 
</span><ins>+    [pasteboard setPropertyList:@[@"file-name-should-not-be-used"] forType:NSFilenamesPboardType];
+    assert([pasteboard propertyListForType:NSFilenamesPboardType]);
+
</ins><span class="cx">     auto source = adoptNS([[DumpRenderTreeFileDraggingSource alloc] initWithPromisedFileURLs:fileURLs]);
</span><span class="cx">     draggingInfo = [[DumpRenderTreeDraggingInfo alloc] initWithImage:nil offset:NSZeroSize pasteboard:pasteboard source:source.get()];
</span><span class="cx">     [mainFrame.webView draggingEntered:draggingInfo];
</span></span></pre>
</div>
</div>

</body>
</html>