gecko-dev/editor
Masayuki Nakano 4354450caa Bug 1904192 - Make TextControlState::SetValue suppress TextEditor to dispatch input events even after dispatching input event during composition r=m_kato,geckoview-reviewers
`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
2024-06-25 03:52:54 +00:00
..
composer Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
docs Bug 1842986 - Remove dom.forms.inputmode pref r=emilio 2023-09-15 16:49:21 +00:00
libeditor Bug 1904192 - Make TextControlState::SetValue suppress TextEditor to dispatch input events even after dispatching input event during composition r=m_kato,geckoview-reviewers 2024-06-25 03:52:54 +00:00
reftests Bug 1879538 - cleanup unnecessary and redundant reftest conditions. r=aryx,jgilbert 2024-02-22 23:04:45 +00:00
spellchecker Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
txmgr Bug 1856795 - Remove redundant member init r=emilio 2023-10-15 15:29:02 +00:00
AsyncSpellCheckTestHelper.sys.mjs Bug 1864896: Autofix unused function arguments (editor). r=masayuki 2024-03-01 18:28:33 +00:00
moz.build
nsIDocumentStateListener.idl
nsIEditActionListener.idl Bug 1859245 - part 3: Make JoinNodesTransaction and SplitNodeTransaction handle only the new direction mode r=m_kato 2023-10-27 01:57:29 +00:00
nsIEditor.idl Bug 1764895 - part 3: Get rid of nsIEditor.setShouldTxnSetSelection r=m_kato DONTBUILD 2023-12-14 00:41:20 +00:00
nsIEditorMailSupport.idl Bug 1839814 - Move nsIEditor.wrapWidth to nsIEditorMailSupport r=m_kato 2023-06-27 05:47:55 +00:00
nsIEditorSpellCheck.idl
nsIHTMLAbsPosEditor.idl
nsIHTMLEditor.idl Bug 1851951 - Make HTMLEditor refer computed display instead of the HTML default style at considering block or inline element r=m_kato 2023-09-27 03:01:26 +00:00
nsIHTMLInlineTableEditor.idl
nsIHTMLObjectResizer.idl
nsITableEditor.idl