mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
4354450caa
`input` event listeners may be async functions and may set the text control element value after the editor ends dispatching an `input` event. Even in this case, the `input` event listener should not be called recursively by committing composition which is caused by setting the value because the value is overwritten by the setting value which was intended by the web app. Unfortunately, we cannot check whether the value setter is an async `input` event listener. Therefore, we need to suppress `input` events even after the editor ends dispatching `input` event. On the other hand, we should not suppress `input` event if the value is set by a `compositionupdate` event listener which runs before the editor starts handling the latest composition change because once we do that, the app won't receive `input` event for the composition. Therefore, we should not suppress the editor starts handling the composition change (including during `beforeinput` event dispatching, but the `beforeinput` is not cancelable, so, the result will be odd, therefore, we have no tests for the cases). Therefore, this patch adds a new method to `TextComposition` to make `TextControlState::SetValue` can check whether the editor is handling the latest composition change or after that. So, during composition, setting value should cause `input` events between `TextComposition` starts dispatching a `compositionupdate` event and `EditorBase` starts handling `eCompositionChange` event which is dispatched after `compositionupdate`. Differential Revision: https://phabricator.services.mozilla.com/D214676 |
||
---|---|---|
.. | ||
composer | ||
docs | ||
libeditor | ||
reftests | ||
spellchecker | ||
txmgr | ||
AsyncSpellCheckTestHelper.sys.mjs | ||
moz.build | ||
nsIDocumentStateListener.idl | ||
nsIEditActionListener.idl | ||
nsIEditor.idl | ||
nsIEditorMailSupport.idl | ||
nsIEditorSpellCheck.idl | ||
nsIHTMLAbsPosEditor.idl | ||
nsIHTMLEditor.idl | ||
nsIHTMLInlineTableEditor.idl | ||
nsIHTMLObjectResizer.idl | ||
nsITableEditor.idl |