Closed Bug 1918907 Opened 2 months ago Closed 2 months ago

Once a bookmark is dragging over itself or outside of browser window while dragging, it cannot be dropped into the content area.

Categories

(Core :: DOM: Copy & Paste and Drag & Drop, defect, P2)

Unspecified
All
defect

Tracking

()

VERIFIED FIXED
132 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox-esr128 131+ verified
firefox130 --- wontfix
firefox131 + verified
firefox132 + verified

People

(Reporter: alice0775, Assigned: handyman)

References

(Regression)

Details

(Keywords: nightly-community, regression, ux-consistency)

Attachments

(3 files)

Reproduced on Firefox128.3ESR(20240913150006) and Nightly132.0a1(20240914211959) Windows11 and Ubuntu22.04.

Steps to reproduce:

  1. Start Firefox with normal sizemode
  2. Drag start a bookmark on the bookmarks toolbar.
  3. Drag over itself or outside of browser window
  4. Then drop it into contentarea

Actual results:
Cannot drop.
Screencast: https://youtu.be/H0Vz0z_kOM0

The following error appears when the bug occurs.

TypeError: can't access property "types", dataTransfer is null 75 ContentAreaDropListener.sys.mjs:235:17
    canDropLink resource://gre/modules/ContentAreaDropListener.sys.mjs:235

Expected results:
Can drop

Regression window:
https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=9ac7f1f672d585d3a66062be012715bfafbb1e4d&tochange=01bfc9faa69043308206f123a4f171b426aa2758

:handyman, since you are the author of the regressor, bug 1893119, could you take a look? Also, could you set the severity field?

For more information, please visit BugBot documentation.

Flags: needinfo?(davidp99)

Also, if you pass over a toolbutton while dragging a local file, you will not be able to drop the file into the contentarea.

STR:

  1. Drag start a local file from file explorer
  2. Drag over on the toolbuttons such as reload button and magnifying glass in the location bar.
  3. Try drop it onto contentarea

Screencast: https://youtu.be/YkInQknWmos

[Tracking Requested - why for this release]: Drag and drop stops working in some case.

Pls backed out the offending patch from 128.3ESR if not fix this bug.

Backing out the regressing change isn't practical at this point due to a large number of dependent changes which landed on top of it.

It looks like the content process is (properly) releasing its drag session when the drag leaves the content region, but the parent process doesn't stop "tracking" the content drag session because, from its perspective, the content and the drag source bookmark are part of the same widget. Therefore, when the drag returns to the widget, the parent believes content already has a drag session (nsBaseDragSession::MaybeAddBrowser returns false), so it doesn't create one, which is wrong. nsContentUtils::SetDataTransferInEvent then cannot create a DT, and the error results.

My first thought is that the parent should stop tracking the content drag session when the drag leaves content (i.e. when content calls EndDragSession). Right now, that stuff is aligned by the belief that the processes are synchronized by the behavior, but we may actually need to synchronize here (like, by sending an IPDL message when EndDragSession runs in content).

Assignee: nobody → davidp99
Flags: needinfo?(davidp99)

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.

This continues the old behavior (pre-bug 1893119) instead of doing something new and more complicated. This leaves the drag sessions alive (but dormant) when the drag exists their widget.

Duplicate of this bug: 1918883
Severity: -- → S3
Priority: -- → P2

The bug is marked as tracked for firefox131 (beta) and tracked for firefox132 (nightly). However, the bug still has low severity.

:hsinyi, could you please increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(htsai)
Severity: S3 → S2
Flags: needinfo?(htsai)

:m_kato do you think you could take a look at the attached patch? we have one beta left this cycle in order to land this

Flags: needinfo?(m_kato)
Flags: needinfo?(m_kato)

:gstoll do you think you can check if this is good to land now? I noticed handyman is on pto

Flags: needinfo?(gstoll)

Yes, I just queued it on Lando, sorry I missed this earlier!

Flags: needinfo?(gstoll)
Pushed by gstoll@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/6e042c75c31a Don't clear drag session target BrowserChild on eDragLeave/eDragExit r=m_kato

Thank you! Can you also set the nomination for beta/esr. It probably wont make b9 but I Can still uplift before RC week

Flags: needinfo?(gstoll)
Status: NEW → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 132 Branch

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.

Original Revision: https://phabricator.services.mozilla.com/D222389

Attachment #9426145 - Flags: approval-mozilla-esr128?

esr128 Uplift Approval Request

  • User impact if declined: drag and drop won't work when dragging in and out of windows
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: see STR in bug (and the duplicate bug)
  • Risk associated with taking this patch: medium
  • Explanation of risk level: changes drag and drop behavior which is notoriously finicky.
  • String changes made/needed: no
  • Is Android affected?: no
Flags: qe-verify+
Flags: needinfo?(gstoll)

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.

Original Revision: https://phabricator.services.mozilla.com/D222389

Attachment #9426148 - Flags: approval-mozilla-beta?

beta Uplift Approval Request

  • User impact if declined: drag and drop won't work when dragging in and out of windows
  • Code covered by automated testing: no
  • Fix verified in Nightly: no
  • Needs manual QE test: yes
  • Steps to reproduce for manual QE testing: see STR in bug (and the duplicate bug)
  • Risk associated with taking this patch: medium
  • Explanation of risk level: changes drag and drop behavior which is notoriously finicky.
  • String changes made/needed: no
  • Is Android affected?: no
Attachment #9426148 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attachment #9426145 - Flags: approval-mozilla-esr128? → approval-mozilla-esr128+
QA Whiteboard: [qa-triaged]

I was able to reproduce the issue on Win11x64 using Firefox build 132.0a1(20240914211959).
Verified as fixed on Win11x64/Ubuntu 24.04 using Firefox builds: 132.0a1(20240922213737).
Pending verification on 131.0 and 128.3.0.

Verified as fixed on Win11x64/Ubuntu 24.04 using Firefox builds 131.0 and 128.3.0esr.

Status: RESOLVED → VERIFIED
QA Whiteboard: [qa-triaged]
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: