[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

trey trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:42:24 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 1790581e5995e81074b427b3b83d5d3a771d8499
Author: trey <trey at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu May 27 17:11:32 2004 +0000

    WebCore:
    
     	First cut at DHTML dragging, destination side.  Dragging text, files
            and URLs onto elements works.  Type conversion from NSPasteboard to
    	MIME types is hardwired.  No JS access yet to modifier keys, or
    	drag operations mask.
    
    	Per IE's dragging API, we have the new DOM events ondragenter,
    	ondragover, ondragleave and ondrop.
    	We also have an event.dataTransfer object providing access to the
    	NSPasteboard bearing the incoming data.
    
            Reviewed by rjw.
    
            * WebCore.pbproj/project.pbxproj:  add 2 new files.
            * khtml/ecma/kjs_dom.cpp:
            (DOMNode::getValueProperty):  JS access to ondragenter and pals
            (DOMNode::putValue):  Ditto
            * khtml/ecma/kjs_dom.h:
            (KJS::DOMNode::):  New attr enum values.
            * khtml/ecma/kjs_dom.lut.h:
            (KJS::):
            * khtml/ecma/kjs_events.cpp:
            (DOMMouseEvent::mark):  Pass along mark to dataTransfer we hold.
            (DOMMouseEvent::getValueProperty):  Create and return dataTransfer.
            (Clipboard::Clipboard):  New class exposed in JS.
            (Clipboard::~Clipboard):
            (Clipboard::tryGet):  Boilerplate.
            (Clipboard::getValueProperty):  Return the clipboard's props.
            (Clipboard::tryPut):  Boilerplate.
            (Clipboard::putValue):  Set the clipboard's props.
            (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
            * khtml/ecma/kjs_events.h:
            (KJS::DOMMouseEvent::DOMMouseEvent):  Init clipboard ptr.
            (KJS::DOMMouseEvent::):
            (KJS::Clipboard::toBoolean):
            (KJS::Clipboard::classInfo):
            (KJS::Clipboard::):
            * khtml/ecma/kjs_events.lut.h:
            (KJS::):
            * khtml/html/html_elementimpl.cpp:
            (HTMLElementImpl::parseHTMLAttribute):  Enable setting ondragenter
    	and friends as html attributes.
            * khtml/khtmlview.cpp:
            (KHTMLView::dispatchDragEvent):  Send a drag related event to the DOM.
            (KHTMLView::updateDragAndDrop):  Handle a dragenter or dragupdate.
            (KHTMLView::cancelDragAndDrop):  Handle a dragexit.
            (KHTMLView::performDragAndDrop):  Handle an actual drop.
            * khtml/khtmlview.h:
            * khtml/misc/htmlattrs.c:  Generated code.
            * khtml/misc/htmlattrs.h:  Generated code.
            * khtml/misc/htmlattrs.in:  Add ondragenter, etc
            * khtml/xml/dom2_eventsimpl.cpp:
            (EventImpl::typeToId):  Handle new event types for dragging.
            (EventImpl::idToType):  Ditto.
            (MouseEventImpl::MouseEventImpl):  Init new clipboard ptr.
            (MouseEventImpl::~MouseEventImpl):  Deref clipboard.
            (ClipboardImpl::ClipboardImpl):
            (ClipboardImpl::~ClipboardImpl):
            * khtml/xml/dom2_eventsimpl.h:
            (DOM::EventImpl::):  New event enums.
            (DOM::MouseEventImpl::clipboard):
            * kwq/KWQClipboard.h: Added.
            * kwq/KWQClipboard.mm: Added.
            (KWQClipboard::KWQClipboard):
            (KWQClipboard::~KWQClipboard):
            (KWQClipboard::isForDragging): Trivial getter/setters.
            (KWQClipboard::dropEffect):
            (KWQClipboard::setDropEffect):
            (KWQClipboard::dropAllowed):
            (KWQClipboard::setDropAllowed):
            (cocoaTypeFromMIMEType):  Convert MIME pboard type to Cocoa type.
            (KWQClipboard::clearData):  OSX specific clipboard impl. of IE func
            (KWQClipboard::clearAllData):   Ditto
            (KWQClipboard::getData): Ditto
            (KWQClipboard::setData): Ditto
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge dragOperationForDraggingInfo:]):  Passthrough from WebKit to khtmlpart
            (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
            (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
    
    WebKit:
    
    	First cut at DHTML dragging, destination side.  Dragging text, files and URLs onto
    	elements works.  Type conversion from NSPasteboard to MIME types is hardwired.
    	No JS access yet to modifier keys, or operations mask.
    
            Reviewed by Chris.
    
            * WebView.subproj/WebHTMLView.m:
            (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): Call DHTML dragging via bridge.
            (-[WebHTMLView draggingCancelledWithDraggingInfo:]): Ditto.
            (-[WebHTMLView concludeDragForDraggingInfo:]): Ditto.
            * WebView.subproj/WebHTMLViewPrivate.h:
            * WebView.subproj/WebView.m:
            (-[WebView _setWebKitDragRespondsToDragging:]):  New SPI for finer grained control than the
    	delegate currently has.
            (-[WebView _webKitDragRespondsToDragging]): Ditto.
            (-[WebView _commonInitializationWithFrameName:groupName:]):  Init new flag.
            (-[WebView _dragOperationForDraggingInfo:]):  Comment.
            * WebView.subproj/WebViewPrivate.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6709 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 73e2d03..4da7f55 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,85 @@
+2004-05-27  Trey Matteson  <trey at apple.com>
+
+ 	First cut at DHTML dragging, destination side.  Dragging text, files
+        and URLs onto elements works.  Type conversion from NSPasteboard to
+	MIME types is hardwired.  No JS access yet to modifier keys, or
+	drag operations mask.
+
+	Per IE's dragging API, we have the new DOM events ondragenter,
+	ondragover, ondragleave and ondrop.
+	We also have an event.dataTransfer object providing access to the
+	NSPasteboard bearing the incoming data.
+
+        Reviewed by rjw.
+
+        * WebCore.pbproj/project.pbxproj:  add 2 new files.
+        * khtml/ecma/kjs_dom.cpp:
+        (DOMNode::getValueProperty):  JS access to ondragenter and pals
+        (DOMNode::putValue):  Ditto
+        * khtml/ecma/kjs_dom.h:
+        (KJS::DOMNode::):  New attr enum values.
+        * khtml/ecma/kjs_dom.lut.h:
+        (KJS::):
+        * khtml/ecma/kjs_events.cpp:
+        (DOMMouseEvent::mark):  Pass along mark to dataTransfer we hold.
+        (DOMMouseEvent::getValueProperty):  Create and return dataTransfer.
+        (Clipboard::Clipboard):  New class exposed in JS.
+        (Clipboard::~Clipboard):
+        (Clipboard::tryGet):  Boilerplate.
+        (Clipboard::getValueProperty):  Return the clipboard's props.
+        (Clipboard::tryPut):  Boilerplate.
+        (Clipboard::putValue):  Set the clipboard's props.
+        (ClipboardProtoFunc::tryCall): Implement clipboard's funcs.
+        * khtml/ecma/kjs_events.h:
+        (KJS::DOMMouseEvent::DOMMouseEvent):  Init clipboard ptr.
+        (KJS::DOMMouseEvent::):
+        (KJS::Clipboard::toBoolean):
+        (KJS::Clipboard::classInfo):
+        (KJS::Clipboard::):
+        * khtml/ecma/kjs_events.lut.h:
+        (KJS::):
+        * khtml/html/html_elementimpl.cpp:
+        (HTMLElementImpl::parseHTMLAttribute):  Enable setting ondragenter
+	and friends as html attributes.
+        * khtml/khtmlview.cpp:
+        (KHTMLView::dispatchDragEvent):  Send a drag related event to the DOM.
+        (KHTMLView::updateDragAndDrop):  Handle a dragenter or dragupdate.
+        (KHTMLView::cancelDragAndDrop):  Handle a dragexit.
+        (KHTMLView::performDragAndDrop):  Handle an actual drop.
+        * khtml/khtmlview.h:
+        * khtml/misc/htmlattrs.c:  Generated code.
+        * khtml/misc/htmlattrs.h:  Generated code.
+        * khtml/misc/htmlattrs.in:  Add ondragenter, etc
+        * khtml/xml/dom2_eventsimpl.cpp:
+        (EventImpl::typeToId):  Handle new event types for dragging.
+        (EventImpl::idToType):  Ditto.
+        (MouseEventImpl::MouseEventImpl):  Init new clipboard ptr.
+        (MouseEventImpl::~MouseEventImpl):  Deref clipboard.
+        (ClipboardImpl::ClipboardImpl):
+        (ClipboardImpl::~ClipboardImpl):
+        * khtml/xml/dom2_eventsimpl.h:
+        (DOM::EventImpl::):  New event enums.
+        (DOM::MouseEventImpl::clipboard):
+        * kwq/KWQClipboard.h: Added.
+        * kwq/KWQClipboard.mm: Added.
+        (KWQClipboard::KWQClipboard):
+        (KWQClipboard::~KWQClipboard):
+        (KWQClipboard::isForDragging): Trivial getter/setters.
+        (KWQClipboard::dropEffect):
+        (KWQClipboard::setDropEffect):
+        (KWQClipboard::dropAllowed):
+        (KWQClipboard::setDropAllowed):
+        (cocoaTypeFromMIMEType):  Convert MIME pboard type to Cocoa type.
+        (KWQClipboard::clearData):  OSX specific clipboard impl. of IE func
+        (KWQClipboard::clearAllData):   Ditto
+        (KWQClipboard::getData): Ditto
+        (KWQClipboard::setData): Ditto
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge dragOperationForDraggingInfo:]):  Passthrough from WebKit to khtmlpart
+        (-[WebCoreBridge dragExitedWithDraggingInfo:]):  Ditto
+        (-[WebCoreBridge concludeDragForDraggingInfo:]): Ditto
+
 2004-05-27  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Gramps
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 6f6da82..c8fcc46 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -532,6 +532,7 @@
 				93859E33065FCAD300CF54EE,
 				51F6A3D80663BF04004D2919,
 				51F6A3E00663C2EC004D2919,
+				2D90660D0665D937006B6F1A,
 			);
 			isa = PBXHeadersBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -814,6 +815,7 @@
 				931D722B065FC40800C966E1,
 				51F6A3D70663BF04004D2919,
 				51F6A3DF0663C2EC004D2919,
+				2D90660E0665D937006B6F1A,
 			);
 			isa = PBXSourcesBuildPhase;
 			runOnlyForDeploymentPostprocessing = 0;
@@ -849,6 +851,44 @@
 //082
 //083
 //084
+//2D0
+//2D1
+//2D2
+//2D3
+//2D4
+		2D90660B0665D937006B6F1A = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.c.h;
+			path = KWQClipboard.h;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		2D90660C0665D937006B6F1A = {
+			fileEncoding = 30;
+			isa = PBXFileReference;
+			lastKnownFileType = sourcecode.cpp.objcpp;
+			path = KWQClipboard.mm;
+			refType = 4;
+			sourceTree = "<group>";
+		};
+		2D90660D0665D937006B6F1A = {
+			fileRef = 2D90660B0665D937006B6F1A;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+		2D90660E0665D937006B6F1A = {
+			fileRef = 2D90660C0665D937006B6F1A;
+			isa = PBXBuildFile;
+			settings = {
+			};
+		};
+//2D0
+//2D1
+//2D2
+//2D3
+//2D4
 //350
 //351
 //352
@@ -3258,6 +3298,8 @@
 				F550D70B02E13281018635CA,
 				F550D70902E13281018635CA,
 				F550D70C02E13281018635CA,
+				2D90660B0665D937006B6F1A,
+				2D90660C0665D937006B6F1A,
 				F58784CD02DE375901EA4122,
 				F58784DA02DE375901EA4122,
 				354F248902EE28590ACA2ACA,
diff --git a/WebCore/khtml/ecma/kjs_dom.cpp b/WebCore/khtml/ecma/kjs_dom.cpp
index f1adde1..05ca4dd 100644
--- a/WebCore/khtml/ecma/kjs_dom.cpp
+++ b/WebCore/khtml/ecma/kjs_dom.cpp
@@ -119,6 +119,10 @@ bool DOMNode::toBoolean(ExecState *) const
   oncontextmenu	DOMNode::OnContextMenu		DontDelete
   ondblclick	DOMNode::OnDblClick		DontDelete
   ondragdrop	DOMNode::OnDragDrop		DontDelete
+  ondragenter	DOMNode::OnDragEnter		DontDelete
+  ondragleave	DOMNode::OnDragLeave		DontDelete
+  ondragover	DOMNode::OnDragOver		DontDelete
+  ondrop	DOMNode::OnDrop                 DontDelete
   onerror	DOMNode::OnError		DontDelete
   onfocus	DOMNode::OnFocus       		DontDelete
   oninput       DOMNode::OnInput                DontDelete
@@ -232,6 +236,14 @@ Value DOMNode::getValueProperty(ExecState *exec, int token) const
     return getListener(DOM::EventImpl::MOUSEOVER_EVENT);
   case OnMouseUp:
     return getListener(DOM::EventImpl::MOUSEUP_EVENT);
+  case OnDragEnter:
+    return getListener(DOM::EventImpl::DRAGENTER_EVENT);
+  case OnDragOver:
+    return getListener(DOM::EventImpl::DRAGOVER_EVENT);
+  case OnDragLeave:
+    return getListener(DOM::EventImpl::DRAGLEAVE_EVENT);
+  case OnDrop:
+    return getListener(DOM::EventImpl::DROP_EVENT);
   case OnMove:
     return getListener(DOM::EventImpl::KHTML_MOVE_EVENT);
   case OnReset:
@@ -370,6 +382,18 @@ void DOMNode::putValue(ExecState *exec, int token, const Value& value, int /*att
   case OnMouseUp:
     setListener(exec,DOM::EventImpl::MOUSEUP_EVENT,value);
     break;
+  case OnDragEnter:
+    setListener(exec,DOM::EventImpl::DRAGENTER_EVENT,value);
+    break;
+  case OnDragOver:
+    setListener(exec,DOM::EventImpl::DRAGOVER_EVENT,value);
+    break;
+  case OnDragLeave:
+    setListener(exec,DOM::EventImpl::DRAGLEAVE_EVENT,value);
+    break;
+  case OnDrop:
+    setListener(exec,DOM::EventImpl::DROP_EVENT,value);
+    break;
   case OnMove:
     setListener(exec,DOM::EventImpl::KHTML_MOVE_EVENT,value);
     break;
diff --git a/WebCore/khtml/ecma/kjs_dom.h b/WebCore/khtml/ecma/kjs_dom.h
index 2f3a0ee..a49d381 100644
--- a/WebCore/khtml/ecma/kjs_dom.h
+++ b/WebCore/khtml/ecma/kjs_dom.h
@@ -60,6 +60,7 @@ namespace KJS {
            CloneNode, Normalize, IsSupported, AddEventListener, RemoveEventListener,
            DispatchEvent, Contains,
            OnAbort, OnBlur, OnChange, OnClick, OnContextMenu, OnDblClick, OnDragDrop, OnError,
+           OnDragEnter, OnDragOver, OnDragLeave, OnDrop,
            OnFocus, OnInput, OnKeyDown, OnKeyPress, OnKeyUp, OnLoad, OnMouseDown,
            OnMouseMove, OnMouseOut, OnMouseOver, OnMouseUp, OnMove, OnReset,
            OnResize, OnScroll, OnSearch, OnSelect, OnSubmit, OnUnload,
diff --git a/WebCore/khtml/ecma/kjs_dom.lut.h b/WebCore/khtml/ecma/kjs_dom.lut.h
index 07fa704..0297333 100644
--- a/WebCore/khtml/ecma/kjs_dom.lut.h
+++ b/WebCore/khtml/ecma/kjs_dom.lut.h
@@ -30,30 +30,30 @@ namespace KJS {
 
 const struct HashEntry DOMNodeTableEntries[] = {
    { "nodeType", DOMNode::NodeType, DontDelete|ReadOnly, 0, 0 },
-   { 0, 0, 0, 0, 0 },
+   { "ondragenter", DOMNode::OnDragEnter, DontDelete, 0, 0 },
    { "offsetTop", DOMNode::OffsetTop, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "namespaceURI", DOMNode::NamespaceURI, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "ondragdrop", DOMNode::OnDragDrop, DontDelete, 0, &DOMNodeTableEntries[72] },
+   { "ondragdrop", DOMNode::OnDragDrop, DontDelete, 0, &DOMNodeTableEntries[74] },
    { 0, 0, 0, 0, 0 },
    { "scrollTop", DOMNode::ScrollTop, DontDelete, 0, 0 },
-   { "onclick", DOMNode::OnClick, DontDelete, 0, &DOMNodeTableEntries[67] },
+   { "onclick", DOMNode::OnClick, DontDelete, 0, &DOMNodeTableEntries[69] },
    { "localName", DOMNode::LocalName, DontDelete|ReadOnly, 0, 0 },
    { "childNodes", DOMNode::ChildNodes, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { 0, 0, 0, 0, 0 },
+   { "ondragover", DOMNode::OnDragOver, DontDelete, 0, 0 },
    { "offsetHeight", DOMNode::OffsetHeight, DontDelete|ReadOnly, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { "parentElement", DOMNode::ParentElement, DontDelete|ReadOnly, 0, 0 },
-   { "onload", DOMNode::OnLoad, DontDelete, 0, &DOMNodeTableEntries[68] },
+   { "onload", DOMNode::OnLoad, DontDelete, 0, &DOMNodeTableEntries[70] },
    { 0, 0, 0, 0, 0 },
    { "nodeName", DOMNode::NodeName, DontDelete|ReadOnly, 0, 0 },
-   { "lastChild", DOMNode::LastChild, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[69] },
+   { "lastChild", DOMNode::LastChild, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[71] },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
@@ -67,38 +67,40 @@ const struct HashEntry DOMNodeTableEntries[] = {
    { "nodeValue", DOMNode::NodeValue, DontDelete, 0, 0 },
    { "onscroll", DOMNode::OnScroll, DontDelete, 0, 0 },
    { "previousSibling", DOMNode::PreviousSibling, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[58] },
-   { "prefix", DOMNode::Prefix, DontDelete, 0, &DOMNodeTableEntries[60] },
-   { "nextSibling", DOMNode::NextSibling, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[66] },
-   { "onreset", DOMNode::OnReset, DontDelete, 0, 0 },
+   { "prefix", DOMNode::Prefix, DontDelete, 0, &DOMNodeTableEntries[61] },
+   { "nextSibling", DOMNode::NextSibling, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[68] },
+   { "ondragleave", DOMNode::OnDragLeave, DontDelete, 0, &DOMNodeTableEntries[67] },
    { "onsubmit", DOMNode::OnSubmit, DontDelete, 0, 0 },
    { "ownerDocument", DOMNode::OwnerDocument, DontDelete|ReadOnly, 0, &DOMNodeTableEntries[56] },
    { "onkeypress", DOMNode::OnKeyPress, DontDelete, 0, 0 },
    { "onmove", DOMNode::OnMove, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "onerror", DOMNode::OnError, DontDelete, 0, &DOMNodeTableEntries[74] },
+   { "onerror", DOMNode::OnError, DontDelete, 0, &DOMNodeTableEntries[76] },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "onchange", DOMNode::OnChange, DontDelete, 0, &DOMNodeTableEntries[61] },
+   { "onchange", DOMNode::OnChange, DontDelete, 0, &DOMNodeTableEntries[62] },
    { 0, 0, 0, 0, 0 },
    { "oninput", DOMNode::OnInput, DontDelete, 0, 0 },
    { "onmouseout", DOMNode::OnMouseOut, DontDelete, 0, 0 },
    { 0, 0, 0, 0, 0 },
-   { "onblur", DOMNode::OnBlur, DontDelete, 0, &DOMNodeTableEntries[64] },
-   { "oncontextmenu", DOMNode::OnContextMenu, DontDelete, 0, &DOMNodeTableEntries[71] },
-   { "ondblclick", DOMNode::OnDblClick, DontDelete, 0, &DOMNodeTableEntries[59] },
-   { "onfocus", DOMNode::OnFocus, DontDelete, 0, &DOMNodeTableEntries[63] },
-   { "onkeydown", DOMNode::OnKeyDown, DontDelete, 0, &DOMNodeTableEntries[62] },
-   { "onkeyup", DOMNode::OnKeyUp, DontDelete, 0, &DOMNodeTableEntries[65] },
+   { "onblur", DOMNode::OnBlur, DontDelete, 0, &DOMNodeTableEntries[59] },
+   { "oncontextmenu", DOMNode::OnContextMenu, DontDelete, 0, &DOMNodeTableEntries[73] },
+   { "ondblclick", DOMNode::OnDblClick, DontDelete, 0, &DOMNodeTableEntries[60] },
+   { "ondrop", DOMNode::OnDrop, DontDelete, 0, &DOMNodeTableEntries[65] },
+   { "onfocus", DOMNode::OnFocus, DontDelete, 0, &DOMNodeTableEntries[64] },
+   { "onkeydown", DOMNode::OnKeyDown, DontDelete, 0, &DOMNodeTableEntries[63] },
+   { "onkeyup", DOMNode::OnKeyUp, DontDelete, 0, &DOMNodeTableEntries[66] },
    { "onmousedown", DOMNode::OnMouseDown, DontDelete, 0, 0 },
    { "onmousemove", DOMNode::OnMouseMove, DontDelete, 0, 0 },
-   { "onmouseover", DOMNode::OnMouseOver, DontDelete, 0, &DOMNodeTableEntries[73] },
+   { "onmouseover", DOMNode::OnMouseOver, DontDelete, 0, &DOMNodeTableEntries[75] },
    { "onmouseup", DOMNode::OnMouseUp, DontDelete, 0, 0 },
-   { "onresize", DOMNode::OnResize, DontDelete, 0, &DOMNodeTableEntries[70] },
+   { "onreset", DOMNode::OnReset, DontDelete, 0, 0 },
+   { "onresize", DOMNode::OnResize, DontDelete, 0, &DOMNodeTableEntries[72] },
    { "onsearch", DOMNode::OnSearch, DontDelete, 0, 0 },
    { "onselect", DOMNode::OnSelect, DontDelete, 0, 0 },
-   { "onunload", DOMNode::OnUnload, DontDelete, 0, &DOMNodeTableEntries[75] },
+   { "onunload", DOMNode::OnUnload, DontDelete, 0, &DOMNodeTableEntries[77] },
    { "offsetWidth", DOMNode::OffsetWidth, DontDelete|ReadOnly, 0, 0 },
    { "clientWidth", DOMNode::ClientWidth, DontDelete|ReadOnly, 0, 0 },
    { "clientHeight", DOMNode::ClientHeight, DontDelete|ReadOnly, 0, 0 },
@@ -107,7 +109,7 @@ const struct HashEntry DOMNodeTableEntries[] = {
    { "scrollHeight", DOMNode::ScrollHeight, DontDelete|ReadOnly, 0, 0 }
 };
 
-const struct HashTable DOMNodeTable = { 2, 76, DOMNodeTableEntries, 56 };
+const struct HashTable DOMNodeTable = { 2, 78, DOMNodeTableEntries, 56 };
 
 } // namespace
 
diff --git a/WebCore/khtml/ecma/kjs_events.cpp b/WebCore/khtml/ecma/kjs_events.cpp
index b7a14de..f7d807e 100644
--- a/WebCore/khtml/ecma/kjs_events.cpp
+++ b/WebCore/khtml/ecma/kjs_events.cpp
@@ -535,7 +535,7 @@ Value DOMUIEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List
 const ClassInfo DOMMouseEvent::info = { "MouseEvent", &DOMUIEvent::info, &DOMMouseEventTable, 0 };
 
 /*
- at begin DOMMouseEventTable 2
+ at begin DOMMouseEventTable 17
   screenX	DOMMouseEvent::ScreenX	DontDelete|ReadOnly
   screenY	DOMMouseEvent::ScreenY	DontDelete|ReadOnly
   clientX	DOMMouseEvent::ClientX	DontDelete|ReadOnly
@@ -552,6 +552,7 @@ const ClassInfo DOMMouseEvent::info = { "MouseEvent", &DOMUIEvent::info, &DOMMou
   relatedTarget	DOMMouseEvent::RelatedTarget DontDelete|ReadOnly
   fromElement	DOMMouseEvent::FromElement DontDelete|ReadOnly
   toElement	DOMMouseEvent::ToElement	DontDelete|ReadOnly
+  dataTransfer	DOMMouseEvent::DataTransfer DontDelete|ReadOnly
 @end
 @begin DOMMouseEventProtoTable 1
   initMouseEvent	DOMMouseEvent::InitMouseEvent	DontDelete|Function 15
@@ -565,6 +566,14 @@ DOMMouseEvent::~DOMMouseEvent()
 {
 }
 
+// pass marks through to JS objects we hold during garbage collection
+void DOMMouseEvent::mark()
+{
+  ObjectImp::mark();
+  if (clipboard && !clipboard->marked())
+    clipboard->mark();
+}
+
 Value DOMMouseEvent::tryGet(ExecState *exec, const Identifier &p) const
 {
 #ifdef KJS_VERBOSE
@@ -633,6 +642,12 @@ Value DOMMouseEvent::getValueProperty(ExecState *exec, int token) const
     /* fall through */
   case RelatedTarget:
     return getDOMNode(exec,static_cast<DOM::MouseEvent>(event).relatedTarget());
+  case DataTransfer:
+    if (!clipboard) {
+      DOM::MouseEventImpl *impl = static_cast<DOM::MouseEventImpl *>(event.handle());
+      clipboard = new Clipboard(exec, impl->clipboard());
+    }
+    return Object(clipboard);
   default:
     kdWarning() << "Unhandled token in DOMMouseEvent::getValueProperty : " << token << endl;
     return Value();
@@ -852,3 +867,126 @@ Value DOMMutationEventProtoFunc::tryCall(ExecState *exec, Object &thisObj, const
   }
   return Undefined();
 }
+
+// -------------------------------------------------------------------------
+
+const ClassInfo Clipboard::info = { "Clipboard", 0, &ClipboardTable, 0 };
+
+/* Source for ClipboardTable. Use "make hashtables" to regenerate.
+ at begin ClipboardTable 2
+  dropEffect	Clipboard::DropEffect	DontDelete
+  dropAllowed	Clipboard::DropAllowed	DontDelete
+ at end
+ at begin ClipboardProtoTable 3
+  clearData	Clipboard::ClearData	DontDelete|Function 0
+  getData	Clipboard::GetData	DontDelete|Function 1
+  setData	Clipboard::SetData	DontDelete|Function 2
+ at end
+*/
+
+DEFINE_PROTOTYPE("Clipboard", ClipboardProto)
+IMPLEMENT_PROTOFUNC(ClipboardProtoFunc)
+IMPLEMENT_PROTOTYPE(ClipboardProto, ClipboardProtoFunc)
+
+Clipboard::Clipboard(ExecState *exec, DOM::ClipboardImpl *cb)
+: DOMObject(ClipboardProto::self(exec)), clipboard(cb)
+{
+    if (clipboard)
+        clipboard->ref();
+}
+
+Clipboard::~Clipboard()
+{
+    if (clipboard)
+        clipboard->deref();
+}
+
+// FIXME lookups of dropEffect and dropAllowed should fail if !clipboard->isForDragging
+
+Value Clipboard::tryGet(ExecState *exec, const Identifier &propertyName) const
+{
+    return DOMObjectLookupGetValue<Clipboard,DOMObject>(exec, propertyName, &ClipboardTable, this);
+}
+
+Value Clipboard::getValueProperty(ExecState *exec, int token) const
+{
+    switch (token) {
+        case DropEffect:
+            return String(clipboard->dropEffect());
+        case DropAllowed:
+            return String(clipboard->dropAllowed());
+        default:
+            kdWarning() << "Clipboard::getValueProperty unhandled token " << token << endl;
+            return Value();
+    }
+}
+
+void Clipboard::tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr)
+{
+    DOMObjectLookupPut<Clipboard,DOMObject>(exec, propertyName, value, attr, &ClipboardTable, this );
+}
+
+void Clipboard::putValue(ExecState *exec, int token, const Value& value, int /*attr*/)
+{
+    switch (token) {
+        case DropEffect:
+            clipboard->setDropEffect(value.toString(exec).string());
+            break;
+        case DropAllowed:
+            clipboard->setDropAllowed(value.toString(exec).string());
+            break;
+        default:
+            kdWarning() << "Clipboard::putValue unhandled token " << token << endl;
+    }
+}
+
+Value ClipboardProtoFunc::tryCall(ExecState *exec, Object &thisObj, const List &args)
+{
+    if (!thisObj.inherits(&KJS::Clipboard::info)) {
+        Object err = Error::create(exec,TypeError);
+        exec->setException(err);
+        return err;
+    }
+
+    Clipboard *cb = static_cast<Clipboard *>(thisObj.imp());
+    switch (id) {
+        case Clipboard::ClearData:
+            if (args.size() == 0) {
+                cb->clipboard->clearAllData();
+                return Undefined();
+            } else if (args.size() == 1) {
+                cb->clipboard->clearData(args[0].toString(exec).string());
+                return Undefined();
+            } else {
+                Object err = Error::create(exec,SyntaxError,"clearData: Invalid number of arguments");
+                exec->setException(err);
+                return err;
+            }
+        case Clipboard::GetData:
+        {
+            if (args.size() == 1) {
+                bool success;
+                DOM::DOMString result = cb->clipboard->getData(args[0].toString(exec).string(), success);
+                if (success) {
+                    return String(result);
+                } else {
+                    return Undefined();
+                }
+            } else {
+                Object err = Error::create(exec,SyntaxError,"getData: Invalid number of arguments");
+                exec->setException(err);
+                return err;
+            }
+        }
+        case Clipboard::SetData:
+            if (args.size() == 2) {
+                return Boolean(cb->clipboard->setData(args[0].toString(exec).string(), args[1].toString(exec).string()));
+            } else {
+                Object err = Error::create(exec,SyntaxError,"setData: Invalid number of arguments");
+                exec->setException(err);
+                return err;
+            }
+    }
+    return Undefined();
+}
+
diff --git a/WebCore/khtml/ecma/kjs_events.h b/WebCore/khtml/ecma/kjs_events.h
index 57dfc11..051c122 100644
--- a/WebCore/khtml/ecma/kjs_events.h
+++ b/WebCore/khtml/ecma/kjs_events.h
@@ -23,13 +23,17 @@
 #define _KJS_EVENTS_H_
 
 #include "ecma/kjs_dom.h"
+#include "ecma/kjs_html.h"
 #include "dom/dom2_events.h"
 #include "dom/dom_misc.h"
 
+namespace DOM { class ClipboardImpl; }
+
 namespace KJS {
 
   class Window;
-
+  class Clipboard;
+    
   class JSEventListener : public DOM::EventListener {
   public:
     JSEventListener(Object _listener, const Object &_win, bool _html = false);
@@ -127,18 +131,21 @@ namespace KJS {
 
   class DOMMouseEvent : public DOMUIEvent {
   public:
-    DOMMouseEvent(ExecState *exec, DOM::MouseEvent me) : DOMUIEvent(exec, me) {}
+    DOMMouseEvent(ExecState *exec, DOM::MouseEvent me) : DOMUIEvent(exec, me), clipboard(0) {}
     ~DOMMouseEvent();
     virtual Value tryGet(ExecState *exec,const Identifier &p) const;
     Value getValueProperty(ExecState *, int token) const;
+    virtual void mark();
     // no put - all read-only
     virtual const ClassInfo* classInfo() const { return &info; }
     static const ClassInfo info;
     enum { ScreenX, ScreenY, ClientX, X, ClientY, Y, OffsetX, OffsetY,
            CtrlKey, ShiftKey, AltKey,
-           MetaKey, Button, RelatedTarget, FromElement, ToElement,
+           MetaKey, Button, RelatedTarget, FromElement, ToElement, DataTransfer,
            InitMouseEvent };
     DOM::MouseEvent toMouseEvent() const { return static_cast<DOM::MouseEvent>(event); }
+  protected:
+    mutable Clipboard *clipboard;
   };
 
   class DOMKeyboardEvent : public DOMUIEvent {
@@ -180,7 +187,25 @@ namespace KJS {
            InitMutationEvent };
     DOM::MutationEvent toMutationEvent() const { return static_cast<DOM::MutationEvent>(event); }
   };
-
+  
+  class Clipboard : public DOMObject {
+  friend class ClipboardProtoFunc;
+  public:
+    Clipboard(ExecState *exec, DOM::ClipboardImpl *ds);
+    ~Clipboard();
+    virtual Value tryGet(ExecState *exec, const Identifier &propertyName) const;
+    Value getValueProperty(ExecState *exec, int token) const;
+    virtual void tryPut(ExecState *exec, const Identifier &propertyName, const Value& value, int attr = None);
+    void putValue(ExecState *exec, int token, const Value& value, int /*attr*/);
+    virtual bool toBoolean(ExecState *) const { return true; }
+    virtual const ClassInfo* classInfo() const { return &info; }
+    static const ClassInfo info;
+    enum { ClearData, GetData, SetData, DropEffect, DropAllowed };
+  private:
+    DOM::ClipboardImpl *clipboard;
+  };
+  
+  
 }; // namespace
 
 #endif
diff --git a/WebCore/khtml/ecma/kjs_events.lut.h b/WebCore/khtml/ecma/kjs_events.lut.h
index 271a840..e6e7b58 100644
--- a/WebCore/khtml/ecma/kjs_events.lut.h
+++ b/WebCore/khtml/ecma/kjs_events.lut.h
@@ -107,25 +107,32 @@ const struct HashTable DOMUIEventProtoTable = { 2, 1, DOMUIEventProtoTableEntrie
 namespace KJS {
 
 const struct HashEntry DOMMouseEventTableEntries[] = {
-   { "screenX", DOMMouseEvent::ScreenX, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[3] },
-   { "screenY", DOMMouseEvent::ScreenY, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[2] },
-   { "clientX", DOMMouseEvent::ClientX, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[5] },
-   { "x", DOMMouseEvent::X, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[4] },
-   { "clientY", DOMMouseEvent::ClientY, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[7] },
-   { "y", DOMMouseEvent::Y, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[6] },
-   { "offsetX", DOMMouseEvent::OffsetX, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[9] },
-   { "offsetY", DOMMouseEvent::OffsetY, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[8] },
-   { "ctrlKey", DOMMouseEvent::CtrlKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[10] },
-   { "shiftKey", DOMMouseEvent::ShiftKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[15] },
-   { "altKey", DOMMouseEvent::AltKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[11] },
-   { "metaKey", DOMMouseEvent::MetaKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[12] },
-   { "button", DOMMouseEvent::Button, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[13] },
-   { "relatedTarget", DOMMouseEvent::RelatedTarget, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[14] },
+   { 0, 0, 0, 0, 0 },
+   { "x", DOMMouseEvent::X, DontDelete|ReadOnly, 0, 0 },
+   { "y", DOMMouseEvent::Y, DontDelete|ReadOnly, 0, 0 },
+   { "ctrlKey", DOMMouseEvent::CtrlKey, DontDelete|ReadOnly, 0, 0 },
+   { "offsetX", DOMMouseEvent::OffsetX, DontDelete|ReadOnly, 0, 0 },
+   { "offsetY", DOMMouseEvent::OffsetY, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[20] },
+   { "shiftKey", DOMMouseEvent::ShiftKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[18] },
+   { 0, 0, 0, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "relatedTarget", DOMMouseEvent::RelatedTarget, DontDelete|ReadOnly, 0, 0 },
+   { 0, 0, 0, 0, 0 },
    { "fromElement", DOMMouseEvent::FromElement, DontDelete|ReadOnly, 0, 0 },
-   { "toElement", DOMMouseEvent::ToElement, DontDelete|ReadOnly, 0, 0 }
+   { 0, 0, 0, 0, 0 },
+   { "clientX", DOMMouseEvent::ClientX, DontDelete|ReadOnly, 0, 0 },
+   { "screenX", DOMMouseEvent::ScreenX, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[17] },
+   { "screenY", DOMMouseEvent::ScreenY, DontDelete|ReadOnly, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "clientY", DOMMouseEvent::ClientY, DontDelete|ReadOnly, 0, 0 },
+   { "altKey", DOMMouseEvent::AltKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[19] },
+   { "metaKey", DOMMouseEvent::MetaKey, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[21] },
+   { "button", DOMMouseEvent::Button, DontDelete|ReadOnly, 0, 0 },
+   { "toElement", DOMMouseEvent::ToElement, DontDelete|ReadOnly, 0, &DOMMouseEventTableEntries[22] },
+   { "dataTransfer", DOMMouseEvent::DataTransfer, DontDelete|ReadOnly, 0, 0 }
 };
 
-const struct HashTable DOMMouseEventTable = { 2, 16, DOMMouseEventTableEntries, 2 };
+const struct HashTable DOMMouseEventTable = { 2, 23, DOMMouseEventTableEntries, 17 };
 
 } // namespace
 
@@ -203,3 +210,27 @@ const struct HashEntry DOMMutationEventProtoTableEntries[] = {
 const struct HashTable DOMMutationEventProtoTable = { 2, 1, DOMMutationEventProtoTableEntries, 1 };
 
 } // namespace
+
+namespace KJS {
+
+const struct HashEntry ClipboardTableEntries[] = {
+   { "dropEffect", Clipboard::DropEffect, DontDelete, 0, 0 },
+   { "dropAllowed", Clipboard::DropAllowed, DontDelete, 0, 0 }
+};
+
+const struct HashTable ClipboardTable = { 2, 2, ClipboardTableEntries, 2 };
+
+} // namespace
+
+namespace KJS {
+
+const struct HashEntry ClipboardProtoTableEntries[] = {
+   { "clearData", Clipboard::ClearData, DontDelete|Function, 0, 0 },
+   { 0, 0, 0, 0, 0 },
+   { "getData", Clipboard::GetData, DontDelete|Function, 1, &ClipboardProtoTableEntries[3] },
+   { "setData", Clipboard::SetData, DontDelete|Function, 2, 0 }
+};
+
+const struct HashTable ClipboardProtoTable = { 2, 4, ClipboardProtoTableEntries, 3 };
+
+} // namespace
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index 39ae00a..7e8fa8f 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -447,7 +447,23 @@ void HTMLElementImpl::parseHTMLAttribute(HTMLAttributeImpl *attr)
         setHTMLEventListener(EventImpl::SCROLL_EVENT,
             getDocument()->createHTMLEventListener(attr->value().string()));
         break;
-// other misc attributes
+    case ATTR_ONDRAGENTER:
+        setHTMLEventListener(EventImpl::DRAGENTER_EVENT,
+                             getDocument()->createHTMLEventListener(attr->value().string()));
+        break;
+    case ATTR_ONDRAGOVER:
+        setHTMLEventListener(EventImpl::DRAGOVER_EVENT,
+                             getDocument()->createHTMLEventListener(attr->value().string()));
+        break;
+    case ATTR_ONDRAGLEAVE:
+        setHTMLEventListener(EventImpl::DRAGLEAVE_EVENT,
+                             getDocument()->createHTMLEventListener(attr->value().string()));
+        break;
+    case ATTR_ONDROP:
+        setHTMLEventListener(EventImpl::DROP_EVENT,
+                             getDocument()->createHTMLEventListener(attr->value().string()));
+        break;
+    // other misc attributes
     default:
 #ifdef UNSUPPORTED_ATTR
 	kdDebug(6030) << "UATTR: <" << this->nodeName().string() << "> ["
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 2a5c46a..4938831 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -150,6 +150,7 @@ public:
         linkPressed = false;
         useSlowRepaints = false;
         originalNode = 0;
+        dragTarget = 0;
 	borderTouched = false;
 #if !APPLE_CHANGES
 #ifndef KHTML_NO_SCROLLBARS
@@ -238,6 +239,8 @@ public:
     // Used by objects during layout to communicate repaints that need to take place only
     // after all layout has been completed.
     QPtrList<RenderObject::RepaintInfo>* repaintRects;
+    
+    Node dragTarget;
 };
 
 #ifndef QT_NO_TOOLTIP
@@ -1154,6 +1157,74 @@ void KHTMLView::contentsContextMenuEvent ( QContextMenuEvent *_ce )
 #endif
 }
 
+bool KHTMLView::dispatchDragEvent(int eventId, DOM::NodeImpl *dragTarget, const QPoint &loc, DOM::ClipboardImpl *clipboard)
+{
+    int clientX, clientY;
+    viewportToContents(loc.x(), loc.y(), clientX, clientY);
+    // Typically we'd use the mouse event's globalX/Y, but we have no mouse event to query, and in practice
+    // the globalX/Y fields are the window level coords anyway.
+    int screenX = loc.x();
+    int screenY = loc.y();
+    bool ctrlKey = 0;   // FIXME - set up modifiers, grab from AK or CG
+    bool altKey = 0;
+    bool shiftKey = 0;
+    bool metaKey = 0;
+    
+    MouseEventImpl *me = new MouseEventImpl(static_cast<EventImpl::EventId>(eventId),
+                                            true, true, m_part->xmlDocImpl()->defaultView(),
+                                            0, screenX, screenY, clientX, clientY,
+                                            ctrlKey, altKey, shiftKey, metaKey,
+                                            0, 0, clipboard);
+    me->ref();
+    int exceptioncode = 0;
+    dragTarget->dispatchEvent(me, exceptioncode, true);
+    bool accept = me->defaultPrevented();
+    me->deref();
+    return accept;
+}
+
+bool KHTMLView::updateDragAndDrop(const QPoint &loc, DOM::ClipboardImpl *clipboard)
+{
+    bool accept = false;
+    int xm, ym;
+    viewportToContents(loc.x(), loc.y(), xm, ym);
+    DOM::NodeImpl::MouseEvent mev(0, DOM::NodeImpl::MouseMove);
+    m_part->xmlDocImpl()->prepareMouseEvent(true, xm, ym, &mev);
+    DOM::Node newTarget = mev.innerNode;
+    
+    if (d->dragTarget != newTarget) {
+        if (!d->dragTarget.isNull()) {
+            dispatchDragEvent(EventImpl::DRAGLEAVE_EVENT, d->dragTarget.handle(), loc, clipboard);
+        }
+        if (!newTarget.isNull()) {
+            accept = dispatchDragEvent(EventImpl::DRAGENTER_EVENT, newTarget.handle(), loc, clipboard);
+        }
+    } else if (!newTarget.isNull()) {
+        accept = dispatchDragEvent(EventImpl::DRAGOVER_EVENT, newTarget.handle(), loc, clipboard);
+    }
+    d->dragTarget = newTarget;
+
+    return accept;
+}
+
+void KHTMLView::cancelDragAndDrop(const QPoint &loc, DOM::ClipboardImpl *clipboard)
+{
+    if (!d->dragTarget.isNull()) {
+        dispatchDragEvent(EventImpl::DRAGLEAVE_EVENT, d->dragTarget.handle(), loc, clipboard);
+    }
+    d->dragTarget = 0;
+}
+
+bool KHTMLView::performDragAndDrop(const QPoint &loc, DOM::ClipboardImpl *clipboard)
+{
+    bool accept = false;
+    if (!d->dragTarget.isNull()) {
+        accept = dispatchDragEvent(EventImpl::DROP_EVENT, d->dragTarget.handle(), loc, clipboard);
+    }
+    d->dragTarget = 0;
+    return accept;
+}
+
 #if !APPLE_CHANGES
 
 bool KHTMLView::focusNextPrevChild( bool next )
diff --git a/WebCore/khtml/khtmlview.h b/WebCore/khtml/khtmlview.h
index ee555bd..79107d4 100644
--- a/WebCore/khtml/khtmlview.h
+++ b/WebCore/khtml/khtmlview.h
@@ -35,6 +35,7 @@ class QRect;
 namespace DOM {
     class HTMLDocumentImpl;
     class DocumentImpl;
+    class ClipboardImpl;
     class ElementImpl;
     class HTMLElementImpl;
     class HTMLTitleElementImpl;
@@ -203,6 +204,10 @@ public:
     void contentsContextMenuEvent ( QContextMenuEvent *_ce );
     void doAutoScroll();
 
+    bool updateDragAndDrop(const QPoint &, DOM::ClipboardImpl *clipboard);
+    void cancelDragAndDrop(const QPoint &, DOM::ClipboardImpl *clipboard);
+    bool performDragAndDrop(const QPoint &, DOM::ClipboardImpl *clipboard);
+
     void timerEvent ( QTimerEvent * );
 
     void repaintRectangle(const QRect& r, bool immediate);
@@ -276,6 +281,7 @@ private:
     bool dispatchMouseEvent(int eventId, DOM::NodeImpl *targetNode, bool cancelable,
 			    int detail,QMouseEvent *_mouse, bool setUnder,
 			    int mouseEventType);
+    bool dispatchDragEvent(int eventId, DOM::NodeImpl *dragTarget, const QPoint &loc, DOM::ClipboardImpl *clipboard);
 
     void applyBodyScrollQuirk(khtml::RenderObject* o, ScrollBarMode& hMode, ScrollBarMode& vMode);
 
diff --git a/WebCore/khtml/misc/htmlattrs.c b/WebCore/khtml/misc/htmlattrs.c
index 0f21fe5..f05e4f9 100644
--- a/WebCore/khtml/misc/htmlattrs.c
+++ b/WebCore/khtml/misc/htmlattrs.c
@@ -8,7 +8,7 @@ struct attrs {
     const char *name;
     int id;
 };
-/* maximum key range = 708, duplicates = 1 */
+/* maximum key range = 939, duplicates = 1 */
 
 #ifdef __GNUC__
 __inline
@@ -22,32 +22,32 @@ hash_attr (register const char *str, register unsigned int len)
 {
   static const unsigned short asso_values[] =
     {
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712,   0, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712,  10, 125,  10,
-       95,   0,  70, 180,  70,   0,   0,   0,   0,  35,
-        0,   0,  80,   5,  40,  25,  50,  40, 220, 220,
-       40,  90,   0, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712, 712, 712, 712, 712,
-      712, 712, 712, 712, 712, 712
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948,  10, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948,  65, 115,  10,
+      185,   0, 110, 220, 105,   0,   0,  85,   0, 145,
+        0,   0,   5,   0,  10,  35,  65, 190,   5,  35,
+       50,   0,   0, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948, 948, 948, 948, 948,
+      948, 948, 948, 948, 948, 948
     };
   register int hval = len;
 
@@ -97,275 +97,309 @@ findAttr (register const char *str, register unsigned int len)
 {
   enum
     {
-      TOTAL_KEYWORDS = 167,
+      TOTAL_KEYWORDS = 171,
       MIN_WORD_LENGTH = 2,
       MAX_WORD_LENGTH = 15,
-      MIN_HASH_VALUE = 4,
-      MAX_HASH_VALUE = 711
+      MIN_HASH_VALUE = 9,
+      MAX_HASH_VALUE = 947
     };
 
   static const struct attrs wordlist_attr[] =
     {
-      {"link", ATTR_LINK},
-      {"alink", ATTR_ALINK},
-      {"onclick", ATTR_ONCLICK},
-      {"size", ATTR_SIZE},
-      {"min", ATTR_MIN},
-      {"cols", ATTR_COLS},
+      {"loop", ATTR_LOOP},
       {"rel", ATTR_REL},
-      {"name", ATTR_NAME},
+      {"rev", ATTR_REV},
       {"color", ATTR_COLOR},
-      {"alt", ATTR_ALT},
-      {"cite", ATTR_CITE},
-      {"clear", ATTR_CLEAR},
+      {"onerror", ATTR_ONERROR},
+      {"size", ATTR_SIZE},
+      {"cols", ATTR_COLS},
       {"noresize", ATTR_NORESIZE},
       {"onresize", ATTR_ONRESIZE},
-      {"class", ATTR_CLASS},
-      {"action", ATTR_ACTION},
+      {"scope", ATTR_SCOPE},
+      {"version", ATTR_VERSION},
       {"src", ATTR_SRC},
-      {"axis", ATTR_AXIS},
       {"onscroll", ATTR_ONSCROLL},
-      {"loop", ATTR_LOOP},
-      {"max", ATTR_MAX},
-      {"onselect", ATTR_ONSELECT},
-      {"face", ATTR_FACE},
+      {"precision", ATTR_PRECISION},
+      {"top", ATTR_TOP},
+      {"type", ATTR_TYPE},
       {"plain", ATTR_PLAIN},
-      {"id", ATTR_ID},
-      {"title", ATTR_TITLE},
-      {"code", ATTR_CODE},
-      {"rules", ATTR_RULES},
-      {"onload", ATTR_ONLOAD},
-      {"for", ATTR_FOR},
-      {"content", ATTR_CONTENT},
+      {"oversrc", ATTR_OVERSRC},
+      {"cite", ATTR_CITE},
+      {"rows", ATTR_ROWS},
+      {"enctype", ATTR_ENCTYPE},
+      {"link", ATTR_LINK},
+      {"clear", ATTR_CLEAR},
+      {"vlink", ATTR_VLINK},
+      {"style", ATTR_STYLE},
       {"span", ATTR_SPAN},
-      {"scope", ATTR_SCOPE},
+      {"nosave", ATTR_NOSAVE},
+      {"onclick", ATTR_ONCLICK},
       {"onreset", ATTR_ONRESET},
-      {"left", ATTR_LEFT},
-      {"onerror", ATTR_ONERROR},
+      {"onselect", ATTR_ONSELECT},
+      {"wrap", ATTR_WRAP},
+      {"nowrap", ATTR_NOWRAP},
       {"colspan", ATTR_COLSPAN},
-      {"top", ATTR_TOP},
+      {"for", ATTR_FOR},
+      {"vspace", ATTR_VSPACE},
+      {"profile", ATTR_PROFILE},
+      {"alt", ATTR_ALT},
+      {"title", ATTR_TITLE},
+      {"action", ATTR_ACTION},
+      {"content", ATTR_CONTENT},
+      {"min", ATTR_MIN},
+      {"class", ATTR_CLASS},
+      {"axis", ATTR_AXIS},
+      {"alink", ATTR_ALINK},
+      {"rowspan", ATTR_ROWSPAN},
+      {"accept", ATTR_ACCEPT},
+      {"keytype", ATTR_KEYTYPE},
+      {"left", ATTR_LEFT},
+      {"onkeypress", ATTR_ONKEYPRESS},
+      {"text", ATTR_TEXT},
+      {"label", ATTR_LABEL},
+      {"id", ATTR_ID},
+      {"face", ATTR_FACE},
       {"char", ATTR_CHAR},
+      {"object", ATTR_OBJECT},
       {"dir", ATTR_DIR},
-      {"label", ATTR_LABEL},
-      {"z-index", ATTR_Z_INDEX},
-      {"text", ATTR_TEXT},
-      {"media", ATTR_MEDIA},
-      {"scheme", ATTR_SCHEME},
-      {"onfocus", ATTR_ONFOCUS},
-      {"onunload", ATTR_ONUNLOAD},
-      {"ismap", ATTR_ISMAP},
-      {"incremental", ATTR_INCREMENTAL},
-      {"html", ATTR_HTML},
-      {"frame", ATTR_FRAME},
-      {"declare", ATTR_DECLARE},
+      {"code", ATTR_CODE},
+      {"archive", ATTR_ARCHIVE},
+      {"ondrop", ATTR_ONDROP},
+      {"name", ATTR_NAME},
+      {"shape", ATTR_SHAPE},
+      {"hspace", ATTR_HSPACE},
+      {"href", ATTR_HREF},
+      {"visibility", ATTR_VISIBILITY},
+      {"nohref", ATTR_NOHREF},
       {"onsearch", ATTR_ONSEARCH},
-      {"precision", ATTR_PRECISION},
-      {"accept", ATTR_ACCEPT},
-      {"data", ATTR_DATA},
-      {"style", ATTR_STYLE},
-      {"classid", ATTR_CLASSID},
+      {"prompt", ATTR_PROMPT},
+      {"rules", ATTR_RULES},
+      {"start", ATTR_START},
       {"coords", ATTR_COORDS},
-      {"oninput", ATTR_ONINPUT},
       {"accesskey", ATTR_ACCESSKEY},
-      {"start", ATTR_START},
-      {"href", ATTR_HREF},
-      {"nohref", ATTR_NOHREF},
-      {"results", ATTR_RESULTS},
-      {"selected", ATTR_SELECTED},
-      {"shape", ATTR_SHAPE},
-      {"object", ATTR_OBJECT},
-      {"checked", ATTR_CHECKED},
+      {"z-index", ATTR_Z_INDEX},
+      {"ismap", ATTR_ISMAP},
+      {"onload", ATTR_ONLOAD},
+      {"onabort", ATTR_ONABORT},
+      {"max", ATTR_MAX},
+      {"value", ATTR_VALUE},
+      {"oninput", ATTR_ONINPUT},
+      {"readonly", ATTR_READONLY},
+      {"composite", ATTR_COMPOSITE},
+      {"codetype", ATTR_CODETYPE},
+      {"declare", ATTR_DECLARE},
+      {"direction", ATTR_DIRECTION},
+      {"scrolling", ATTR_SCROLLING},
+      {"onkeyup", ATTR_ONKEYUP},
       {"lang", ATTR_LANG},
       {"align", ATTR_ALIGN},
-      {"usemap", ATTR_USEMAP},
-      {"profile", ATTR_PROFILE},
-      {"onmouseout", ATTR_ONMOUSEOUT},
-      {"hspace", ATTR_HSPACE},
+      {"pagey", ATTR_PAGEY},
+      {"valign", ATTR_VALIGN},
+      {"charset", ATTR_CHARSET},
+      {"scheme", ATTR_SCHEME},
+      {"selected", ATTR_SELECTED},
+      {"incremental", ATTR_INCREMENTAL},
       {"compact", ATTR_COMPACT},
-      {"direction", ATTR_DIRECTION},
-      {"noshade", ATTR_NOSHADE},
-      {"composite", ATTR_COMPOSITE},
+      {"behavior", ATTR_BEHAVIOR},
+      {"abbr", ATTR_ABBR},
       {"defer", ATTR_DEFER},
-      {"onblur", ATTR_ONBLUR},
-      {"charset", ATTR_CHARSET},
-      {"multiple", ATTR_MULTIPLE},
-      {"onkeyup", ATTR_ONKEYUP},
-      {"scrollamount", ATTR_SCROLLAMOUNT},
-      {"type", ATTR_TYPE},
-      {"vlink", ATTR_VLINK},
-      {"onmouseup", ATTR_ONMOUSEUP},
-      {"onabort", ATTR_ONABORT},
-      {"enctype", ATTR_ENCTYPE},
-      {"oncontextmenu", ATTR_ONCONTEXTMENU},
-      {"readonly", ATTR_READONLY},
-      {"headers", ATTR_HEADERS},
-      {"datetime", ATTR_DATETIME},
-      {"ondblclick", ATTR_ONDBLCLICK},
-      {"method", ATTR_METHOD},
-      {"nosave", ATTR_NOSAVE},
-      {"rev", ATTR_REV},
-      {"scrolling", ATTR_SCROLLING},
-      {"hidden", ATTR_HIDDEN},
-      {"unknown", ATTR_UNKNOWN},
-      {"onkeypress", ATTR_ONKEYPRESS},
-      {"codebase", ATTR_CODEBASE},
-      {"value", ATTR_VALUE},
-      {"charoff", ATTR_CHAROFF},
-      {"onchange", ATTR_ONCHANGE},
-      {"challenge", ATTR_CHALLENGE},
+      {"onkeydown", ATTR_ONKEYDOWN},
       {"scrolldelay", ATTR_SCROLLDELAY},
-      {"summary", ATTR_SUMMARY},
-      {"onsubmit", ATTR_ONSUBMIT},
-      {"autocomplete", ATTR_AUTOCOMPLETE},
-      {"rows", ATTR_ROWS},
-      {"prompt", ATTR_PROMPT},
-      {"version", ATTR_VERSION},
-      {"abbr", ATTR_ABBR},
+      {"unknown", ATTR_UNKNOWN},
+      {"html", ATTR_HTML},
+      {"onblur", ATTR_ONBLUR},
       {"border", ATTR_BORDER},
-      {"pagex", ATTR_PAGEX},
-      {"placeholder", ATTR_PLACEHOLDER},
-      {"keytype", ATTR_KEYTYPE},
-      {"longdesc", ATTR_LONGDESC},
+      {"frame", ATTR_FRAME},
+      {"classid", ATTR_CLASSID},
+      {"valuetype", ATTR_VALUETYPE},
       {"cellborder", ATTR_CELLBORDER},
-      {"cellspacing", ATTR_CELLSPACING},
-      {"tabindex", ATTR_TABINDEX},
-      {"codetype", ATTR_CODETYPE},
-      {"target", ATTR_TARGET},
-      {"truespeed", ATTR_TRUESPEED},
-      {"oversrc", ATTR_OVERSRC},
+      {"results", ATTR_RESULTS},
       {"mayscript", ATTR_MAYSCRIPT},
-      {"vspace", ATTR_VSPACE},
-      {"wrap", ATTR_WRAP},
-      {"nowrap", ATTR_NOWRAP},
-      {"archive", ATTR_ARCHIVE},
-      {"disabled", ATTR_DISABLED},
+      {"pagex", ATTR_PAGEX},
       {"bordercolor", ATTR_BORDERCOLOR},
+      {"onfocus", ATTR_ONFOCUS},
+      {"cellspacing", ATTR_CELLSPACING},
       {"bgcolor", ATTR_BGCOLOR},
-      {"autosave", ATTR_AUTOSAVE},
-      {"pagey", ATTR_PAGEY},
-      {"onmousemove", ATTR_ONMOUSEMOVE},
+      {"data", ATTR_DATA},
+      {"placeholder", ATTR_PLACEHOLDER},
+      {"width", ATTR_WIDTH},
       {"onmouseover", ATTR_ONMOUSEOVER},
-      {"height", ATTR_HEIGHT},
-      {"hreflang", ATTR_HREFLANG},
+      {"noshade", ATTR_NOSHADE},
+      {"media", ATTR_MEDIA},
+      {"checked", ATTR_CHECKED},
+      {"headers", ATTR_HEADERS},
+      {"onchange", ATTR_ONCHANGE},
+      {"challenge", ATTR_CHALLENGE},
+      {"multiple", ATTR_MULTIPLE},
+      {"ondblclick", ATTR_ONDBLCLICK},
+      {"charoff", ATTR_CHAROFF},
+      {"codebase", ATTR_CODEBASE},
+      {"target", ATTR_TARGET},
+      {"autosave", ATTR_AUTOSAVE},
+      {"usemap", ATTR_USEMAP},
+      {"onunload", ATTR_ONUNLOAD},
+      {"http-equiv", ATTR_HTTP_EQUIV},
+      {"longdesc", ATTR_LONGDESC},
       {"accept-charset", ATTR_ACCEPT_CHARSET},
-      {"rowspan", ATTR_ROWSPAN},
-      {"pluginurl", ATTR_PLUGINURL},
-      {"maxlength", ATTR_MAXLENGTH},
-      {"leftmargin", ATTR_LEFTMARGIN},
       {"standby", ATTR_STANDBY},
+      {"bgproperties", ATTR_BGPROPERTIES},
+      {"hidden", ATTR_HIDDEN},
+      {"tabindex", ATTR_TABINDEX},
+      {"truespeed", ATTR_TRUESPEED},
+      {"height", ATTR_HEIGHT},
+      {"ondragover", ATTR_ONDRAGOVER},
+      {"method", ATTR_METHOD},
+      {"hreflang", ATTR_HREFLANG},
       {"topmargin", ATTR_TOPMARGIN},
+      {"onmousemove", ATTR_ONMOUSEMOVE},
+      {"scrollamount", ATTR_SCROLLAMOUNT},
+      {"datetime", ATTR_DATETIME},
+      {"oncontextmenu", ATTR_ONCONTEXTMENU},
+      {"autocomplete", ATTR_AUTOCOMPLETE},
+      {"onsubmit", ATTR_ONSUBMIT},
+      {"ondragleave", ATTR_ONDRAGLEAVE},
+      {"ondragenter", ATTR_ONDRAGENTER},
+      {"onmouseup", ATTR_ONMOUSEUP},
+      {"tableborder", ATTR_TABLEBORDER},
       {"contenteditable", ATTR_CONTENTEDITABLE},
-      {"onkeydown", ATTR_ONKEYDOWN},
-      {"valign", ATTR_VALIGN},
+      {"disabled", ATTR_DISABLED},
+      {"summary", ATTR_SUMMARY},
       {"onmousedown", ATTR_ONMOUSEDOWN},
-      {"language", ATTR_LANGUAGE},
-      {"width", ATTR_WIDTH},
+      {"pluginurl", ATTR_PLUGINURL},
+      {"leftmargin", ATTR_LEFTMARGIN},
+      {"onmouseout", ATTR_ONMOUSEOUT},
+      {"maxlength", ATTR_MAXLENGTH},
       {"frameborder", ATTR_FRAMEBORDER},
-      {"behavior", ATTR_BEHAVIOR},
       {"cellpadding", ATTR_CELLPADDING},
-      {"tableborder", ATTR_TABLEBORDER},
-      {"valuetype", ATTR_VALUETYPE},
-      {"background", ATTR_BACKGROUND},
-      {"visibility", ATTR_VISIBILITY},
-      {"http-equiv", ATTR_HTTP_EQUIV},
       {"pluginpage", ATTR_PLUGINPAGE},
       {"pluginspage", ATTR_PLUGINSPAGE},
-      {"bgproperties", ATTR_BGPROPERTIES},
-      {"marginheight", ATTR_MARGINHEIGHT},
-      {"marginwidth", ATTR_MARGINWIDTH}
+      {"language", ATTR_LANGUAGE},
+      {"marginwidth", ATTR_MARGINWIDTH},
+      {"background", ATTR_BACKGROUND},
+      {"marginheight", ATTR_MARGINHEIGHT}
     };
 
   static const short lookup[] =
     {
-        -1,   -1,   -1,   -1,    0,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,    1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,    2,   -1,    3,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,    4,    5,
-        -1,   -1,   -1,    6,   -1,   -1,   -1,   -1,
-        -1,    7,   -1,   -1,   -1,   -1,   -1,    8,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,    9,
-        10,   11,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1, -248,   -1,   14,   15,   -1,   16,   17,
-      -155,   -2,   -1,   18,   19,   -1,   -1,   -1,
-        20,   -1,   -1,   -1,   -1,   21,   22,   23,
-        -1,   24,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   25,   -1,   -1,   -1,   26,   27,   28,
-        -1,   29,   -1,   -1,   -1,   30,   -1,   31,
-        32,   -1,   33,   -1,   34,   -1,   -1,   35,
-        -1,   -1,   -1,   -1,   36,   37,   38,   -1,
-        -1,   -1,   39,   -1,   40,   -1,   41,   -1,
-        42,   43,   44,   -1,   -1,   -1,   -1,   -1,
-        45,   46,   -1,   47,   48,   -1,   -1,   49,
-        50,   -1,   51,   52,   53,   -1,   54,   -1,
-        -1,   55,   56,   -1,   57,   -1,   -1,   -1,
-        58,   59,   -1,   60,   61,   -1,   -1,   -1,
-        62,   -1,   63,   64,   65,   -1,   66,   67,
-        68,   -1,   69,   70,   71,   72,   -1,   -1,
-        73,   74,   75,   -1,   76,   -1,   -1,   77,
-        -1,   78,   79,   80,   81,   82,   -1,   -1,
-        -1,   83,   -1,   -1,   -1,   -1,   84,   -1,
-        85,   86,   -1,   -1,   -1,   87,   -1,   -1,
-        88,   -1,   -1,   -1,   -1,   89,   90,   -1,
-        -1,   -1,   -1,   91,   -1,   -1,   -1,   92,
-        93,   -1,   94,   -1,   -1,   -1,   -1,   -1,
-        95,   -1,   -1,   -1,   -1,   96,   -1,   97,
-        98,   -1,   99,  100,   -1,   -1,  101,   -1,
-        -1,  102,   -1,  103,   -1,  104,  105,  106,
-        -1,  107,  108,  109,   -1,   -1,   -1,  110,
-        -1,  111,   -1,  112,  113,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       114,   -1,  115,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,  116,  117,  118,  119,   -1,
-       120,   -1,   -1,   -1,   -1,   -1,  121,   -1,
-       122,   -1,   -1,   -1,   -1,  123,   -1,   -1,
-       124,   -1,   -1,  125,   -1,   -1,  126,   -1,
-        -1,   -1,   -1,   -1,   -1,  127,   -1,  128,
-        -1,   -1,  129,   -1,  130,  131,  132,   -1,
-        -1,  133,  134,  135,   -1,  136,  137,   -1,
-        -1,   -1,   -1,  138,   -1,   -1,   -1,   -1,
-       139,   -1,  140,  141,   -1,   -1,  142,   -1,
-        -1,   -1,   -1,   -1,   -1,  143,   -1,   -1,
-        -1,   -1,  144,  145,   -1,   -1,   -1,   -1,
-        -1,   -1,  146,   -1,  147,  148,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  149,   -1,
-       150,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  151,   -1,  152,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       153,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,  154,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,    0,   -1,   -1,   -1,    1,   -1,   -1,
+        -1,   -1,    2,   -1,   -1,   -1,   -1,   -1,
+        -1,    3,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,    4,   -1,    5,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,    6,   -1,   -1,   -1, -231,   -1,    9,
+        -1,   10,   11, -164,   -2,   -1,   -1,   12,
+        -1,   -1,   -1,   -1,   -1,   13,   -1,   -1,
+        -1,   14,   15,   16,   -1,   17,   -1,   18,
+        -1,   -1,   -1,   -1,   19,   -1,   -1,   20,
+        -1,   21,   22,   -1,   -1,   -1,   -1,   23,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   24,   -1,   -1,   -1,   25,   -1,   26,
+        27,   -1,   -1,   -1,   -1,   28,   29,   30,
+        -1,   31,   32,   33,   -1,   -1,   34,   -1,
+        -1,   -1,   -1,   -1,   35,   36,   -1,   37,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   38,   39,   40,   -1,   41,   -1,
+        -1,   -1,   42,   43,   -1,   44,   -1,   -1,
+        -1,   45,   46,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   47,   48,   -1,   -1,   -1,
+        49,   50,   -1,   51,   -1,   52,   -1,   -1,
+        -1,   -1,   53,   -1,   54,   -1,   55,   56,
+        -1,   -1,   57,   -1,   -1,   -1,   58,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   59,   60,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   61,   -1,   -1,   62,   63,   64,
+        -1,   65,   -1,   -1,   66,   -1,   -1,   -1,
+        67,   -1,   -1,   -1,   -1,   68,   69,   -1,
+        -1,   70,   -1,   -1,   71,   -1,   -1,   72,
+        73,   -1,   -1,   -1,   -1,   -1,   74,   75,
+        -1,   76,   -1,   77,   78,   79,   -1,   -1,
+        -1,   80,   -1,   -1,   -1,   81,   -1,   82,
+        -1,   -1,   -1,   -1,   83,   -1,   -1,   84,
+        -1,   85,   86,   -1,   -1,   -1,   -1,   87,
+        88,   89,   -1,   -1,   -1,   90,   -1,   91,
+        -1,   -1,   92,   93,   94,   95,   96,   -1,
+        -1,   -1,   97,   -1,   98,   99,   -1,  100,
+        -1,  101,   -1,   -1,   -1,   -1,  102,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  103,
+        -1,  104,   -1,  105,  106,   -1,  107,   -1,
+       108,  109,   -1,   -1,   -1,   -1,   -1,  110,
+       111,   -1,   -1,   -1,  112,   -1,   -1,   -1,
+        -1,   -1,  113,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       114,   -1,   -1,   -1,   -1,   -1,   -1,  115,
+        -1,   -1,   -1,  116,  117,  118,   -1,   -1,
+       119,   -1,  120,   -1,   -1,   -1,   -1,  121,
+       122,  123,   -1,   -1,   -1,  124,   -1,  125,
+        -1,  126,  127,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  128,
+        -1,  129,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  130,   -1,
+       131,   -1,   -1,   -1,   -1,   -1,   -1,  132,
+        -1,   -1,  133,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  134,   -1,   -1,
+       135,   -1,   -1,   -1,   -1,  136,   -1,   -1,
+        -1,  137,   -1,   -1,   -1,   -1,   -1,   -1,
+       138,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  139,   -1,  140,   -1,   -1,
+        -1,  141,  142,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  143,  144,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  145,  146,  147,   -1,   -1,
+        -1,   -1,  148,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,  149,  150,   -1,
+        -1,  151,   -1,   -1,   -1,   -1,  152,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,  153,   -1,
+       154,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,  155,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,  156,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  156,   -1,   -1,   -1,  157,   -1,   -1,
+        -1,  158,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+       159,  160,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  161,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  162,   -1,  163,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  164,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,  165,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,  166,
+        -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       157,   -1,   -1,  158,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  159,   -1,
+       167,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       160,   -1,   -1,   -1,   -1,  161,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,  162,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,  168,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,  163,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-       164,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  165,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
+        -1,   -1,  169,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
         -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
-        -1,   -1,   -1,   -1,   -1,   -1,   -1,  166
+        -1,   -1,   -1,  170
     };
 
   if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
@@ -500,6 +534,10 @@ static const char * const attrList[] = {
     "ONCLICK",
     "ONCONTEXTMENU",
     "ONDBLCLICK",
+    "ONDRAGENTER",
+    "ONDRAGLEAVE",
+    "ONDRAGOVER",
+    "ONDROP",
     "ONERROR",
     "ONFOCUS",
     "ONINPUT",
diff --git a/WebCore/khtml/misc/htmlattrs.h b/WebCore/khtml/misc/htmlattrs.h
index 4097f0a..2a007e3 100644
--- a/WebCore/khtml/misc/htmlattrs.h
+++ b/WebCore/khtml/misc/htmlattrs.h
@@ -102,79 +102,83 @@ htmlattrs.in by makeattrs, do not edit */
 #define ATTR_ONCLICK 93
 #define ATTR_ONCONTEXTMENU 94
 #define ATTR_ONDBLCLICK 95
-#define ATTR_ONERROR 96
-#define ATTR_ONFOCUS 97
-#define ATTR_ONINPUT 98
-#define ATTR_ONKEYDOWN 99
-#define ATTR_ONKEYPRESS 100
-#define ATTR_ONKEYUP 101
-#define ATTR_ONLOAD 102
-#define ATTR_ONMOUSEDOWN 103
-#define ATTR_ONMOUSEMOVE 104
-#define ATTR_ONMOUSEOUT 105
-#define ATTR_ONMOUSEOVER 106
-#define ATTR_ONMOUSEUP 107
-#define ATTR_ONRESET 108
-#define ATTR_ONRESIZE 109
-#define ATTR_ONSCROLL 110
-#define ATTR_ONSEARCH 111
-#define ATTR_ONSELECT 112
-#define ATTR_ONSUBMIT 113
-#define ATTR_ONUNLOAD 114
-#define ATTR_OVERSRC 115
-#define ATTR_PAGEX 116
-#define ATTR_PAGEY 117
-#define ATTR_PLACEHOLDER 118
-#define ATTR_PLAIN 119
-#define ATTR_PLUGINPAGE 120
-#define ATTR_PLUGINSPAGE 121
-#define ATTR_PLUGINURL 122
-#define ATTR_PRECISION 123
-#define ATTR_PROFILE 124
-#define ATTR_PROMPT 125
-#define ATTR_READONLY 126
-#define ATTR_REL 127
-#define ATTR_RESULTS 128
-#define ATTR_REV 129
-#define ATTR_ROWS 130
-#define ATTR_ROWSPAN 131
-#define ATTR_RULES 132
-#define ATTR_SCHEME 133
-#define ATTR_SCOPE 134
-#define ATTR_SCROLLAMOUNT 135
-#define ATTR_SCROLLDELAY 136
-#define ATTR_SCROLLING 137
-#define ATTR_SELECTED 138
-#define ATTR_SHAPE 139
-#define ATTR_SIZE 140
-#define ATTR_SPAN 141
-#define ATTR_SRC 142
-#define ATTR_STANDBY 143
-#define ATTR_START 144
-#define ATTR_STYLE 145
-#define ATTR_SUMMARY 146
-#define ATTR_TABINDEX 147
-#define ATTR_TABLEBORDER 148
-#define ATTR_TARGET 149
-#define ATTR_TEXT 150
-#define ATTR_TITLE 151
-#define ATTR_TOP 152
-#define ATTR_TOPMARGIN 153
-#define ATTR_TRUESPEED 154
-#define ATTR_TYPE 155
-#define ATTR_UNKNOWN 156
-#define ATTR_USEMAP 157
-#define ATTR_VALIGN 158
-#define ATTR_VALUE 159
-#define ATTR_VALUETYPE 160
-#define ATTR_VERSION 161
-#define ATTR_VISIBILITY 162
-#define ATTR_VLINK 163
-#define ATTR_VSPACE 164
-#define ATTR_WIDTH 165
-#define ATTR_WRAP 166
-#define ATTR_Z_INDEX 167
-#define ATTR_LAST_ATTR 167
+#define ATTR_ONDRAGENTER 96
+#define ATTR_ONDRAGLEAVE 97
+#define ATTR_ONDRAGOVER 98
+#define ATTR_ONDROP 99
+#define ATTR_ONERROR 100
+#define ATTR_ONFOCUS 101
+#define ATTR_ONINPUT 102
+#define ATTR_ONKEYDOWN 103
+#define ATTR_ONKEYPRESS 104
+#define ATTR_ONKEYUP 105
+#define ATTR_ONLOAD 106
+#define ATTR_ONMOUSEDOWN 107
+#define ATTR_ONMOUSEMOVE 108
+#define ATTR_ONMOUSEOUT 109
+#define ATTR_ONMOUSEOVER 110
+#define ATTR_ONMOUSEUP 111
+#define ATTR_ONRESET 112
+#define ATTR_ONRESIZE 113
+#define ATTR_ONSCROLL 114
+#define ATTR_ONSEARCH 115
+#define ATTR_ONSELECT 116
+#define ATTR_ONSUBMIT 117
+#define ATTR_ONUNLOAD 118
+#define ATTR_OVERSRC 119
+#define ATTR_PAGEX 120
+#define ATTR_PAGEY 121
+#define ATTR_PLACEHOLDER 122
+#define ATTR_PLAIN 123
+#define ATTR_PLUGINPAGE 124
+#define ATTR_PLUGINSPAGE 125
+#define ATTR_PLUGINURL 126
+#define ATTR_PRECISION 127
+#define ATTR_PROFILE 128
+#define ATTR_PROMPT 129
+#define ATTR_READONLY 130
+#define ATTR_REL 131
+#define ATTR_RESULTS 132
+#define ATTR_REV 133
+#define ATTR_ROWS 134
+#define ATTR_ROWSPAN 135
+#define ATTR_RULES 136
+#define ATTR_SCHEME 137
+#define ATTR_SCOPE 138
+#define ATTR_SCROLLAMOUNT 139
+#define ATTR_SCROLLDELAY 140
+#define ATTR_SCROLLING 141
+#define ATTR_SELECTED 142
+#define ATTR_SHAPE 143
+#define ATTR_SIZE 144
+#define ATTR_SPAN 145
+#define ATTR_SRC 146
+#define ATTR_STANDBY 147
+#define ATTR_START 148
+#define ATTR_STYLE 149
+#define ATTR_SUMMARY 150
+#define ATTR_TABINDEX 151
+#define ATTR_TABLEBORDER 152
+#define ATTR_TARGET 153
+#define ATTR_TEXT 154
+#define ATTR_TITLE 155
+#define ATTR_TOP 156
+#define ATTR_TOPMARGIN 157
+#define ATTR_TRUESPEED 158
+#define ATTR_TYPE 159
+#define ATTR_UNKNOWN 160
+#define ATTR_USEMAP 161
+#define ATTR_VALIGN 162
+#define ATTR_VALUE 163
+#define ATTR_VALUETYPE 164
+#define ATTR_VERSION 165
+#define ATTR_VISIBILITY 166
+#define ATTR_VLINK 167
+#define ATTR_VSPACE 168
+#define ATTR_WIDTH 169
+#define ATTR_WRAP 170
+#define ATTR_Z_INDEX 171
+#define ATTR_LAST_ATTR 171
 DOM::DOMString getAttrName(unsigned short id);
 
 #endif
diff --git a/WebCore/khtml/misc/htmlattrs.in b/WebCore/khtml/misc/htmlattrs.in
index 1330291..63677db 100644
--- a/WebCore/khtml/misc/htmlattrs.in
+++ b/WebCore/khtml/misc/htmlattrs.in
@@ -93,6 +93,10 @@ onchange
 onclick
 oncontextmenu
 ondblclick
+ondragenter
+ondragleave
+ondragover
+ondrop
 onerror
 onfocus
 oninput
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.cpp b/WebCore/khtml/xml/dom2_eventsimpl.cpp
index d4e6e89..4b678f4 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.cpp
+++ b/WebCore/khtml/xml/dom2_eventsimpl.cpp
@@ -183,6 +183,14 @@ EventImpl::EventId EventImpl::typeToId(DOMString type)
 	return MOUSEMOVE_EVENT;
     else if (type == "mouseout")
 	return MOUSEOUT_EVENT;
+    else if (type == "dragenter")
+	return DRAGENTER_EVENT;
+    else if (type == "dragover")
+	return DRAGOVER_EVENT;
+    else if (type == "dragleave")
+	return DRAGLEAVE_EVENT;
+    else if (type == "drop")
+	return DROP_EVENT;
     else if (type == "DOMSubtreeModified")
 	return DOMSUBTREEMODIFIED_EVENT;
     else if (type == "DOMNodeInserted")
@@ -263,6 +271,14 @@ DOMString EventImpl::idToType(EventImpl::EventId id)
 	    return "mousemove";
 	case MOUSEOUT_EVENT:
 	    return "mouseout";
+	case DRAGENTER_EVENT:
+            return "dragenter";
+	case DRAGOVER_EVENT:
+            return "dragover";
+	case DRAGLEAVE_EVENT:
+            return "dragleave";
+	case DROP_EVENT:
+	    return "drop";
 	case DOMSUBTREEMODIFIED_EVENT:
 	    return "DOMSubtreeModified";
 	case DOMNODEINSERTED_EVENT:
@@ -418,6 +434,7 @@ MouseEventImpl::MouseEventImpl()
     m_metaKey = false;
     m_button = 0;
     m_relatedTarget = 0;
+    m_clipboard = 0;
 }
 
 MouseEventImpl::MouseEventImpl(EventId _id,
@@ -434,7 +451,8 @@ MouseEventImpl::MouseEventImpl(EventId _id,
 			       bool shiftKeyArg,
 			       bool metaKeyArg,
 			       unsigned short buttonArg,
-			       NodeImpl *relatedTargetArg)
+			       NodeImpl *relatedTargetArg,
+                               ClipboardImpl *clipboardArg)
 		   : UIEventImpl(_id,canBubbleArg,cancelableArg,viewArg,detailArg)
 {
     m_screenX = screenXArg;
@@ -449,6 +467,9 @@ MouseEventImpl::MouseEventImpl(EventId _id,
     m_relatedTarget = relatedTargetArg;
     if (m_relatedTarget)
 	m_relatedTarget->ref();
+    m_clipboard = clipboardArg;
+    if (m_clipboard)
+	m_clipboard->ref();
     computeLayerPos();
 }
 
@@ -487,6 +508,8 @@ MouseEventImpl::~MouseEventImpl()
 {
     if (m_relatedTarget)
 	m_relatedTarget->deref();
+    if (m_clipboard)
+	m_clipboard->deref();
 }
 
 void MouseEventImpl::initMouseEvent(const DOMString &typeArg,
@@ -777,3 +800,13 @@ bool RegisteredEventListener::operator==(const RegisteredEventListener &other)
 	    listener == other.listener &&
 	    useCapture == other.useCapture);
 }
+
+// -----------------------------------------------------------------------------
+
+ClipboardImpl::ClipboardImpl()
+{
+}
+
+ClipboardImpl::~ClipboardImpl()
+{
+}
diff --git a/WebCore/khtml/xml/dom2_eventsimpl.h b/WebCore/khtml/xml/dom2_eventsimpl.h
index 5a19456..684bdb5 100644
--- a/WebCore/khtml/xml/dom2_eventsimpl.h
+++ b/WebCore/khtml/xml/dom2_eventsimpl.h
@@ -38,6 +38,7 @@ namespace DOM {
 class AbstractViewImpl;
 class DOMStringImpl;
 class NodeImpl;
+class ClipboardImpl;
 
 // ### support user-defined events
 
@@ -57,6 +58,11 @@ public:
         MOUSEOVER_EVENT,
         MOUSEMOVE_EVENT,
         MOUSEOUT_EVENT,
+        // IE drag and drop events
+        DRAGENTER_EVENT,
+        DRAGOVER_EVENT,
+        DRAGLEAVE_EVENT,
+        DROP_EVENT,
         // Mutation events
         DOMSUBTREEMODIFIED_EVENT,
         DOMNODEINSERTED_EVENT,
@@ -203,7 +209,8 @@ public:
 		   bool shiftKeyArg,
 		   bool metaKeyArg,
 		   unsigned short buttonArg,
-		   NodeImpl *relatedTargetArg);
+		   NodeImpl *relatedTargetArg,
+                   ClipboardImpl *clipboardArg=0);
     virtual ~MouseEventImpl();
     long screenX() const { return m_screenX; }
     long screenY() const { return m_screenY; }
@@ -217,6 +224,7 @@ public:
     bool metaKey() const { return m_metaKey; }
     unsigned short button() const { return m_button; }
     NodeImpl *relatedTarget() const { return m_relatedTarget; }
+    ClipboardImpl *clipboard() const { return m_clipboard; }
     void initMouseEvent(const DOMString &typeArg,
 			bool canBubbleArg,
 			bool cancelableArg,
@@ -246,6 +254,7 @@ protected:
     bool m_metaKey;
     unsigned short m_button;
     NodeImpl *m_relatedTarget;
+    ClipboardImpl *m_clipboard;
  private:
     void computeLayerPos();
 };
@@ -360,5 +369,24 @@ private:
     RegisteredEventListener & operator=( const RegisteredEventListener & );
 };
 
+// State available during IE's events for drag and drop and copy/paste
+class ClipboardImpl : public khtml::Shared<ClipboardImpl> {
+public:
+    ClipboardImpl();
+    virtual ~ClipboardImpl();
+    // Is this operation a drag-drop or a copy-paste?
+    virtual bool isForDragging() const = 0;
+
+    virtual DOMString dropEffect() const = 0;
+    virtual void setDropEffect(const DOMString &s) = 0;
+    virtual DOMString dropAllowed() const = 0;
+    virtual void setDropAllowed(const DOMString &s) = 0;
+    
+    virtual void clearData(const DOMString &type) = 0;
+    virtual void clearAllData() = 0;
+    virtual DOMString getData(const DOMString &type, bool &success) const = 0;
+    virtual bool setData(const DOMString &type, const DOMString &data) = 0;
+};
+
 }; //namespace
 #endif
diff --git a/WebCore/kwq/KWQKConfigBase.h b/WebCore/kwq/KWQClipboard.h
similarity index 61%
copy from WebCore/kwq/KWQKConfigBase.h
copy to WebCore/kwq/KWQClipboard.h
index 1bb289c..626246e 100644
--- a/WebCore/kwq/KWQKConfigBase.h
+++ b/WebCore/kwq/KWQClipboard.h
@@ -23,43 +23,37 @@
  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
  */
 
-#ifndef KCONFIG_H_
-#define KCONFIG_H_
+// An implementation of the clipboard class from IE that talks to the Cocoa Pasteboard
 
-#include "KWQString.h"
-#if APPLE_CHANGES
-#include "KWQKHTMLSettings.h"
-#endif
-
-class QColor;
-class QStringList;
+#ifndef KWQCLIPBOARD_H_
+#define KWQCLIPBOARD_H_
 
-class KWQKConfigImpl;
+#import <AppKit/AppKit.h>
+#include "xml/dom2_eventsimpl.h"
 
-class KConfig {
+class KWQClipboard : public DOM::ClipboardImpl
+{
 public:
+    KWQClipboard(bool forDragging, NSPasteboard *pasteboard);
+    virtual ~KWQClipboard();
 
-    KConfig(const QString &n, bool bReadOnly=false, bool bUseKDEGlobals = true);
-    ~KConfig();
-
-    void setGroup(const QString &pGroup);
-    
-    QString readEntry(const char *pKey, const QString& aDefault=QString::null) const;
+    bool isForDragging() const;
     
-    int readNumEntry(const char *pKey, int nDefault=0) const;
-    unsigned int readUnsignedNumEntry(const KHTMLSettings *settings, const char *pKey, unsigned int nDefault=0) const;
+    DOM::DOMString dropEffect() const;
+    void setDropEffect(const DOM::DOMString &s);
+    DOM::DOMString dropAllowed() const;
+    void setDropAllowed(const DOM::DOMString &s);
     
-    QColor readColorEntry(const char *pKey, const QColor *pDefault=0L) const;
-
+    void clearData(const DOM::DOMString &type);
+    void clearAllData();
+    DOM::DOMString getData(const DOM::DOMString &type, bool &success) const;
+    bool setData(const DOM::DOMString &type, const DOM::DOMString &data);
 private:
-
-    KConfig(const KConfig &);
-    KConfig &operator=(const KConfig &);
-    
-    KWQKConfigImpl *impl;
-
+    NSPasteboard *m_pasteboard;
+    bool m_forDragging;
+    DOM::DOMString m_dropEffect;
+    DOM::DOMString m_dropAllowed;
 };
 
-void RefreshPlugins(bool reload);
 
 #endif
diff --git a/WebCore/kwq/KWQClipboard.mm b/WebCore/kwq/KWQClipboard.mm
new file mode 100644
index 0000000..03cf09f
--- /dev/null
+++ b/WebCore/kwq/KWQClipboard.mm
@@ -0,0 +1,156 @@
+/*
+ * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "KWQClipboard.h"
+
+using DOM::DOMString;
+
+KWQClipboard::KWQClipboard(bool forDragging, NSPasteboard *pasteboard)
+  : m_pasteboard([pasteboard retain]), m_forDragging(forDragging)
+{
+}
+
+KWQClipboard::~KWQClipboard()
+{
+    [m_pasteboard release];
+}
+
+bool KWQClipboard::isForDragging() const
+{
+    return m_forDragging;
+}
+
+DOM::DOMString KWQClipboard::dropEffect() const
+{
+    return m_dropEffect;
+}
+
+void KWQClipboard::setDropEffect(const DOM::DOMString &s)
+{
+    m_dropEffect = s;
+}
+
+DOM::DOMString KWQClipboard::dropAllowed() const
+{
+    return m_dropAllowed;
+}
+
+void KWQClipboard::setDropAllowed(const DOM::DOMString &s)
+{
+    m_dropAllowed = s;
+}
+
+// FIXME hardwired for now, will use UTI
+static NSString *cocoaTypeFromMIMEType(const DOMString &type) {
+    QString qType = type.string();
+
+    // Cut off any trailing charset - JS String are Unicode, which encapsulates this issue
+    int semicolon = qType.find(';');
+    if (semicolon >= 0) {
+        qType = qType.left(semicolon+1);
+    }
+    qType = qType.stripWhiteSpace();
+
+    if (!qType.compare("text/plain")) {
+        return NSStringPboardType;
+    } else if (!qType.compare("text/html")) {
+        return NSHTMLPboardType;
+    } else if (!qType.compare("text/rtf")) {
+        return NSRTFPboardType;
+    } else if (!qType.compare("text/uri-list")) {
+        return NSURLPboardType;     // note fallback to NSFilenamesPboardType in caller
+    } else {
+        // FIXME - Better fallback for application/Foo might be to take Foo
+        return qType.getNSString();
+    }
+}
+
+void KWQClipboard::clearData(const DOMString &type)
+{    
+}
+
+void KWQClipboard::clearAllData()
+{
+}
+
+DOMString KWQClipboard::getData(const DOMString &type, bool &success) const
+{
+    success = false;
+    NSString *cocoaType = cocoaTypeFromMIMEType(type);
+    NSString *cocoaValue = nil;
+    NSArray *availableTypes = [m_pasteboard types];
+
+    // Fetch the data in different ways for the different Cocoa types
+    if (cocoaType == NSURLPboardType) {
+        NSURL *url = nil;
+        // must check this or we get a printf from CF when there's no data of this type
+        if ([availableTypes containsObject:NSURLPboardType]) {
+            url = [NSURL URLFromPasteboard:m_pasteboard];
+        }
+        if (url) {
+            cocoaValue = [url absoluteString];
+        } else {
+            // Try Filenames type (in addition to URL type) when client requests text/uri-list
+            cocoaType = NSFilenamesPboardType;
+            cocoaValue = nil;
+        }
+    }
+
+    if (cocoaType == NSFilenamesPboardType) {
+        NSArray *fileList = nil;
+        // must check this or we get a printf from CF when there's no data of this type
+        if ([availableTypes containsObject:NSFilenamesPboardType]) {
+            fileList = [m_pasteboard propertyListForType:cocoaType];
+        }
+        if (fileList && [fileList count] > 0) {
+            NSMutableString *urls = [NSMutableString string];
+            unsigned i;
+            for (i = 0; i < [fileList count]; i++) {
+                if (i > 0) {
+                    [urls appendString:@"\n"];
+                }
+                NSURL *url = [NSURL fileURLWithPath:[fileList objectAtIndex:i]];
+                [urls appendString:[url absoluteString]];
+            }
+            cocoaValue = urls;
+        } else {
+            cocoaValue = nil;
+        }
+    } else if (!cocoaValue) {        
+        cocoaValue = [m_pasteboard stringForType:cocoaType];
+    }
+
+    if (cocoaValue) {
+        success = true;
+        return DOMString(QString::fromNSString(cocoaValue));
+    } else {
+        return DOMString();
+    }
+}
+
+bool KWQClipboard::setData(const DOMString &type, const DOMString &data)
+{
+    return true;
+}
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 1dfc0dd..62e5ff5 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -24,6 +24,7 @@
  */
 
 #import <Foundation/Foundation.h>
+#import <AppKit/NSDragging.h>       // for NSDragOperation typedef
 
 #import <WebCore/WebCoreKeyboardAccess.h>
 
@@ -312,6 +313,10 @@ typedef enum {
 
 - (WebScriptObject *)windowScriptObject;
 
+- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info;
+- (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info;
+- (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info;
+
 @end
 
 // The WebCoreBridge protocol contains methods for use by the WebCore side of the bridge.
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index e061b0d..a85ba78 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -31,6 +31,7 @@
 #import "dom_nodeimpl.h"
 #import "dom_position.h"
 #import "dom_selection.h"
+#import "dom2_eventsimpl.h"
 #import "dom2_rangeimpl.h"
 #import "dom2_viewsimpl.h"
 #import "htmlediting.h"
@@ -58,6 +59,7 @@
 
 #import "KWQAssertions.h"
 #import "KWQCharsets.h"
+#import "KWQClipboard.h"
 #import "KWQDOMNode.h"
 #import "KWQEditCommand.h"
 #import "KWQFont.h"
@@ -1545,4 +1547,70 @@ static HTMLFormElementImpl *formElementFromDOMElement(DOMElement *element)
     v->ensureVisible(r.left(), r.top());
 }
 
+// [info draggingLocation] is in window coords
+
+- (NSDragOperation)dragOperationForDraggingInfo:(id <NSDraggingInfo>)info
+{
+    if (_part) {
+        KHTMLView *v = _part->view();
+        if (v) {
+            // Sending an event can result in the destruction of the view and part.
+            v->ref();
+            
+            KWQClipboard *clipboard = new KWQClipboard(true, [info draggingPasteboard]);
+            clipboard->ref();
+
+            // FIXME - massage result into NSDragOperation
+            //  consult event.stopped and event.dataTransfer.dropEffect
+            //  perhaps put that smarts in KWQClipboard 
+            NSDragOperation op = v->updateDragAndDrop(QPoint([info draggingLocation]), clipboard) ? NSDragOperationCopy : NSDragOperationNone;
+
+            clipboard->deref();
+            v->deref();
+            return op;
+        }
+    }
+    return NSDragOperationNone;
+}
+
+- (void)dragExitedWithDraggingInfo:(id <NSDraggingInfo>)info
+{
+    if (_part) {
+        KHTMLView *v = _part->view();
+        if (v) {
+            // Sending an event can result in the destruction of the view and part.
+            v->ref();
+
+            KWQClipboard *clipboard = new KWQClipboard(true, [info draggingPasteboard]);
+            clipboard->ref();
+            
+            v->cancelDragAndDrop(QPoint([info draggingLocation]), clipboard);
+
+            clipboard->deref();
+            v->deref();
+        }
+    }
+}
+
+- (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)info {
+    if (_part) {
+        KHTMLView *v = _part->view();
+        if (v) {
+            // Sending an event can result in the destruction of the view and part.
+            v->ref();
+
+            KWQClipboard *clipboard = new KWQClipboard(true, [info draggingPasteboard]);
+            clipboard->ref();
+
+            BOOL result = v->performDragAndDrop(QPoint([info draggingLocation]), clipboard);
+
+            clipboard->deref();
+            v->deref();
+
+            return result;
+        }
+    }
+    return NO;
+}
+
 @end
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index fd9ab30..3f72b7e 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,24 @@
+2004-05-27  Trey Matteson  <trey at apple.com>
+
+	First cut at DHTML dragging, destination side.  Dragging text, files and URLs onto
+	elements works.  Type conversion from NSPasteboard to MIME types is hardwired.
+	No JS access yet to modifier keys, or operations mask.
+
+        Reviewed by Chris.
+
+        * WebView.subproj/WebHTMLView.m:
+        (-[WebHTMLView draggingUpdatedWithDraggingInfo:]): Call DHTML dragging via bridge.
+        (-[WebHTMLView draggingCancelledWithDraggingInfo:]): Ditto.
+        (-[WebHTMLView concludeDragForDraggingInfo:]): Ditto.
+        * WebView.subproj/WebHTMLViewPrivate.h:
+        * WebView.subproj/WebView.m:
+        (-[WebView _setWebKitDragRespondsToDragging:]):  New SPI for finer grained control than the
+	delegate currently has.
+        (-[WebView _webKitDragRespondsToDragging]): Ditto.
+        (-[WebView _commonInitializationWithFrameName:groupName:]):  Init new flag.
+        (-[WebView _dragOperationForDraggingInfo:]):  Comment.
+        * WebView.subproj/WebViewPrivate.h:
+
 2004-05-27  Darin Adler  <darin at apple.com>
 
         * WebView.subproj/WebFrameView.m: (-[WebFrameView _scrollVerticallyBy:]): Added comment.
diff --git a/WebKit/WebView.subproj/WebHTMLView.m b/WebKit/WebView.subproj/WebHTMLView.m
index d20f121..0d616b8 100644
--- a/WebKit/WebView.subproj/WebHTMLView.m
+++ b/WebKit/WebView.subproj/WebHTMLView.m
@@ -1706,36 +1706,46 @@ static WebHTMLView *lastHitView = nil;
 
 - (NSDragOperation)draggingUpdatedWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
-    if ([self _canProcessDragWithDraggingInfo:draggingInfo]) {
+    NSDragOperation operation = [[self _bridge] dragOperationForDraggingInfo:draggingInfo];
+    _private->webCoreHandlingDrag = (operation != NSDragOperationNone);
+    if (!_private->webCoreHandlingDrag
+        && [self _canProcessDragWithDraggingInfo:draggingInfo]
+        && [[self _webView] _webKitDragRespondsToDragging])
+    {
         [[self _bridge] moveDragCaretToPoint:[self convertPoint:[draggingInfo draggingLocation] fromView:nil]];
-        return (_private->initiatedDrag && [[self _bridge] isSelectionEditable]) ? NSDragOperationMove : NSDragOperationCopy;
+        operation = (_private->initiatedDrag && [[self _bridge] isSelectionEditable]) ? NSDragOperationMove : NSDragOperationCopy;
     } else {
         [[self _bridge] removeDragCaret];
-        return NSDragOperationNone;
     }
+    return operation;
 }
 
 - (void)draggingCancelledWithDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
+    [[self _bridge] dragExitedWithDraggingInfo:draggingInfo];
     [[self _bridge] removeDragCaret];
 }
 
 - (BOOL)concludeDragForDraggingInfo:(id <NSDraggingInfo>)draggingInfo
 {
     WebBridge *bridge = [self _bridge];
-    BOOL didInsert = NO;
-    if ([self _canProcessDragWithDraggingInfo:draggingInfo]) {
-        if (_private->initiatedDrag && [[self _bridge] isSelectionEditable]) {
-            DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:[draggingInfo draggingPasteboard] allowPlainText:YES];
-            [bridge moveSelectionToDragCaret:fragment];
-        } else {
-            [bridge setSelectionToDragCaret];
-            [self _replaceSelectionWithPasteboard:[draggingInfo draggingPasteboard] selectReplacement:YES allowPlainText:YES];
+    if (_private->webCoreHandlingDrag) {
+        return [[self _bridge] concludeDragForDraggingInfo:draggingInfo];
+    } else {
+        BOOL didInsert = NO;
+        if ([self _canProcessDragWithDraggingInfo:draggingInfo] && [[self _webView] _webKitDragRespondsToDragging]) {
+            if (_private->initiatedDrag && [[self _bridge] isSelectionEditable]) {
+                DOMDocumentFragment *fragment = [self _documentFragmentFromPasteboard:[draggingInfo draggingPasteboard] allowPlainText:YES];
+                [bridge moveSelectionToDragCaret:fragment];
+            } else {
+                [bridge setSelectionToDragCaret];
+                [self _replaceSelectionWithPasteboard:[draggingInfo draggingPasteboard] selectReplacement:YES allowPlainText:YES];
+            }
+            didInsert = YES;
         }
-        didInsert = YES;
+        [bridge removeDragCaret];
+        return didInsert;
     }
-    [bridge removeDragCaret];
-    return didInsert;
 }
 
 - (NSDictionary *)elementAtPoint:(NSPoint)point
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index d23bb73..afd5153 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -24,6 +24,8 @@
     BOOL ignoringMouseDraggedEvents;
     BOOL printing;
     BOOL initiatedDrag;
+    // Is WebCore handling drag destination duties (DHTML dragging)?
+    BOOL webCoreHandlingDrag;
     
     id savedSubviews;
     BOOL subviewsSetAside;
diff --git a/WebKit/WebView.subproj/WebView.m b/WebKit/WebView.subproj/WebView.m
index e21ecc8..56c5f79 100644
--- a/WebKit/WebView.subproj/WebView.m
+++ b/WebKit/WebView.subproj/WebView.m
@@ -1103,6 +1103,16 @@ NSString *_WebMainFrameURLKey =         @"mainFrameURL";
     _private->initiatedDrag = initiatedDrag;
 }
 
+- (void)_setWebKitDragRespondsToDragging:(BOOL)flag
+{
+    _private->doWebKitDragReponse = flag;
+}
+
+- (BOOL)_webKitDragRespondsToDragging
+{
+    return _private->doWebKitDragReponse;
+}
+
 @end
 
 
@@ -1227,6 +1237,7 @@ NSMutableDictionary *countInvocations;
 - (void)_commonInitializationWithFrameName:(NSString *)frameName groupName:(NSString *)groupName
 {
     _private->drawsBackground = YES;
+    _private->doWebKitDragReponse = YES;
 
     NSRect f = [self frame];
     WebFrameView *wv = [[WebFrameView alloc] initWithFrame: NSMakeRect(0,0,f.size.width,f.size.height)];
@@ -1723,6 +1734,7 @@ NS_ENDHANDLER
     }
     
     if (operation == NSDragOperationNone) {
+        // ??? this is bad, it is causing false exit events in WebCore
         [_private->draggingDocumentView draggingCancelledWithDraggingInfo:draggingInfo];
     }
     
diff --git a/WebKit/WebView.subproj/WebViewPrivate.h b/WebKit/WebView.subproj/WebViewPrivate.h
index 95816a0..1142427 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.h
+++ b/WebKit/WebView.subproj/WebViewPrivate.h
@@ -96,6 +96,7 @@ extern NSString *_WebMainFrameURLKey;
     BOOL drawsBackground;
     BOOL editable;
     BOOL initiatedDrag;
+    BOOL doWebKitDragReponse;   // should we do the built-in WebKit handling of incoming drags?
         
     NSString *mediaStyle;
     
@@ -280,6 +281,9 @@ Could be worth adding to the API.
 - (void)_writeImageElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
 - (void)_writeLinkElement:(NSDictionary *)element withPasteboardTypes:(NSArray *)types toPasteboard:(NSPasteboard *)pasteboard;
 
+- (void)_setWebKitDragRespondsToDragging:(BOOL)flag;
+- (BOOL)_webKitDragRespondsToDragging;
+
 @end
 
 @interface WebView (WebViewPrintingPrivate)

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list