<!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>[182957] 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/182957">182957</a></dd>
<dt>Author</dt> <dd>dbates@webkit.org</dd>
<dt>Date</dt> <dd>2015-04-17 11:21:30 -0700 (Fri, 17 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>REGRESSION: SVG does not support link dragging
https://bugs.webkit.org/show_bug.cgi?id=141597

Reviewed by Darin Adler.

Source/WebCore:

Fixes an issue where a SVG hyperlink cannot be dragged. We should support
dragging an SVG A element just as we support dragging an HTML A element.

Test: fast/events/drag-and-drop-link.html

* page/DragController.cpp: Removed explicit include of header Element.h as it will
be ultimately included by HTMLAnchorElement.h, among other headers.
(WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
(WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
determine whether a element is a hyperlink that can be dragged.
* page/DragController.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
 WebCore::isDraggableLink().
* rendering/HitTestResult.cpp:
(WebCore::HitTestResult::isLiveLink): Deleted.
* rendering/HitTestResult.h:

Source/WebKit/mac:

Write -[WebElementDictionary _isLiveLink] in terms of WebCore::isDraggableLink().

* Misc/WebElementDictionary.mm:
(-[WebElementDictionary _isLiveLink]):

LayoutTests:

Add a test to ensure we do not regress dragging of a HTML hyperlink or a SVG hyperlink.

* fast/events/drag-and-drop-link-expected.txt: Added.
* fast/events/drag-and-drop-link.html: Added.
* platform/efl/TestExpectations: Mark the test as &quot;failure&quot; since EFL does not support drag-and-drop.
* platform/gtk/TestExpectations: Mark the test as &quot;failure&quot; until we implement drag-and-drop support for
GTK+ as part of fixing &lt;https://bugs.webkit.org/show_bug.cgi?id=42194&gt;.
* platform/ios-simulator/TestExpectations: Skip the test since iOS does not implement
drag-and-drop support.
* platform/mac-wk2/TestExpectations: Skip the test until we implement drag-and-drop support in EventSender
for Mac as part of fixing &lt;https://bugs.webkit.org/show_bug.cgi?id=42194&gt;.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacwk2TestExpectations">trunk/LayoutTests/platform/mac-wk2/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="#trunkSourceWebCorepageDragControllerh">trunk/Source/WebCore/page/DragController.h</a></li>
<li><a href="#trunkSourceWebCorepageEventHandlercpp">trunk/Source/WebCore/page/EventHandler.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingHitTestResultcpp">trunk/Source/WebCore/rendering/HitTestResult.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingHitTestResulth">trunk/Source/WebCore/rendering/HitTestResult.h</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacMiscWebElementDictionarymm">trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventsdraganddroplinkexpectedtxt">trunk/LayoutTests/fast/events/drag-and-drop-link-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsdraganddroplinkhtml">trunk/LayoutTests/fast/events/drag-and-drop-link.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/LayoutTests/ChangeLog        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-04-17  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION: SVG does not support link dragging
+        https://bugs.webkit.org/show_bug.cgi?id=141597
+
+        Reviewed by Darin Adler.
+
+        Add a test to ensure we do not regress dragging of a HTML hyperlink or a SVG hyperlink.
+
+        * fast/events/drag-and-drop-link-expected.txt: Added.
+        * fast/events/drag-and-drop-link.html: Added.
+        * platform/efl/TestExpectations: Mark the test as &quot;failure&quot; since EFL does not support drag-and-drop.
+        * platform/gtk/TestExpectations: Mark the test as &quot;failure&quot; until we implement drag-and-drop support for
+        GTK+ as part of fixing &lt;https://bugs.webkit.org/show_bug.cgi?id=42194&gt;.
+        * platform/ios-simulator/TestExpectations: Skip the test since iOS does not implement
+        drag-and-drop support.
+        * platform/mac-wk2/TestExpectations: Skip the test until we implement drag-and-drop support in EventSender
+        for Mac as part of fixing &lt;https://bugs.webkit.org/show_bug.cgi?id=42194&gt;.
+
</ins><span class="cx"> 2015-04-17  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r182912 and r182920.
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsdraganddroplinkexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/drag-and-drop-link-expected.txt (0 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/drag-and-drop-link-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/drag-and-drop-link-expected.txt        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+This test checks that drag-and-drop support works for a hyperlink.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Dragging HTML hyperlink
+
+PASS event.dataTransfer.getData(&quot;url&quot;) is &quot;http://www.whatwg.org/html&quot;
+
+Dragging SVG hyperlink
+
+PASS event.dataTransfer.getData(&quot;url&quot;) is &quot;http://www.w3.org/TR/SVG11/&quot;
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsdraganddroplinkhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/drag-and-drop-link.html (0 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/drag-and-drop-link.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/drag-and-drop-link.html        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -0,0 +1,139 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+#drop-container &gt; div {
+    height: 256px;
+    width: 256px;
+    color: gray;
+}
+#drop-instructions {
+    display: -webkit-box;
+    display: -moz-box;
+    display: -ms-flexbox;
+    -webkit-box-align: center;
+    -moz-box-align: center;
+    -ms-flex-align: center;
+    -webkit-box-pack: center;
+    -moz-box-pack: center;
+    -ms-flex-pack: center;
+    -webkit-user-select: none;
+    -moz-user-select: none;
+    -ms-user-select: none;
+    pointer-events: none;
+}
+#drop-target {
+    border: 1px dashed black;
+    margin-top: -256px; /* Paint on top of #drop-instructions. */
+}
+&lt;/style&gt;
+&lt;script&gt;
+var dropTarget;
+var draggingElement;
+var event;
+
+var svgHyperlink;
+var htmlHyperlink;
+var numberOfTestsToRun;
+
+window.jsTestIsAsync = true;
+
+window.onload = function ()
+{
+    svgHyperlink = document.getElementById(&quot;svgHyperlink&quot;);
+    htmlHyperlink = document.getElementById(&quot;htmlHyperlink&quot;);
+
+    svgHyperlink.ondragstart = dragStart;
+    svgHyperlink.ondragend = dragEnd;
+    htmlHyperlink.ondragstart = dragStart;
+    htmlHyperlink.ondragend = dragEnd;
+
+    dropTarget = document.getElementById(&quot;drop-target&quot;);
+    dropTarget.ondrop = drop;
+
+    runTests();
+}
+
+function dragStart(e)
+{
+    event = e;
+    draggingElement = e.target;
+}
+
+function dragEnd(e)
+{
+    dropTarget.innerHTML = &quot;&quot;;
+    draggingElement = null;
+}
+
+function drop(e)
+{
+    event = e;
+    var expectedHref = draggingElement instanceof SVGElement ? draggingElement.href.baseVal : draggingElement.href;
+    shouldBeEqualToString('event.dataTransfer.getData(&quot;url&quot;)', expectedHref);
+    if (window.testRunner &amp;&amp; !--numberOfTestsToRun)
+        done();
+}
+
+function done()
+{
+    var testContainer = document.getElementById(&quot;test-container&quot;);
+    if (testContainer)
+        document.body.removeChild(testContainer);
+    debug('&lt;br&gt;&lt;span class=&quot;pass&quot;&gt;TEST COMPLETE&lt;/span&gt;');
+    finishJSTest();
+}
+
+function dragAndDrop(beginX, beginY, endX, endY)
+{
+    if (!window.eventSender)
+        return;
+    eventSender.mouseMoveTo(beginX, beginY);
+    eventSender.mouseDown();
+    eventSender.leapForward(100);
+    eventSender.mouseMoveTo(endX, endY);
+    eventSender.mouseUp();
+}
+
+function runTests()
+{
+    if (!window.testRunner)
+        return;
+
+    var endX = dropTarget.offsetLeft + 10;
+    var endY = dropTarget.offsetTop + dropTarget.offsetHeight / 2;
+
+    numberOfTestsToRun = 2;
+
+    debug(&quot;&lt;br&gt;Dragging HTML hyperlink&lt;br&gt;&quot;);
+    dragAndDrop(htmlHyperlink.offsetLeft, htmlHyperlink.offsetTop + htmlHyperlink.offsetHeight / 2, endX, endY);
+
+    debug(&quot;&lt;br&gt;Dragging SVG hyperlink&lt;br&gt;&quot;);
+    // Only the SVG root element has a CSS layout box. And Offset{Left, Top, Width, Height} only work for elements that have a CSS layout box
+    // per &lt;http://www.w3.org/TR/cssom-view/#extensions-to-the-htmlelement-interface&gt;.
+    dragAndDrop(svgHyperlink.ownerSVGElement.offsetLeft, svgHyperlink.ownerSVGElement.offsetTop + 10, endX, endY);
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div id=&quot;description&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;test-container&quot;&gt;
+    &lt;div id=&quot;drop-container&quot;&gt;
+        &lt;div id=&quot;drop-instructions&quot;&gt;Drop a hyperlink on me.&lt;/div&gt;
+        &lt;div id=&quot;drop-target&quot; contenteditable=&quot;true&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+    &lt;hr&gt;
+    &lt;p&gt;Items that can be dragged to the drop target:&lt;/p&gt;
+    &lt;svg width=&quot;200&quot; height=&quot;30&quot;&gt;
+        &lt;a xlink:href=&quot;http://www.w3.org/TR/SVG11/&quot; id=&quot;svgHyperlink&quot;&gt;&lt;text x=&quot;0&quot; y=&quot;20&quot; style=&quot;text-decoration: underline&quot;&gt;SVG hyperlink&lt;/text&gt;&lt;/a&gt;
+    &lt;/svg&gt;
+    &lt;a href=&quot;http://www.whatwg.org/html&quot; id=&quot;htmlHyperlink&quot;&gt;HTML hyperlink&lt;/a&gt;
+    &lt;hr&gt;
+&lt;/div&gt;
+&lt;div id=&quot;console&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+description(&quot;This test checks that drag-and-drop support works for a hyperlink.&quot;);
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -343,6 +343,7 @@
</span><span class="cx"> webkit.org/b/86623 fast/events/drag-dataTransferItemList.html
</span><span class="cx"> webkit.org/b/86623 fast/events/drag-image-filename.html [ Timeout ]
</span><span class="cx"> webkit.org/b/86623 fast/events/drag-in-frames.html [ Failure ]
</span><ins>+webkit.org/b/86623 fast/events/drag-and-drop-link.html [ Failure ]
</ins><span class="cx"> webkit.org/b/86623 fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Failure ]
</span><span class="cx"> webkit.org/b/86623 fast/events/drag-parent-node.html [ Failure ]
</span><span class="cx"> webkit.org/b/86623 fast/events/drag-selects-image.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -1410,6 +1410,7 @@
</span><span class="cx"> webkit.org/b/63706 fast/events/drag-and-drop-fire-drag-dragover.html [ Failure ]
</span><span class="cx"> webkit.org/b/63706 fast/events/drag-and-drop.html [ Failure Timeout ]
</span><span class="cx"> webkit.org/b/63706 fast/events/drag-and-drop-subframe-dataTransfer.html [ Failure Timeout ]
</span><ins>+webkit.org/b/42194 fast/events/drag-and-drop-link.html [ Failure ]
</ins><span class="cx"> webkit.org/b/63706 fast/events/drag-and-drop-link-into-focused-contenteditable.html [ Failure ]
</span><span class="cx"> webkit.org/b/63706 fast/events/drag-parent-node.html [ Failure ]
</span><span class="cx"> webkit.org/b/63706 fast/events/dropzone-001.html [ Failure Timeout ]
</span></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -157,6 +157,7 @@
</span><span class="cx"> fast/events/drag-file-crash.html
</span><span class="cx"> fast/events/drag-image-filename.html
</span><span class="cx"> fast/events/drag-in-frames.html
</span><ins>+fast/events/drag-and-drop-link.html
</ins><span class="cx"> fast/events/drag-and-drop-link-into-focused-contenteditable.html
</span><span class="cx"> fast/events/drag-outside-window.html
</span><span class="cx"> fast/events/drag-parent-node.html
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacwk2TestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-wk2/TestExpectations (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-wk2/TestExpectations        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/LayoutTests/platform/mac-wk2/TestExpectations        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -76,6 +76,7 @@
</span><span class="cx"> fast/events/drag-and-drop-dataTransfer-types-nocrash.html
</span><span class="cx"> fast/events/drag-and-drop-fire-drag-dragover.html
</span><span class="cx"> fast/events/drag-and-drop.html
</span><ins>+fast/events/drag-and-drop-link.html
</ins><span class="cx"> fast/events/drag-in-frames.html
</span><span class="cx"> fast/events/drag-parent-node.html
</span><span class="cx"> fast/events/dropzone-001.html
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/ChangeLog        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-04-17  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION: SVG does not support link dragging
+        https://bugs.webkit.org/show_bug.cgi?id=141597
+
+        Reviewed by Darin Adler.
+
+        Fixes an issue where a SVG hyperlink cannot be dragged. We should support
+        dragging an SVG A element just as we support dragging an HTML A element.
+
+        Test: fast/events/drag-and-drop-link.html
+
+        * page/DragController.cpp: Removed explicit include of header Element.h as it will
+        be ultimately included by HTMLAnchorElement.h, among other headers.
+        (WebCore::isDraggableLink): Added. Extracted code from HitTestResult::isLiveLink().
+        (WebCore::DragController::draggableElement): Call WebCore::isDraggableLink() to
+        determine whether a element is a hyperlink that can be dragged.
+        * page/DragController.h:
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::selectClosestWordOrLinkFromMouseEvent): Write code in terms of
+         WebCore::isDraggableLink().
+        * rendering/HitTestResult.cpp:
+        (WebCore::HitTestResult::isLiveLink): Deleted.
+        * rendering/HitTestResult.h:
+
</ins><span class="cx"> 2015-04-17  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r182912 and r182920.
</span></span></pre></div>
<a id="trunkSourceWebCorepageDragControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.cpp (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.cpp        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/page/DragController.cpp        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -26,8 +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><ins>+#include &quot;HTMLAnchorElement.h&quot;
+#include &quot;SVGAElement.h&quot;
+
</ins><span class="cx"> #if ENABLE(DRAG_SUPPORT)
</span><del>-
</del><span class="cx"> #include &quot;CachedImage.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;DataTransfer.h&quot;
</span><span class="lines">@@ -40,7 +42,6 @@
</span><span class="cx"> #include &quot;DragState.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;EditorClient.h&quot;
</span><del>-#include &quot;Element.h&quot;
</del><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="lines">@@ -48,7 +49,6 @@
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameSelection.h&quot;
</span><span class="cx"> #include &quot;FrameView.h&quot;
</span><del>-#include &quot;HTMLAnchorElement.h&quot;
</del><span class="cx"> #include &quot;HTMLAttachmentElement.h&quot;
</span><span class="cx"> #include &quot;HTMLImageElement.h&quot;
</span><span class="cx"> #include &quot;HTMLInputElement.h&quot;
</span><span class="lines">@@ -80,9 +80,21 @@
</span><span class="cx"> #include &quot;markup.h&quot;
</span><span class="cx"> #include &lt;wtf/CurrentTime.h&gt;
</span><span class="cx"> #include &lt;wtf/RefPtr.h&gt;
</span><ins>+#endif
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+bool isDraggableLink(const Element&amp; element)
+{
+    if (is&lt;HTMLAnchorElement&gt;(element))
+        return downcast&lt;HTMLAnchorElement&gt;(element).isLiveLink();
+    if (is&lt;SVGAElement&gt;(element))
+        return element.isLink();
+    return false;
+}
+
+#if ENABLE(DRAG_SUPPORT)
+    
</ins><span class="cx"> static PlatformMouseEvent createMouseEvent(DragData&amp; dragData)
</span><span class="cx"> {
</span><span class="cx">     int keyState = dragData.modifierKeyState();
</span><span class="lines">@@ -652,9 +664,7 @@
</span><span class="cx">                 state.type = static_cast&lt;DragSourceAction&gt;(state.type | DragSourceActionImage);
</span><span class="cx">                 return element;
</span><span class="cx">             }
</span><del>-            if ((m_dragSourceAction &amp; DragSourceActionLink)
-                &amp;&amp; is&lt;HTMLAnchorElement&gt;(*element)
-                &amp;&amp; downcast&lt;HTMLAnchorElement&gt;(*element).isLiveLink()) {
</del><ins>+            if ((m_dragSourceAction &amp; DragSourceActionLink) &amp;&amp; isDraggableLink(*element)) {
</ins><span class="cx">                 state.type = static_cast&lt;DragSourceAction&gt;(state.type | DragSourceActionLink);
</span><span class="cx">                 return element;
</span><span class="cx">             }
</span><span class="lines">@@ -988,6 +998,6 @@
</span><span class="cx">     m_page.dragCaretController().setCaretPosition(frame-&gt;visiblePositionForPoint(framePoint));
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#endif // ENABLE(DRAG_SUPPORT)
+
</ins><span class="cx"> } // namespace WebCore
</span><del>-
-#endif // ENABLE(DRAG_SUPPORT)
</del></span></pre></div>
<a id="trunkSourceWebCorepageDragControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DragController.h (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DragController.h        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/page/DragController.h        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -140,6 +140,8 @@
</span><span class="cx"> #endif
</span><span class="cx">     };
</span><span class="cx"> 
</span><ins>+    WEBCORE_EXPORT bool isDraggableLink(const Element&amp;);
+
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorepageEventHandlercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/EventHandler.cpp (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/EventHandler.cpp        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/page/EventHandler.cpp        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -598,17 +598,17 @@
</span><span class="cx"> 
</span><span class="cx"> void EventHandler::selectClosestWordOrLinkFromMouseEvent(const MouseEventWithHitTestResults&amp; result)
</span><span class="cx"> {
</span><del>-    if (!result.hitTestResult().isLiveLink())
</del><ins>+    Element* urlElement = result.hitTestResult().URLElement();
+    if (!urlElement || !isDraggableLink(*urlElement))
</ins><span class="cx">         return selectClosestWordFromMouseEvent(result);
</span><span class="cx"> 
</span><span class="cx">     Node* targetNode = result.targetNode();
</span><span class="cx"> 
</span><span class="cx">     if (targetNode &amp;&amp; targetNode-&gt;renderer() &amp;&amp; m_mouseDownMayStartSelect) {
</span><span class="cx">         VisibleSelection newSelection;
</span><del>-        Element* URLElement = result.hitTestResult().URLElement();
</del><span class="cx">         VisiblePosition pos(targetNode-&gt;renderer()-&gt;positionForPoint(result.localPoint(), nullptr));
</span><del>-        if (pos.isNotNull() &amp;&amp; pos.deepEquivalent().deprecatedNode()-&gt;isDescendantOf(URLElement))
-            newSelection = VisibleSelection::selectionFromContentsOfNode(URLElement);
</del><ins>+        if (pos.isNotNull() &amp;&amp; pos.deepEquivalent().deprecatedNode()-&gt;isDescendantOf(urlElement))
+            newSelection = VisibleSelection::selectionFromContentsOfNode(urlElement);
</ins><span class="cx"> 
</span><span class="cx">         updateSelectionForMouseDownDispatchingSelectStart(targetNode, expandSelectionToRespectSelectOnMouseDown(*targetNode, newSelection), WordGranularity);
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResultcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.cpp (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.cpp        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/rendering/HitTestResult.cpp        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -608,20 +608,6 @@
</span><span class="cx">     return URL();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool HitTestResult::isLiveLink() const
-{
-    if (!m_innerURLElement)
-        return false;
-
-    if (is&lt;HTMLAnchorElement&gt;(*m_innerURLElement))
-        return downcast&lt;HTMLAnchorElement&gt;(*m_innerURLElement).isLiveLink();
-
-    if (is&lt;SVGAElement&gt;(*m_innerURLElement))
-        return m_innerURLElement-&gt;isLink();
-
-    return false;
-}
-
</del><span class="cx"> bool HitTestResult::isOverLink() const
</span><span class="cx"> {
</span><span class="cx">     return m_innerURLElement &amp;&amp; m_innerURLElement-&gt;isLink();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingHitTestResulth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/HitTestResult.h (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/HitTestResult.h        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebCore/rendering/HitTestResult.h        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -111,7 +111,6 @@
</span><span class="cx">     WEBCORE_EXPORT URL absoluteAttachmentURL() const;
</span><span class="cx"> #endif
</span><span class="cx">     WEBCORE_EXPORT String textContent() const;
</span><del>-    WEBCORE_EXPORT bool isLiveLink() const;
</del><span class="cx">     bool isOverLink() const;
</span><span class="cx">     WEBCORE_EXPORT bool isContentEditable() const;
</span><span class="cx">     void toggleMediaControlsDisplay() const;
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-04-17  Daniel Bates  &lt;dabates@apple.com&gt;
+
+        REGRESSION: SVG does not support link dragging
+        https://bugs.webkit.org/show_bug.cgi?id=141597
+
+        Reviewed by Darin Adler.
+
+        Write -[WebElementDictionary _isLiveLink] in terms of WebCore::isDraggableLink().
+
+        * Misc/WebElementDictionary.mm:
+        (-[WebElementDictionary _isLiveLink]):
+
</ins><span class="cx"> 2015-04-16  Sam Weinig  &lt;sam@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Expose JavaScriptMarkupEnabled preference for WebKit1
</span></span></pre></div>
<a id="trunkSourceWebKitmacMiscWebElementDictionarymm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm (182956 => 182957)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm        2015-04-17 17:33:21 UTC (rev 182956)
+++ trunk/Source/WebKit/mac/Misc/WebElementDictionary.mm        2015-04-17 18:21:30 UTC (rev 182957)
</span><span class="lines">@@ -36,6 +36,7 @@
</span><span class="cx"> #import &quot;WebTypesInternal.h&quot;
</span><span class="cx"> #import &quot;WebView.h&quot;
</span><span class="cx"> #import &quot;WebViewPrivate.h&quot;
</span><ins>+#import &lt;WebCore/DragController.h&gt;
</ins><span class="cx"> #import &lt;WebCore/Frame.h&gt;
</span><span class="cx"> #import &lt;WebCore/HitTestResult.h&gt;
</span><span class="cx"> #import &lt;WebCore/Image.h&gt;
</span><span class="lines">@@ -265,7 +266,8 @@
</span><span class="cx"> 
</span><span class="cx"> - (NSNumber *)_isLiveLink
</span><span class="cx"> {
</span><del>-    return [NSNumber numberWithBool:_result-&gt;isLiveLink()];
</del><ins>+    Element* urlElement = _result-&gt;URLElement();
+    return [NSNumber numberWithBool:(urlElement &amp;&amp; isDraggableLink(*urlElement))];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (NSNumber *)_isContentEditable
</span></span></pre>
</div>
</div>

</body>
</html>