Note: There are a few cases of duplicates in user autocompletion which are being worked on.

Focus (?) not working for tabs in Gaia browser app (virtual keyboard broken for remote content in browser)

RESOLVED FIXED in mozilla17



5 years ago
3 years ago


(Reporter: cjones, Assigned: Felipe)


(Blocks: 1 bug)

Dependency tree / graph

Firefox Tracking Flags

(Not tracked)



(1 attachment)

This is almost certainly due to bug 774139.

Testing on, which doesn't preventDefault() the touchstart event so should only get mouse events IIUC, I see

received event touchstart
received event mousedown
received event touchmove   <== wrong, I think
received event mousemove
received event touchmove
received event mousemove
received event touchend    <== also wrong, I think, maybe not
received event mouseup

This is probably confusing either our focus code or the JS form helper.
Blocks: 745143

Comment 1

5 years ago
That sequence seems right to me. If you have listeners, you'll always get the touch events. And if the code called preventDefault() then it should stop getting mouse events, but will still get touch.
OK.  Good to know, my understanding was incorrect.
Alright, doesn't seem to be touch-event related.  Whew!

If I load this page

as the "Template" app, set to run out-of-process, it brings up the VKB just fine.  If I remove the .focus() call and tap the app, it works just fine too.

However, if I load the same page in the browser app, it *doesn't* work, whether with explicit .focus() or tapping the input box.

This smells to me like a missing docShell.activate on the content side.  Dale, Justin, can you guys investigate?
No longer blocks: 774139
Component: DOM: Events → DOM: Other
Summary: Gaia virtual keyboard broken for remote content → Focus (?) not working for tabs in Gaia browser app (virtual keyboard broken for remote content in browser)
Blocks: 693515
Another possibility is that this is a recent bug in the gaia browser app.  If so please close out.

Comment 5

5 years ago
Created attachment 643728 [details] [diff] [review]

Comment 6

5 years ago
Here's what I think is happening:

You remember when you were dealing with bug 761927 and debugging through nsFocusManager::SetFocusInner et. al?  The focus manager is activated by mouse or keyboard input events.

Now, in bug 774139, we stopped sending mouse events to the parent element, in favor of creating the phony mouse events in the content.  But this means that SetFocusInner won't get called and remote->Activate() won't be called (

The solution is that we can still block cross-process forwarding of mouse events in that case, but we make them reach the parent frame as well. This seems a more correct behavior.

Another hack solution would be to call remote->Activate()  in nsEventStateManager::HandleCrossProcessEvent, but that feels like a hack and I believe can fall into other focus issues.
Comment on attachment 643728 [details] [diff] [review]

Fixes the bug for me.
Attachment #643728 - Flags: feedback+
Indeed a regression from forwarding touch events.
Blocks: 774139
No longer blocks: 693515
Component: DOM: Other → DOM
A potential problem with this patch is that IIUC, it will result in synthesized mouse events *always* being delivered to in-process content, even if the content preventDefault().  I don't think that's all that serious of a problem but we'd need to test.


5 years ago
Attachment #643728 - Flags: review?(bugs)
Comment on attachment 643728 [details] [diff] [review]

smaug is OK with delegating this review to me.
Attachment #643728 - Flags: review?(bugs) → review+


5 years ago
Assignee: nobody → felipc
Target Milestone: --- → mozilla17
Last Resolved: 5 years ago
Resolution: --- → FIXED
Depends on: 779358


5 years ago
Blocks: 819102


3 years ago
See Also: → bug 981278
You need to log in before you can comment on or make changes to this bug.