gecko-dev/dom/events
Masayuki Nakano f8a317eb9a Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug
DataTransfer should have more 2 constructors.  One takes |const nsAString&| and
sets its data to the string.  The other takes |nsITransferable*| and stores only
its data with DataTransferItem.

If given data is external resource like the case of `HTMLEditor::PasteTransferable()`,
we should copy its data to each DataTransferItem because nsITransferable is not
cycle-collectable, but DataTransfer may be grabbed by JS.  Unfortunately, adding
new path to initialize DataTransfer with nsITransferable instance is too risky
because DataTransfer and DataTransferItem work together to initialize each of
them if DataTransfer is in external mode. Therefore, this patch makes the
new constructor temporarily sets it to in external mode, then, cache usable types
first, then, call `FillAllExternalData()` to  make each DataTransferItem initializes
its data by itself, finally, make the constructor set it to internal mode and release
nsITransferable instance.  This is ugly implementation but the most reasonable
way for now because:

- We don't need to change DataTransfer nor DataTransferItem a lot in this bug.
- We don't need to duplicate any code like a loop in `CacheExternalData()`.

In another bug, we should redesign DataTransfer and DataTransferItem to
make DataTransferable easier to be added new constructors.

Differential Revision: https://phabricator.services.mozilla.com/D19298

--HG--
extra : moz-landing-system : lando
2019-02-19 07:13:20 +00:00
..
crashtests Bug 1397711 - Null-check widget of keyboard event before invoking its PostHandleKeyEvent. r=masayuki 2017-09-07 22:07:34 +10:00
test Bug 998941 - part 2-1: Implement InputEvent.dataTransfer declared by Input Events r=smaug 2019-02-19 06:32:11 +00:00
AnimationEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
AnimationEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
AsyncEventDispatcher.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
AsyncEventDispatcher.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
BeforeUnloadEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
BeforeUnloadEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
Clipboard.cpp Merge mozilla-central to autoland. a=merge CLOSED TREE 2019-01-04 01:03:06 +02:00
Clipboard.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ClipboardEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ClipboardEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
CommandEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
CommandEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
CompositionEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
CompositionEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ConstructibleEventTarget.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ConstructibleEventTarget.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ContentEventHandler.cpp Bug 181137 - part 8: Make ContentIteratorBase and its subclasses non-refcountable r=smaug 2019-01-11 01:52:26 +00:00
ContentEventHandler.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
CustomEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
CustomEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
DOMEventTargetHelper.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
DOMEventTargetHelper.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
DataTransfer.cpp Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug 2019-02-19 07:13:20 +00:00
DataTransfer.h Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug 2019-02-19 07:13:20 +00:00
DataTransferItem.cpp Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug 2019-02-19 07:13:20 +00:00
DataTransferItem.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
DataTransferItemList.cpp Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug 2019-02-19 07:13:20 +00:00
DataTransferItemList.h Bug 998941 - part 2-3: Create new constructors of DataTransfer to set only plain text or nsITransferable r=smaug 2019-02-19 07:13:20 +00:00
DeviceMotionEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
DeviceMotionEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
DragEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
DragEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
Event.cpp Bug 998941 - part 2-1: Implement InputEvent.dataTransfer declared by Input Events r=smaug 2019-02-19 06:32:11 +00:00
Event.h Bug 1521396 - Make ClickHandlerChild prevent multiple action of middle click on link element for preventing middle click paste r=smaug 2019-01-22 07:28:55 +00:00
EventDispatcher.cpp Bug 1500692 - Centralize profiling category definition and add infrastructure for subcategories. r=njn 2019-02-16 17:37:43 +00:00
EventDispatcher.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
EventListenerManager.cpp Bug 1524130 - Remove deprecation of attr modified event. r=smaug 2019-02-07 14:21:08 +00:00
EventListenerManager.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
EventListenerService.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
EventListenerService.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
EventNameList.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
EventStateManager.cpp Bug 1524683 - Move all nsIFrameLoaderOwner references to nsFrameLoaderOwner; r=nika 2019-02-15 22:20:53 +00:00
EventStateManager.h Bug 1445844 - Add a pref to block large custom cursors outside of the viewport's bounds. r=smaug 2019-02-06 17:40:46 +00:00
EventStates.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
EventTarget.cpp Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky 2019-01-02 13:27:05 +00:00
EventTarget.h Bug 1353867 - Follow-up, take 2: revert rev c9a17c8a3c3f and add include of WindowProxyHolder.h where it was missing. r=bz 2019-01-03 09:11:00 +02:00
FocusEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
FocusEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
IMEContentObserver.cpp Bug 1519185: Remove AttributeWillChange aNewValue parameter r=emilio,bzbarsky 2019-01-29 17:59:38 +01:00
IMEContentObserver.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
IMEStateManager.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
IMEStateManager.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ImageCaptureError.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ImageCaptureError.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
InputEvent.cpp Bug 998941 - part 2-1: Implement InputEvent.dataTransfer declared by Input Events r=smaug 2019-02-19 06:32:11 +00:00
InputEvent.h Bug 998941 - part 2-1: Implement InputEvent.dataTransfer declared by Input Events r=smaug 2019-02-19 06:32:11 +00:00
InputTypeList.h Bug 1447239 - Implement InputEvent.inputType r=smaug 2019-01-07 10:10:57 +00:00
InternalMutationEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
JSEventHandler.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
JSEventHandler.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
KeyNameList.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
KeyboardEvent.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
KeyboardEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MessageEvent.cpp Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky 2019-01-02 13:27:05 +00:00
MessageEvent.h Bug 1353867 - Change WindowProxyHolder's native type to BrowsingContext. r=bzbarsky 2019-01-02 13:27:05 +00:00
MouseEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MouseEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MouseScrollEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MouseScrollEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MutationEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
MutationEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
NotifyPaintEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
NotifyPaintEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
PaintRequest.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
PaintRequest.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
PendingFullscreenEvent.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
PhysicalKeyCodeNameList.h
PointerEvent.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
PointerEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
PointerEventHandler.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
PointerEventHandler.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ScrollAreaEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
ScrollAreaEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
SimpleGestureEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
SimpleGestureEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
SpeechRecognitionError.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
SpeechRecognitionError.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
StorageEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
StorageEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TextClause.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TextClause.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TextComposition.cpp Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
TextComposition.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
Touch.cpp Bug 1323400 - Part 1: Mark Touch::Equals as a const method; r=smaug 2019-02-15 16:28:35 +00:00
Touch.h Bug 1323400 - Part 1: Mark Touch::Equals as a const method; r=smaug 2019-02-15 16:28:35 +00:00
TouchEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TouchEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TransitionEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
TransitionEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
UIEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
UIEvent.h Bug 1353867 - Add cross-process proxies for WindowProxy. r=bzbarsky 2019-01-02 13:29:18 +00:00
VirtualKeyCodeList.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
WheelEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
WheelEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
WheelHandlingHelper.cpp Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
WheelHandlingHelper.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
XULCommandEvent.cpp Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
XULCommandEvent.h Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format 2018-11-30 11:46:48 +01:00
moz.build Bug 1447239 - Implement InputEvent.inputType r=smaug 2019-01-07 10:10:57 +00:00
nsIEventListenerService.idl Bug 1489047 - Change almost all DOMString occurrences in XPIDL files to AString. r=nika 2018-09-06 18:02:43 +10:00