<!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>[173686] 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/173686">173686</a></dd>
<dt>Author</dt> <dd>carlosgc@webkit.org</dd>
<dt>Date</dt> <dd>2014-09-16 23:27:46 -0700 (Tue, 16 Sep 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>DragData should not depend on Clipboard, DocumentFragment, and Document
https://bugs.webkit.org/show_bug.cgi?id=21358
Reviewed by Darin Adler.
Source/WebCore:
Refactor DragData to not depend on Frame, DocumentFragment,
Document and Range. DragData::asFragment() has been moved to
DragController and implemented in the platform specific file.
DragData methods using Frame has been reworked in Mac to not use
Frame, since all other ports were ignoreing the frame parameter.
* page/DragController.cpp:
(WebCore::DragController::documentFragmentFromDragData): Make it
a static member to be able to use createFragmentFromDragData().
(WebCore::DragController::performDragOperation): Update to
DragData API changes.
(WebCore::DragController::dispatchTextInputEventFor): Ditto.
(WebCore::DragController::concludeEditDrag): Ditto.
(WebCore::documentFragmentFromDragData): Deleted.
* page/DragController.h:
* page/efl/DragControllerEfl.cpp:
(WebCore::DragController::createFragmentFromDragData): Move
DragData::asFragment() implementation here.
* page/gtk/DragControllerGtk.cpp:
(WebCore::DragController::dragOperation):
(WebCore::DragController::createFragmentFromDragData): Ditto.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::dragOperation):
(WebCore::DragController::createFragmentFromDragData): Ditto.
* page/win/DragControllerWin.cpp:
(WebCore::DragController::createFragmentFromDragData): Ditto.
* platform/DragData.h:
* platform/efl/DragDataEfl.cpp:
(WebCore::DragData::asPlainText): Remove Frame parameter.
(WebCore::DragData::containsURL): Ditto.
(WebCore::DragData::asURL): Ditto.
(WebCore::DragData::asFragment): Deleted.
* platform/gtk/DragDataGtk.cpp:
(WebCore::DragData::asPlainText): Remove Frame parameter.
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::containsURL): Ditto.
(WebCore::DragData::asURL): Ditto.
(WebCore::DragData::asFragment): Deleted.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::asPlainText): Same implementation as the
Editor.
(WebCore::DragData::containsURL): Remove Frame parameter.
(WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead
of using the Editor client.
(WebCore::DragData::asFragment): Deleted.
* platform/win/DragDataWin.cpp:
(WebCore::DragData::containsURL): Remove Frame parameter.
(WebCore::DragData::asURL): Ditto.
(WebCore::DragData::asPlainText): Ditto.
(WebCore::DragData::containsCompatibleContent):
(WebCore::DragData::asFragment): Deleted.
Source/WebKit2:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::performDragControllerAction): Update to API
change in DragData::asURL().</pre>
<h3>Modified Paths</h3>
<ul>
<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="#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="#trunkSourceWebCoreplatformDragDatah">trunk/Source/WebCore/platform/DragData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformeflDragDataEflcpp">trunk/Source/WebCore/platform/efl/DragDataEfl.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgtkDragDataGtkcpp">trunk/Source/WebCore/platform/gtk/DragDataGtk.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformmacDragDataMacmm">trunk/Source/WebCore/platform/mac/DragDataMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformwinClipboardUtilitiesWinh">trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.h</a></li>
<li><a href="#trunkSourceWebCoreplatformwinDragDataWincpp">trunk/Source/WebCore/platform/win/DragDataWin.cpp</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/ChangeLog        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -1,3 +1,62 @@
</span><ins>+2014-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ DragData should not depend on Clipboard, DocumentFragment, and Document
+ https://bugs.webkit.org/show_bug.cgi?id=21358
+
+ Reviewed by Darin Adler.
+
+ Refactor DragData to not depend on Frame, DocumentFragment,
+ Document and Range. DragData::asFragment() has been moved to
+ DragController and implemented in the platform specific file.
+ DragData methods using Frame has been reworked in Mac to not use
+ Frame, since all other ports were ignoreing the frame parameter.
+
+ * page/DragController.cpp:
+ (WebCore::DragController::documentFragmentFromDragData): Make it
+ a static member to be able to use createFragmentFromDragData().
+ (WebCore::DragController::performDragOperation): Update to
+ DragData API changes.
+ (WebCore::DragController::dispatchTextInputEventFor): Ditto.
+ (WebCore::DragController::concludeEditDrag): Ditto.
+ (WebCore::documentFragmentFromDragData): Deleted.
+ * page/DragController.h:
+ * page/efl/DragControllerEfl.cpp:
+ (WebCore::DragController::createFragmentFromDragData): Move
+ DragData::asFragment() implementation here.
+ * page/gtk/DragControllerGtk.cpp:
+ (WebCore::DragController::dragOperation):
+ (WebCore::DragController::createFragmentFromDragData): Ditto.
+ * page/mac/DragControllerMac.mm:
+ (WebCore::DragController::dragOperation):
+ (WebCore::DragController::createFragmentFromDragData): Ditto.
+ * page/win/DragControllerWin.cpp:
+ (WebCore::DragController::createFragmentFromDragData): Ditto.
+ * platform/DragData.h:
+ * platform/efl/DragDataEfl.cpp:
+ (WebCore::DragData::asPlainText): Remove Frame parameter.
+ (WebCore::DragData::containsURL): Ditto.
+ (WebCore::DragData::asURL): Ditto.
+ (WebCore::DragData::asFragment): Deleted.
+ * platform/gtk/DragDataGtk.cpp:
+ (WebCore::DragData::asPlainText): Remove Frame parameter.
+ (WebCore::DragData::containsCompatibleContent):
+ (WebCore::DragData::containsURL): Ditto.
+ (WebCore::DragData::asURL): Ditto.
+ (WebCore::DragData::asFragment): Deleted.
+ * platform/mac/DragDataMac.mm:
+ (WebCore::DragData::asPlainText): Same implementation as the
+ Editor.
+ (WebCore::DragData::containsURL): Remove Frame parameter.
+ (WebCore::DragData::asURL): Use URLByCanonicalizingURL() instead
+ of using the Editor client.
+ (WebCore::DragData::asFragment): Deleted.
+ * platform/win/DragDataWin.cpp:
+ (WebCore::DragData::containsURL): Remove Frame parameter.
+ (WebCore::DragData::asURL): Ditto.
+ (WebCore::DragData::asPlainText): Ditto.
+ (WebCore::DragData::containsCompatibleContent):
+ (WebCore::DragData::asFragment): Deleted.
+
</ins><span class="cx"> 2014-09-16 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> Rename Node::childNode(index) to traverseToChildAt(index) for clarity
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/DragController.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -114,25 +114,25 @@
</span><span class="cx"> m_client.dragControllerDestroyed();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData& dragData, Frame* frame, Range& context, bool allowPlainText, bool& chosePlainText)
</del><ins>+PassRefPtr<DocumentFragment> DragController::documentFragmentFromDragData(DragData& dragData, Frame& frame, Range& context, bool allowPlainText, bool& chosePlainText)
</ins><span class="cx"> {
</span><span class="cx"> chosePlainText = false;
</span><span class="cx">
</span><span class="cx"> Document& document = context.ownerDocument();
</span><span class="cx"> if (dragData.containsCompatibleContent()) {
</span><del>- if (PassRefPtr<DocumentFragment> fragment = dragData.asFragment(frame, context, allowPlainText, chosePlainText))
</del><ins>+ if (PassRefPtr<DocumentFragment> fragment = createFragmentFromDragData(dragData, frame, context, allowPlainText, chosePlainText))
</ins><span class="cx"> return fragment;
</span><span class="cx">
</span><del>- if (dragData.containsURL(frame, DragData::DoNotConvertFilenames)) {
</del><ins>+ if (dragData.containsURL(DragData::DoNotConvertFilenames)) {
</ins><span class="cx"> String title;
</span><del>- String url = dragData.asURL(frame, DragData::DoNotConvertFilenames, &title);
</del><ins>+ String url = dragData.asURL(DragData::DoNotConvertFilenames, &title);
</ins><span class="cx"> if (!url.isEmpty()) {
</span><span class="cx"> RefPtr<HTMLAnchorElement> anchor = HTMLAnchorElement::create(document);
</span><span class="cx"> anchor->setHref(url);
</span><span class="cx"> if (title.isEmpty()) {
</span><span class="cx"> // Try the plain text first because the url might be normalized or escaped.
</span><span class="cx"> if (dragData.containsPlainText())
</span><del>- title = dragData.asPlainText(frame);
</del><ins>+ title = dragData.asPlainText();
</ins><span class="cx"> if (title.isEmpty())
</span><span class="cx"> title = url;
</span><span class="cx"> }
</span><span class="lines">@@ -146,7 +146,7 @@
</span><span class="cx"> }
</span><span class="cx"> if (allowPlainText && dragData.containsPlainText()) {
</span><span class="cx"> chosePlainText = true;
</span><del>- return createFragmentFromText(context, dragData.asPlainText(frame)).get();
</del><ins>+ return createFragmentFromText(context, dragData.asPlainText()).get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return 0;
</span><span class="lines">@@ -234,7 +234,7 @@
</span><span class="cx"> return false;
</span><span class="cx">
</span><span class="cx"> m_client.willPerformDragDestinationAction(DragDestinationActionLoad, dragData);
</span><del>- m_page.mainFrame().loader().load(FrameLoadRequest(&m_page.mainFrame(), ResourceRequest(dragData.asURL(&m_page.mainFrame()))));
</del><ins>+ m_page.mainFrame().loader().load(FrameLoadRequest(&m_page.mainFrame(), ResourceRequest(dragData.asURL())));
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -425,7 +425,7 @@
</span><span class="cx"> bool DragController::dispatchTextInputEventFor(Frame* innerFrame, DragData& dragData)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(m_page.dragCaretController().hasCaret());
</span><del>- String text = m_page.dragCaretController().isContentRichlyEditable() ? emptyString() : dragData.asPlainText(innerFrame);
</del><ins>+ String text = m_page.dragCaretController().isContentRichlyEditable() ? emptyString() : dragData.asPlainText();
</ins><span class="cx"> Node* target = innerFrame->editor().findEventTargetFrom(m_page.dragCaretController().caretPosition());
</span><span class="cx"> return target->dispatchEvent(TextEvent::createForDrop(innerFrame->document()->domWindow(), text), IGNORE_EXCEPTION);
</span><span class="cx"> }
</span><span class="lines">@@ -494,7 +494,7 @@
</span><span class="cx"> ResourceCacheValidationSuppressor validationSuppressor(cachedResourceLoader);
</span><span class="cx"> if (dragIsMove(innerFrame->selection(), dragData) || dragCaret.isContentRichlyEditable()) {
</span><span class="cx"> bool chosePlainText = false;
</span><del>- RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, innerFrame.get(), *range, true, chosePlainText);
</del><ins>+ RefPtr<DocumentFragment> fragment = documentFragmentFromDragData(dragData, *innerFrame, *range, true, chosePlainText);
</ins><span class="cx"> if (!fragment || !innerFrame->editor().shouldInsertFragment(fragment, range, EditorInsertActionDropped)) {
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="lines">@@ -517,7 +517,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> } else {
</span><del>- String text = dragData.asPlainText(innerFrame.get());
</del><ins>+ String text = dragData.asPlainText();
</ins><span class="cx"> if (text.isEmpty() || !innerFrame->editor().shouldInsertText(text, range.get(), EditorInsertActionDropped)) {
</span><span class="cx"> return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.h (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.h        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/DragController.h        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">
</span><span class="cx"> class DataTransfer;
</span><span class="cx"> class Document;
</span><ins>+ class DocumentFragment;
</ins><span class="cx"> class DragClient;
</span><span class="cx"> class DragData;
</span><span class="cx"> class Element;
</span><span class="lines">@@ -44,6 +45,7 @@
</span><span class="cx"> class IntRect;
</span><span class="cx"> class Page;
</span><span class="cx"> class PlatformMouseEvent;
</span><ins>+ class Range;
</ins><span class="cx">
</span><span class="cx"> struct DragState;
</span><span class="cx">
</span><span class="lines">@@ -113,6 +115,10 @@
</span><span class="cx"> void cleanupAfterSystemDrag();
</span><span class="cx"> void declareAndWriteDragImage(DataTransfer&, Element&, const URL&, const String& label);
</span><span class="cx">
</span><ins>+ // FIXME: Move createFragmentFromDragData implementation to the Editor and make documentFragmentFromDragData a static function again.
+ static PassRefPtr<DocumentFragment> documentFragmentFromDragData(DragData&, Frame&, Range&, bool allowPlainText, bool& chosePlainText);
+ static PassRefPtr<DocumentFragment> createFragmentFromDragData(DragData&, Frame&, Range&, bool allowPlainText, bool& chosePlainText);
+
</ins><span class="cx"> Page& m_page;
</span><span class="cx"> DragClient& 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 (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/efl/DragControllerEfl.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/efl/DragControllerEfl.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -29,6 +29,8 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DragController.h"
</span><span class="cx">
</span><ins>+#include "Document.h"
+#include "DocumentFragment.h"
</ins><span class="cx"> #include "DragData.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="lines">@@ -50,7 +52,7 @@
</span><span class="cx">
</span><span class="cx"> DragOperation DragController::dragOperation(DragData& dragData)
</span><span class="cx"> {
</span><del>- if (dragData.containsURL(0))
</del><ins>+ if (dragData.containsURL())
</ins><span class="cx"> return DragOperationCopy;
</span><span class="cx">
</span><span class="cx"> return DragOperationNone;
</span><span class="lines">@@ -71,4 +73,9 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<DocumentFragment> DragController::createFragmentFromDragData(DragData&, Frame&, Range&, bool /*allowPlainText*/, bool& /*chosePlainText*/)
+{
+ return nullptr;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepagegtkDragControllerGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/gtk/DragControllerGtk.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -26,13 +26,17 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DragController.h"
</span><span class="cx">
</span><ins>+#include "DataObjectGtk.h"
</ins><span class="cx"> #include "DataTransfer.h"
</span><ins>+#include "Document.h"
+#include "DocumentFragment.h"
</ins><span class="cx"> #include "DragData.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameView.h"
</span><span class="cx"> #include "Page.h"
</span><span class="cx"> #include "Pasteboard.h"
</span><ins>+#include "markup.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -53,7 +57,7 @@
</span><span class="cx"> DragOperation DragController::dragOperation(DragData& dragData)
</span><span class="cx"> {
</span><span class="cx"> // FIXME: This logic is incomplete
</span><del>- if (dragData.containsURL(0))
</del><ins>+ if (dragData.containsURL())
</ins><span class="cx"> return DragOperationCopy;
</span><span class="cx">
</span><span class="cx"> return DragOperationNone;
</span><span class="lines">@@ -74,4 +78,12 @@
</span><span class="cx"> dataTransfer.pasteboard().writeImage(element, url, label);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+PassRefPtr<DocumentFragment> DragController::createFragmentFromDragData(DragData& dragData, Frame& frame, Range&, bool /*allowPlainText*/, bool& /*chosePlainText*/)
+{
+ if (!dragData.platformData()->hasMarkup() || !frame.document())
+ return nullptr;
+
+ return createFragmentFromMarkup(*frame.document(), dragData.platformData()->markup(), "");
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorepagemacDragControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/mac/DragControllerMac.mm (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/mac/DragControllerMac.mm        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/mac/DragControllerMac.mm        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -29,13 +29,18 @@
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><span class="cx">
</span><span class="cx"> #import "DataTransfer.h"
</span><ins>+#import "Document.h"
+#import "DocumentFragment.h"
</ins><span class="cx"> #import "DragClient.h"
</span><span class="cx"> #import "DragData.h"
</span><ins>+#import "Editor.h"
+#import "EditorClient.h"
</ins><span class="cx"> #import "Element.h"
</span><span class="cx"> #import "FrameView.h"
</span><span class="cx"> #import "MainFrame.h"
</span><span class="cx"> #import "Page.h"
</span><span class="cx"> #import "Pasteboard.h"
</span><ins>+#import "Range.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -54,7 +59,7 @@
</span><span class="cx">
</span><span class="cx"> DragOperation DragController::dragOperation(DragData& dragData)
</span><span class="cx"> {
</span><del>- if ((dragData.flags() & DragApplicationIsModal) || !dragData.containsURL(&m_page.mainFrame()))
</del><ins>+ if ((dragData.flags() & DragApplicationIsModal) || !dragData.containsURL())
</ins><span class="cx"> return DragOperationNone;
</span><span class="cx">
</span><span class="cx"> if (!m_documentUnderMouse || (!(dragData.flags() & (DragApplicationHasAttachedSheet | DragApplicationIsSource))))
</span><span class="lines">@@ -87,6 +92,12 @@
</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><ins>+PassRefPtr<DocumentFragment> DragController::createFragmentFromDragData(DragData& dragData, Frame& frame, Range& context, bool allowPlainText, bool& chosePlainText)
+{
+ Pasteboard pasteboard(dragData.pasteboardName());
+ return frame.editor().webContentFromPasteboard(pasteboard, context, allowPlainText, chosePlainText);
+}
+
</ins><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 (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/win/DragControllerWin.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/page/win/DragControllerWin.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -26,9 +26,13 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DragController.h"
</span><span class="cx">
</span><ins>+#include "ClipboardUtilitiesWin.h"
</ins><span class="cx"> #include "DataTransfer.h"
</span><ins>+#include "Document.h"
+#include "DocumentFragment.h"
</ins><span class="cx"> #include "DragData.h"
</span><span class="cx"> #include "Element.h"
</span><ins>+#include "Frame.h"
</ins><span class="cx"> #include "FrameSelection.h"
</span><span class="cx"> #include "Pasteboard.h"
</span><span class="cx"> #include "markup.h"
</span><span class="lines">@@ -50,7 +54,7 @@
</span><span class="cx"> //if we are a modal window, we are the drag source, or the window is an attached sheet
</span><span class="cx"> //If this can be determined from within WebCore operationForDrag can be pulled into
</span><span class="cx"> //WebCore itself
</span><del>- return dragData.containsURL(0) && !m_didInitiateDrag ? DragOperationCopy : DragOperationNone;
</del><ins>+ return dragData.containsURL() && !m_didInitiateDrag ? DragOperationCopy : DragOperationNone;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool DragController::isCopyKeyDown(DragData&)
</span><span class="lines">@@ -83,4 +87,27 @@
</span><span class="cx"> pasteboard.writeMarkup(createMarkup(element, IncludeNode, 0, ResolveAllURLs));
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+template <typename PlatformDragData>
+static PassRefPtr<DocumentFragment> createFragmentFromPlatformData(PlatformDragData* platformDragData, Frame& frame)
+{
+ if (containsFilenames(platformDragData)) {
+ if (PassRefPtr<DocumentFragment> fragment = fragmentFromFilenames(frame.document(), platformDragData))
+ return fragment;
+ }
+
+ if (containsHTML(platformDragData)) {
+ if (PassRefPtr<DocumentFragment> fragment = fragmentFromHTML(frame.document(), platformDragData))
+ return fragment;
+ }
+ return nullptr;
</ins><span class="cx"> }
</span><ins>+
+PassRefPtr<DocumentFragment> DragController::createFragmentFromDragData(DragData& dragData, Frame& frame, Range&, bool /*allowPlainText*/, bool& /*chosePlainText*/)
+{
+ if (DragDataRef platformDragData = dragData.platformData())
+ return createFragmentFromPlatformData(platformDragData, frame);
+
+ return createFragmentFromPlatformData(&dragData.dragDataMap(), frame);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformDragDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/DragData.h (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/DragData.h        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/DragData.h        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -60,10 +60,7 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class Frame;
-class DocumentFragment;
</del><span class="cx"> class URL;
</span><del>-class Range;
</del><span class="cx">
</span><span class="cx"> enum DragApplicationFlags {
</span><span class="cx"> DragApplicationNone = 0,
</span><span class="lines">@@ -95,14 +92,13 @@
</span><span class="cx"> DragApplicationFlags flags() const { return m_applicationFlags; }
</span><span class="cx"> DragDataRef platformData() const { return m_platformDragData; }
</span><span class="cx"> DragOperation draggingSourceOperationMask() const { return m_draggingSourceOperationMask; }
</span><del>- bool containsURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames) const;
</del><ins>+ bool containsURL(FilenameConversionPolicy = ConvertFilenames) const;
</ins><span class="cx"> bool containsPlainText() const;
</span><span class="cx"> bool containsCompatibleContent() const;
</span><del>- String asURL(Frame*, FilenameConversionPolicy filenamePolicy = ConvertFilenames, String* title = 0) const;
- String asPlainText(Frame*) const;
</del><ins>+ String asURL(FilenameConversionPolicy = ConvertFilenames, String* title = nullptr) const;
+ String asPlainText() const;
</ins><span class="cx"> void asFilenames(Vector<String>&) const;
</span><span class="cx"> Color asColor() const;
</span><del>- PassRefPtr<DocumentFragment> asFragment(Frame*, Range& context, bool allowPlainText, bool& chosePlainText) const;
</del><span class="cx"> bool canSmartReplace() const;
</span><span class="cx"> bool containsColor() const;
</span><span class="cx"> bool containsFiles() const;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformeflDragDataEflcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/efl/DragDataEfl.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/efl/DragDataEfl.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/efl/DragDataEfl.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -21,8 +21,7 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DragData.h"
</span><span class="cx">
</span><del>-#include "Document.h"
-#include "DocumentFragment.h"
</del><ins>+#include <wtf/text/WTFString.h>
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -55,7 +54,7 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asPlainText(Frame*) const
</del><ins>+String DragData::asPlainText() const
</ins><span class="cx"> {
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="lines">@@ -70,19 +69,14 @@
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool DragData::containsURL(Frame*, FilenameConversionPolicy) const
</del><ins>+bool DragData::containsURL(FilenameConversionPolicy) const
</ins><span class="cx"> {
</span><span class="cx"> return false;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asURL(Frame*, FilenameConversionPolicy, String*) const
</del><ins>+String DragData::asURL(FilenameConversionPolicy, String*) const
</ins><span class="cx"> {
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<DocumentFragment> DragData::asFragment(Frame*, Range&, bool, bool&) const
-{
- return 0;
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformgtkDragDataGtkcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/gtk/DragDataGtk.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/gtk/DragDataGtk.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/gtk/DragDataGtk.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -18,10 +18,6 @@
</span><span class="cx"> #include "DragData.h"
</span><span class="cx">
</span><span class="cx"> #include "DataObjectGtk.h"
</span><del>-#include "Document.h"
-#include "DocumentFragment.h"
-#include "Frame.h"
-#include "markup.h"
</del><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -55,7 +51,7 @@
</span><span class="cx"> return m_platformDragData->hasText();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asPlainText(Frame*) const
</del><ins>+String DragData::asPlainText() const
</ins><span class="cx"> {
</span><span class="cx"> return m_platformDragData->text();
</span><span class="cx"> }
</span><span class="lines">@@ -67,15 +63,15 @@
</span><span class="cx">
</span><span class="cx"> bool DragData::containsCompatibleContent() const
</span><span class="cx"> {
</span><del>- return containsPlainText() || containsURL(0) || m_platformDragData->hasMarkup() || containsColor() || containsFiles();
</del><ins>+ return containsPlainText() || containsURL() || m_platformDragData->hasMarkup() || containsColor() || containsFiles();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-bool DragData::containsURL(Frame* frame, FilenameConversionPolicy filenamePolicy) const
</del><ins>+bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
</ins><span class="cx"> {
</span><del>- return !asURL(frame, filenamePolicy).isEmpty();
</del><ins>+ return !asURL(filenamePolicy).isEmpty();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const
</del><ins>+String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const
</ins><span class="cx"> {
</span><span class="cx"> if (!m_platformDragData->hasURL())
</span><span class="cx"> return String();
</span><span class="lines">@@ -91,16 +87,4 @@
</span><span class="cx"> return url;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-
-PassRefPtr<DocumentFragment> DragData::asFragment(Frame* frame, Range&, bool, bool&) const
-{
- if (!m_platformDragData->hasMarkup())
- return nullptr;
-
- if (!frame->document())
- return nullptr;
-
- return createFragmentFromMarkup(*frame->document(), m_platformDragData->markup(), "");
</del><span class="cx"> }
</span><del>-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoreplatformmacDragDataMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/mac/DragDataMac.mm (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/mac/DragDataMac.mm        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/mac/DragDataMac.mm        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -27,18 +27,11 @@
</span><span class="cx"> #import "DragData.h"
</span><span class="cx">
</span><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>-#import "Document.h"
-#import "DocumentFragment.h"
-#import "DOMDocumentFragment.h"
-#import "DOMDocumentFragmentInternal.h"
-#import "Editor.h"
-#import "EditorClient.h"
-#import "Frame.h"
</del><span class="cx"> #import "MIMETypeRegistry.h"
</span><span class="cx"> #import "Pasteboard.h"
</span><span class="cx"> #import "PasteboardStrategy.h"
</span><span class="cx"> #import "PlatformStrategies.h"
</span><del>-#import "Range.h"
</del><ins>+#import "WebCoreNSURLExtras.h"
</ins><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="lines">@@ -107,9 +100,20 @@
</span><span class="cx"> || platformStrategies()->pasteboardStrategy()->stringForType(String(NSURLPboardType), m_pasteboardName).length();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asPlainText(Frame *frame) const
</del><ins>+String DragData::asPlainText() const
</ins><span class="cx"> {
</span><del>- return frame->editor().readPlainTextFromPasteboard(*Pasteboard::create(m_pasteboardName));
</del><ins>+ Pasteboard pasteboard(m_pasteboardName);
+ PasteboardPlainText text;
+ pasteboard.read(text);
+ String string = text.text;
+
+ // FIXME: It's not clear this is 100% correct since we know -[NSURL URLWithString:] does not handle
+ // all the same cases we handle well in the URL code for creating an NSURL.
+ if (text.isURL)
+ return userVisibleString([NSURL URLWithString:string]);
+
+ // FIXME: WTF should offer a non-Mac-specific way to convert string to precomposed form so we can do it for all platforms.
+ return [(NSString *)string precomposedStringWithCanonicalMapping];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Color DragData::asColor() const
</span><span class="lines">@@ -134,12 +138,12 @@
</span><span class="cx"> || types.contains(String(kUTTypePNG));
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool DragData::containsURL(Frame* frame, FilenameConversionPolicy filenamePolicy) const
</del><ins>+bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
</ins><span class="cx"> {
</span><del>- return !asURL(frame, filenamePolicy).isEmpty();
</del><ins>+ return !asURL(filenamePolicy).isEmpty();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asURL(Frame* frame, FilenameConversionPolicy, String* title) const
</del><ins>+String DragData::asURL(FilenameConversionPolicy, String* title) const
</ins><span class="cx"> {
</span><span class="cx"> // FIXME: Use filenamePolicy.
</span><span class="cx">
</span><span class="lines">@@ -151,17 +155,13 @@
</span><span class="cx">
</span><span class="cx"> Vector<String> types;
</span><span class="cx"> platformStrategies()->pasteboardStrategy()->getTypes(types, m_pasteboardName);
</span><del>-
- // FIXME: using the editorClient to call into WebKit, for now, since
- // calling webkit_canonicalize from WebCore involves migrating a sizable amount of
- // helper code that should either be done in a separate patch or figured out in another way.
-
</del><ins>+
</ins><span class="cx"> if (types.contains(String(NSURLPboardType))) {
</span><span class="cx"> NSURL *URLFromPasteboard = [NSURL URLWithString:platformStrategies()->pasteboardStrategy()->stringForType(String(NSURLPboardType), m_pasteboardName)];
</span><span class="cx"> NSString *scheme = [URLFromPasteboard scheme];
</span><span class="cx"> // Cannot drop other schemes unless <rdar://problem/10562662> and <rdar://problem/11187315> are fixed.
</span><span class="cx"> if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])
</span><del>- return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString];
</del><ins>+ return [URLByCanonicalizingURL(URLFromPasteboard) absoluteString];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (types.contains(String(NSStringPboardType))) {
</span><span class="lines">@@ -171,7 +171,7 @@
</span><span class="cx"> // The result of this function is used to initiate navigation, so we shouldn't allow arbitrary file URLs.
</span><span class="cx"> // FIXME: Should we allow only http family schemes, or anything non-local?
</span><span class="cx"> if ([scheme isEqualToString:@"http"] || [scheme isEqualToString:@"https"])
</span><del>- return [frame->editor().client()->canonicalizeURL(URLFromPasteboard) absoluteString];
</del><ins>+ return [URLByCanonicalizingURL(URLFromPasteboard) absoluteString];
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (types.contains(String(NSFilenamesPboardType))) {
</span><span class="lines">@@ -181,19 +181,13 @@
</span><span class="cx"> BOOL isDirectory;
</span><span class="cx"> if ([[NSFileManager defaultManager] fileExistsAtPath:files[0] isDirectory:&isDirectory] && isDirectory)
</span><span class="cx"> return String();
</span><del>- return [frame->editor().client()->canonicalizeURL([NSURL fileURLWithPath:files[0]]) absoluteString];
</del><ins>+ return [URLByCanonicalizingURL([NSURL fileURLWithPath:files[0]]) absoluteString];
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return String();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<DocumentFragment> DragData::asFragment(Frame* frame, Range& range, bool allowPlainText, bool& chosePlainText) const
-{
- Pasteboard pasteboard(m_pasteboardName);
- return frame->editor().webContentFromPasteboard(pasteboard, range, 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="trunkSourceWebCoreplatformwinClipboardUtilitiesWinh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.h (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.h        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/win/ClipboardUtilitiesWin.h        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class Document;
</span><ins>+class DocumentFragment;
</ins><span class="cx"> class URL;
</span><span class="cx">
</span><span class="cx"> HGLOBAL createGlobalData(const String&);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformwinDragDataWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/win/DragDataWin.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/win/DragDataWin.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebCore/platform/win/DragDataWin.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -29,10 +29,6 @@
</span><span class="cx">
</span><span class="cx"> #include "COMPtr.h"
</span><span class="cx"> #include "ClipboardUtilitiesWin.h"
</span><del>-#include "Frame.h"
-#include "DocumentFragment.h"
-#include "Markup.h"
-#include "Range.h"
</del><span class="cx"> #include "TextEncoding.h"
</span><span class="cx"> #include <objidl.h>
</span><span class="cx"> #include <shlwapi.h>
</span><span class="lines">@@ -56,7 +52,7 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool DragData::containsURL(Frame*, FilenameConversionPolicy filenamePolicy) const
</del><ins>+bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const
</ins><span class="cx"> {
</span><span class="cx"> if (m_platformDragData)
</span><span class="cx"> return SUCCEEDED(m_platformDragData->QueryGetData(urlWFormat()))
</span><span class="lines">@@ -101,7 +97,7 @@
</span><span class="cx"> getFileContentData(m_platformDragData, size, dataBlob);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asURL(Frame*, FilenameConversionPolicy filenamePolicy, String* title) const
</del><ins>+String DragData::asURL(FilenameConversionPolicy filenamePolicy, String* title) const
</ins><span class="cx"> {
</span><span class="cx"> return (m_platformDragData) ? getURL(m_platformDragData, filenamePolicy, title) : getURL(&m_dragDataMap, filenamePolicy, title);
</span><span class="cx"> }
</span><span class="lines">@@ -181,7 +177,7 @@
</span><span class="cx"> return m_dragDataMap.contains(plainTextWFormat()->cfFormat) || m_dragDataMap.contains(plainTextFormat()->cfFormat);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-String DragData::asPlainText(Frame*) const
</del><ins>+String DragData::asPlainText() const
</ins><span class="cx"> {
</span><span class="cx"> return (m_platformDragData) ? getPlainText(m_platformDragData) : getPlainText(&m_dragDataMap);
</span><span class="cx"> }
</span><span class="lines">@@ -200,48 +196,12 @@
</span><span class="cx">
</span><span class="cx"> bool DragData::containsCompatibleContent() const
</span><span class="cx"> {
</span><del>- return containsPlainText() || containsURL(0)
</del><ins>+ return containsPlainText() || containsURL()
</ins><span class="cx"> || ((m_platformDragData) ? (containsHTML(m_platformDragData) || containsFilenames(m_platformDragData))
</span><span class="cx"> : (containsHTML(&m_dragDataMap) || containsFilenames(&m_dragDataMap)))
</span><span class="cx"> || containsColor();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-PassRefPtr<DocumentFragment> DragData::asFragment(Frame* frame, Range&, bool, bool&) const
-{
- /*
- * Order is richest format first. On OSX this is:
- * * Web Archive
- * * Filenames
- * * HTML
- * * RTF
- * * TIFF
- * * PICT
- */
-
- if (m_platformDragData) {
- if (containsFilenames(m_platformDragData)) {
- if (PassRefPtr<DocumentFragment> fragment = fragmentFromFilenames(frame->document(), m_platformDragData))
- return fragment;
- }
-
- if (containsHTML(m_platformDragData)) {
- if (PassRefPtr<DocumentFragment> fragment = fragmentFromHTML(frame->document(), m_platformDragData))
- return fragment;
- }
- } else {
- if (containsFilenames(&m_dragDataMap)) {
- if (PassRefPtr<DocumentFragment> fragment = fragmentFromFilenames(frame->document(), &m_dragDataMap))
- return fragment;
- }
-
- if (containsHTML(&m_dragDataMap)) {
- if (PassRefPtr<DocumentFragment> fragment = fragmentFromHTML(frame->document(), &m_dragDataMap))
- return fragment;
- }
- }
- return 0;
-}
-
</del><span class="cx"> Color DragData::asColor() const
</span><span class="cx"> {
</span><span class="cx"> return Color();
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebKit2/ChangeLog        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2014-09-16 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ DragData should not depend on Clipboard, DocumentFragment, and Document
+ https://bugs.webkit.org/show_bug.cgi?id=21358
+
+ Reviewed by Darin Adler.
+
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::performDragControllerAction): Update to API
+ change in DragData::asURL().
+
</ins><span class="cx"> 2014-09-16 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> [iOS] Add iOS SDK name and version suffix to WebKitSystemInterface debug/release product name
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (173685 => 173686)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-09-17 04:32:32 UTC (rev 173685)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2014-09-17 06:27:46 UTC (rev 173686)
</span><span class="lines">@@ -1369,7 +1369,7 @@
</span><span class="cx"> UNUSED_PARAM(sandboxExtensionHandle);
</span><span class="cx"> UNUSED_PARAM(sandboxExtensionsForUpload);
</span><span class="cx">
</span><del>- String url = dragData.asURL(nullptr);
</del><ins>+ String url = dragData.asURL();
</ins><span class="cx"> if (!url.isEmpty())
</span><span class="cx"> m_process->assumeReadAccessToBaseURL(url);
</span><span class="cx"> m_process->send(Messages::WebPage::PerformDragControllerAction(action, dragData), m_pageID);
</span></span></pre>
</div>
</div>
</body>
</html>