Closed Bug 68058 Opened 25 years ago Closed 25 years ago

Dropping dragged webpage text yields "null"

Categories

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

defect

Tracking

()

VERIFIED FIXED
mozilla0.9.1

People

(Reporter: tarahim, Assigned: bugzilla)

References

Details

(Keywords: regression, Whiteboard: [br])

Attachments

(3 files)

DnD of a link to text area of this bugzilla form is broken. DnD from Mail message to another window is broken. DnD withing textarea of this bugzilla form is broken. 20010207008 MTrunk.
This is the result of Ben's d&d api changes. -> ben
Assignee: vishy → ben
OS: Mac System 9.x → All
Hardware: Macintosh → All
Summary: Drag and Drop of URL broken again. → URLs cannot be dropped anywhere
this regression causes failure of about half the D&D testcases <http://www.mozilla.org/quality/browser/front-end/testplans/browser-drag-and-drop.html>. If we can get a fix for 0.8 that would totally rock
Whiteboard: critical for 0.8
QA Contact: sairuh → tpreston
*** Bug 68295 has been marked as a duplicate of this bug. ***
*** Bug 68295 has been marked as a duplicate of this bug. ***
What's the deal here? Are we waiting on Ben? This is a 0.8 bug so we should try and get moving on it. I'd hate to lose traction after the 0.8 branch is cut.
Hmm.. first time I tried to drag static text to a editfield here the textfield's value just changed to "null", then I couldn't drag and drop at all.
Yes, more is broken. Editors within pages aren't accepting drags, and some drop data is null.
Summary: URLs cannot be dropped anywhere → Most URL and text d&d is broken
r=blizzard
I don't see alecf around, but I think I understand enough to say r/sr=brendan@mozilla.org. Get an r= on that final patch (blizzard may be willing to supply it again), and then get this fix in and move any remaining problems into 0.9 bug(s). Thanks, /be
This patch does not fix the problem on Windows, which doesn't even let you drop links into textfields anywhere. But I believe that might be an editor problem. Joe or Kathy, could you shed some light here? And drags of webpage text to the url bar still yields 'null' with this patch applied, which is probably an xpapps problem...
Backing out Ben's dnd lib and corresponding call site patches has yielded the following: * Ben's changes caused the problem that the url bar doesn't let you drop links * Ben's changes caused the problem that dropping text in the url bar yields 'null' * Ben's changes did NOT cause the problem that textfields aren't accepting drags of content from the same page However, when I got rid of the following check: if (aDragSession.sourceDocument == window._content.document) aDragSession.canDrop = false; (which is supposed to prevent dropping content dragged from a page into the same page, although that never prevented textfield dropping in the past) with Ben's changes applied, dropping into textfields on the same page still didn't work...whereas when I got rid of it after backing out Ben, dropping into textfields *did* work. It's being hit in both cases. brade's recent changes to nsTextEditorDragListener::DragOver() seemed to have no effect in any case. In all cases, if ( flavorSupported ) { dragSession->SetCanDrop(PR_TRUE); was hit (the flavor was supported).
I have confirmed that the problem with editors not accepting link and text drops was caused by Joe's fix for bug 66290. Filed bug 68457 for that issue. This bug remains open for text drags to the url bar resulting in 'null', and another xpapps problem about dropping urls resulting in link text instead of url (which Ben sees, but I don't, since dropping urls seems to be broken on Windows as mentioned above).
Eeek...or maybe not. With both Ben and Joe's changes backed out, everything worked fine. When I reinstated Ben's dnd changes, it all didn't work again...Maybe I was smoking something earlier. Ben, it looks like this is all you. Please try it on your Windows box.
Ben and I have a fix in hand for most of this stuff. I'm still investigating why dropping into gfx textfields gives 'null' on Windows only. We will not be fixing the inability to drop content from a page into a textfield on the same page for .8. r=timeless sr=ben
OK, let's get this into the branch. a=asa.
All that we plan on fixing for .8 has been checked in. I'd still like to find why dropping plain text is 'null' on Windows, but I'll leave this off the radar until I do. I stepped through, and it certainly seems like everything is being passed correctly. Part of the fix involved commenting out places where we set the drag action to DRAGDROP_ACTION_LINK, which becomes DROPEFFECT_LINK (http://msdn.microsoft.com/library/psdk/com/oen_a2z_7nsk.htm). For some reason, passing DROPEFFECT_LINK directly into ::DoDragDrop (see http://msdn.microsoft.com/library/psdk/com/ofn_a2o_706o.htm and http://lxr.mozilla.org/seamonkey/source/widget/src/windows/nsDragService.cpp#144 ) is providing the wrong cursor feedback on Windows, and disallowing the drop. Unless this is a problem on Windows' end, we'll need pink's masterful expertise here, but I guess that can be another bug.
Keywords: mozilla0.8
OS: All → Windows 2000
Hardware: All → PC
Summary: Most URL and text d&d is broken → Dropping dragged webpage text yields "null" on Windows
Whiteboard: critical for 0.8
This is still broken in 2001021204 Mac build.
I have a simple fix for this on Macintosh (which should probably be applied elsewhere). Ben--can you review it and get someone else to sr= it (or vice versa). Does this fix the problem on Windows too? Index: mozilla/xpfe/communicator/resources/content/contentAreaDD.js =================================================================== RCS file: /cvsroot/mozilla/xpfe/communicator/resources/content/contentAreaDD.js,v retrieving revision 1.9 diff -c -2 -r1.9 contentAreaDD.js *** contentAreaDD.js 2001/02/05 07:42:40 1.9 --- contentAreaDD.js 2001/02/12 17:23:38 *************** *** 140,143 **** --- 140,146 ---- onDragOver: function (aEvent, aFlavour, aDragSession) { + if (aEvent.getPreventDefault()) + return; + // if the drag originated w/in this content area, bail early. This avoids loading // a URL dragged from the content area into the very same content area (which is
Depends on: 68507
*** Bug 68896 has been marked as a duplicate of this bug. ***
So are any of the attached patches usable for the trunk too? Nominating for mozilla 0.9
Keywords: mozilla0.9
Adding patch keyword. It's three lines - let's get it checked in. Gerv
Keywords: patch
Keywords: approval, review
Since it has not been checked into trunk builds, changing OS and Platform to All/All
OS: Windows 2000 → All
Hardware: PC → All
Summary: Dropping dragged webpage text yields "null" on Windows → Dropping dragged webpage text yields "null"
Looks good, fixes the case where links can't be dropped into textfields on the same pages (still seeing null problem). r=blake
Kathy explained this one to me on IRC. a=ben@netscape.com
Marking nsbeta1+, p1, mozilla0.9. Kathy, if you can, check your patch in, please! Can someone tell what's left to fix in this bug?
Keywords: nsbeta1 → nsbeta1+
Priority: -- → P1
Target Milestone: --- → mozilla0.9
You still can not drag text of the body into textarea of this form in 030911 build.
brade: ping :-) Gerv
Guys, stop bothering brade, I checked in her fix awhile ago :-) (sorry, should have mentioned that)
Assignee: ben → blakeross
Component: XP Apps → XP Apps: Drag and Drop
Keywords: approval, patch, review
Was that after hiratu reported his problem, or has he seen another bug? Gerv
Currently in 2001032418 build, selected text in the body can not be dragged at all.
Seems like fixed by bug 68707. I can confirm it fixed in 2001041704 build.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: x for Mac D&D pr
The problem mentioned in the summary of this bug isn't fixed.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Interestingly, if there is a link in a text line, the link is dropped whether the dragged text contains the link or not.
Target Milestone: mozilla0.9 → mozilla0.9.1
Terri, can you give me a more narrow idea of when this started occurring? We know it was sometime around 2/9 or before. Can anyone confirm that this does/doesn't happen on all platforms? Due to some investigation ben and I did (that seemed to show that we're confusing text/x- moz-url and text/html somewhere along the line), I think this sucker is pink's...
Keywords: mozilla0.9
pink, somewhere past xpapps we appear to be misinterpreting the flavor. If I don't add the data for text/x-moz-url, this works perfectly. If I leave it in, the dragged text is suddenly text/x-moz-url (or it's still the correct flavor, but we're incorrectly using the data provided for text/x-moz-url). This explains why what we're dropping isn't actually just "null", but "null" \n [selection]. Ben reports seeing similar oddities elsewhere, so passing to you.
Assignee: blakeross → pinkerton
Status: REOPENED → NEW
Well, a(n apparently incorrect) newsgroup post led me to this minor revelation today: whichever flavour we add first in onDragStart is the flavour that it's interpreted as later on. This seems to be an xpapps problem after all; Ben checked in his nsDragAndDrop api changes on February 4th, and this was reported on February 7th. -> Ben (I'm glad it took me three months to rediscover that this part of the bug belongs to Ben, considering I told myself that on 2/10)
Assignee: pinkerton → ben
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Given that this is a regression and affects many areas of d&d, I'd prefer to see this get fixed for 0.9.1. The fix is easy anyways, and I'll probably get to it within this week.
Whiteboard: x for Mac D&D pr → [br]
Target Milestone: mozilla0.9.2 → mozilla0.9.1
DND of links broke down in 2001050904 trunk for Mac again. Links are not draggable to another window or into textarea of a form like this one.
Taking.
Assignee: ben → blakeross
Status: NEW → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Fix checked in.
Verified mac build 2001053009 Verified w98 build 2001053004 Verified linux build 2001053008 (Can't drag to Instant Messanger, will open new bug on that0
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: