Backed out changeset 11421fcb32b5 (bug 1162050)

This commit is contained in:
Carsten "Tomcat" Book 2016-07-11 11:18:46 +02:00
Родитель 287942807f
Коммит 9bcbd8cb61
1 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -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;