зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 11421fcb32b5 (bug 1162050)
This commit is contained in:
Родитель
287942807f
Коммит
9bcbd8cb61
|
@ -3432,6 +3432,32 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
|
|||
|
||||
case eDrop:
|
||||
{
|
||||
// now fire the dragdrop event, for compatibility with XUL
|
||||
if (mCurrentTarget && nsEventStatus_eConsumeNoDefault != *aStatus) {
|
||||
nsCOMPtr<nsIContent> targetContent;
|
||||
mCurrentTarget->GetContentForEvent(aEvent,
|
||||
getter_AddRefs(targetContent));
|
||||
|
||||
nsCOMPtr<nsIWidget> widget = mCurrentTarget->GetNearestWidget();
|
||||
WidgetDragEvent event(aEvent->IsTrusted(), eLegacyDragDrop, widget);
|
||||
|
||||
WidgetMouseEvent* mouseEvent = aEvent->AsMouseEvent();
|
||||
event.mRefPoint = mouseEvent->mRefPoint;
|
||||
if (mouseEvent->mWidget) {
|
||||
event.mRefPoint += mouseEvent->mWidget->WidgetToScreenOffset();
|
||||
}
|
||||
event.mRefPoint -= widget->WidgetToScreenOffset();
|
||||
event.mModifiers = mouseEvent->mModifiers;
|
||||
event.buttons = mouseEvent->buttons;
|
||||
event.inputSource = mouseEvent->inputSource;
|
||||
|
||||
nsEventStatus status = nsEventStatus_eIgnore;
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
presShell->HandleEventWithTarget(&event, mCurrentTarget,
|
||||
targetContent, &status);
|
||||
}
|
||||
}
|
||||
sLastDragOverFrame = nullptr;
|
||||
ClearGlobalActiveContent(this);
|
||||
break;
|
||||
|
|
Загрузка…
Ссылка в новой задаче