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)
Tracking
(blocking-b2g:koi+, 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)
|
966 bytes,
patch
|
Details | Diff | Splinter Review | |
|
7.64 KB,
patch
|
kanru
:
review+
|
Details | Diff | Splinter Review |
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.
Comment 1•12 years ago
|
||
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]
| Reporter | ||
Comment 2•12 years ago
|
||
Tim, I can't find any workaround from my perspective. I think we need help from gecko team.
Flags: needinfo?(lchang)
Comment 3•12 years ago
|
||
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)
| Assignee | ||
Comment 4•12 years ago
|
||
I'll take a look and see if it's an easy fix or workaround.
Flags: needinfo?(kchen)
Comment 5•12 years ago
|
||
Tim, may I know who will take the ownership of this bug.
Flags: needinfo?(timdream)
Comment 6•12 years ago
|
||
Kanru is investigating for now.
Assignee: nobody → kchen
Status: NEW → ASSIGNED
Flags: needinfo?(timdream)
Flags: needinfo?(schien)
| Assignee | ||
Comment 7•12 years ago
|
||
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?
| Assignee | ||
Comment 8•12 years ago
|
||
Each time I input a character jspinyin receive two deactivate call.
| Assignee | ||
Comment 9•12 years ago
|
||
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.
Comment 10•12 years ago
|
||
(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.
| Assignee | ||
Comment 11•12 years ago
|
||
(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).
| Assignee | ||
Comment 12•12 years ago
|
||
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.
| Assignee | ||
Comment 13•12 years ago
|
||
I don't know if there is a more efficient way to do this :S
Attachment #826656 -
Flags: review?(xyuan)
Comment 14•12 years ago
|
||
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+
Updated•12 years ago
|
Flags: needinfo?(xyuan)
| Assignee | ||
Comment 15•12 years ago
|
||
Bug 914100 looks good. I can't test bug 811177 because IME tests app is broken for a while.
| Assignee | ||
Comment 16•12 years ago
|
||
Comment 17•12 years ago
|
||
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)
| Assignee | ||
Comment 18•12 years ago
|
||
(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)
| Assignee | ||
Comment 19•12 years ago
|
||
Clearly the element in an iframe is not a descendant of the document.body.
| Assignee | ||
Comment 20•12 years ago
|
||
This version looks better :)
Attachment #826656 -
Attachment is obsolete: true
Attachment #827302 -
Flags: review?(xyuan)
Comment 21•12 years ago
|
||
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)
| Assignee | ||
Updated•12 years ago
|
Attachment #827302 -
Attachment is patch: true
| Assignee | ||
Comment 22•12 years ago
|
||
(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.
| Assignee | ||
Comment 23•12 years ago
|
||
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..
| Assignee | ||
Comment 24•12 years ago
|
||
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.
Comment 25•12 years ago
|
||
On b2g-desktop, the UI tests app is not OOPed. May it be the cause?
| Assignee | ||
Comment 26•12 years ago
|
||
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..
Updated•12 years ago
|
Component: Gaia::Keyboard → General
| Assignee | ||
Comment 27•12 years ago
|
||
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)
| Assignee | ||
Comment 28•12 years ago
|
||
Correction: ...the content iframe does *not* have an MM...
https://tbpl.mozilla.org/?tree=Try&rev=2b08dd6e4df1
Comment 29•12 years ago
|
||
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 30•12 years ago
|
||
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)
Comment 31•12 years ago
|
||
uh, indeed.
Comment 32•12 years ago
|
||
@Kan-ru, thanks for digging into this tough bug. You're almost there:)
| Assignee | ||
Comment 33•12 years ago
|
||
| Assignee | ||
Comment 34•12 years ago
|
||
Add test case and fix the null check.
Attachment #830754 -
Attachment is obsolete: true
Attachment #831413 -
Flags: review?(bugs)
Comment 35•12 years ago
|
||
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+
| Assignee | ||
Comment 36•12 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=c6d9d11154fa
Looks like we don't need the hack here.
| Assignee | ||
Comment 37•12 years ago
|
||
Uh.. it does need the hack.
| Assignee | ||
Comment 38•12 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=f6644987b5b0
Dispatch click event directly
Comment 39•12 years ago
|
||
Update: Kanru told me he still have trouble debug Emulator test run locally, so he will work something out.
| Assignee | ||
Comment 40•12 years ago
|
||
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+
| Assignee | ||
Comment 41•12 years ago
|
||
Comment 42•12 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/2fe365696178
https://hg.mozilla.org/mozilla-central/rev/84c1a344132b
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 43•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/07185f63dc39
https://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/6cff38d1f936
status-b2g-v1.2:
--- → fixed
status-firefox26:
--- → wontfix
status-firefox27:
--- → wontfix
status-firefox28:
--- → fixed
Target Milestone: --- → 1.3 Sprint 5 - 11/22
| Assignee | ||
Comment 45•12 years ago
|
||
Until bug 941468 is fixed, we need to back this out.
Attachment #8343561 -
Flags: review?(xyuan)
Updated•12 years ago
|
Attachment #8343561 -
Flags: review?(xyuan) → review+
| Assignee | ||
Comment 46•12 years ago
|
||
Actually I think load forms.js only once in the top browser could resolve both problem.. patches coming.
| Assignee | ||
Updated•12 years ago
|
Attachment #8343561 -
Attachment is obsolete: true
You need to log in
before you can comment on or make changes to this bug.
Description
•