Closed Bug 1941973 Opened 1 month ago Closed 1 month ago

Make `EditorBase::OnCompositionChange` always dispatch `input` event whose `isComposing` is `true` with a pref

Categories

(Core :: DOM: Editor, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: masayuki, Assigned: masayuki)

References

(Blocks 1 open bug, )

Details

(Keywords: webcompat:platform-bug)

User Story

platform-scheduled:2025-03-31

Attachments

(1 file)

Although dispatching redundant input event before compositionend breaks the pairs of beforeinput and input for each edit, the reported site in bug 1910865 seems stores HTMLInputElement.value value at input and tries to use it in compositionend. So, redundant input event could fix the issue on the web site.

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
User Story: (updated)
Pushed by masayuki@d-toybox.com: https://hg.mozilla.org/integration/autoland/rev/a24b524fe1b3 Make `EditorBase::OnCompositionChange` always dispatch `input` event with a new pref r=m_kato
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: