Bug 326817
| Summary: | [WPE] Wayland text-input-v1 pre-edit cursor and styling offsets are bytes, but are used as characters | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Simon Pena <spena> |
| Component: | WPE WebKit | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugs-noreply |
| Priority: | P2 | ||
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=326573 https://bugs.webkit.org/show_bug.cgi?id=326818 https://bugs.webkit.org/show_bug.cgi?id=327412 |
||
Simon Pena
The text-input-v1 preedit_cursor event gives the cursor position in bytes from the start of the pre-edit text, and a negative index means no cursor is shown. The preedit_styling event gives index and length in bytes too. WPEInputMethodContextWaylandV1 passes them on unchanged, as the pre-edit cursor offset and as underline ranges, which are both counted in characters.
With text that is not ASCII, the cursor position and the underlines are wrong. A negative cursor index becomes a very large unsigned offset; it only ends up at the end of the pre-edit because WebKit clamps it there.
The styling events arrive before the preedit_string event they apply to, so the conversion has to happen once the text is known, in get_preedit_string.
Found by reading the code and the protocol; not reproduced yet. Bug 326573 is the same problem in text-input-v3 (which was reproduced)
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |