Closed Bug 45605 Opened 24 years ago Closed 23 years ago

Embedding Drag + Drop support

Categories

(Core Graveyard :: Embedding: APIs, defect, P1)

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.9

People

(Reporter: jud, Assigned: mikepinkerton)

References

(Blocks 1 open bug)

Details

(Keywords: topembed+, Whiteboard: SWAG: 4 weeks)

Attachments

(1 file, 5 obsolete files)

Embedded gecko needs to define and implement support for Drag + Drop.
in theory (heh), the embedding window only needs to make sure that the native d&d 
events are funnelled into the event sink just like other native events. 
Everything else should be handled internally by gecko.

Note that xul is not required to use the drag&drop services of XPTookit, though 
DOM event handlers (in JS or C++) will need to be registered in order to process 
the events.
Keywords: embed
Keywords: nsbeta3
we'll need this after beta3.
Whiteboard: [nsbeta3-]
Target Milestone: --- → M19
->Pinkerton/M0.9, cc blizzard
Assignee: valeski → pinkerton
Target Milestone: M19 → mozilla0.9
please add swag to status whiteboard
an embedding app needs ability to drag a "URL" from outside our content area,
onto it and have it load the URL. an embedding app also needs the reverse. The
ability to drag a "URL" from the content area outside the content area, and drop it.
this depends on if there is a xul wrapper around the embedded document, or not.
The code to handle all this is 90% there and can just be copied from navigator,
but it's all in JS. If we have to re-write it in C++, it will take longer.

Is there a place to hang event listeners at the top of the embedded document?
Where is this outer document constructed? Is it different from the non-embedded
(nscp6) case?
Whiteboard: [nsbeta3-] → [nsbeta3-] SWAG: 1 week
cc'ing adam lock who utilized a xul doc layer to handle context menu
notification. We have to decide whether or not we're going to support the xul
doc layer. Currently, we're exposing c++ versions of all notifications. Most
embedders haven't bought into XUL, therefore asking them to play w/ JS isn't
well received.

Listener registration occurs here:
http://lxr.mozilla.org/seamonkey/source/embedding/browser/webBrowser/nsIWebBrowser.idl#53

window construction is done by the embedding app (see
http://www.mozilla.org/projects/embedding/webbrowser.html#_Toc485633589 )

Adam, can you address the last question?
just spoke to hyatt:

what about using XBL in the same way that we do key-bindings? That allows us to
re-use the existing navigator JS and use XBL to hookup the event handlers.
please ellaborate: "hookup event handlers" (in cpp)? If we can leverage XBL to
accomplish this, great!
either hook them up (use |addEventListener()|) in c++ or, preferably, via XBL
using the same mechanism we're using to hook up the keybindings.

cc'ing hyatt, since we seem to be talking about a lot of overlap with bugs he
has for keybinding tasks.

OS: Linux → All
Hardware: PC → All
What you are describing here is what the gtk embedding widget does except it
does it with XUL.  I hang the event listeners off an otherwise empty ( except
for the content area ) XUL document.
working on this now, leveraging hyatt's XBL keybinding work.
Status: NEW → ASSIGNED
Priority: P3 → P1
cc'ing blake and alecf since they have already started work on separating the
content area's DnD JS (woohoo).

There are a couple of tasks we see:
- hooking up the XBL to hyatt's window root (2 days)
- extracting the content area JS so that it no longer references browser window
elements (like the url bar) Alec suggested something like a
"contentAreaContainer" that wraps the dragObserver and can provide it with
different info depending on the context. This would be good for both embedding
and things like mail (2 days)
- changing the install of the content area JS (it can't live in the navigator
package for embedding reasons) and installing the XBL into the same place (1 day).

Did I miss anything?
Depends on: 59701
Depends on: 58757
ok, I have most of the code written, problem is that we can't yet put <script> 
tags into XBL files, so we can't include all the nice XPApps content area DnD 
files (bug 58757).

I'll try to get the c++ part landed soon.
hyatt, can you a=? who would be qualified to do an r=?
Ok, so here's where we stand.  From the meeting today, I got the impression we 
may not have to do the XBL drag and drop thing.  

My big concern about this is that if we don't rewrite the JavaScript code in 
C++, then we are pretty far away from making this work (given all of the nasty 
issues related to avoiding recompilation of included 
<script> and resolving trust issues with principals for the handlers and 
for included <script>).  We'd probably have to do something to enable JS to be 
compiled on the window root, and then do something to give the window root a 
principal that was trusted.  I don't really even know how to do this, and I'm 
not sure how the ownership model would work in script-land.  

While I think it's ok to check this in, we should have the window drag handler 
not be compiled (so get nsXBLWindowDragHandler out of the projects and 
makefiles) and have the hookup be disabled until we know for sure that we want 
to continue developing an XBL-based drag and drop solution.  That way we don't 
bloat the code until we're sure we're turning this on.

I don't see any code in the patch that does the transition over to the new 
htmlBindings and platformHTMLBindings files.  It looks like the new ones are 
being checked in without the old ones being removed.  Are you planning on doing 
that in a later checkin, or did you want to tackle that now?

a=hyatt.
If we want to continue along this path, I'm going to need some serious help from 
brendan, since I think the nsWindowRoot would need to evolve into a full-blown 
script object with a trusted principal.

cc'ing him.

Also, you aren't really dependent on the XBL <script> bug as it turns out.  
We'll have to hack this up differently from the way normal XBL <script> tags are 
going to work.  

(This is a crack baby pseudo-XBL we're playing with, and it unfortunately 
doesn't work the same way as real XBL.)
There's no problem compiling a script against an object other than the one you
pass to scope the execution(s) of that script.  Also, the principal is a compile
time parameter, so you can provide a trusted one when compiling and the trust
will apply when executing.

Ask me questions in terms of the JS API if you can, I think that will move
things along fastest.

/be
Depends on: 61505
we're in a holding pattern here. it will be pretty easy if we can rely on a thin
xul layer (no need for script tags in xbl, and a few other things), but if we
can't, this will be a lot of work.

raising estimate to two weeks until we can get some answers.
Whiteboard: [nsbeta3-] SWAG: 1 week → [nsbeta3-] SWAG: 2 weeks
Updating QA Contact
QA Contact: jrgm → mdunn
for now, i think we're going with the idea that if an embedding app wants dnd,
they can use the thin xul layer. i really don't think we want to be duplicating
all the dnd code in c++.

pushing off.
Target Milestone: mozilla0.9 → Future
Blocks: 64833
Blocks: 70229
No longer blocks: 64833
Correction: Changing QA contact for the Embed API bugs to David Epstein.
QA Contact: mdunn → depstein
ok, this is needed sooner rather than later so i'm pulling it back in.

my new plan (since the script tag just isn't gonna happen) is to migrate the
content area's JS to c++ and share it between embedding and seamonkey. I figure
i'll hang the dnd listeners off the same node where we hang the tooltip and
context menu listeners.

objections?
Severity: normal → major
Whiteboard: [nsbeta3-] SWAG: 2 weeks → SWAG: 4 weeks
Target Milestone: Future → mozilla0.9.9
*** Bug 79513 has been marked as a duplicate of this bug. ***
Keywords: embedtopembed+
patches seamonkey and embedding to use this new service. a new bug will cover
additional client APIs for being able to override individual stages. this gets
basic "black box" functionality in (and uses PPEmbed as a testbed).
Attachment #19779 - Attachment is obsolete: true
Attachment #19780 - Attachment is obsolete: true
Attachment #19781 - Attachment is obsolete: true
Attached patch same patch, with new files (obsolete) — Splinter Review
Attachment #69501 - Attachment is obsolete: true
Attachment #69533 - Attachment is obsolete: true
Comment on attachment 69542 [details] [diff] [review]
this one actually builds

r=brade
Attachment #69542 - Flags: review+
Blocks: 125773
looks like there are a couple stray printfs in the patch that you might want to
kill.

Otherwise, cool!
landed.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
verified patch against Mozilla 0.9.8 Gecko 20020218. All OK except I noticed the
following:
* In /mozilla/embedding/browser/webBrowser/makefile.win and makefile.in, what
happened to .\nsIDragDropHandler.idl in the script pathway?
* In /mozilla/content/macbuild/contentIDL.xml, why isn't nsDragDropHandler.idl
in the paths? (<PATH> </PATH> tags)

Mozilla build 0.9.8 Gecko 20020222. nsIDragDropHandler.idl located in XPIDLSRCS
section of makefile.win & makefile.in in /mozilla/content/base/public. D&D works
fine in MfcEmbed's Editor window & Composer, but not to the desktop.
fwiw, the not being able to drag to the desktop is 127703, just waiting on a=.
verified.
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: