From fc5a62297da70f013054bccd8a458669bd7ea87b Mon Sep 17 00:00:00 2001 From: Michael Layzell Date: Wed, 6 Sep 2017 11:39:03 -0400 Subject: [PATCH] Bug 1199729 - Part 6: Add some comments to DataTransfer to clarify use of methods, r=baku --- dom/events/DataTransfer.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dom/events/DataTransfer.h b/dom/events/DataTransfer.h index 08873f1c4731..6dc787a67aa4 100644 --- a/dom/events/DataTransfer.h +++ b/dom/events/DataTransfer.h @@ -76,6 +76,7 @@ protected: // this constructor is used only by the Clone method to copy the fields as // needed to a new data transfer. + // NOTE: Do not call this method directly. DataTransfer(nsISupports* aParent, EventMessage aEventMessage, const uint32_t aEffectAllowed, @@ -298,6 +299,12 @@ public: return mDragImage; } + // This method makes a copy of the DataTransfer object, with a few properties + // changed, and the mode updated to reflect the correct mode for the given + // event. This method is used during the drag operation to generate the + // DataTransfer objects for each event after `dragstart`. Event objects will + // lazily clone the DataTransfer stored in the DragSession (which is a clone + // of the DataTransfer used in the `dragstart` event) when requested. nsresult Clone(nsISupports* aParent, EventMessage aEventMessage, bool aUserCancelled, bool aIsCrossDomainSubFrameDrop, DataTransfer** aResult);