Closed
Bug 138049
Opened 23 years ago
Closed 23 years ago
Advertise OS-native image data when dragging an image
Categories
(Core :: XUL, defect)
Core
XUL
Tracking
()
VERIFIED
FIXED
mozilla1.0
People
(Reporter: mikepinkerton, Assigned: mikepinkerton)
References
Details
(Keywords: topembed+, Whiteboard: [ADT2 RTM] [a= needs a refresh, drivers mailed 5/29] [ETA 05/31] custrtm-)
Attachments
(1 file)
17.44 KB,
patch
|
ccarlen
:
review+
alecf
:
superreview+
jud
:
approval+
|
Details | Diff | Splinter Review |
We already advertise OS-native image formats on the clipboard (DIB on Win32/PICT
on MacOS). Now we need to advertise them during a drag.
This involves:
- getting the nsIImage from the DOM node and putting it into the transferable
when the drag begins
- converting the nsIImage to OS-native format when asked for (on demand)
all this code has been written, all I need to do is hook up the pieces.
Assignee | ||
Updated•23 years ago
|
Assignee | ||
Comment 1•23 years ago
|
||
Comment 2•23 years ago
|
||
Comment on attachment 80070 [details] [diff] [review]
advertise CF_DIB and PICT
>@@ -674,5 +676,6 @@
> NS_ASSERTION ( retVal == noErr, "SDIFD failed in DragSendDataProc" );
> }
>- nsMemory::Free ( data );
>+ if ( data )
>+ nsMemory::Free ( data );
> } // if valid refcon
If this is something that can happen > once, assign nsnull to data.
>+nsContentAreaDragDrop::GetImageFrame(nsIContent* aContent, nsIDocument *aDocument, nsIPresContext *aPresContext,
>+ nsIPresShell *aPresShell, nsIImageFrame** aImageFrame)
>+{
>+ NS_ENSURE_ARG_POINTER(aImageFrame);
>+ *aImageFrame = nsnull;
>+
>+ nsresult rv = NS_ERROR_FAILURE;
>+
>+ if (aDocument) {
>+ // Make sure the presentation is up-to-date
>+ rv = aDocument->FlushPendingNotifications();
>+ if (NS_FAILED(rv))
>+ return rv;
>+ }
>+
>+ if (aContent && aDocument && aPresContext && aPresShell) {
>+ nsIFrame* frame = nsnull;
>+ rv = aPresShell->GetPrimaryFrameFor(aContent, &frame);
>+ if (NS_SUCCEEDED(rv) && frame) {
>+ nsCOMPtr<nsIAtom> type;
>+ frame->GetFrameType(getter_AddRefs(type));
>+ if (type.get() == nsLayoutAtoms::imageFrame) {
>+ nsIImageFrame* imageFrame;
>+ rv = frame->QueryInterface(NS_GET_IID(nsIImageFrame), (void**)&imageFrame);
>+ if (NS_FAILED(rv)) {
>+ NS_WARNING("Should not happen - frame is not image frame even though type is nsLayoutAtoms::imageFrame");
>+ return rv;
>+ }
>+ *aImageFrame = imageFrame;
The AddRef'ing or not through here is manual. I'd rather use
nsCOMPtr<nsIImageFrame> imageFrame and then NS_ADDREF(*aImageFrame =
imageFrame) if success.
>+ }
>+ else
>+ return NS_ERROR_FAILURE;
r=ccarlen
Attachment #80070 -
Flags: review+
Assignee | ||
Comment 3•23 years ago
|
||
to address conrad's 2nd comment, frame are not addref'd, so using a comPtr in
this case will assert.
cc'ing alecf for a possible sr.
Comment 4•23 years ago
|
||
Comment on attachment 80070 [details] [diff] [review]
advertise CF_DIB and PICT
sr=alecf
Attachment #80070 -
Flags: superreview+
Assignee | ||
Comment 5•23 years ago
|
||
mother, may i?
Updated•23 years ago
|
Attachment #80070 -
Flags: approval+
Comment 6•23 years ago
|
||
marking adt1.0.0- for beta.. Let's take a look at this again for rtm.
Assignee | ||
Comment 7•23 years ago
|
||
i'm sorry, this is needed by embedding clients. it must go on the branch.
Comment 8•23 years ago
|
||
Changing to [adt2 RTM]. adt1.0.0- for the 1.0 branch. Pls verify this on the
trunk, as we will need it shortly.
Updated•23 years ago
|
QA Contact: jrgm → tpreston
Comment 9•23 years ago
|
||
pinkerton's comments on how to verify:
on the trunk, try dragging images around to various parts of the app.
> nothing should be different from before.
>
> on mac, you can drag images to the desktop, and a PICT clipping will be
> created. on win32, you can drag images to AOL mail compose.
Verified these behaviors on Mac and windows trunk
Status: RESOLVED → VERIFIED
Comment 10•23 years ago
|
||
[Internal Reference]
http://bugscape.netscape.com/show_bug.cgi?id=4705
Comment 11•23 years ago
|
||
adt1.0.0+ (on ADT's behalf) for approval to checkin to the 1.0 branch. Please
get drivers a= again, since their previous approval is more than 3 days old.
After, checking in, please add the fixed1.0 keyword.
Updated•23 years ago
|
Blocks: 143047
Whiteboard: [ADT2 RTM] [a= needs a refresh] → [ADT2 RTM] [a= needs a refresh] [ETA 05/31]
Updated•23 years ago
|
Whiteboard: [ADT2 RTM] [a= needs a refresh] [ETA 05/31] → [ADT2 RTM] [a= needs a refresh] [ETA 05/31] custrtm-
Assignee | ||
Updated•23 years ago
|
Whiteboard: [ADT2 RTM] [a= needs a refresh] [ETA 05/31] custrtm- → [ADT2 RTM] [a= needs a refresh, drivers mailed 5/29] [ETA 05/31] custrtm-
Comment 12•23 years ago
|
||
please checkin to the 1.0.1 branch ASAP. once there please remove the
mozilla1.0.1+ keyword and add the fixed1.0.1 keyword.
Keywords: mozilla1.0.1 → mozilla1.0.1+
Updated•23 years ago
|
Keywords: mozilla1.0.1+
Comment 14•23 years ago
|
||
Verified fixed on win XP branch build 2002082209 and Mac OS X (Jaguar) branch
build 2002082205
Keywords: fixed1.0.1 → verified1.0.1
You need to log in
before you can comment on or make changes to this bug.
Description
•