gecko-dev/editor
Masayuki Nakano 0451a3f0a7 Bug 1504910 - part 3: Make TextEditor::OnDrop() remove selected content before inserting dropped content and fire "input" event before inserting first content r=m_kato
Both Chrome and Safari dispatches 2 sets of "beforeinput" and "input" events
when user drag and drop content in same editor.  One is "deleteByDrag" and
the other is "insertFromDrop".  We need to follow same behavior since
it should be able to cancel only "deleteByDrag" or "insertFromDrop" when
we implement "beforeinput" event.

HTMLEditor::InsertObject() may handle asynchronously.  And we don't need to
do anything additionally for HTMLEditor.  Therefore, TextEditor::OnDrop()
can delete selection before inserting dropped content by itself.

Therefore, this patch makes TextEditor::OnDrop() call
TextEditor::PrepareToInsertContent() and EditorBase::FireInputEvent() by
itself.

Unfortunately, it seems that we cannot write automated tests for this.
Even if using synthesizeMouse() of EventUtils, synthesizing mouse events
won't generate "dragover" nor "drop" events.  Perhaps, like EventUtils.js,
we need to do something with drag service, but it means that we cannot
emulate drag and drop in an editor.

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

--HG--
extra : moz-landing-system : lando
2018-11-12 07:19:01 +00:00
..
composer Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj 2018-10-31 20:39:03 +00:00
libeditor Bug 1504910 - part 3: Make TextEditor::OnDrop() remove selected content before inserting dropped content and fire "input" event before inserting first content r=m_kato 2018-11-12 07:19:01 +00:00
reftests Bug 1473927 - Load textbox.css and numberbox.css as document stylesheets. r=paolo 2018-10-09 10:22:15 +02:00
spellchecker Backed out 2 changesets (bug 1504913) for build bustage in build/src/extensions/spellcheck/src/mozSpellChecker.cpp 2018-11-07 04:06:58 +02:00
txmgr Bug 1484118 - Remove the XPCOM component registration for nsTransactionManager; r=masayuki 2018-08-23 09:36:59 -04:00
AsyncSpellCheckTestHelper.jsm Bug 1489980 - Enable ESLint for editor/ - Manual fixes. r=masayuki 2018-09-13 07:59:47 +00:00
moz.build Bug 1491199 - Get rid of nsIEditorBlobListener. r=masayuki 2018-09-18 04:34:21 +00:00
nsIDocumentStateListener.idl
nsIEditActionListener.idl Bug 1489047 - Change almost all DOMString occurrences in XPIDL files to AString. r=nika 2018-09-06 18:02:43 +10:00
nsIEditor.idl Bug 1485890 - Remove dumpContentTree, debugDumpContent and debugUnitTests from nsIEditor. r=masayuki 2018-10-29 07:23:49 +00:00
nsIEditorMailSupport.idl Bug 1491191 - Remove unused methods in nsIEditorMailSupport. r=masayuki 2018-09-14 10:03:24 +00:00
nsIEditorObserver.idl
nsIEditorSpellCheck.idl Backed out 2 changesets (bug 1504913) for build bustage in build/src/extensions/spellcheck/src/mozSpellChecker.cpp 2018-11-07 04:06:58 +02:00
nsIEditorStyleSheets.idl Bug 1470361: Remove nsIEditorStyleSheets.addStyleSheet / removeStyleSheet / replaceStyleSheet. r=m_kato 2018-06-25 10:46:38 +02:00
nsIHTMLAbsPosEditor.idl Bug 1484136 - Create HTMLEditor::RefreshGrabberInternal() for internal use r=m_kato 2018-09-11 05:30:33 +00:00
nsIHTMLEditor.idl Bug 1501663 - part 7: HTMLEditor::GetSelectedElement() shouldn't return element node when Selection starts before the element node r=m_kato 2018-11-05 11:38:10 +00:00
nsIHTMLInlineTableEditor.idl Bug 1485929 - Create HTMLEditor::RefreshInlineTableEditingUIInternal() for internal use r=m_kato 2018-09-11 12:10:54 +00:00
nsIHTMLObjectResizer.idl Bug 1485921 - Create HTMLEditor::RefreshResizersInternal() for internal use r=m_kato 2018-09-11 08:15:52 +00:00
nsIPlaintextEditor.idl Bug 1489047 - Change almost all DOMString occurrences in XPIDL files to AString. r=nika 2018-09-06 18:02:43 +10:00
nsITableEditor.idl Bug 1484126 - part 1: Create CellData struct which implements nsITableEditor::GetCellDataAt() r=m_kato 2018-10-12 13:40:25 +00:00
nsIURIRefObject.idl Bug 1489047 - Change almost all DOMString occurrences in XPIDL files to AString. r=nika 2018-09-06 18:02:43 +10:00