Bug 1918907: Don't clear drag session target BrowserChild on eDragLeave/eDragExit r=m_kato
The BrowserChild should only be cleared on EndDragSession, which is sent when the user finishes or cancels dragging. This is reciprocal to it being set in StartDragSession. The change to nsDragSessionProxy::EndDragSessionImpl is non-functional -- it highlights the BrowserChild symmetry above. Differential Revision: https://phabricator.services.mozilla.com/D222389
This commit is contained in:
@@ -1939,15 +1939,6 @@ mozilla::ipc::IPCResult BrowserChild::RecvRealDragEvent(
|
|||||||
}
|
}
|
||||||
|
|
||||||
DispatchWidgetEventViaAPZ(localEvent);
|
DispatchWidgetEventViaAPZ(localEvent);
|
||||||
|
|
||||||
if (aEvent.mMessage == eDragLeave || aEvent.mMessage == eDragExit) {
|
|
||||||
// If session is still active, remove its target.
|
|
||||||
dragSession = GetDragSession();
|
|
||||||
if (dragSession) {
|
|
||||||
static_cast<nsDragSessionProxy*>(dragSession.get())
|
|
||||||
->SetDragTarget(nullptr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return IPC_OK();
|
return IPC_OK();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -191,15 +191,6 @@ nsresult nsDragSessionProxy::EndDragSessionImpl(bool aDoneDrag,
|
|||||||
mSourceBrowser = nullptr;
|
mSourceBrowser = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mTargetBrowser) {
|
SetDragTarget(nullptr);
|
||||||
nsCOMPtr<BrowserChild> targetBC = do_QueryReferent(mTargetBrowser);
|
|
||||||
MOZ_ASSERT(targetBC);
|
|
||||||
[[maybe_unused]] RefPtr<nsIDragSession> session =
|
|
||||||
targetBC->GetDragSession();
|
|
||||||
MOZ_ASSERT(session == this);
|
|
||||||
targetBC->SetDragSession(nullptr);
|
|
||||||
mTargetBrowser = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user