Closed Bug 251775 Opened 20 years ago Closed 20 years ago

[FIX]Remove direct drag-drop knowledge from nsFrame::HandlePress

Categories

(Core :: Layout, defect, P1)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha3

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch Proposed patch (obsolete) — Splinter Review
Comment on attachment 153466 [details] [diff] [review]
Proposed patch 

biesi, jst, what do you think?
Attachment #153466 - Flags: superreview?(jst)
Attachment #153466 - Flags: review?(cbiesinger)
That patch fixes bug 244859 too.
Blocks: 244859
Priority: -- → P1
Summary: Remove direct drag-drop knowledge from nsFrame::HandlePress → [FIX]Remove direct drag-drop knowledge from nsFrame::HandlePress
Target Milestone: --- → mozilla1.8beta
Comment on attachment 153466 [details] [diff] [review]
Proposed patch 

thanks!

Index: content/base/public/nsContentUtils.h

+   * @return the nsIImage corresponding to the first frame of the image
+   */
+  static nsresult GetImageFromContent(nsIImageLoadingContent* aContent,
+				       nsIImage** aImage);

+   * @return whether it's draggable
+   */
+  static PRBool ContentIsDraggable(nsIContent* aContent) {

This is a bit inconsistent. the @return refers to two different things here...
why not use something like:
@param [out]
in the first case?
> This is a bit inconsistent. the @return refers to two different things here...

That seems to be the style of the file, basically...
Comment on attachment 153466 [details] [diff] [review]
Proposed patch 

content/base/src/nsContentUtils.cpp
+  return CallGetInterface(ir.get(), aImage);

is the .get() needed?

+      nsCOMPtr<nsIURI> absURI;

what's this COMptr for?

content/base/src/nsContentAreaDragDrop.cpp

+  NS_PRECONDITION(outParent, "Null out param?");

I kinda find these useless, but ok.

 void
 nsTransferableFactory::FindParentLinkNode(nsIDOMNode* inNode, 
					   nsIDOMNode** outParent)

maybe this should return an already_AddRefed, instead of using an out param
Attachment #153466 - Flags: review?(cbiesinger) → review+
> is the .get() needed?

Yes, if you want it to compile.

> +      nsCOMPtr<nsIURI> absURI;
> what's this COMptr for?

Oops.  That's from an earlier patch iteration.  Fixed.

> maybe this should return an already_AddRefed, instead of using an out param

Hmm.. yeah, I could do that.  There're just a _lot_ of callsites...
Blocks: 252926
Comment on attachment 153466 [details] [diff] [review]
Proposed patch 

- In content/base/public/nsContentUtils.h:

+   * Method to get an nsIImage from an image loading content
+   *
+   * @param aContent The image loading content.  Must not be null.
+   * @return the nsIImage corresponding to the first frame of the image
+   */
+  static nsresult GetImageFromContent(nsIImageLoadingContent* aContent,
+				       nsIImage** aImage);

Seems like this could return already_AddRefed().

sr=jst with that and the other comments addressed.
Attachment #153466 - Flags: superreview?(jst) → superreview+
Attachment #153466 - Attachment is obsolete: true
Fixed.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: mozilla1.8beta → mozilla1.8alpha3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: