Closed
Bug 203062
Opened 23 years ago
Closed 23 years ago
missing drop hook and move to utility methods
Categories
(Core :: DOM: Editor, defect)
Core
DOM: Editor
Tracking
()
VERIFIED
FIXED
People
(Reporter: Brade, Assigned: Brade)
References
Details
(Keywords: topembed)
Attachments
(2 files)
|
23.32 KB,
patch
|
kinmoz
:
review+
sfraser_bugs
:
superreview+
|
Details | Diff | Splinter Review |
|
38.06 KB,
patch
|
KaiE
:
review+
sfraser_bugs
:
superreview+
asa
:
approval1.4b+
|
Details | Diff | Splinter Review |
We are missing a callback to drophook in DragOver.
Also, we should move all of this hook stuff to nsEditorUtils.cpp.
| Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
Comment on attachment 121434 [details] [diff] [review]
missing hook v1
>Index: libeditor/base/nsEditorUtils.cpp
>===================================================================
>+/******************************************************************************
>+ * utility methods for drag/drop/copy/paste hooks
>+ *****************************************************************************/
>+
>+nsresult
>+nsEditorHookUtils::GetHookEnumeratorFromDocument(nsIDOMDocument *aDoc,
>+ nsISimpleEnumerator **aResult)
>+{
>+ nsCOMPtr<nsIDocument> doc = do_QueryInterface(aDoc);
>+ if (!doc) return NS_ERROR_FAILURE;
>+
>+ nsCOMPtr<nsISupports> isupp;
>+ doc->GetContainer(getter_AddRefs(isupp));
>+ nsCOMPtr<nsIDocShell> docShell = do_QueryInterface(isupp);
>+ nsCOMPtr<nsIClipboardDragDropHookList> hookObj = do_GetInterface(docShell);
>+ if (!hookObj) return NS_ERROR_FAILURE;
>+
>+ nsCOMPtr<nsISimpleEnumerator> enumerator;
>+ hookObj->GetHookEnumerator(getter_AddRefs(enumerator));
>+ if (!enumerator) return NS_ERROR_FAILURE;
>+
>+ *aResult = enumerator;
>+ NS_ADDREF(*aResult);
>+ return NS_OK;
>+}
You could just
return hookObj->GetHookEnumerator(aResult);
here.
Otherwise it looks good!
Attachment #121434 -
Flags: superreview+
Comment on attachment 121434 [details] [diff] [review]
missing hook v1
r=kin@netscape.com with sfraser's issue addressed.
My one concern is that this change will prevent embedders from ever extending
the types of data that can be dropped into the editor, for example if they had
the ability to convert RTF to HTML, since the editor will deny the drop and
never give the hooks a crack at saying yes. I guess we can file another bug to
track that issue?
PRBool canDrop = CanDrop(aDragEvent);
+ if (canDrop)
+ {
+ nsCOMPtr<nsIDOMDocument> domdoc;
+ mEditor->GetDocument(getter_AddRefs(domdoc));
+ canDrop = nsEditorHookUtils::DoAllowDropHook(domdoc, aDragEvent,
dragSession);
+ }
+
Attachment #121434 -
Flags: review+
| Assignee | ||
Comment 4•23 years ago
|
||
FYI, I filed bug 203105 to track the CanDrop()/DoAllowDropHook() issue I
mentioned above.
| Assignee | ||
Updated•23 years ago
|
Attachment #121469 -
Flags: superreview?(sfraser)
Updated•23 years ago
|
Attachment #121469 -
Flags: superreview?(sfraser) → superreview+
Comment 6•23 years ago
|
||
Comment on attachment 121469 [details] [diff] [review]
updated patch
r=kaie on the differences between this patch and the previous version -
carrying forward the other review
Attachment #121469 -
Flags: review+
| Assignee | ||
Comment 7•23 years ago
|
||
I would like to land this patch for 1.4beta. It cleans up the editor code
(better factoring) for dealing with the hooks that initially landed as part of
bug 197121. I'd like this to land for 1.4beta for editor embedding.
Comment 8•23 years ago
|
||
Comment on attachment 121469 [details] [diff] [review]
updated patch
a=asa (on behalf of drivers) for checkin to 1.4b
Attachment #121469 -
Flags: approval1.4b+
| Assignee | ||
Comment 9•23 years ago
|
||
patch checked in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Comment 11•23 years ago
|
||
i did some simple d'n'd btwn editor windows, mail compose and a browser window,
and this looks fine. let me know if there's a particular scenario[s] i should
check out --but otherwise this looks fine with 2003.05.13 builds.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•