Files
tubestation/widget/tests
Masayuki Nakano 5e9b04cd87 Bug 1941973 - Make EditorBase::OnCompositionChange always dispatch input event with a new pref r=m_kato
The reported web site in bug 1910865 sets `HTMLInputElement.value` to the
latest value explicitly at every `input` event except when during a composition.
When it's in a composition, it stores the latest value at `input` events during
the composition and set it at `compositionend` event listener.

Currently, Gecko dispatches the events as the following order at ending a
composition:
1. `beforeinput` whose `isComposing` is `true`
2. `compositionend`
3. `input` whose `isComposing` is `false`

Therefore, if user chooses the commit string from the candidate list, the
commit string is not notified by `input` event before the `compositionend`.

On the other hand, Chrome dispatch the events as the following order:
1. `beforeinput` whose `isComposing` is `true`
2. `input` whose `isComposing` is `true`
3. `compositionend`

I.e., no `input` event is fired after `compositionend` and there is no `input`
event whose `isComposing` is `false`.  This is handled in the spec issue [1],
but not yet resolved.

Perhaps, we can dispatch redundant `input` event before `compositionend` event,
i.e.,
1. `beforeinput` whose `isComposing` is `true`
2. `input` whose `isComposing` is `true`
3. `compositionend`
4. `input` whose `isComposing` is `false`

This breaks the pair of `beforeinput` and `input`, but I guess it's not
important for web apps especially for the redundant `input` event case.

1. https://github.com/w3c/uievents/issues/202

Differential Revision: https://phabricator.services.mozilla.com/D234620
2025-01-24 02:35:35 +00:00
..