Closed Bug 931746 Opened 12 years ago Closed 12 years ago

The composition string is always cleared abnormally in the location bar of the browser

Categories

(Firefox OS Graveyard :: General, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:koi+, firefox26 wontfix, firefox27 wontfix, firefox28 fixed, b2g-v1.2 fixed)

RESOLVED FIXED
1.3 Sprint 5 - 11/22
blocking-b2g koi+
Tracking Status
firefox26 --- wontfix
firefox27 --- wontfix
firefox28 --- fixed
b2g-v1.2 --- fixed

People

(Reporter: lchang, Assigned: kanru)

References

Details

(Whiteboard: [3rd-party-keyboard])

Attachments

(2 files, 4 obsolete files)

gaia: 65050448048799c749601d22955bdf24bb4bc72a gecko: 9e2ec4ca9896a4a5a4698d49a1a053c1c1c07ff9 The composition string will show in the location bar shortly and then disappear right away when the keyboard app is using "setComposition()". You can try this issue by using pinyin IME since it is the only layout engine which uses new composition APIs so far. As Gary mentioned in https://bugzilla.mozilla.org/show_bug.cgi?id=924846#c11 , I found that this bug is also caused by OOP issue. It will work fine if I enable OOP in the browser app but I don't know why.
See Also: → 924846
We need a fix/workaround in koi+. Luke, are you still investigating the Gecko part or we need help?
blocking-b2g: koi? → koi+
Flags: needinfo?(lchang)
Whiteboard: [3rd-party-keyboard]
Tim, I can't find any workaround from my perspective. I think we need help from gecko team.
Flags: needinfo?(lchang)
Luke, thank you. Kanru or SC, do you have extra bandwidth to work on the issue? If not I can try to talk to managers...
Flags: needinfo?(schien)
Flags: needinfo?(kchen)
I'll take a look and see if it's an easy fix or workaround.
Flags: needinfo?(kchen)
Tim, may I know who will take the ownership of this bug.
Flags: needinfo?(timdream)
Kanru is investigating for now.
Assignee: nobody → kchen
Status: NEW → ASSIGNED
Flags: needinfo?(timdream)
Flags: needinfo?(schien)
I/GeckoDump( 1075): jspinyin: Deactivate. I/GeckoDump( 1075): jspinyin: empty. I/GeckoDump( 1075): jspinyin: SendPendingSymbol: I/GeckoDump( 1075): jspinyin: SendPendingSymbol endComposition I/GeckoDump( 1075): jspinyin: E/GeckoConsole( 1075): [JavaScript Error: "TypeError: inputContext is null" {file: "app://keyboard.gaiamobile.org/js/keyboard.js" line: 1839}] I/GeckoDump( 1075): jspinyin: Activate. Input type: text E/GeckoConsole( 1075): [JavaScript Error: "Return value is not an object."] Probably loosing focus?
Each time I input a character jspinyin receive two deactivate call.
forms.js was loaded twice. When we focus the search bar, both forms.js receive "focus" event and addEditorObserver self. Only the second forms.js receives the Forms:SetComposition message and triggers EditAction that makes the first forms.js call sendKeyboardState.
(In reply to Kan-Ru Chen [:kanru] from comment #9) > forms.js was loaded twice. > > When we focus the search bar, both forms.js receive "focus" event and > addEditorObserver self. Only the second forms.js receives the > Forms:SetComposition message and triggers EditAction that makes the first > forms.js call sendKeyboardState. Where did you test it? On b2g-desktop, there are two form.js files loaded; while on the device, there seems only one.
(In reply to Yuan Xulei [:yxl] from comment #10) > (In reply to Kan-Ru Chen [:kanru] from comment #9) > > forms.js was loaded twice. > > > > When we focus the search bar, both forms.js receive "focus" event and > > addEditorObserver self. Only the second forms.js receives the > > Forms:SetComposition message and triggers EditAction that makes the first > > forms.js call sendKeyboardState. > > Where did you test it? On b2g-desktop, there are two form.js files loaded; > while on the device, there seems only one. On the device (unagi).
4796:I/Gecko ( 4658): focus evt currentTarget[object ContentFrameMessageManager @ 0x47327200 (native @ 0x47ba62e0)] 4808:I/Gecko ( 4658): focus evt currentTarget[object ContentFrameMessageManager @ 0x453325c0 (native @ 0x45330ee0)] The event is received by two different frame message manager. I guess the event is captured by the system iframe then captured by the browser app iframe since they are in the same tree.
I don't know if there is a more efficient way to do this :S
Attachment #826656 - Flags: review?(xyuan)
Comment on attachment 826656 [details] [diff] [review] Only handle events from our direct descendants Review of attachment 826656 [details] [diff] [review]: ----------------------------------------------------------------- It looks good for me, but I don't test it on devices. Please make sure the patch doesn't break bug 914100 and bug 811177.
Attachment #826656 - Flags: review?(xyuan) → review+
Flags: needinfo?(xyuan)
Bug 914100 looks good. I can't test bug 811177 because IME tests app is broken for a while.
Hi Kan-Ru, the patch broke the |UI Tests| app. With the patch, I cannot open the keyboard with the keyboard page of the |UI Tests| app. Without that path, that test app works fine.
Flags: needinfo?(xyuan) → needinfo?(kchen)
(In reply to Yuan Xulei [:yxl] from comment #17) > Hi Kan-Ru, the patch broke the |UI Tests| app. With the patch, I cannot open > the keyboard with the keyboard page of the |UI Tests| app. > > Without that path, that test app works fine. Thanks, backout'ed https://hg.mozilla.org/integration/b2g-inbound/rev/2620144506dc
Flags: needinfo?(kchen)
Clearly the element in an iframe is not a descendant of the document.body.
This version looks better :)
Attachment #826656 - Attachment is obsolete: true
Attachment #827302 - Flags: review?(xyuan)
Comment on attachment 827302 [details] [diff] [review] Only handle the event from our descendants I tested the patch on b2g-desktop of mozilla-central with gaia master. It fixed the location bar issue, but I still cannot open keyboard on the keyboard page of the UI tests app. I got "too much recursion" errors in the javascript console. Steps to reproduce: 1. Launch UI tests app 2. Open the Keyboard page 3. Tap the first text area Actual: The virtual keyboard doesn't show. Expected: The virtual keyboard shows.
Attachment #827302 - Flags: review?(xyuan)
Attachment #827302 - Attachment is patch: true
(In reply to Yuan Xulei [:yxl] from comment #21) > Comment on attachment 827302 [details] [diff] [review] > Only handle the event from our descendants > > I tested the patch on b2g-desktop of mozilla-central with gaia master. It > fixed the location bar issue, but I still cannot open keyboard on the > keyboard page of the UI tests app. I got "too much recursion" errors in the > javascript console. Hmm, strange. I avoided any recursion in the patch already and it works locally. I will do more test.
So on b2g-desktop, in the UI tests app, only one focus event was fired yet the target has different top window with the content.window. How could it be..
The EventTarget chain does sometimes include the frame message manager (nsInProcessTabChildGlobal) of the UI tests app but never when we focus it. So the event always dispatches to the system app frame message manager only. This is weird, I don't know why we miss the inner frame message manager in the EventTarget chain only on b2g-desktop.
On b2g-desktop, the UI tests app is not OOPed. May it be the cause?
The mozbrowser's DocShell has typeContent so it's frame message handler shouldn't be used as the chrome event handler. But why we get the event on the phone? We are getting close..
Component: Gaia::Keyboard → General
In this setup: <iframe id="root" mozbrowser> #document <iframe id="app" mozbrowser> #document <input id="input1"> <iframe id="content"> #document <input id="input2"> Events dispatched to input1 has following target chain (some omitted): chromeWindow->rootMM->appMM->input1 Events dispatched to input2 has following target chain (some omitted): chromeWindow->rootMM->input2 Because the content iframe does have an MM so it set its mParentTarget to its mChromeEventHandler, the rootMM. This patch adds the enclosing mozbrowser's MM to the target chain, so after this patch events dispatched to input2 has following target chain: chromeWindow->rootMM->appMM->input2 This make the appMM have a chance to receive or capture the events from its content.
Attachment #830754 - Flags: review?(bugs)
Attachment #830754 - Flags: feedback?(xyuan)
Correction: ...the content iframe does *not* have an MM... https://tbpl.mozilla.org/?tree=Try&rev=2b08dd6e4df1
Comment on attachment 830754 [details] [diff] [review] Make sure all mozbrowser mm are in the target chain Could you please add still some test that the parent document of the iframe doesn't get the event. And that the message managers do get them.
Attachment #830754 - Flags: review?(bugs) → review+
Comment on attachment 830754 [details] [diff] [review] Make sure all mozbrowser mm are in the target chain Review of attachment 830754 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/base/nsGlobalWindow.cpp @@ +2801,5 @@ > TryGetTabChildGlobalAsEventTarget(frameElement); > > if (!eventTarget) { > + nsGlobalWindow* topWin = GetScriptableTop(); > + frameElement = topWin->GetFrameElementInternal(); You need a check to ensure |topWin| is not nullptr.
Attachment #830754 - Flags: feedback?(xyuan)
@Kan-ru, thanks for digging into this tough bug. You're almost there:)
Add test case and fix the null check.
Attachment #830754 - Attachment is obsolete: true
Attachment #831413 - Flags: review?(bugs)
Comment on attachment 831413 [details] [diff] [review] Make sure all mozbrowser mm are in the target chain Could you add a click event listener to the main document too and make sure it is not called. Also, if synthesizeMouseAtCenter doesn't succeed everywhere, you may need to do similar hack I did in https://bug847763.bugzilla.mozilla.org/attachment.cgi?id=829768 (the synthesizeMouseAtPoint part)
Attachment #831413 - Flags: review?(bugs) → review+
https://tbpl.mozilla.org/?tree=Try&rev=c6d9d11154fa Looks like we don't need the hack here.
Uh.. it does need the hack.
Update: Kanru told me he still have trouble debug Emulator test run locally, so he will work something out.
Final version that works on both desktop and emulator. Tree closed, will push when it open.
Attachment #831413 - Attachment is obsolete: true
Attachment #833380 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Depends on: 941468
Attached patch backout-84c1a344132b (obsolete) — Splinter Review
Until bug 941468 is fixed, we need to back this out.
Attachment #8343561 - Flags: review?(xyuan)
Attachment #8343561 - Flags: review?(xyuan) → review+
Actually I think load forms.js only once in the top browser could resolve both problem.. patches coming.
Attachment #8343561 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: