Bug 421817, remove dragstart, drag and dragleave events for 1.9, they'll be back in a later release, r=jonas, sr=jst, a=beltzner

This commit is contained in:
enndeakin@sympatico.ca 2008-03-21 15:47:13 -07:00
parent 7e0743d764
commit 729513dc36
8 changed files with 11 additions and 82 deletions

View File

@ -410,13 +410,10 @@ nsContentUtils::InitializeEventTable() {
{ &nsGkAtoms::ondragenter, { NS_DRAGDROP_ENTER, EventNameType_XUL }},
{ &nsGkAtoms::ondragover, { NS_DRAGDROP_OVER_SYNTH, EventNameType_XUL }},
{ &nsGkAtoms::ondragexit, { NS_DRAGDROP_EXIT_SYNTH, EventNameType_XUL }},
{ &nsGkAtoms::ondragdrop, { NS_DRAGDROP_DRAGDROP, EventNameType_XUL }},
{ &nsGkAtoms::ondragdrop, { NS_DRAGDROP_DROP, EventNameType_XUL }},
{ &nsGkAtoms::ondraggesture, { NS_DRAGDROP_GESTURE, EventNameType_XUL }},
{ &nsGkAtoms::ondrag, { NS_DRAGDROP_DRAG, EventNameType_XUL }},
{ &nsGkAtoms::ondragend, { NS_DRAGDROP_END, EventNameType_XUL }},
{ &nsGkAtoms::ondragstart, { NS_DRAGDROP_START, EventNameType_XUL }},
{ &nsGkAtoms::ondragleave, { NS_DRAGDROP_LEAVE_SYNTH, EventNameType_XUL }},
{ &nsGkAtoms::ondrop, { NS_DRAGDROP_DROP, EventNameType_XUL }},
{ &nsGkAtoms::onoverflow, { NS_SCROLLPORT_OVERFLOW, EventNameType_XUL }},
{ &nsGkAtoms::onunderflow, { NS_SCROLLPORT_UNDERFLOW, EventNameType_XUL }}
#ifdef MOZ_SVG

View File

@ -290,11 +290,8 @@ GK_ATOM(dragevent, "dragevent")
GK_ATOM(dragexit, "dragexit")
GK_ATOM(draggesture, "draggesture")
GK_ATOM(dragging, "dragging")
GK_ATOM(dragleave, "dragleave")
GK_ATOM(dragover, "dragover")
GK_ATOM(dragSession, "dragSession")
GK_ATOM(dragstart, "dragstart")
GK_ATOM(drop, "drop")
GK_ATOM(dropAfter, "dropAfter")
GK_ATOM(dropBefore, "dropBefore")
GK_ATOM(dropOn, "dropOn")

View File

@ -64,7 +64,7 @@ static const char* const sEventNames[] = {
"compositionstart", "compositionend", "popupshowing", "popupshown",
"popuphiding", "popuphidden", "close", "command", "broadcast", "commandupdate",
"dragenter", "dragover", "dragexit", "dragdrop", "draggesture",
"drag", "dragend", "dragstart", "dragleave", "drop", "resize",
"drag", "dragend", "resize",
"scroll", "overflow", "underflow", "overflowchanged",
"DOMSubtreeModified", "DOMNodeInserted", "DOMNodeRemoved",
"DOMNodeRemovedFromDocument", "DOMNodeInsertedIntoDocument",
@ -1259,7 +1259,7 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
return sEventNames[eDOMEvents_dragover];
case NS_DRAGDROP_EXIT_SYNTH:
return sEventNames[eDOMEvents_dragexit];
case NS_DRAGDROP_DRAGDROP:
case NS_DRAGDROP_DROP:
return sEventNames[eDOMEvents_dragdrop];
case NS_DRAGDROP_GESTURE:
return sEventNames[eDOMEvents_draggesture];
@ -1267,12 +1267,6 @@ const char* nsDOMEvent::GetEventName(PRUint32 aEventType)
return sEventNames[eDOMEvents_drag];
case NS_DRAGDROP_END:
return sEventNames[eDOMEvents_dragend];
case NS_DRAGDROP_START:
return sEventNames[eDOMEvents_dragstart];
case NS_DRAGDROP_LEAVE_SYNTH:
return sEventNames[eDOMEvents_dragleave];
case NS_DRAGDROP_DROP:
return sEventNames[eDOMEvents_drop];
case NS_SCROLLPORT_OVERFLOW:
return sEventNames[eDOMEvents_overflow];
case NS_SCROLLPORT_UNDERFLOW:

View File

@ -103,9 +103,6 @@ public:
eDOMEvents_draggesture,
eDOMEvents_drag,
eDOMEvents_dragend,
eDOMEvents_dragstart,
eDOMEvents_dragleave,
eDOMEvents_drop,
eDOMEvents_resize,
eDOMEvents_scroll,
eDOMEvents_overflow,

View File

@ -266,13 +266,10 @@ static const EventDispatchData sDragEvents[] = {
{ NS_DRAGDROP_ENTER, HANDLER(&nsIDOMDragListener::DragEnter) },
{ NS_DRAGDROP_OVER_SYNTH, HANDLER(&nsIDOMDragListener::DragOver) },
{ NS_DRAGDROP_EXIT_SYNTH, HANDLER(&nsIDOMDragListener::DragExit) },
{ NS_DRAGDROP_DRAGDROP, HANDLER(&nsIDOMDragListener::DragDrop) },
{ NS_DRAGDROP_DROP, HANDLER(&nsIDOMDragListener::DragDrop) },
{ NS_DRAGDROP_GESTURE, HANDLER(&nsIDOMDragListener::DragGesture) },
{ NS_DRAGDROP_DRAG, HANDLER(&nsIDOMDragListener::Drag) },
{ NS_DRAGDROP_END, HANDLER(&nsIDOMDragListener::DragEnd) },
{ NS_DRAGDROP_START, HANDLER(&nsIDOMDragListener::DragStart) },
{ NS_DRAGDROP_LEAVE_SYNTH, HANDLER(&nsIDOMDragListener::DragLeave) },
{ NS_DRAGDROP_DROP, HANDLER(&nsIDOMDragListener::Drop) },
{ NS_DRAGDROP_END, HANDLER(&nsIDOMDragListener::DragEnd) }
};
static const EventDispatchData sXULEvents[] = {

View File

@ -1947,10 +1947,6 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
nsCOMPtr<nsIWidget> widget = mCurrentTarget->GetWindow();
// get the widget from the target frame
nsMouseEvent startEvent(NS_IS_TRUSTED_EVENT(aEvent), NS_DRAGDROP_START,
widget, nsMouseEvent::eReal);
FillInEventFromGestureDown(&startEvent);
nsMouseEvent gestureEvent(NS_IS_TRUSTED_EVENT(aEvent), NS_DRAGDROP_GESTURE,
widget, nsMouseEvent::eReal);
FillInEventFromGestureDown(&gestureEvent);
@ -1970,16 +1966,10 @@ nsEventStateManager::GenerateDragGesture(nsPresContext* aPresContext,
// Set the current target to the content for the mouse down
mCurrentTargetContent = targetContent;
// Dispatch both the dragstart and draggesture events to the DOM
// Dispatch the draggesture event to the DOM
nsEventStatus status = nsEventStatus_eIgnore;
nsEventDispatcher::Dispatch(targetContent, aPresContext, &startEvent, nsnull,
&status);
if (status != nsEventStatus_eConsumeNoDefault) {
status = nsEventStatus_eIgnore;
nsEventDispatcher::Dispatch(targetContent, aPresContext, &gestureEvent, nsnull,
&status);
}
// Note that frame event handling doesn't care about NS_DRAGDROP_GESTURE,
// which is just as well since we don't really know which frame to
@ -2518,34 +2508,6 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
break;
case NS_DRAGDROP_DROP:
{
// now fire the dragdrop event, for compatibility with XUL
if (mCurrentTarget) {
nsCOMPtr<nsIContent> targetContent;
mCurrentTarget->GetContentForEvent(presContext, aEvent,
getter_AddRefs(targetContent));
nsCOMPtr<nsIWidget> widget = mCurrentTarget->GetWindow();
nsMouseEvent event(NS_IS_TRUSTED_EVENT(aEvent), NS_DRAGDROP_DRAGDROP,
widget, nsMouseEvent::eReal);
nsMouseEvent* mouseEvent = static_cast<nsMouseEvent*>(aEvent);
event.refPoint = mouseEvent->refPoint;
event.isShift = mouseEvent->isShift;
event.isControl = mouseEvent->isControl;
event.isAlt = mouseEvent->isAlt;
event.isMeta = mouseEvent->isMeta;
nsEventStatus status = nsEventStatus_eIgnore;
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
if (presShell) {
presShell->HandleEventWithTarget(&event, mCurrentTarget,
targetContent, &status);
}
}
// fall through and call GenerateDragDropEnterExit
}
case NS_DRAGDROP_EXIT:
// clean up after ourselves. make sure we do this _after_ the event, else we'll
// clean up too early!
@ -3182,8 +3144,6 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
//The frame has changed but the content may not have. Check before dispatching to content
mLastDragOverFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
FireDragEnterOrExit(aPresContext, aEvent, NS_DRAGDROP_LEAVE_SYNTH,
targetContent, lastContent, mLastDragOverFrame);
FireDragEnterOrExit(aPresContext, aEvent, NS_DRAGDROP_EXIT_SYNTH,
targetContent, lastContent, mLastDragOverFrame);
}
@ -3204,8 +3164,6 @@ nsEventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
nsCOMPtr<nsIContent> lastContent;
mLastDragOverFrame->GetContentForEvent(aPresContext, aEvent, getter_AddRefs(lastContent));
FireDragEnterOrExit(aPresContext, aEvent, NS_DRAGDROP_LEAVE_SYNTH,
nsnull, lastContent, mLastDragOverFrame);
FireDragEnterOrExit(aPresContext, aEvent, NS_DRAGDROP_EXIT_SYNTH,
nsnull, lastContent, mLastDragOverFrame);

View File

@ -44,14 +44,11 @@
/*
* The listener for drag events.
*
* The reason for two events for the same operation are for compatibility
* between the WHAT-WG drag and drop spec and existing XUL code.
*/
#define NS_IDOMDRAGLISTENER_IID \
{ /* 1A107271-1E26-419A-BCF1-0A4CF7A66B45 */ \
0x1a107271, 0x1e26, 0x419a, \
{0xbc, 0xf1, 0x0a, 0x4c, 0xf7, 0xa6, 0x6b, 0x45} }
{ /* CD5186C4-228F-4413-AFD9-B65DAA105714 */ \
0xcd5186c4, 0x228f, 0x4413, \
{0xaf, 0xd9, 0xb6, 0x5d, 0xaa, 0x10, 0x57, 0x14} }
@ -132,11 +129,6 @@ public:
* @returns whether the event was consumed or ignored. @see nsresult
*/
NS_IMETHOD Drag(nsIDOMEvent* aMouseEvent) = 0;
// these methods are for compatibility
NS_IMETHOD DragStart(nsIDOMEvent* aMouseEvent) { return NS_OK; }
NS_IMETHOD DragLeave(nsIDOMEvent* aMouseEvent) { return NS_OK; }
NS_IMETHOD Drop(nsIDOMEvent* aMouseEvent) { return NS_OK; }
};
NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMDragListener, NS_IDOMDRAGLISTENER_IID)

View File

@ -249,15 +249,12 @@ class nsHashKey;
#define NS_DRAGDROP_ENTER (NS_DRAGDROP_EVENT_START)
#define NS_DRAGDROP_OVER (NS_DRAGDROP_EVENT_START + 1)
#define NS_DRAGDROP_EXIT (NS_DRAGDROP_EVENT_START + 2)
#define NS_DRAGDROP_DRAGDROP (NS_DRAGDROP_EVENT_START + 3)
#define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 3)
#define NS_DRAGDROP_GESTURE (NS_DRAGDROP_EVENT_START + 4)
#define NS_DRAGDROP_DRAG (NS_DRAGDROP_EVENT_START + 5)
#define NS_DRAGDROP_END (NS_DRAGDROP_EVENT_START + 6)
#define NS_DRAGDROP_START (NS_DRAGDROP_EVENT_START + 7)
#define NS_DRAGDROP_DROP (NS_DRAGDROP_EVENT_START + 8)
#define NS_DRAGDROP_OVER_SYNTH (NS_DRAGDROP_EVENT_START + 1)
#define NS_DRAGDROP_EXIT_SYNTH (NS_DRAGDROP_EVENT_START + 2)
#define NS_DRAGDROP_LEAVE_SYNTH (NS_DRAGDROP_EVENT_START + 9)
// Events for popups
#define NS_XUL_EVENT_START 1500