Closed Bug 1596920 Opened 5 years ago Closed 5 years ago

Text entry in Gecko is broken on the Oculus Go in Firefox Reality

Categories

(GeckoView :: General, defect, P1)

ARM64
Android
defect

Tracking

(firefox75 fixed, firefox77 fixed)

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed
firefox77 --- fixed

People

(Reporter: rbarker, Assigned: m_kato)

References

Details

(Whiteboard: [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76][geckoview:m77][geckoview:m78])

Attachments

(5 files)

Attached image Actual results.

Steps to Reproduce:

  1. Open settings and click account button
  2. attempt to enter email address mr.noob@aol.com

Actual result:
Text displayed is mroobaol.com@.n
Expected result:
Text should be displayed as entered.

Notes:
FxR is using GeckoView Nightly 72.0.20191104094118

I have not seen this issue on faster devices such as the Oculus Quest or HTC Focus.

Rank: 5
Depends on: 1569007
Priority: -- → P2
Whiteboard: [geckoview:m1912]

Gecko Thread

11-18 11:20:19.946  4701  4722 I GeckoEditableSupport: IME: IME_REPLACE_TEXT: text="."
11-18 11:20:20.000  4701  4722 I GeckoEditableSupport: IME: NotifyIMEOfTextChange: s=9, oe=9, ne=10
11-18 11:20:20.001  4701  4722 I GeckoEditableSupport: IME: NOTIFY_IME_OF_SELECTION_CHANGE
11-18 11:20:20.024  4701  4722 I GeckoEditableSupport: IME: IME_REPLACE_TEXT: text="c"
11-18 11:20:20.080  4701  4722 I GeckoEditableSupport: IME: IME_REPLACE_TEXT: text="o"
11-18 11:20:20.105  4701  4722 I GeckoEditableSupport: IME: NotifyIMEOfTextChange: s=10, oe=10, ne=12 <--- merged "c" and "o" event
11-18 11:20:20.107  4701  4722 I GeckoEditableSupport: IME: NOTIFY_IME_OF_SELECTION_CHANGE
11-18 11:20:20.144  4701  4722 I GeckoEditableSupport: IME: IME_REPLACE_TEXT: text="m"
11-18 11:20:20.181  4701  4722 I GeckoEditableSupport: IME: NotifyIMEOfTextChange: s=10, oe=10, ne=11

IC and Java thread

11-18 11:20:19.929  4539  4554 D GeckoEditable: reply: Action(TYPE_SET_SPAN)
11-18 11:20:19.951  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@9b3253) = 0
11-18 11:20:19.952  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@a9be790) = 0
11-18 11:20:19.952  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@e4fa889) = 0
11-18 11:20:19.952  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@7b26178) = 0
11-18 11:20:19.953  4539  4539 D GeckoEditable: sendKeyEvent(KeyEvent { action=ACTION_UP, keyCode=KEYCODE_PERIOD, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=613010, downTime=613010, deviceId=-1, source=0x101 }, 1, 0)
11-18 11:20:19.955  4539  4539 D GeckoEditable: offer: Action(TYPE_EVENT)
Offering replace text
11-18 11:20:19.984  4539  4555 D GeckoEditable: reply: Action(TYPE_REPLACE_TEXT)
11-18 11:20:19.985  4539  4554 D GeckoEditable: reply: Action(TYPE_SET_SPAN)
11-18 11:20:19.985  4539  4554 D GeckoEditable: discarding stale set span call
11-18 11:20:19.993  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$START@f5d0781) = 10
11-18 11:20:19.993  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$END@1abb026) = 10
11-18 11:20:19.993  4539  4539 D GeckoEditable: getSpanStart(android.text.NoCopySpan$Concrete@f4f31b7) = -1
11-18 11:20:19.993  4539  4539 D GeckoEditable: getSpanEnd(android.text.NoCopySpan$Concrete@f4f31b7) = -1
11-18 11:20:19.994  4539  4539 D GeckoEditable: offer: Action(TYPE_SET_SPAN)
11-18 11:20:19.997  4539  4539 D GeckoEditable: setSpan(android.text.NoCopySpan$Concrete@30d908d, 10, 10, 17)
11-18 11:20:19.997  4539  4539 D GeckoEditable: offer: Action(TYPE_REPLACE_TEXT)
11-18 11:20:19.998  4539  4539 D GeckoEditable: icSendComposition(): no composition
11-18 11:20:19.999  4539  4774 D GeckoEditable: onDefaultKeyEvent(action=1, keyCode=56, metaState=0, time=613010, repeatCount=0)
11-18 11:20:20.000  4539  4539 D GeckoEditable: sending: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_C, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=614068, downTime=614068, deviceId=-1, source=0x101 }
11-18 11:20:20.003  4539  4539 D GeckoEditable: replace(10, 10, "c") = GeckoEditable
11-18 11:20:20.004  4539  4539 D GeckoEditable: getSpanStart(android.text.NoCopySpan$Concrete@30d908d) = 10
XXXX 11-18 11:20:20.004  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$END@1abb026) = 11 <--- When typeing "c" selection on Java is 11 by repalce affer
11-18 11:20:20.004  4539  4539 D GeckoEditable: offer: Action(TYPE_SET_SPAN)
11-18 11:20:20.007  4539  4539 D GeckoEditable: setSpan(android.text.NoCopySpan$Concrete@8dfb242, 10, 11, 33)
11-18 11:20:20.007  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@9b3253) = 0
11-18 11:20:20.008  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@a9be790) = 0
11-18 11:20:20.008  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@e4fa889) = 0
11-18 11:20:20.011  4539  4832 D GeckoEditable: onTextChange(".", 9, 9)
XXX 11-18 11:20:20.016  4539  4555 D GeckoEditable: onSelectionChange(10, 10) <--- "." is set in Gecko now, then selection on Gecko is 10. Most senario isn't sycned, but icSyncShadowText syncs text due to no data in our queue.
11-18 11:20:20.018  4539  4640 D GeckoEditable: reply: Action(TYPE_EVENT)
11-18 11:20:20.023  4539  4554 D GeckoEditable: reply: Action(TYPE_SET_SPAN)
11-18 11:20:20.036  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@9b3253) = 0
11-18 11:20:20.036  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@a9be790) = 0
11-18 11:20:20.037  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@e4fa889) = 0
11-18 11:20:20.037  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@7b26178) = 0
11-18 11:20:20.037  4539  4539 D GeckoEditable: sendKeyEvent(KeyEvent { action=ACTION_UP, keyCode=KEYCODE_C, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=613010, downTime=613010, deviceId=-1, source=0x101 }, 1, 0)
11-18 11:20:20.041  4539  4539 D GeckoEditable: offer: Action(TYPE_EVENT)
11-18 11:20:20.046  4539  4774 D GeckoEditable: reply: Action(TYPE_REPLACE_TEXT)
11-18 11:20:20.047  4539  4832 D GeckoEditable: reply: Action(TYPE_SET_SPAN)
11-18 11:20:20.047  4539  4832 D GeckoEditable: discarding stale set span call
11-18 11:20:20.056  4539  4640 D GeckoEditable: onDefaultKeyEvent(action=1, keyCode=31, metaState=0, time=613010, repeatCount=0)
11-18 11:20:20.058  4539  4554 D GeckoEditable: reply: Action(TYPE_EVENT)
XXX 11-18 11:20:20.060  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$START@f5d0781) = 10 <--- selection on Java is 10 unfortunately
11-18 11:20:20.060  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$END@1abb026) = 10
...
11-18 11:20:20.073  4539  4539 D GeckoEditable: offer: Action(TYPE_REPLACE_TEXT)
11-18 11:20:20.073  4539  4539 D GeckoEditable: icSendComposition(): no composition
11-18 11:20:20.073  4539  4539 D GeckoEditable: sending: KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_O, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=614141, downTime=614141, deviceId=-1, source=0x101 }
11-18 11:20:20.080  4539  4539 D GeckoEditable: replace(10, 10, "o") = GeckoEditable
11-18 11:20:20.080  4539  4539 D GeckoEditable: getSpanStart(android.text.NoCopySpan$Concrete@30d908d) = 10
11-18 11:20:20.080  4539  4539 D GeckoEditable: getSpanStart(android.text.Selection$END@1abb026) = 11
11-18 11:20:20.081  4539  4539 D GeckoEditable: offer: Action(TYPE_SET_SPAN)
11-18 11:20:20.083  4539  4539 D GeckoEditable: setSpan(android.text.NoCopySpan$Concrete@8dfb242, 10, 11, 33)
11-18 11:20:20.083  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@9b3253) = 0
11-18 11:20:20.084  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@a9be790) = 0
11-18 11:20:20.084  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@e4fa889) = 0
11-18 11:20:20.101  4539  4555 D GeckoEditable: reply: Action(TYPE_REPLACE_TEXT)
11-18 11:20:20.102  4539  4640 D GeckoEditable: reply: Action(TYPE_SET_SPAN)
11-18 11:20:20.104  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@9b3253) = 0
11-18 11:20:20.104  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@a9be790) = 0
11-18 11:20:20.104  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@e4fa889) = 0
11-18 11:20:20.104  4539  4539 D GeckoEditable: getSpanFlags(android.text.NoCopySpan$Concrete@7b26178) = 0
11-18 11:20:20.105  4539  4539 D GeckoEditable: sendKeyEvent(KeyEvent { action=ACTION_UP, keyCode=KEYCODE_O, scanCode=0, metaState=0, flags=0x0, repeatCount=0, eventTime=613010, downTime=613010, deviceId=-1, source=0x101 }, 1, 0)
11-18 11:20:20.106  4539  4539 D GeckoEditable: offer: Action(TYPE_EVENT)
11-18 11:20:20.119  4539  4554 D GeckoEditable: onTextChange("oc", 10, 10)
Component: General → Graphics: WebRender
Product: GeckoView → Core
Component: Graphics: WebRender → General
Product: Core → GeckoView
Assignee: nobody → m_kato
Whiteboard: [geckoview:m1912] → [geckoview:m1912] [geckoview:m74]
Whiteboard: [geckoview:m1912] [geckoview:m74] → [geckoview:m1912][geckoview:m74][geckoview:m75]
Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/3b50706b1bad Waiting for text change when keypress is dispatched. r=geckoview-reviewers,esawin
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75

I can still easily reproduce this issue in FxR using GeckoView Nightly 75.0.20200221095110.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

(In reply to Randall Barker [:rbarker] from comment #7)

I can still easily reproduce this issue in FxR using GeckoView Nightly 75.0.20200221095110.

Could you attach adb log with the latest GV? (set DEBUG_ANDROID_IME=1 on GeckoEditoable.cpp and set DEBUG value to true for GeckoEditable.java and GeckoInputConnection.java). When I emulate old device that uses Android arm emulator, this cannot reproduce this after landing my fix.

Flags: needinfo?(rbarker)
Whiteboard: [geckoview:m1912][geckoview:m74][geckoview:m75] → [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76]

I can no longer reproduce this issue. Maybe I was on an older version of FxR when I reproduced.

Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Flags: needinfo?(rbarker)
Resolution: --- → FIXED

Figures, as soon as I close this, I am able to reproduce. I'll try and collect the logs you asked for now. Sorry.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached file Logcat with flags

:m_kato, I've attached the logcat from a build of GeckoView from the latest in m-c. Hope this helps.

Flags: needinfo?(m_kato)
Attached video type.mp4

Video recording of FxR during logcat capture.

Thanks, I am looking.

Flags: needinfo?(m_kato)
Whiteboard: [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76] → [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76][geckoview:m77]

Actually we emulate key event (down, press and up) from replace transaction of
Editable. When dispatching key press, we always update current caret position.

Most situations is the following.

  1. Dispatch keypress
  2. Dispatch another keypress
  3. Receive merged text/selection change result by 1. and 2.
  4. Sync shadow (Java's Editable) text with 3.'s result. It means selection is
    correct position now.
  5. Dispatch keypress with correct position.

When this issue occurs, the following situation occurs.

  1. Dispatch keypress
  2. Dispatch another keypress
  3. Receive text/selection change result of 1.
  4. Sync shadow (Java's Editable) text with 3.'s result. It means selection is
    old position now.
  5. Dispatch another keypress with old position.
  6. Receive text/selection change result of 2.
  7. Receive text/selection change result of 5.

So when dispatching key press, we shouldn't always update selection if unnecessary.
Because selection range is already often set before dispatching key press.

Pushed by m_kato@ga2.so-net.ne.jp: https://hg.mozilla.org/integration/autoland/rev/27da136bf5a9 Don't set selection on dispatching key event if unnecessary. r=geckoview-reviewers,snorp
Whiteboard: [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76][geckoview:m77] → [geckoview:m1912][geckoview:m74][geckoview:m75][geckoview:m76][geckoview:m77][geckoview:m78]
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: