Bug 327413
| Summary: | [GTK][WPE] Input method commit without a preedit dispatches compositionend without compositionstart | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pena <spena> |
| Component: | WPE WebKit | Assignee: | Fujii Hironori <fujii> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply, cgarcia, fujii |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=84394 https://bugs.webkit.org/show_bug.cgi?id=327694 |
||
Simon Pena
When an input method commits text without a preedit, for example a keyboard that commits a whole suggestion at once, the page receives compositionend, and a beforeinput with inputType insertFromComposition, but no compositionstart.
InputMethodFilter::committed() calls webkitWebViewConfirmComposition(), which ends in Editor::setComposition(text, ConfirmComposition). That always dispatches compositionend, whether or not a composition was in progress.
Steps (API test): focus a textarea, then emit "committed" with "hello" on the input method context, with no preedit before it. The text is inserted, and the page gets one compositionend and no compositionstart.
Expected: either no composition events, with the text inserted as typing (inputType insertText), or a compositionstart before the compositionend. Pages that track composition state, such as rich text editors, can be confused by an unpaired compositionend.
Seen first with wpe-android, whose keyboard integration commits every suggestion this way. Bug 84394 reported the same symptom in 2012 for number keys typed through an input method. Today's key handling path skips one-character commits, but commits outside key handling still get an unpaired compositionend.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Fujii Hironori
Pull request: https://github.com/WebKit/WebKit/pull/77005
EWS
Committed 323806@main (30178fb84c6f): <https://commits.webkit.org/323806@main>
Reviewed commits have been landed. Closing PR #77005 and removing active labels.