Open Bug 1556336 Opened 5 years ago Updated 9 days ago

Make editors stop listening to composition events, instead, TextComposition should notify focused editor directly

Categories

(Core :: DOM: Editor, task, P3)

task

Tracking

()

People

(Reporter: edgar, Unassigned)

References

Details

(Keywords: inputmethod, site-compat)

It is Gecko only event, we should use compositionupdate instead.

This is a quick try in https://treeherder.mozilla.org/#/jobs?repo=try&revision=eaefbfbc8f98057cdc86a3cfd1fe8245471a202e.
I did some manually test on <input> and contenteditable element, the IME input works well.
But there were some tests failure which needs some more investigation.

(In reply to Edgar Chen [:edgar] from comment #8)

(In reply to Edgar Chen [:edgar] from comment #6)

We could fix this issue by marking eCompositionChange event as a composed event.

I decided go with this way because there are some test failure after moving to eCompositionUpdate (comment #7), and it probably requires me more time to investigate.

However, we plans to deprecate eCompositionChange event which is a gecko specific event, so maybe we should try to use eCompositionUpdate in HTMLEditor instead.

Is this something we want to do for the long term? If yes, I could file a follow-up bug for it.

Ideally, yes it is. But eCompositionUpdate is not dispatched when only selection in composition string is changed. This behavior is defined by UI Events.

when a text composition system updates its active text passage with a new character, which is reflected in the string in data.

So, we have 2 choices:

  1. Dispatch eCompositionUpdate with setting WidgetEvent::mFlags.mOnlySystemGroupDispatch to true when only selection is changed
  2. Notify editor directly immediately after dispatching eCompositionUpdate from TextComposition

The latter may be better for performance.

Priority: -- → P3

According to the investigation of Emilio in bug 1553008, editor shouldn't handle eCompositionUpdate nor eCompositionChange since they may not reach the editor. So, TextComposition should communicate focused editor directly after eCompositionStart.

Assignee: nobody → masayuki
Status: NEW → ASSIGNED
Depends on: 1553008
Keywords: inputmethod
Keywords: site-compat
Assignee: masayuki → nobody
Severity: normal → S3
Status: ASSIGNED → NEW
OS: Unspecified → All
Hardware: Unspecified → All
Summary: Stop using "text" event in Editor → Make editors stop listening to composition events, instead, TextComposition should notify focused editor directly
You need to log in before you can comment on or make changes to this bug.