Bug 1893119: Part 3 - Add widget to nsContentUtils::GetDragSession r=gstoll,rkraesig

Updates each client of the nsContentUtils method to get the right drag session -- the one for the widget that is currently the source or target of the drag session.
The change to nsDOMWindowUtils::DispatchDOMEventViaPresShellForTesting() supports the change to WidgetDragEvent::InitDropEffectForTests() and enabled a
large number of test fixes in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D211067
This commit is contained in:
David P
2024-07-04 07:48:04 +00:00
parent 6755e73ac9
commit 805b8742ba
14 changed files with 73 additions and 21 deletions

View File

@@ -3305,7 +3305,8 @@ mozilla::ipc::IPCResult ContentChild::RecvEndDragSession(
nsCOMPtr<nsIDragService> dragService =
do_GetService("@mozilla.org/widget/dragservice;1");
if (dragService) {
nsCOMPtr<nsIDragSession> dragSession = nsContentUtils::GetDragSession();
nsCOMPtr<nsIDragSession> dragSession;
dragService->GetCurrentSession(getter_AddRefs(dragSession));
if (dragSession) {
if (aUserCancelled) {
dragSession->UserCancelled();