Closed Bug 975276 Opened 8 years ago Closed 7 years ago

[Keyboard]A cursor is not displayed on the head of a string by setComposition.

Categories

(Firefox OS Graveyard :: Gaia::Keyboard, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
2.0 S5 (4july)

People

(Reporter: osk4095, Assigned: xyuan)

References

Details

Attachments

(3 files)

Attached video Cursor_1_FxOS(bug).mp4
[steps to reproduce]
Set "0" to "cursor" of setComposition(DOMString text, optional long cursor), InputContext
  InputContext.setComposition(text, 0);
 * Refer to video.

[actual results]
Seemingly a cursor is displayed on the end of a string. It is not displayed on the head of it. 

[expected results]
A cursor is displayed on the head of a string.
Therefore it suggests an opportunity to a user for inputting a character from the head of the string.
Cursor_1_FxOS(bug).mp4
When "0" is set to "cursor" of "setComposition", a cursor moves to the end of a string.

Cursor_2_Android(expected).mp4
Expected result: When Android IME sets cursor location "0", a cursor locates the head of a string.  

Both of above cases, you can input a letter from the head of a string. 
However a blinking cursor location of "Cursor_1_FxOS(bug).mp4" is different from the expected result "Cursor_2_Android(expected).mp4".
Duplicate of this bug: 972209
http://mxr.mozilla.org/mozilla-central/source/dom/inputmethod/MozKeyboard.js#577
> 577         cursor: cursor || text.length,

Looks like this a simple mistake. If cursor is 0, the text.length is used unexpectedly.

We should avoid a case of |cursor === 0|.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Yuan, could you take a look? See comment 3.
Flags: needinfo?(xyuan)
Thank you for your reply.

We have confirmed the expected result after fixing the place pointed out with local environment.
We are waiting for a fixed source file in the future.
(In reply to Masayuki Nakano (:masayuki) (Mozilla Japan) from comment #4)
> Yuan, could you take a look? See comment 3.

It is a mistake. Let me fix it.
Assignee: nobody → xyuan
Flags: needinfo?(xyuan)
It is a mistake. When cursor is not passed, we use the text length as cursor value. When cursor is passed, even 0 value, we should use the passed value, but never the text length.
Attachment #8441131 - Flags: review?(masayuki)
Attachment #8441131 - Flags: review?(masayuki) → review+
Please run this through Try (and post a link here) before requesting checkin. Thanks!
Keywords: checkin-needed
(In reply to Ryan VanderMeulen [:RyanVM UTC-4][PTO June 19-22] from comment #8)
> Please run this through Try (and post a link here) before requesting
> checkin. Thanks!

The try link:

https://tbpl.mozilla.org/?tree=Try&rev=b05f4985ea0c
Try is green. Ask for checkin.
Thanks ;)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/543203ca7ebe
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S5 (4july)
You need to log in before you can comment on or make changes to this bug.