<!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>[208576] 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/208576">208576</a></dd>
<dt>Author</dt> <dd>wilander@apple.com</dd>
<dt>Date</dt> <dd>2016-11-10 20:15:41 -0800 (Thu, 10 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Add link information to data transfer pasteboard for drag and drop links
https://bugs.webkit.org/show_bug.cgi?id=163468
&lt;rdar://problem/20634630&gt;

Reviewed by Brent Fulgham.

Source/WebCore:

Test: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
This test ensures data transfers still work for types 'text' and 'url', i.e. that we don't
regress in-page use of the drag pasteboard.

* page/DragController.cpp:
(WebCore::DragController::startDrag):
    Now adds trustworthy link information to the drag pasteboard.
* platform/Pasteboard.h:
    New function declaration Pasteboard::writeTrustworthyWebURLsPboardType.
* platform/efl/PasteboardEfl.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
    Empty, i.e. not implemented.
* platform/gtk/PasteboardGtk.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
    Empty, i.e. not implemented.
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
    Calls ASSERT_NOT_REACHED() to make sure we don't use this function before we have
    decided on a trustrworthy URL pasteboard type on iOS. Currently not used since we
    don't support drag &amp; drop on iOS.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
    Writes the given URL to the WebURLsWithTitlesPboardType. This pasteboard type
    serves as a trusted drop source.
* platform/win/PasteboardWin.cpp:
(WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
    Empty, i.e. not implemented.

LayoutTests:

* editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt: Added.
* editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html: Added.
    This test ensures data transfer is not deleted or overwritten for the types 'text' and 'url'.
* platform/ios-simulator/TestExpectations:
    Drag &amp; drop is not supported on iOS.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorepageDragControllercpp">trunk/Source/WebCore/page/DragController.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformPasteboardh">trunk/Source/WebCore/platform/Pasteboard.h</a></li>
<li><a href="#trunkSourceWebCoreplatformeflPasteboardEflcpp">trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkPasteboardGtkcpp">trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformiosPasteboardIOSmm">trunk/Source/WebCore/platform/ios/PasteboardIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformmacPasteboardMacmm">trunk/Source/WebCore/platform/mac/PasteboardMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinPasteboardWincpp">trunk/Source/WebCore/platform/win/PasteboardWin.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestseditingpasteboarddraglinkwithdatatransferaddstrustedlinktopasteboardexpectedtxt">trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt</a></li>
<li><a href="#trunkLayoutTestseditingpasteboarddraglinkwithdatatransferaddstrustedlinktopasteboardhtml">trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/LayoutTests/ChangeLog        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-11-10  John Wilander  &lt;wilander@apple.com&gt;
+
+        Add link information to data transfer pasteboard for drag and drop links
+        https://bugs.webkit.org/show_bug.cgi?id=163468
+        &lt;rdar://problem/20634630&gt;
+
+        Reviewed by Brent Fulgham.
+
+        * editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt: Added.
+        * editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html: Added.
+            This test ensures data transfer is not deleted or overwritten for the types 'text' and 'url'.
+        * platform/ios-simulator/TestExpectations:
+            Drag &amp; drop is not supported on iOS.
+
</ins><span class="cx"> 2016-11-10  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r208522): LayoutTest fast/loader/reload-zero-byte-plugin.html is a flaky failure
</span></span></pre></div>
<a id="trunkLayoutTestseditingpasteboarddraglinkwithdatatransferaddstrustedlinktopasteboardexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt (0 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard-expected.txt        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -0,0 +1,14 @@
</span><ins>+PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstAnchorSource and not overwritten.
+PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondAnchorSource and not overwritten.
+PASS 'javascript:alert('Set by data transfer');' was set in the data transfer for firstSvgSource and not overwritten.
+PASS 'http://webkit.org/setByDataTransfer' was set in the data transfer for secondSvgSource and not overwritten.
+
+This only has an ondragenter handler and is here to make sure dragging over it doesn't change the pasteboard.
+This only has an ondragover handler and is here to make sure dragging over it doesn't change the pasteboard.
+firstAnchorSource
+secondAnchorSource
+https://webkit.org
+
+https://webkit.org
+
+
</ins></span></pre></div>
<a id="trunkLayoutTestseditingpasteboarddraglinkwithdatatransferaddstrustedlinktopasteboardhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html (0 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html                                (rev 0)
+++ trunk/LayoutTests/editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -0,0 +1,137 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML 2.0//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+    &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;input id=&quot;destination&quot; type=&quot;text&quot; style=&quot;height: 256px; width: 256px; border: 1px dashed black;&quot; /&gt;
+&lt;hr&gt;
+
+&lt;div id=&quot;ondragenterElement&quot; ondragenter='event.preventDefault(); event.dataTransfer.setData(&quot;url&quot;, &quot;http://webkit.org/setByDragenter&quot;)'&gt;
+    &lt;a href=&quot;https://webkit.org&quot;&gt;This only has an ondragenter handler and is here to make sure dragging over it doesn't change the pasteboard.&lt;/a&gt;
+&lt;/div&gt;
+
+&lt;div id=&quot;ondragoverElement&quot; ondragover='event.preventDefault(); event.dataTransfer.setData(&quot;text&quot;, &quot;Text set by dragover.&quot;)'&gt;
+    &lt;a href=&quot;https://webkit.org&quot;&gt;This only has an ondragover handler and is here to make sure dragging over it doesn't change the pasteboard.&lt;/a&gt;
+&lt;/div&gt;
+
+&lt;a id=&quot;firstAnchorSource&quot; draggable=&quot;true&quot; href=&quot;https://webkit.org&quot;&gt;firstAnchorSource&lt;/a&gt;&lt;br&gt;
+&lt;a id=&quot;secondAnchorSource&quot; draggable=&quot;true&quot; href=&quot;https://webkit.org&quot;&gt;secondAnchorSource&lt;/a&gt;&lt;br&gt;
+
+&lt;svg id=&quot;firstSvgSource&quot; draggable=&quot;true&quot; width=&quot;140&quot; height=&quot;30&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+    &lt;a xlink:href=&quot;https://webkit.org&quot; target=&quot;_blank&quot;&gt;
+        &lt;rect height=&quot;30&quot; width=&quot;120&quot; y=&quot;0&quot; x=&quot;0&quot; rx=&quot;15&quot;/&gt;
+        &lt;text fill=&quot;white&quot; text-anchor=&quot;middle&quot; y=&quot;21&quot; x=&quot;60&quot;&gt;https://webkit.org&lt;/text&gt;
+    &lt;/a&gt;
+&lt;/svg&gt;&lt;br&gt;
+&lt;svg id=&quot;secondSvgSource&quot; draggable=&quot;true&quot; width=&quot;140&quot; height=&quot;30&quot; xmlns=&quot;http://www.w3.org/2000/svg&quot; xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;&gt;
+    &lt;a xlink:href=&quot;https://webkit.org&quot; target=&quot;_blank&quot;&gt;
+        &lt;rect height=&quot;30&quot; width=&quot;120&quot; y=&quot;0&quot; x=&quot;0&quot; rx=&quot;15&quot;/&gt;
+        &lt;text fill=&quot;blue&quot; text-anchor=&quot;middle&quot; y=&quot;21&quot; x=&quot;60&quot;&gt;https://webkit.org&lt;/text&gt;
+    &lt;/a&gt;
+&lt;/svg&gt;&lt;br&gt;
+
+&lt;!-- Should be uncommented when https://bugs.webkit.org/show_bug.cgi?id=164280 is fixed
+
+&lt;div draggable=&quot;true&quot;&gt;
+    &lt;math id=&quot;firstMathSource&quot; style=&quot;padding: 0&quot;&gt;
+        &lt;mrow href=&quot;https://webkit.org&quot;&gt;
+            &lt;mrow&gt;
+                &lt;mrow&gt;
+                    &lt;mspace id=&quot;space1&quot; width=&quot;150px&quot; height=&quot;20px&quot; mathbackground=&quot;yellow&quot;&gt;&lt;/mspace&gt;
+                &lt;/mrow&gt;
+            &lt;/mrow&gt;
+        &lt;/mrow&gt;
+    &lt;/math&gt;
+&lt;/div&gt;
+&lt;div draggable=&quot;true&quot;&gt;
+    &lt;math id=&quot;secondMathSource&quot; style=&quot;padding: 0&quot;&gt;
+        &lt;mrow href=&quot;https://webkit.org&quot;&gt;
+            &lt;mrow&gt;
+                &lt;mrow&gt;
+                    &lt;mspace id=&quot;space2&quot; width=&quot;150px&quot; height=&quot;20px&quot; mathbackground=&quot;red&quot;&gt;&lt;/mspace&gt;
+                &lt;/mrow&gt;
+            &lt;/mrow&gt;
+        &lt;/mrow&gt;
+    &lt;/math&gt;
+&lt;/div&gt;
+
+--&gt;
+&lt;script&gt;
+    var TEXT_TO_SET_IN_DATA_TRANSFER = &quot;javascript:alert('Set by data transfer');&quot;;
+    var URL_TO_SET_IN_DATA_TRANSFER = &quot;http://webkit.org/setByDataTransfer&quot;;
+
+    var testResults = [];
+
+    function addDragstartEventHander(elementId, dataTransferType) {
+        var intendedDataTransferContent = (dataTransferType === &quot;text&quot; ? TEXT_TO_SET_IN_DATA_TRANSFER : URL_TO_SET_IN_DATA_TRANSFER);
+        document.getElementById(elementId).addEventListener(&quot;dragstart&quot;, function (event) {
+            event.dataTransfer.setData(dataTransferType, intendedDataTransferContent);
+            var actualDataTransferContent = event.dataTransfer.getData(dataTransferType);
+            if (actualDataTransferContent === intendedDataTransferContent) {
+                testResults.push({
+                    passed : true,
+                    message : &quot;'&quot; + actualDataTransferContent + &quot;' was set in the data transfer for &quot; + elementId + &quot; and not overwritten.&quot;
+                });
+            } else {
+                testResults.push({
+                    passed : false,
+                    message : (actualDataTransferContent ? &quot;'&quot; + actualDataTransferContent + &quot;'&quot; : &quot;Nothing&quot;) + &quot; was set in the data transfer for &quot; + elementId + &quot; or it was overwritten.&quot;
+                });
+            }
+        });
+    }
+
+    addDragstartEventHander(&quot;firstAnchorSource&quot;, &quot;text&quot;);
+    addDragstartEventHander(&quot;secondAnchorSource&quot;, &quot;url&quot;);
+    addDragstartEventHander(&quot;firstSvgSource&quot;, &quot;text&quot;);
+    addDragstartEventHander(&quot;secondSvgSource&quot;, &quot;url&quot;);
+    // Should be uncommented when https://bugs.webkit.org/show_bug.cgi?id=164280 is fixed
+    // addDragstartEventHander(&quot;firstMathSource&quot;, &quot;text&quot;);
+    // addDragstartEventHander(&quot;secondMathSource&quot;, &quot;url&quot;);
+
+    function moveMouseToCenterOfElement(elementId) {
+        var element = document.getElementById(elementId);
+        var centerX = element.offsetLeft + element.offsetWidth / 2;
+        var centerY = element.offsetTop + element.offsetHeight / 2;
+        eventSender.mouseMoveTo(centerX, centerY);
+    }
+
+    function dragAndDropElement (elementId) {
+        moveMouseToCenterOfElement(elementId);
+        eventSender.mouseDown();
+        eventSender.leapForward(200);
+        moveMouseToCenterOfElement(&quot;ondragoverElement&quot;);
+        eventSender.leapForward(100);
+        moveMouseToCenterOfElement(&quot;ondragenterElement&quot;);
+        eventSender.leapForward(100);
+        moveMouseToCenterOfElement(&quot;destination&quot;);
+        eventSender.leapForward(200);
+        eventSender.mouseUp();
+    }
+
+    if (window.testRunner &amp;&amp; eventSender) {
+        testRunner.dumpAsText();
+        testRunner.waitUntilDone();
+
+        dragAndDropElement(&quot;firstAnchorSource&quot;);
+        dragAndDropElement(&quot;secondAnchorSource&quot;);
+        dragAndDropElement(&quot;firstSvgSource&quot;);
+        dragAndDropElement(&quot;secondSvgSource&quot;);
+        // Should be uncommented when https://bugs.webkit.org/show_bug.cgi?id=164280 is fixed
+        // dragAndDropElement(&quot;firstMathSource&quot;);
+        // dragAndDropElement(&quot;secondMathSource&quot;);
+
+        testResults.forEach(function(result) {
+            if (result.passed) {
+                testPassed(result.message);
+            } else {
+                testFailed(result.message);
+            }
+        });
+
+        testRunner.notifyDone();
+    }
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -229,6 +229,7 @@
</span><span class="cx"> fast/canvas/canvas-toDataURL-webp.html
</span><span class="cx"> 
</span><span class="cx"> # Drag-and-drop is not supported:
</span><ins>+editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
</ins><span class="cx"> fast/events/bogus-dropEffect-effectAllowed.html
</span><span class="cx"> fast/events/clear-drag-state.html
</span><span class="cx"> fast/events/clear-edit-drag-state.html
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/ChangeLog        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-11-10  John Wilander  &lt;wilander@apple.com&gt;
+
+        Add link information to data transfer pasteboard for drag and drop links
+        https://bugs.webkit.org/show_bug.cgi?id=163468
+        &lt;rdar://problem/20634630&gt;
+
+        Reviewed by Brent Fulgham.
+
+        Test: editing/pasteboard/drag-link-with-data-transfer-adds-trusted-link-to-pasteboard.html
+        This test ensures data transfers still work for types 'text' and 'url', i.e. that we don't
+        regress in-page use of the drag pasteboard.
+
+        * page/DragController.cpp:
+        (WebCore::DragController::startDrag):
+            Now adds trustworthy link information to the drag pasteboard.
+        * platform/Pasteboard.h:
+            New function declaration Pasteboard::writeTrustworthyWebURLsPboardType.
+        * platform/efl/PasteboardEfl.cpp:
+        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
+            Empty, i.e. not implemented.
+        * platform/gtk/PasteboardGtk.cpp:
+        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
+            Empty, i.e. not implemented.
+        * platform/ios/PasteboardIOS.mm:
+        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
+            Calls ASSERT_NOT_REACHED() to make sure we don't use this function before we have
+            decided on a trustrworthy URL pasteboard type on iOS. Currently not used since we
+            don't support drag &amp; drop on iOS.
+        * platform/mac/PasteboardMac.mm:
+        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
+            Writes the given URL to the WebURLsWithTitlesPboardType. This pasteboard type
+            serves as a trusted drop source.
+        * platform/win/PasteboardWin.cpp:
+        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
+            Empty, i.e. not implemented.
+
</ins><span class="cx"> 2016-11-10  Said Abou-Hallawa  &lt;sabouhallawa@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION(r207182): [iOS] Crash because of passing freed CFDictionaryRef to CG when decoding a sub-sampled large image
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/page/DragController.cpp        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -875,6 +875,13 @@
</span><span class="cx">             // Simplify whitespace so the title put on the dataTransfer resembles what the user sees
</span><span class="cx">             // on the web page. This includes replacing newlines with spaces.
</span><span class="cx">             src.editor().copyURL(linkURL, hitTestResult.textContent().simplifyWhiteSpace(), dataTransfer.pasteboard());
</span><ins>+        } else {
+            // Make sure the pasteboard also contains trustworthy link data
+            // but don't overwrite more general pasteboard types.
+            PasteboardURL pasteboardURL;
+            pasteboardURL.url = linkURL;
+            pasteboardURL.title = hitTestResult.textContent();
+            dataTransfer.pasteboard().writeTrustworthyWebURLsPboardType(pasteboardURL);
</ins><span class="cx">         }
</span><span class="cx"> 
</span><span class="cx">         const VisibleSelection&amp; sourceSelection = src.selection().selection();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformPasteboardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Pasteboard.h (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Pasteboard.h        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/Pasteboard.h        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -166,6 +166,7 @@
</span><span class="cx">     virtual void read(PasteboardWebContentReader&amp;);
</span><span class="cx"> 
</span><span class="cx">     virtual void write(const PasteboardURL&amp;);
</span><ins>+    virtual void writeTrustworthyWebURLsPboardType(const PasteboardURL&amp;);
</ins><span class="cx">     virtual void write(const PasteboardImage&amp;);
</span><span class="cx">     virtual void write(const PasteboardWebContent&amp;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflPasteboardEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/efl/PasteboardEfl.cpp        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -96,6 +96,11 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&amp;)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> void Pasteboard::writeString(const String&amp;, const String&amp;)
</span><span class="cx"> {
</span><span class="cx">     notImplemented();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkPasteboardGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/gtk/PasteboardGtk.cpp        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DragData.h&quot;
</span><span class="cx"> #include &quot;Image.h&quot;
</span><ins>+#include &quot;NotImplemented.h&quot;
</ins><span class="cx"> #include &quot;PasteboardStrategy.h&quot;
</span><span class="cx"> #include &quot;PlatformStrategies.h&quot;
</span><span class="cx"> #include &quot;SelectionData.h&quot;
</span><span class="lines">@@ -179,6 +180,11 @@
</span><span class="cx">     writeToClipboard();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&amp;)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> void Pasteboard::write(const PasteboardImage&amp; pasteboardImage)
</span><span class="cx"> {
</span><span class="cx">     m_selectionData-&gt;clearAll();
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformiosPasteboardIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/ios/PasteboardIOS.mm (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/ios/PasteboardIOS.mm        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -127,6 +127,15 @@
</span><span class="cx">     platformStrategies()-&gt;pasteboardStrategy()-&gt;writeToPasteboard(kUTTypeURL, pasteboardURL.url.string());
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&amp; pasteboardURL)
+{
+    // A trustworthy URL pasteboard type needs to be decided on
+    // before we allow calls to this function. A page data transfer
+    // should not use the same pasteboard type as this function for
+    // URLs.
+    ASSERT_NOT_REACHED();
+}
+
</ins><span class="cx"> void Pasteboard::writePasteboard(const Pasteboard&amp;)
</span><span class="cx"> {
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformmacPasteboardMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/PasteboardMac.mm (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/mac/PasteboardMac.mm        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -234,6 +234,13 @@
</span><span class="cx">     m_changeCount = writeURLForTypes(writableTypesForURL(), m_pasteboardName, pasteboardURL);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&amp; pasteboardURL)
+{
+    NSURL *cocoaURL = pasteboardURL.url;
+    Vector&lt;String&gt; paths = { [cocoaURL absoluteString], pasteboardURL.title.stripWhiteSpace() };
+    m_changeCount = platformStrategies()-&gt;pasteboardStrategy()-&gt;setPathnamesForType(paths, WebURLsWithTitlesPboardType, m_pasteboardName);
+}
+
</ins><span class="cx"> static NSFileWrapper* fileWrapper(const PasteboardImage&amp; pasteboardImage)
</span><span class="cx"> {
</span><span class="cx">     NSFileWrapper *wrapper = [[[NSFileWrapper alloc] initRegularFileWithContents:pasteboardImage.resourceData-&gt;createNSData().get()] autorelease];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinPasteboardWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/PasteboardWin.cpp (208575 => 208576)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/PasteboardWin.cpp        2016-11-11 02:20:48 UTC (rev 208575)
+++ trunk/Source/WebCore/platform/win/PasteboardWin.cpp        2016-11-11 04:15:41 UTC (rev 208576)
</span><span class="lines">@@ -721,6 +721,11 @@
</span><span class="cx">     writeURLToDataObject(pasteboardURL.url, pasteboardURL.title);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Pasteboard::writeTrustworthyWebURLsPboardType(const PasteboardURL&amp;)
+{
+    notImplemented();
+}
+
</ins><span class="cx"> void Pasteboard::writeImage(Element&amp; element, const URL&amp;, const String&amp;)
</span><span class="cx"> {
</span><span class="cx">     if (!is&lt;RenderImage&gt;(element.renderer()))
</span></span></pre>
</div>
</div>

</body>
</html>