зеркало из https://github.com/mozilla/gecko-dev.git
Bug 895274 part.82 Rename NS_DRAGDROP_ENTER to eDragEnter r=smaug
This commit is contained in:
Родитель
811d0fac7e
Коммит
a07c726a8f
|
@ -5507,8 +5507,7 @@ nsContentUtils::SetDataTransferInEvent(WidgetDragEvent* aDragEvent)
|
||||||
// for the dragenter and dragover events, initialize the drop effect
|
// for the dragenter and dragover events, initialize the drop effect
|
||||||
// from the drop action, which platform specific widget code sets before
|
// from the drop action, which platform specific widget code sets before
|
||||||
// the event is fired based on the keyboard state.
|
// the event is fired based on the keyboard state.
|
||||||
if (aDragEvent->mMessage == NS_DRAGDROP_ENTER ||
|
if (aDragEvent->mMessage == eDragEnter || aDragEvent->mMessage == eDragOver) {
|
||||||
aDragEvent->mMessage == eDragOver) {
|
|
||||||
uint32_t action, effectAllowed;
|
uint32_t action, effectAllowed;
|
||||||
dragSession->GetDragAction(&action);
|
dragSession->GetDragAction(&action);
|
||||||
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
|
aDragEvent->dataTransfer->GetEffectAllowedInt(&effectAllowed);
|
||||||
|
|
|
@ -187,7 +187,7 @@ EVENT(dragend,
|
||||||
EventNameType_HTMLXUL,
|
EventNameType_HTMLXUL,
|
||||||
eDragEventClass)
|
eDragEventClass)
|
||||||
EVENT(dragenter,
|
EVENT(dragenter,
|
||||||
NS_DRAGDROP_ENTER,
|
eDragEnter,
|
||||||
EventNameType_HTMLXUL,
|
EventNameType_HTMLXUL,
|
||||||
eDragEventClass)
|
eDragEventClass)
|
||||||
EVENT(dragleave,
|
EVENT(dragleave,
|
||||||
|
|
|
@ -3171,7 +3171,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NS_DRAGDROP_ENTER:
|
case eDragEnter:
|
||||||
case eDragOver:
|
case eDragOver:
|
||||||
{
|
{
|
||||||
NS_ASSERTION(aEvent->mClass == eDragEventClass, "Expected a drag event");
|
NS_ASSERTION(aEvent->mClass == eDragEventClass, "Expected a drag event");
|
||||||
|
@ -4320,7 +4320,7 @@ EventStateManager::GenerateDragDropEnterExit(nsPresContext* aPresContext,
|
||||||
targetContent, lastContent, sLastDragOverFrame);
|
targetContent, lastContent, sLastDragOverFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
FireDragEnterOrExit(aPresContext, aDragEvent, NS_DRAGDROP_ENTER,
|
FireDragEnterOrExit(aPresContext, aDragEvent, eDragEnter,
|
||||||
lastContent, targetContent, mCurrentTarget);
|
lastContent, targetContent, mCurrentTarget);
|
||||||
|
|
||||||
if (sLastDragOverFrame) {
|
if (sLastDragOverFrame) {
|
||||||
|
@ -4395,15 +4395,14 @@ EventStateManager::FireDragEnterOrExit(nsPresContext* aPresContext,
|
||||||
// adjust the drag hover if the dragenter event was cancelled or this is a drag exit
|
// adjust the drag hover if the dragenter event was cancelled or this is a drag exit
|
||||||
if (status == nsEventStatus_eConsumeNoDefault ||
|
if (status == nsEventStatus_eConsumeNoDefault ||
|
||||||
aMessage == NS_DRAGDROP_EXIT) {
|
aMessage == NS_DRAGDROP_EXIT) {
|
||||||
SetContentState((aMessage == NS_DRAGDROP_ENTER) ?
|
SetContentState((aMessage == eDragEnter) ? aTargetContent : nullptr,
|
||||||
aTargetContent : nullptr,
|
|
||||||
NS_EVENT_STATE_DRAGOVER);
|
NS_EVENT_STATE_DRAGOVER);
|
||||||
}
|
}
|
||||||
|
|
||||||
// collect any changes to moz cursor settings stored in the event's
|
// collect any changes to moz cursor settings stored in the event's
|
||||||
// data transfer.
|
// data transfer.
|
||||||
if (aMessage == eDragLeave || aMessage == NS_DRAGDROP_EXIT ||
|
if (aMessage == eDragLeave || aMessage == NS_DRAGDROP_EXIT ||
|
||||||
aMessage == NS_DRAGDROP_ENTER) {
|
aMessage == eDragEnter) {
|
||||||
UpdateDragDataTransfer(&event);
|
UpdateDragDataTransfer(&event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1749,8 +1749,7 @@ nsPluginInstanceOwner::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
if (dragEvent && mInstance) {
|
if (dragEvent && mInstance) {
|
||||||
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
|
WidgetEvent* ievent = aEvent->GetInternalNSEvent();
|
||||||
if (ievent && ievent->mFlags.mIsTrusted &&
|
if (ievent && ievent->mFlags.mIsTrusted &&
|
||||||
ievent->mMessage != NS_DRAGDROP_ENTER &&
|
ievent->mMessage != eDragEnter && ievent->mMessage != eDragOver) {
|
||||||
ievent->mMessage != eDragOver) {
|
|
||||||
aEvent->PreventDefault();
|
aEvent->PreventDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -371,7 +371,7 @@ nsEditorEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
||||||
// you don't need to check if the QI succeeded before each call.
|
// you don't need to check if the QI succeeded before each call.
|
||||||
switch (internalEvent->mMessage) {
|
switch (internalEvent->mMessage) {
|
||||||
// dragenter
|
// dragenter
|
||||||
case NS_DRAGDROP_ENTER: {
|
case eDragEnter: {
|
||||||
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
nsCOMPtr<nsIDOMDragEvent> dragEvent = do_QueryInterface(aEvent);
|
||||||
return DragEnter(dragEvent);
|
return DragEnter(dragEvent);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2581,7 +2581,7 @@ nsTreeBodyFrame::HandleEvent(nsPresContext* aPresContext,
|
||||||
InvalidateRow(mMouseOverRow);
|
InvalidateRow(mMouseOverRow);
|
||||||
mMouseOverRow = -1;
|
mMouseOverRow = -1;
|
||||||
}
|
}
|
||||||
} else if (aEvent->mMessage == NS_DRAGDROP_ENTER) {
|
} else if (aEvent->mMessage == eDragEnter) {
|
||||||
if (!mSlots)
|
if (!mSlots)
|
||||||
mSlots = new Slots();
|
mSlots = new Slots();
|
||||||
|
|
||||||
|
|
|
@ -102,7 +102,7 @@ NS_EVENT_MESSAGE(eFocus, eFocusEventFirst)
|
||||||
NS_EVENT_MESSAGE(eBlur, eFocusEventFirst + 1)
|
NS_EVENT_MESSAGE(eBlur, eFocusEventFirst + 1)
|
||||||
|
|
||||||
NS_EVENT_MESSAGE(eDragDropEventFirst, 1400)
|
NS_EVENT_MESSAGE(eDragDropEventFirst, 1400)
|
||||||
NS_EVENT_MESSAGE(NS_DRAGDROP_ENTER, eDragDropEventFirst)
|
NS_EVENT_MESSAGE(eDragEnter, eDragDropEventFirst)
|
||||||
NS_EVENT_MESSAGE(eDragOver, eDragDropEventFirst + 1)
|
NS_EVENT_MESSAGE(eDragOver, eDragDropEventFirst + 1)
|
||||||
NS_EVENT_MESSAGE(NS_DRAGDROP_EXIT, eDragDropEventFirst + 2)
|
NS_EVENT_MESSAGE(NS_DRAGDROP_EXIT, eDragDropEventFirst + 2)
|
||||||
NS_EVENT_MESSAGE(NS_DRAGDROP_DRAGDROP, eDragDropEventFirst + 3)
|
NS_EVENT_MESSAGE(NS_DRAGDROP_DRAGDROP, eDragDropEventFirst + 3)
|
||||||
|
|
|
@ -99,7 +99,7 @@ bool
|
||||||
WidgetEvent::HasDragEventMessage() const
|
WidgetEvent::HasDragEventMessage() const
|
||||||
{
|
{
|
||||||
switch (mMessage) {
|
switch (mMessage) {
|
||||||
case NS_DRAGDROP_ENTER:
|
case eDragEnter:
|
||||||
case eDragOver:
|
case eDragOver:
|
||||||
case NS_DRAGDROP_EXIT:
|
case NS_DRAGDROP_EXIT:
|
||||||
case NS_DRAGDROP_DRAGDROP:
|
case NS_DRAGDROP_DRAGDROP:
|
||||||
|
|
|
@ -5735,8 +5735,9 @@ PanGestureTypeForEvent(NSEvent* aEvent)
|
||||||
return NSDragOperationNone;
|
return NSDragOperationNone;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aMessage == NS_DRAGDROP_ENTER)
|
if (aMessage == eDragEnter) {
|
||||||
mDragService->StartDragSession();
|
mDragService->StartDragSession();
|
||||||
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIDragSession> dragSession;
|
nsCOMPtr<nsIDragSession> dragSession;
|
||||||
mDragService->GetCurrentSession(getter_AddRefs(dragSession));
|
mDragService->GetCurrentSession(getter_AddRefs(dragSession));
|
||||||
|
@ -5792,7 +5793,7 @@ PanGestureTypeForEvent(NSEvent* aEvent)
|
||||||
|
|
||||||
if (dragSession) {
|
if (dragSession) {
|
||||||
switch (aMessage) {
|
switch (aMessage) {
|
||||||
case NS_DRAGDROP_ENTER:
|
case eDragEnter:
|
||||||
case eDragOver: {
|
case eDragOver: {
|
||||||
uint32_t dragAction;
|
uint32_t dragAction;
|
||||||
dragSession->GetDragAction(&dragAction);
|
dragSession->GetDragAction(&dragAction);
|
||||||
|
@ -5847,7 +5848,7 @@ PanGestureTypeForEvent(NSEvent* aEvent)
|
||||||
globalDragPboard =
|
globalDragPboard =
|
||||||
[[NSPasteboardWrapper alloc] initWithPasteboard:[sender draggingPasteboard]];
|
[[NSPasteboardWrapper alloc] initWithPasteboard:[sender draggingPasteboard]];
|
||||||
|
|
||||||
return [self doDragAction:NS_DRAGDROP_ENTER sender:sender];
|
return [self doDragAction:eDragEnter sender:sender];
|
||||||
|
|
||||||
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSDragOperationNone);
|
NS_OBJC_END_TRY_ABORT_BLOCK_RETURN(NSDragOperationNone);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2634,7 +2634,7 @@ case _value: eventName.AssignLiteral(_name) ; break
|
||||||
_ASSIGN_eventName(eBlur,"eBlur");
|
_ASSIGN_eventName(eBlur,"eBlur");
|
||||||
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
|
_ASSIGN_eventName(NS_DRAGDROP_GESTURE,"NS_DND_GESTURE");
|
||||||
_ASSIGN_eventName(eDrop,"eDrop");
|
_ASSIGN_eventName(eDrop,"eDrop");
|
||||||
_ASSIGN_eventName(NS_DRAGDROP_ENTER,"NS_DND_ENTER");
|
_ASSIGN_eventName(eDragEnter,"eDragEnter");
|
||||||
_ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
|
_ASSIGN_eventName(NS_DRAGDROP_EXIT,"NS_DND_EXIT");
|
||||||
_ASSIGN_eventName(eDragOver,"eDragOver");
|
_ASSIGN_eventName(eDragOver,"eDragOver");
|
||||||
_ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT");
|
_ASSIGN_eventName(NS_EDITOR_INPUT,"NS_EDITOR_INPUT");
|
||||||
|
|
|
@ -295,7 +295,7 @@ nsNativeDragTarget::DragEnter(LPDATAOBJECT pIDataSource,
|
||||||
winDragService->SetIDataObject(pIDataSource);
|
winDragService->SetIDataObject(pIDataSource);
|
||||||
|
|
||||||
// Now process the native drag state and then dispatch the event
|
// Now process the native drag state and then dispatch the event
|
||||||
ProcessDrag(NS_DRAGDROP_ENTER, grfKeyState, ptl, pdwEffect);
|
ProcessDrag(eDragEnter, grfKeyState, ptl, pdwEffect);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче