[TSF] Make `TSFTextStore` notify TSF/TIP of text changes after CRLFs are inserted
Categories
(Core :: DOM: UI Events & Focus Handling, task, P2)
Tracking
()
People
(Reporter: masayuki, Assigned: masayuki)
References
Details
(Keywords: inputmethod, Whiteboard: [sp3])
TIP may have a feature which inserts CRLFs within long text, like a template text feature. However, after fixing bug 1853986, we will reply text and offset data as they are replaced with LFs when TSF/TIP queries the content. Therefore, in the following case, TSF/TIP will get odd result.
- Inserts "abc\r\ndef"
- Query selection offset
Then, selection offset becomes "abc\ndef".length
instead of "abc\r\ndef".length
. I.e., from the TIP point of view, selection is oddly collapsed between e
and f
rather than after f
.
For solving this issue in TSF-aware app side, we need to notify TSF/TIP of a text change and a selection change that all CRLFs of the inserted text range is replaced with LFs. However, we've not done it yet.
In the worst case, the text containing CRLFs may come during a composition. In that case, notifying the composing string change may cause committing the string in better case. Instead, it might cause the TSF/TIP stop working until Firefox process is restarted or just a crash.
On the other hand, we're not sure whether there is such TIP. E.g., ATOK (Japanese 3rd party's IME) has a template text insertion feature, however, linebreaks cause synthesizing Enter
key events instead of inserting CRLFs directly. This must be better for rich text editor apps like Word, etc because rich text editor may have two line breaks, one is a paragraph separator and the other is a line breaker like Enter
key and Shift
+ Enter
key on browsers.
Therefore, in this bug, we should just put the change notification into the queue. Once we'll get IMEs (which can insert CRLFs) from the telemetry added in bug 1865256, let's check whether the simple fix here is enough or not.
Updated•1 year ago
|
Updated•1 year ago
|
Comment 1•1 year ago
|
||
Provided the telemetry is working, there currently seem to be no IMEs that insert CRLFs being used on Nightly: https://sql.telemetry.mozilla.org/queries/96469
Assignee | ||
Comment 2•1 year ago
|
||
(In reply to Jeff Muizelaar [:jrmuizel] from comment #1)
Provided the telemetry is working, there currently seem to be no IMEs that insert CRLFs being used on Nightly: https://sql.telemetry.mozilla.org/queries/96469
Yeah, if we don't get any IME names in early beta builds, I think that it's okay to ship bug 1853986 without fixing this.
(Although I'll try to fix this in this month.)
Comment 3•1 year ago
|
||
I updated the query to include beta and there are still no IME names.
Description
•