mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 11:55:49 +00:00
0451a3f0a7
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 |
||
---|---|---|
.. | ||
composer | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.jsm | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorObserver.idl | ||
nsIEditorSpellCheck.idl | ||
nsIEditorStyleSheets.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsIPlaintextEditor.idl | ||
nsITableEditor.idl | ||
nsIURIRefObject.idl |