webkit should implement the dropzone attribute
authoryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 12:37:48 +0000 (12:37 +0000)
committeryael.aharon@nokia.com <yael.aharon@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 12:37:48 +0000 (12:37 +0000)
commit0255f7e3472041d41bb4618dfe91ee0d11c6abac
tree06ac1a5542a4a9df9959a351839d28cc5bd349cd
parent03a71f49b5c72e29067fa05bd5064f0dbc5e2388
webkit should implement the dropzone attribute
https://bugs.webkit.org/show_bug.cgi?id=58210

Reviewed by Tony Chang.

Source/WebCore:

Add support for dropzone attribute.
http://www.whatwg.org/specs/web-apps/current-work/multipage/dnd.html#the-dropzone-attribute
If a drag event was not canceled by JavaScript, look for an element with a dropzone attribute.
If there is such an element, and it matches the drag data store, set the action defined by that
element and continue processing the drag and drop operation.

Tests: fast/events/dropzone-001.html
       fast/events/dropzone-002.html
       fast/events/dropzone-003.html
       fast/events/dropzone-004.html

* dom/Clipboard.cpp:
(WebCore::Clipboard::hasFileOfType):
(WebCore::Clipboard::hasStringOfType):
(WebCore::convertDropZoneOperationToDragOperation):
(WebCore::convertDragOperationToDropZoneOperation):
(WebCore::Clipboard::processDropZoneKeyword):
* dom/Clipboard.h:
* html/HTMLAttributeNames.in:
* html/HTMLElement.idl:
* page/EventHandler.cpp:
(WebCore::EventHandler::findDropZone):
(WebCore::EventHandler::updateDragAndDrop):
* page/EventHandler.h:

LayoutTests:

* fast/events/dropzone-001-expected.txt: Added.
* fast/events/dropzone-001.html: Added.
* fast/events/dropzone-002-expected.txt: Added.
* fast/events/dropzone-002.html: Added.
* fast/events/dropzone-003-expected.txt: Added.
* fast/events/dropzone-003.html: Added.
* fast/events/dropzone-004-expected.txt: Added.
* fast/events/dropzone-004.html: Added.
* fast/events/resources/dropzone.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87499 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/dropzone-001-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/dropzone-001.html [new file with mode: 0644]
LayoutTests/fast/events/dropzone-002-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/dropzone-002.html [new file with mode: 0644]
LayoutTests/fast/events/dropzone-003-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/dropzone-003.html [new file with mode: 0644]
LayoutTests/fast/events/dropzone-004-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/dropzone-004.html [new file with mode: 0644]
LayoutTests/fast/events/resources/dropzone.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/dom/Clipboard.cpp
Source/WebCore/dom/Clipboard.h
Source/WebCore/html/HTMLAttributeNames.in
Source/WebCore/html/HTMLElement.idl
Source/WebCore/page/EventHandler.cpp