REGRESSION: SVG does not support link dragging
authordbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2015 18:21:30 +0000 (18:21 +0000)
committerdbates@webkit.org <dbates@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 17 Apr 2015 18:21:30 +0000 (18:21 +0000)
commit6edd81ece26ac31db27783b6b7493d902f71001d
tree336d2c9da83f18b0b1cfec5f7ee2fab5524bb3f9
parent34aad6bf7eef1a81c75b506c47e51da5d3f50fd6
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 "failure" since EFL does not support drag-and-drop.
* platform/gtk/TestExpectations: Mark the test as "failure" until we implement drag-and-drop support for
GTK+ as part of fixing <https://bugs.webkit.org/show_bug.cgi?id=42194>.
* 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 <https://bugs.webkit.org/show_bug.cgi?id=42194>.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@182957 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/drag-and-drop-link-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/drag-and-drop-link.html [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/ios-simulator/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/DragController.cpp
Source/WebCore/page/DragController.h
Source/WebCore/page/EventHandler.cpp
Source/WebCore/rendering/HitTestResult.cpp
Source/WebCore/rendering/HitTestResult.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Misc/WebElementDictionary.mm