<!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>[174314] trunk/Source/WebCore</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/174314">174314</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-10-04 01:37:57 -0700 (Sat, 04 Oct 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move DragController::createFragmentFromDragData implementation to the editor
https://bugs.webkit.org/show_bug.cgi?id=136819

Reviewed by Darin Adler.

Make Editor::webContentFromPasteboard() common to all ports and
add a implementation for every port.

* PlatformWin.cmake: Add new files to compilation.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* editing/Editor.cpp:
(WebCore::Editor::pasteWithPasteboard): Move to EditorWin.cpp
since this is only used by windows port.
* editing/Editor.h:
* editing/efl/EditorEfl.cpp:
(WebCore::Editor::webContentFromPasteboard):
* editing/gtk/EditorGtk.cpp:
(WebCore::Editor::webContentFromPasteboard):
* editing/win/EditorWin.cpp: Added.
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::webContentFromPasteboard):
* page/DragController.cpp:
(WebCore::documentFragmentFromDragData): Use the editor instead of
createFragmentFromDragData() that has been removed. Also made this
method a static funtion again.
* page/DragController.h:
* page/efl/DragControllerEfl.cpp: Remove createFragmentFromDragData().
* page/gtk/DragControllerGtk.cpp: Ditto.
* page/mac/DragControllerMac.mm: Ditto.
* page/win/DragControllerWin.cpp: Ditto.
* platform/Pasteboard.h:
(WebCore::Pasteboard::dragDataMap): Add a getter for m_dragDataMap
as required by Editor::webContentFromPasteboard for windows.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorePlatformWincmake">trunk/Source/WebCore/PlatformWin.cmake</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorcpp">trunk/Source/WebCore/editing/Editor.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditingEditorh">trunk/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#trunkSourceWebCoreeditingeflEditorEflcpp">trunk/Source/WebCore/editing/efl/EditorEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreeditinggtkEditorGtkcpp">trunk/Source/WebCore/editing/gtk/EditorGtk.cpp</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="#trunkSourceWebCorepageeflDragControllerEflcpp">trunk/Source/WebCore/page/efl/DragControllerEfl.cpp</a></li>
<li><a href="#trunkSourceWebCorepagegtkDragControllerGtkcpp">trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp</a></li>
<li><a href="#trunkSourceWebCorepagemacDragControllerMacmm">trunk/Source/WebCore/page/mac/DragControllerMac.mm</a></li>
<li><a href="#trunkSourceWebCorepagewinDragControllerWincpp">trunk/Source/WebCore/page/win/DragControllerWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformPasteboardh">trunk/Source/WebCore/platform/Pasteboard.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/Source/WebCore/editing/win/</li>
<li><a href="#trunkSourceWebCoreeditingwinEditorWincpp">trunk/Source/WebCore/editing/win/EditorWin.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/ChangeLog        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2014-10-04  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
+
+        Move DragController::createFragmentFromDragData implementation to the editor
+        https://bugs.webkit.org/show_bug.cgi?id=136819
+
+        Reviewed by Darin Adler.
+
+        Make Editor::webContentFromPasteboard() common to all ports and
+        add a implementation for every port.
+
+        * PlatformWin.cmake: Add new files to compilation.
+        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
+        * editing/Editor.cpp:
+        (WebCore::Editor::pasteWithPasteboard): Move to EditorWin.cpp
+        since this is only used by windows port.
+        * editing/Editor.h:
+        * editing/efl/EditorEfl.cpp:
+        (WebCore::Editor::webContentFromPasteboard):
+        * editing/gtk/EditorGtk.cpp:
+        (WebCore::Editor::webContentFromPasteboard):
+        * editing/win/EditorWin.cpp: Added.
+        (WebCore::Editor::pasteWithPasteboard):
+        (WebCore::Editor::webContentFromPasteboard):
+        * page/DragController.cpp:
+        (WebCore::documentFragmentFromDragData): Use the editor instead of
+        createFragmentFromDragData() that has been removed. Also made this
+        method a static funtion again.
+        * page/DragController.h:
+        * page/efl/DragControllerEfl.cpp: Remove createFragmentFromDragData().
+        * page/gtk/DragControllerGtk.cpp: Ditto.
+        * page/mac/DragControllerMac.mm: Ditto.
+        * page/win/DragControllerWin.cpp: Ditto.
+        * platform/Pasteboard.h:
+        (WebCore::Pasteboard::dragDataMap): Add a getter for m_dragDataMap
+        as required by Editor::webContentFromPasteboard for windows.
+
</ins><span class="cx"> 2014-10-04  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Use is&lt;&gt;() / downcast&lt;&gt;() for CSS StyleProperties
</span></span></pre></div>
<a id="trunkSourceWebCorePlatformWincmake"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/PlatformWin.cmake (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/PlatformWin.cmake        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/PlatformWin.cmake        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -10,6 +10,8 @@
</span><span class="cx"> list(APPEND WebCore_SOURCES
</span><span class="cx">     accessibility/win/AccessibilityObjectWin.cpp
</span><span class="cx"> 
</span><ins>+    editing/win/EditorWin.cpp
+
</ins><span class="cx">     html/HTMLSelectElementWin.cpp
</span><span class="cx"> 
</span><span class="cx">     page/win/DragControllerWin.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -14928,6 +14928,7 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\editing\win\EditorWin.cpp&quot;/&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\fileapi\AsyncFileStream.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseButtonInputType.cpp&quot; /&gt;
</span><span class="cx">     &lt;ClCompile Include=&quot;..\html\BaseCheckableInputType.cpp&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/editing/Editor.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -560,20 +560,6 @@
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if !PLATFORM(COCOA) &amp;&amp; !PLATFORM(EFL) &amp;&amp; !PLATFORM(GTK)
-void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)
-{
-    RefPtr&lt;Range&gt; range = selectedRange();
-    if (!range)
-        return;
-
-    bool chosePlainText;
-    RefPtr&lt;DocumentFragment&gt; fragment = pasteboard-&gt;documentFragment(m_frame, *range, allowPlainText, chosePlainText);
-    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
-        pasteAsFragment(fragment, canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);
-}
-#endif
-
</del><span class="cx"> bool Editor::canSmartReplaceWithPasteboard(Pasteboard&amp; pasteboard)
</span><span class="cx"> {
</span><span class="cx">     return client() &amp;&amp; client()-&gt;smartInsertDeleteEnabled() &amp;&amp; pasteboard.canSmartReplace();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/Editor.h (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/Editor.h        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/editing/Editor.h        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -426,6 +426,8 @@
</span><span class="cx">     DeleteButtonController&amp; deleteButtonController() const { return *m_deleteButtonController; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    PassRefPtr&lt;DocumentFragment&gt; webContentFromPasteboard(Pasteboard&amp;, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText);
+
</ins><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx">     WEBCORE_EXPORT static RenderStyle* styleForSelectionStart(Frame* , Node *&amp;nodeToRemove);
</span><span class="cx">     WEBCORE_EXPORT bool insertParagraphSeparatorInQuotedContent();
</span><span class="lines">@@ -433,7 +435,6 @@
</span><span class="cx">     WEBCORE_EXPORT NSDictionary* fontAttributesForSelectionStart() const;
</span><span class="cx">     WEBCORE_EXPORT String stringSelectionForPasteboard();
</span><span class="cx">     String stringSelectionForPasteboardWithImageAltText();
</span><del>-    PassRefPtr&lt;DocumentFragment&gt; webContentFromPasteboard(Pasteboard&amp;, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText);
</del><span class="cx"> #if !PLATFORM(IOS)
</span><span class="cx">     bool canCopyExcludingStandaloneImages();
</span><span class="cx">     void takeFindStringFromSelection();
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingeflEditorEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/efl/EditorEfl.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/efl/EditorEfl.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/editing/efl/EditorEfl.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -27,8 +27,10 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;DocumentFragment.h&quot;
</ins><span class="cx"> #include &quot;NotImplemented.h&quot;
</span><span class="cx"> #include &quot;Pasteboard.h&quot;
</span><ins>+#include &lt;wtf/PassRefPtr.h&gt;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -47,4 +49,9 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;DocumentFragment&gt; Editor::webContentFromPasteboard(Pasteboard&amp;, Range&amp;, bool /*allowPlainText*/, bool&amp; /*chosePlainText*/)
+{
+    return nullptr;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditinggtkEditorGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/editing/gtk/EditorGtk.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/gtk/EditorGtk.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/editing/gtk/EditorGtk.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -129,4 +129,9 @@
</span><span class="cx">     pasteboard.write(pasteboardContent);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;DocumentFragment&gt; Editor::webContentFromPasteboard(Pasteboard&amp; pasteboard, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText)
+{
+    return createFragmentFromPasteboardData(pasteboard, m_frame, context, allowPlainText, chosePlainText);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreeditingwinEditorWincpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/editing/win/EditorWin.cpp (0 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/editing/win/EditorWin.cpp                                (rev 0)
+++ trunk/Source/WebCore/editing/win/EditorWin.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;Editor.h&quot;
+
+#include &quot;ClipboardUtilitiesWin.h&quot;
+#include &quot;DocumentFragment.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;FrameSelection.h&quot;
+#include &quot;Pasteboard.h&quot;
+#include &quot;windows.h&quot;
+
+namespace WebCore {
+
+void Editor::pasteWithPasteboard(Pasteboard* pasteboard, bool allowPlainText, MailBlockquoteHandling mailBlockquoteHandling)
+{
+    RefPtr&lt;Range&gt; range = selectedRange();
+    if (!range)
+        return;
+
+    bool chosePlainText;
+    RefPtr&lt;DocumentFragment&gt; fragment = pasteboard-&gt;documentFragment(m_frame, *range, allowPlainText, chosePlainText);
+    if (fragment &amp;&amp; shouldInsertFragment(fragment, range, EditorInsertActionPasted))
+        pasteAsFragment(fragment, canSmartReplaceWithPasteboard(*pasteboard), chosePlainText, mailBlockquoteHandling);
+}
+
+template &lt;typename PlatformDragData&gt;
+static PassRefPtr&lt;DocumentFragment&gt; createFragmentFromPlatformData(PlatformDragData&amp; platformDragData, Frame&amp; frame)
+{
+    if (containsFilenames(&amp;platformDragData)) {
+        if (PassRefPtr&lt;DocumentFragment&gt; fragment = fragmentFromFilenames(frame.document(), &amp;platformDragData))
+            return fragment;
+    }
+
+    if (containsHTML(&amp;platformDragData)) {
+        if (PassRefPtr&lt;DocumentFragment&gt; fragment = fragmentFromHTML(frame.document(), &amp;platformDragData))
+            return fragment;
+    }
+    return nullptr;
+}
+
+PassRefPtr&lt;DocumentFragment&gt; Editor::webContentFromPasteboard(Pasteboard&amp; pasteboard, Range&amp;, bool /*allowPlainText*/, bool&amp; /*chosePlainText*/)
+{
+    if (COMPtr&lt;IDataObject&gt; platformDragData = pasteboard.dataObject())
+        return createFragmentFromPlatformData(*platformDragData, m_frame);
+
+    return createFragmentFromPlatformData(pasteboard.dragDataMap(), m_frame);
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -114,13 +114,13 @@
</span><span class="cx">     m_client.dragControllerDestroyed();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DocumentFragment&gt; DragController::documentFragmentFromDragData(DragData&amp; dragData, Frame&amp; frame, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText)
</del><ins>+static PassRefPtr&lt;DocumentFragment&gt; documentFragmentFromDragData(DragData&amp; dragData, Frame&amp; frame, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText)
</ins><span class="cx"> {
</span><span class="cx">     chosePlainText = false;
</span><span class="cx"> 
</span><span class="cx">     Document&amp; document = context.ownerDocument();
</span><span class="cx">     if (dragData.containsCompatibleContent()) {
</span><del>-        if (PassRefPtr&lt;DocumentFragment&gt; fragment = createFragmentFromDragData(dragData, frame, context, allowPlainText, chosePlainText))
</del><ins>+        if (PassRefPtr&lt;DocumentFragment&gt; fragment = frame.editor().webContentFromPasteboard(*Pasteboard::createForDragAndDrop(dragData), context, allowPlainText, chosePlainText))
</ins><span class="cx">             return fragment;
</span><span class="cx"> 
</span><span class="cx">         if (dragData.containsURL(DragData::DoNotConvertFilenames)) {
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.h (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.h        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/DragController.h        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -115,10 +115,6 @@
</span><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"> 
</span><del>-        // FIXME: Move createFragmentFromDragData implementation to the Editor and make documentFragmentFromDragData a static function again.
-        static PassRefPtr&lt;DocumentFragment&gt; documentFragmentFromDragData(DragData&amp;, Frame&amp;, Range&amp;, bool allowPlainText, bool&amp; chosePlainText);
-        static PassRefPtr&lt;DocumentFragment&gt; createFragmentFromDragData(DragData&amp;, Frame&amp;, Range&amp;, bool allowPlainText, bool&amp; chosePlainText);
-
</del><span class="cx">         Page&amp; m_page;
</span><span class="cx">         DragClient&amp; m_client;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageeflDragControllerEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/efl/DragControllerEfl.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/efl/DragControllerEfl.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/efl/DragControllerEfl.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -73,9 +73,4 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DocumentFragment&gt; DragController::createFragmentFromDragData(DragData&amp;, Frame&amp;, Range&amp;, bool /*allowPlainText*/, bool&amp; /*chosePlainText*/)
-{
-    return nullptr;
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorepagegtkDragControllerGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -81,12 +81,4 @@
</span><span class="cx">     frame-&gt;editor().writeImageToPasteboard(dataTransfer.pasteboard(), element, url, label);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DocumentFragment&gt; DragController::createFragmentFromDragData(DragData&amp; dragData, Frame&amp; frame, Range&amp;, bool /*allowPlainText*/, bool&amp; /*chosePlainText*/)
-{
-    if (!dragData.platformData()-&gt;hasMarkup() || !frame.document())
-        return nullptr;
-
-    return createFragmentFromMarkup(*frame.document(), dragData.platformData()-&gt;markup(), &quot;&quot;);
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCorepagemacDragControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/DragControllerMac.mm (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/DragControllerMac.mm        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/mac/DragControllerMac.mm        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -92,12 +92,6 @@
</span><span class="cx">     m_client.declareAndWriteDragImage(dataTransfer.pasteboard().name(), element, url, label, element.document().frame());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;DocumentFragment&gt; DragController::createFragmentFromDragData(DragData&amp; dragData, Frame&amp; frame, Range&amp; context, bool allowPlainText, bool&amp; chosePlainText)
-{
-    Pasteboard pasteboard(dragData.pasteboardName());
-    return frame.editor().webContentFromPasteboard(pasteboard, context, allowPlainText, chosePlainText);
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // ENABLE(DRAG_SUPPORT)
</span></span></pre></div>
<a id="trunkSourceWebCorepagewinDragControllerWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/win/DragControllerWin.cpp (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/win/DragControllerWin.cpp        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/page/win/DragControllerWin.cpp        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -26,14 +26,10 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;DragController.h&quot;
</span><span class="cx"> 
</span><del>-#include &quot;ClipboardUtilitiesWin.h&quot;
</del><span class="cx"> #include &quot;DataTransfer.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentFragment.h&quot;
</del><span class="cx"> #include &quot;DragData.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><del>-#include &quot;Frame.h&quot;
-#include &quot;FrameSelection.h&quot;
</del><span class="cx"> #include &quot;Pasteboard.h&quot;
</span><span class="cx"> #include &quot;markup.h&quot;
</span><span class="cx"> #include &quot;windows.h&quot;
</span><span class="lines">@@ -87,27 +83,4 @@
</span><span class="cx">     pasteboard.writeMarkup(createMarkup(element, IncludeNode, 0, ResolveAllURLs));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-template &lt;typename PlatformDragData&gt;
-static PassRefPtr&lt;DocumentFragment&gt; createFragmentFromPlatformData(PlatformDragData* platformDragData, Frame&amp; frame)
-{
-    if (containsFilenames(platformDragData)) {
-        if (PassRefPtr&lt;DocumentFragment&gt; fragment = fragmentFromFilenames(frame.document(), platformDragData))
-            return fragment;
-    }
-
-    if (containsHTML(platformDragData)) {
-        if (PassRefPtr&lt;DocumentFragment&gt; fragment = fragmentFromHTML(frame.document(), platformDragData))
-            return fragment;
-    }
-    return nullptr;
</del><span class="cx"> }
</span><del>-
-PassRefPtr&lt;DocumentFragment&gt; DragController::createFragmentFromDragData(DragData&amp; dragData, Frame&amp; frame, Range&amp;, bool /*allowPlainText*/, bool&amp; /*chosePlainText*/)
-{
-    if (DragDataRef platformDragData = dragData.platformData())
-        return createFragmentFromPlatformData(platformDragData, frame);
-
-    return createFragmentFromPlatformData(&amp;dragData.dragDataMap(), frame);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformPasteboardh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/Pasteboard.h (174313 => 174314)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/Pasteboard.h        2014-10-04 08:30:15 UTC (rev 174313)
+++ trunk/Source/WebCore/platform/Pasteboard.h        2014-10-04 08:37:57 UTC (rev 174314)
</span><span class="lines">@@ -202,6 +202,7 @@
</span><span class="cx"> #if PLATFORM(WIN)
</span><span class="cx">     COMPtr&lt;IDataObject&gt; dataObject() const { return m_dataObject; }
</span><span class="cx">     void setExternalDataObject(IDataObject*);
</span><ins>+    const DragDataMap&amp; dragDataMap() const { return m_dragDataMap; }
</ins><span class="cx">     void writeURLToWritableDataObject(const URL&amp;, const String&amp;);
</span><span class="cx">     COMPtr&lt;WCDataObject&gt; writableDataObject() const { return m_writableDataObject; }
</span><span class="cx">     void writeImageToDataObject(Element&amp;, const URL&amp;); // FIXME: Layering violation.
</span></span></pre>
</div>
</div>

</body>
</html>