<!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>[212379] trunk/Source</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/212379">212379</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2017-02-15 10:31:00 -0800 (Wed, 15 Feb 2017)</dd>
</dl>

<h3>Log Message</h3>
<pre>Modernize DragClient::startDrag somewhat
https://bugs.webkit.org/show_bug.cgi?id=168379

Reviewed by Tim Horton.

Source/WebCore:

Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
instead of whether it's a link or not.

* loader/EmptyClients.cpp:
* page/DragClient.h:
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
* page/DragController.h:

Source/WebKit/mac:

Update for WebCore changes.

* WebCoreSupport/WebDragClient.h:
* WebCoreSupport/WebDragClient.mm:
(WebDragClient::startDrag):

Source/WebKit/win:

Update for WebCore changes.

* WebCoreSupport/WebDragClient.cpp:
(WebDragClient::startDrag):

Source/WebKit2:

Update for WebCore changes.

* WebProcess/WebCoreSupport/WebDragClient.cpp:
(WebKit::WebDragClient::startDrag):
* WebProcess/WebCoreSupport/WebDragClient.h:
* WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
(WebKit::WebDragClient::startDrag):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreloaderEmptyClientscpp">trunk/Source/WebCore/loader/EmptyClients.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragClienth">trunk/Source/WebCore/page/DragClient.h</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDragControllerh">trunk/Source/WebCore/page/DragController.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebDragClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebDragClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm</a></li>
<li><a href="#trunkSourceWebKitwinChangeLog">trunk/Source/WebKit/win/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitwinWebCoreSupportWebDragClientcpp">trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebDragClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebDragClienth">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm">trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/ChangeLog        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -1,3 +1,21 @@
</span><ins>+2017-02-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Modernize DragClient::startDrag somewhat
+        https://bugs.webkit.org/show_bug.cgi?id=168379
+
+        Reviewed by Tim Horton.
+
+        Change DragClient::startDrag to take a DragImage instead of a DragImageRef, and to pass along the source action
+        instead of whether it's a link or not.
+
+        * loader/EmptyClients.cpp:
+        * page/DragClient.h:
+        * page/DragController.cpp:
+        (WebCore::DragController::startDrag):
+        (WebCore::DragController::doImageDrag):
+        (WebCore::DragController::doSystemDrag):
+        * page/DragController.h:
+
</ins><span class="cx"> 2017-02-15  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Expose Symbol.toPrimitive / valueOf on Location instances
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderEmptyClientscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/EmptyClients.cpp (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/EmptyClients.cpp        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/loader/EmptyClients.cpp        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -131,7 +131,7 @@
</span><span class="cx">     void willPerformDragSourceAction(DragSourceAction, const IntPoint&amp;, DataTransfer&amp;) final { }
</span><span class="cx">     DragDestinationAction actionMaskForDrag(const DragData&amp;) final { return DragDestinationActionNone; }
</span><span class="cx">     DragSourceAction dragSourceActionMaskForPoint(const IntPoint&amp;) final { return DragSourceActionNone; }
</span><del>-    void startDrag(DragImageRef, const IntPoint&amp;, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp;, bool) final { }
</del><ins>+    void startDrag(DragImage, const IntPoint&amp;, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp;, DragSourceAction) final { }
</ins><span class="cx">     void dragControllerDestroyed() final { }
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragClient.h (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragClient.h        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/page/DragClient.h        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     virtual DragDestinationAction actionMaskForDrag(const DragData&amp;) = 0;
</span><span class="cx">     virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&amp; rootViewPoint) = 0;
</span><span class="cx">     
</span><del>-    virtual void startDrag(DragImageRef, const IntPoint&amp; dragImageOrigin, const IntPoint&amp; eventPos, const FloatPoint&amp; dragImageAnchor, DataTransfer&amp;, Frame&amp;, bool linkDrag = false) = 0;
</del><ins>+    virtual void startDrag(DragImage, const IntPoint&amp; dragImageOrigin, const IntPoint&amp; eventPos, const FloatPoint&amp; dragImageAnchor, DataTransfer&amp;, Frame&amp;, DragSourceAction) = 0;
</ins><span class="cx">     virtual void dragEnded() { }
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/page/DragController.cpp        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -857,7 +857,7 @@
</span><span class="cx">         if (!dragImage)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><del>-        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, dragImageBounds, dataTransfer, src, false);
</del><ins>+        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, dragImageBounds, dataTransfer, src, DragSourceActionSelection);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -885,8 +885,9 @@
</span><span class="cx">             doImageDrag(element, dragOrigin, hitTestResult.imageRect(), dataTransfer, src, m_dragOffset);
</span><span class="cx">         } else {
</span><span class="cx">             // DHTML defined drag image
</span><del>-            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
</del><ins>+            doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, DragSourceActionImage);
</ins><span class="cx">         }
</span><ins>+
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -923,7 +924,7 @@
</span><span class="cx">             dragLoc = IntPoint(mouseDraggedPoint.x() + m_dragOffset.x(), mouseDraggedPoint.y() + m_dragOffset.y());
</span><span class="cx">             dragImage = DragImage { platformAdjustDragImageForDeviceScaleFactor(dragImage.get(), m_page.deviceScaleFactor()) };
</span><span class="cx">         }
</span><del>-        doSystemDrag(WTFMove(dragImage), dragLoc, mouseDraggedPoint, { }, dataTransfer, src, true);
</del><ins>+        doSystemDrag(WTFMove(dragImage), dragLoc, mouseDraggedPoint, { }, dataTransfer, src, DragSourceActionLink);
</ins><span class="cx"> 
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="lines">@@ -943,7 +944,7 @@
</span><span class="cx">             dragLoc = dragLocForSelectionDrag(src);
</span><span class="cx">             m_dragOffset = IntPoint(dragOrigin.x() - dragLoc.x(), dragOrigin.y() - dragLoc.y());
</span><span class="cx">         }
</span><del>-        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
</del><ins>+        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, DragSourceActionAttachment);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><span class="lines">@@ -951,7 +952,7 @@
</span><span class="cx">     if (state.type == DragSourceActionDHTML &amp;&amp; dragImage) {
</span><span class="cx">         ASSERT(m_dragSourceAction &amp; DragSourceActionDHTML);
</span><span class="cx">         m_client.willPerformDragSourceAction(DragSourceActionDHTML, dragOrigin, dataTransfer);
</span><del>-        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, false);
</del><ins>+        doSystemDrag(WTFMove(dragImage), dragLoc, dragOrigin, { }, dataTransfer, src, DragSourceActionDHTML);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1001,10 +1002,10 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     dragImageOffset = mouseDownPoint + scaledOrigin;
</span><del>-    doSystemDrag(WTFMove(dragImage), dragImageOffset, dragOrigin, element.boundsInRootViewSpace(), dataTransfer, frame, false);
</del><ins>+    doSystemDrag(WTFMove(dragImage), dragImageOffset, dragOrigin, element.boundsInRootViewSpace(), dataTransfer, frame, DragSourceActionImage);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DragController::doSystemDrag(DragImage image, const IntPoint&amp; dragLoc, const IntPoint&amp; eventPos, const IntRect&amp; dragImageBounds, DataTransfer&amp; dataTransfer, Frame&amp; frame, bool forLink)
</del><ins>+void DragController::doSystemDrag(DragImage image, const IntPoint&amp; dragLoc, const IntPoint&amp; eventPos, const IntRect&amp; dragImageBounds, DataTransfer&amp; dataTransfer, Frame&amp; frame, DragSourceAction dragSourceAction)
</ins><span class="cx"> {
</span><span class="cx">     FloatPoint dragImageAnchor = { 0.5, 0.5 };
</span><span class="cx">     if (forLink)
</span><span class="lines">@@ -1019,7 +1020,7 @@
</span><span class="cx">     // Protect this frame and view, as a load may occur mid drag and attempt to unload this frame
</span><span class="cx">     Ref&lt;MainFrame&gt; frameProtector(m_page.mainFrame());
</span><span class="cx">     RefPtr&lt;FrameView&gt; viewProtector = frameProtector-&gt;view();
</span><del>-    m_client.startDrag(image.get(), viewProtector-&gt;rootViewToContents(frame.view()-&gt;contentsToRootView(dragLoc)), viewProtector-&gt;rootViewToContents(frame.view()-&gt;contentsToRootView(eventPos)), dragImageAnchor, dataTransfer, frameProtector.get(), forLink);
</del><ins>+    m_client.startDrag(WTFMove(image), viewProtector-&gt;rootViewToContents(frame.view()-&gt;contentsToRootView(dragLoc)), viewProtector-&gt;rootViewToContents(frame.view()-&gt;contentsToRootView(eventPos)), dragImageAnchor, dataTransfer, frameProtector.get(), dragSourceAction);
</ins><span class="cx">     // DragClient::startDrag can cause our Page to dispear, deallocating |this|.
</span><span class="cx">     if (!frameProtector-&gt;page())
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.h (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.h        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebCore/page/DragController.h        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx">         void mouseMovedIntoDocument(Document*);
</span><span class="cx"> 
</span><span class="cx">         void doImageDrag(Element&amp;, const IntPoint&amp;, const IntRect&amp;, DataTransfer&amp;, Frame&amp;, IntPoint&amp;);
</span><del>-        void doSystemDrag(DragImage, const IntPoint&amp;, const IntPoint&amp;, const IntRect&amp; dragImageBounds, DataTransfer&amp;, Frame&amp;, bool forLink);
</del><ins>+        void doSystemDrag(DragImage, const IntPoint&amp;, const IntPoint&amp;, const IntRect&amp; dragImageBounds, DataTransfer&amp;, Frame&amp;, DragSourceAction);
</ins><span class="cx">         void cleanupAfterSystemDrag();
</span><span class="cx">         void declareAndWriteDragImage(DataTransfer&amp;, Element&amp;, const URL&amp;, const String&amp; label);
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit/mac/ChangeLog        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2017-02-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Modernize DragClient::startDrag somewhat
+        https://bugs.webkit.org/show_bug.cgi?id=168379
+
+        Reviewed by Tim Horton.
+
+        Update for WebCore changes.
+
+        * WebCoreSupport/WebDragClient.h:
+        * WebCoreSupport/WebDragClient.mm:
+        (WebDragClient::startDrag):
+
</ins><span class="cx"> 2017-02-14  Dean Jackson  &lt;dino@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rename preferLowPowerWebGLRendering setting to forceWebGLUsesLowPower
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.h        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx">     WebCore::DragDestinationAction actionMaskForDrag(const WebCore::DragData&amp;) override;
</span><span class="cx">     void dragControllerDestroyed() override;
</span><span class="cx">     WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&amp; windowPoint) override;
</span><del>-    void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&amp; dragPos, const WebCore::IntPoint&amp; eventPos, const WebCore::FloatPoint&amp;, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, bool linkDrag) override;
</del><ins>+    void startDrag(WebCore::DragImage, const WebCore::IntPoint&amp; dragPos, const WebCore::IntPoint&amp; eventPos, const WebCore::FloatPoint&amp;, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, WebCore::DragSourceAction) override;
</ins><span class="cx">     void declareAndWriteDragImage(const String&amp; pasteboardName, WebCore::Element&amp;, const WebCore::URL&amp;, const String&amp;, WebCore::Frame*) override;
</span><span class="cx"> #if ENABLE(ATTACHMENT_ELEMENT)
</span><span class="cx">     void declareAndWriteAttachment(const String&amp; pasteboardName, WebCore::Element&amp;, const WebCore::URL&amp;, const String&amp; path, WebCore::Frame*) override;
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebDragClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebDragClient.mm        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -95,13 +95,13 @@
</span><span class="cx">     [[m_webView _UIDelegateForwarder] webView:m_webView willPerformDragSourceAction:(WebDragSourceAction)action fromPoint:mouseDownPoint withPasteboard:[NSPasteboard pasteboardWithName:dataTransfer.pasteboard().name()]];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebDragClient::startDrag(DragImageRef dragImage, const IntPoint&amp; at, const IntPoint&amp; eventPos, const FloatPoint&amp;, DataTransfer&amp; dataTransfer, Frame&amp; frame, bool linkDrag)
</del><ins>+void WebDragClient::startDrag(DragImage dragImage, const IntPoint&amp; at, const IntPoint&amp; eventPos, const FloatPoint&amp;, DataTransfer&amp; dataTransfer, Frame&amp; frame, DragSourceAction dragSourceAction)
</ins><span class="cx"> {
</span><span class="cx">     RetainPtr&lt;WebHTMLView&gt; htmlView = (WebHTMLView*)[[kit(&amp;frame) frameView] documentView];
</span><span class="cx">     if (![htmlView.get() isKindOfClass:[WebHTMLView class]])
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    NSEvent *event = linkDrag ? frame.eventHandler().currentNSEvent() : [htmlView.get() _mouseDownEvent];
</del><ins>+    NSEvent *event = dragSourceAction == DragSourceActionLink ? frame.eventHandler().currentNSEvent() : [htmlView.get() _mouseDownEvent];
</ins><span class="cx">     WebHTMLView* topHTMLView = getTopHTMLView(&amp;frame);
</span><span class="cx">     RetainPtr&lt;WebHTMLView&gt; topViewProtector = topHTMLView;
</span><span class="cx">     
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx">     [topHTMLView _stopAutoscrollTimer];
</span><span class="cx">     NSPasteboard *pasteboard = [NSPasteboard pasteboardWithName:dataTransfer.pasteboard().name()];
</span><span class="cx"> 
</span><del>-    NSImage *dragNSImage = dragImage.get();
</del><ins>+    NSImage *dragNSImage = dragImage.get().get();
</ins><span class="cx">     WebHTMLView *sourceHTMLView = htmlView.get();
</span><span class="cx"> 
</span><span class="cx">     IntSize size([dragNSImage size]);
</span></span></pre></div>
<a id="trunkSourceWebKitwinChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/ChangeLog (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit/win/ChangeLog        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2017-02-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Modernize DragClient::startDrag somewhat
+        https://bugs.webkit.org/show_bug.cgi?id=168379
+
+        Reviewed by Tim Horton.
+
+        Update for WebCore changes.
+
+        * WebCoreSupport/WebDragClient.cpp:
+        (WebDragClient::startDrag):
+
</ins><span class="cx"> 2017-02-10  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Attempt to fix the WinCairo 64-Bit Release build following &lt;https://trac.webkit.org/changeset/212173&gt;
</span></span></pre></div>
<a id="trunkSourceWebKitwinWebCoreSupportWebDragClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit/win/WebCoreSupport/WebDragClient.cpp        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -110,7 +110,7 @@
</span><span class="cx">         const_cast&lt;Pasteboard&amp;&gt;(dataTransfer.pasteboard()).setExternalDataObject(newDataObject.get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebDragClient::startDrag(DragImageRef image, const IntPoint&amp; imageOrigin, const IntPoint&amp; dragPoint, const FloatPoint&amp;, DataTransfer&amp; dataTransfer, Frame&amp; frame, bool isLink)
</del><ins>+void WebDragClient::startDrag(DragImage image, const IntPoint&amp; imageOrigin, const IntPoint&amp; dragPoint, const FloatPoint&amp;, DataTransfer&amp; dataTransfer, Frame&amp; frame, DragSourceAction dragSourceAction)
</ins><span class="cx"> {
</span><span class="cx">     //FIXME: Allow UIDelegate to override behaviour &lt;rdar://problem/5015953&gt;
</span><span class="cx"> 
</span><span class="lines">@@ -129,7 +129,7 @@
</span><span class="cx">             if(SUCCEEDED(CoCreateInstance(CLSID_DragDropHelper, 0, CLSCTX_INPROC_SERVER,
</span><span class="cx">                 IID_IDragSourceHelper,(LPVOID*)&amp;helper))) {
</span><span class="cx">                 BITMAP b;
</span><del>-                GetObject(image, sizeof(BITMAP), &amp;b);
</del><ins>+                GetObject(image.get(), sizeof(BITMAP), &amp;b);
</ins><span class="cx">                 SHDRAGIMAGE sdi;
</span><span class="cx">                 sdi.sizeDragImage.cx = b.bmWidth;
</span><span class="cx">                 sdi.sizeDragImage.cy = b.bmHeight;
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">                 sdi.hbmpDragImage = image;
</span><span class="cx">                 sdi.ptOffset.x = dragPoint.x() - imageOrigin.x();
</span><span class="cx">                 sdi.ptOffset.y = dragPoint.y() - imageOrigin.y();
</span><del>-                if (isLink)
</del><ins>+                if (dragSourceAction == DragSourceActionLink)
</ins><span class="cx">                     sdi.ptOffset.y = b.bmHeight - sdi.ptOffset.y;
</span><span class="cx"> 
</span><span class="cx">                 helper-&gt;InitializeFromBitmap(&amp;sdi, dataObject.get());
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit2/ChangeLog        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2017-02-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Modernize DragClient::startDrag somewhat
+        https://bugs.webkit.org/show_bug.cgi?id=168379
+
+        Reviewed by Tim Horton.
+
+        Update for WebCore changes.
+
+        * WebProcess/WebCoreSupport/WebDragClient.cpp:
+        (WebKit::WebDragClient::startDrag):
+        * WebProcess/WebCoreSupport/WebDragClient.h:
+        * WebProcess/WebCoreSupport/mac/WebDragClientMac.mm:
+        (WebKit::WebDragClient::startDrag):
+
</ins><span class="cx"> 2017-02-15  Aakash Jain  &lt;aakash_jain@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove WebIOSEvent interface
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebDragClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.cpp        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(COCOA) &amp;&amp; !PLATFORM(GTK)
</span><del>-void WebDragClient::startDrag(DragImageRef, const IntPoint&amp;, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp;, bool)
</del><ins>+void WebDragClient::startDrag(DragImage, const IntPoint&amp;, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp;, DragSourceAction)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebDragClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebDragClient.h        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -47,7 +47,7 @@
</span><span class="cx">     WebCore::DragDestinationAction actionMaskForDrag(const WebCore::DragData&amp;) override;
</span><span class="cx">     WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint&amp; windowPoint) override;
</span><span class="cx"> 
</span><del>-    void startDrag(WebCore::DragImageRef, const WebCore::IntPoint&amp; dragImageOrigin, const WebCore::IntPoint&amp; eventPos, const WebCore::FloatPoint&amp; dragImageAnchor, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, bool linkDrag = false) override;
</del><ins>+    void startDrag(WebCore::DragImage, const WebCore::IntPoint&amp; dragImageOrigin, const WebCore::IntPoint&amp; eventPos, const WebCore::FloatPoint&amp; dragImageAnchor, WebCore::DataTransfer&amp;, WebCore::Frame&amp;, WebCore::DragSourceAction) override;
</ins><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     void declareAndWriteDragImage(const String&amp; pasteboardName, WebCore::Element&amp;, const WebCore::URL&amp;, const String&amp;, WebCore::Frame*) override;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportmacWebDragClientMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm (212378 => 212379)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2017-02-15 18:23:33 UTC (rev 212378)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebDragClientMac.mm        2017-02-15 18:31:00 UTC (rev 212379)
</span><span class="lines">@@ -82,10 +82,10 @@
</span><span class="cx">     return WTFMove(bitmap);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebDragClient::startDrag(RetainPtr&lt;NSImage&gt; image, const IntPoint&amp; point, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp; frame, bool linkDrag)
</del><ins>+void WebDragClient::startDrag(DragImage image, const IntPoint&amp; point, const IntPoint&amp;, const FloatPoint&amp;, DataTransfer&amp;, Frame&amp; frame, DragSourceAction dragSourceAction)
</ins><span class="cx"> {
</span><del>-    IntSize bitmapSize([image size]);
-    RefPtr&lt;ShareableBitmap&gt; bitmap = convertImageToBitmap(image.get(), bitmapSize, frame);
</del><ins>+    IntSize bitmapSize([image.get() size]);
+    RefPtr&lt;ShareableBitmap&gt; bitmap = convertImageToBitmap(image.get().get(), bitmapSize, frame);
</ins><span class="cx">     ShareableBitmap::Handle handle;
</span><span class="cx">     if (!bitmap || !bitmap-&gt;createHandle(handle))
</span><span class="cx">         return;
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx">     m_page-&gt;willStartDrag();
</span><span class="cx"> 
</span><span class="cx">     // FIXME: Seems this message should be named StartDrag, not SetDragImage.
</span><del>-    m_page-&gt;send(Messages::WebPageProxy::SetDragImage(frame.view()-&gt;contentsToWindow(point), handle, { }, linkDrag));
</del><ins>+    m_page-&gt;send(Messages::WebPageProxy::SetDragImage(frame.view()-&gt;contentsToWindow(point), handle, { }, dragSourceAction == DragSourceActionLink));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static WebCore::CachedImage* cachedImage(Element&amp; element)
</span></span></pre>
</div>
</div>

</body>
</html>