Links with empty hrefs should not be drag sources
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Mar 2017 19:29:25 +0000 (19:29 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 29 Mar 2017 19:29:25 +0000 (19:29 +0000)
commitbc2942d92809b4f1dfe2a2729516cca2dc734ae0
tree9f6e4eb25d5e80f59b0c514b95b87c3691e27358
parent4a7d23b215982fe772b577742245c684439c8c99
Links with empty hrefs should not be drag sources
https://bugs.webkit.org/show_bug.cgi?id=170241
<rdar://problem/31305505>

Reviewed by Tim Horton.

Source/WebCore:

The m_dragSouceAction member of DragController represents the drag source actions that are available to the
document, rather than the available actions given the dragging element. Thus, it is not correct to only check
that (m_dragSourceAction & DragSourceActionAttachment) before proceeding down the attachment dragging codepath.
This should be additionally guarded with a check that the element being dragged is, in fact, an attachment
element.

New API test (see Tools/ChangeLog).

* page/DragController.cpp:
(WebCore::DragController::startDrag):

Tools:

Adds a new API test: DataInteractionTests.LinkWithEmptyHREF.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.h:

Expose the current phase of the data interaction simulator for verifying behaviors in unit tests.

* TestWebKitAPI/ios/DataInteractionSimulator.mm:
(-[DataInteractionSimulator phase]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214556 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/page/DragController.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/ios/DataInteractionTests.mm
Tools/TestWebKitAPI/ios/DataInteractionSimulator.h
Tools/TestWebKitAPI/ios/DataInteractionSimulator.mm