Closed Bug 1650705 Opened 2 years ago Closed 2 years ago

Don't fire input event before firing startcomposition

Categories

(GeckoView :: IME, defect, P3)

Unspecified
Android

Tracking

(firefox87 fixed)

RESOLVED FIXED
87 Branch
Tracking Status
firefox87 --- fixed

People

(Reporter: m_kato, Assigned: m_kato)

References

Details

Attachments

(1 file)

When debugging bug 1633621, I found this issue.

Now, we always remove selected string to set composition string when firing compositionstart. This means that input event is fired before firing compositionstart.

https://searchfox.org/mozilla-central/rev/c86c19bd64f8f19590a4190c282781d3a9631422/widget/android/GeckoEditableSupport.cpp#968-991

  if (performDeletion) {
    WidgetContentCommandEvent event(true, eContentCommandDelete, widget);
    event.mTime = PR_Now() / 1000;
    widget->DispatchEvent(&event, status);
...
  }


  if (composing) {
    mDispatcher->SetPendingComposition(string, mIMERanges);
    mDispatcher->FlushPendingComposition(status);
...
  }

But, when string composition, it is unnecessary to remove selected string (fire input event) if we use StartComposition instead. So we can reduce event counts.

Actually, before starting composition, we always remove current selected
text. So it causes that input event is fired by this operation. This is
different of Blink.

TextEventDispatcher can set composition string using selected text when
starting composition. So we can reduce this input event.

Also, I mistake bug 1499076 fix. By this fix, we always fires input event
when having selected text even if it is unnecessary. This changeset has
this fix too.

Pushed by m_kato@ga2.so-net.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/ce73c96906f4
Don't dispatch unnecessary input event when we dispatch composition start with selected text. r=geckoview-reviewers,agi
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 87 Branch
Regressions: 1694046

Moving some input bugs to the new GeckoView::IME component.

Component: General → IME
You need to log in before you can comment on or make changes to this bug.