Closed
Bug 1305273
Opened 8 years ago
Closed 8 years ago
TSF handling of deletion and selection change by TIPs results in mismatched selection/display
Categories
(Core :: Widget: Win32, defect, P2)
Tracking
()
RESOLVED
DUPLICATE
of bug 1304624
People
(Reporter: marc, Unassigned)
References
Details
(Keywords: inputmethod, Whiteboard: tpi:+)
Attachments
(1 file)
(deleted),
application/octet-stream
|
Details |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Steps to reproduce:
Using Keyman Developer / Keyman Desktop (free downloads at http://www.tavultesoft.com/beta -- important to use Keyman Desktop 9.0.526.0 or later as 9.0.508.0 has a known bug in TSF with Firefox) I created a keyboard layout that had one simple rule (following is full source of keyboard layout, also attached as compiled keyboard ready to install in Keyman Desktop):
store(&VERSION) '9.0'
store(&NAME) 'Firefox context test'
begin Unicode > use(main)
group(main) using keys
'O' + '~' > U+00D5
I then typed 'O~O~O~O~' into any text field (e.g. the search box)
Actual results:
I saw ÕOÕO~O.
Furthermore, the cursor position was as indicated by vertical bar: ÕOÕO~|O and not at the end of the text.
Keyman uses ITfContext::SetSelection to move the selection back and delete a previous character in the context. It appears that Firefox's TSF selection and actual selection become mismatched at some point in the process so that a subsequent character mismatches.
This behaviour can also be seen when pressing backspace with the Keyman keyboard active, to delete existing text. Pressing backspace has no result.
There is a twist here: for compatibility reasons, Keyman has to detect if an app reports a text field as being empty. If the field is reported as empty, this can mean that the app does not support full TSF behaviours. In this situation, Keyman switches to a compatibility mode of sending backspaces with SendInput. So given "abc" in the text field to begin we see:
1. BKSP pressed. Firefox tells Keyman that there is text content of "abc". Keyman deletes the "c" with ITfContext::GetSelection, ITfRange::ShiftStart, ITfRange::SetText. Nothing appears to happen on screen, but the Firefox TSF cache of the content is now "ab".
2. BKSP pressed again. Firefox tells Keyman that there is text content of "ab". Keyman deletes the "b" with ITfContext::GetSelection, ITfRange::ShiftStart, ITfRange::SetText. Nothing appears to happen on screen, but the Firefox TSF cache of the content is now "a".
3. BKSP pressed again. Firefox tells Keyman that there is text content of "a". Keyman deletes the "a" with ITfContext::GetSelection, ITfRange::ShiftStart, ITfRange::SetText. Nothing appears to happen on screen, but the Firefox TSF cache of the content is now "".
4. Finally, BKSP pressed one more time. Firefox tells Keyman that there is no text content. Keyman switches into legacy mode and SendInput(VK_BACK). This deletes the visible "c" from the screen and causes the Firefox TSF content cache to refresh. Then we repeat the process for "ab".
That's a bit complicated to read through but hopefully helps to clarify why backspace "sometimes" seems to work.
Expected results:
I should have seen ÕÕÕÕ
Updated•8 years ago
|
Component: Untriaged → Widget: Win32
Keywords: inputmethod
OS: Unspecified → Windows
Product: Firefox → Core
Updated•8 years ago
|
Priority: -- → P2
Whiteboard: tpi:+
Comment 2•8 years ago
|
||
Now, bug 1304624 was fixed on latest Nightly. Could you check if this is fixed in Nightly <https://nightly.mozilla.org/>?
Flags: needinfo?(mcdurdin)
Reporter | ||
Comment 3•8 years ago
|
||
(In reply to Masayuki Nakano [:masayuki] (Mozilla Japan) from comment #2)
> Now, bug 1304624 was fixed on latest Nightly. Could you check if this is
> fixed in Nightly <https://nightly.mozilla.org/>?
Yes, this appears to be resolved and working correctly in the latest Nightly. I am waiting for a report back from the original issue reporter and will update when I receive their feedback.
Reporter | ||
Comment 4•8 years ago
|
||
I never heard back from the original issue reporter so let's go ahead and assume that this is resolved.
Reporter | ||
Updated•8 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Updated•8 years ago
|
Flags: needinfo?(mcdurdin)
You need to log in
before you can comment on or make changes to this bug.
Description
•