Closed Bug 531105 Opened 10 years ago Closed 10 years ago

Fennec gets focus after page load is complete while user has switched to another app/desktop on N900

Categories

(Firefox for Android Graveyard :: General, defect)

Fennec 1.1
ARM
Maemo
defect
Not set

Tracking

(Not tracked)

VERIFIED FIXED
fennec1.0

People

(Reporter: juhsep, Assigned: mfinkle)

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; fi; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5
Build Identifier: Mozilla/5.0 (X11;U;Linux armv6l;en-US;rv:1.9.2b5pre) Gecko/20091125 Firefox/3.6b5pre Fennec/1.0b6pre

 

Reproducible: Always

Steps to Reproduce:
1. Start to load a web page in Fennec
2. Switch to another application on N900
3. Wait till page load has ended on Fennec
Actual Results:  
Fennec gets focus

Expected Results:  
N900 stays in the app that the user has selected
Hardware: Other → ARM
Version: Trunk → 1.9.2 Branch
tracking-fennec: --- → ?
(In reply to comment #1)
> Probably caused by
> http://mxr.mozilla.org/mobile-browser/source/chrome/content/browser.js#2371 .
> Wonder why we added that...

I think we did it to give form controls focus in the newly loaded webpage. A lot has changed with focus since then. Maybe we can remove it.
Alternatively, there are ways to focus that content without raising the window (focusing the <browser>, I think?)
The flag didn't do it...

Is there any cases where we want Fennec to raise when we call focus()?

Otherwise we could default mozilla.widget.raise-on-setfocus to false
Status: UNCONFIRMED → NEW
Ever confirmed: true
We don't want to change window.focus() behavior across the board, we just want to avoid calling it in that case. The question is whether we need to replace it with something else... what breaks if we just remove it?
Attached patch patchSplinter Review
This patch simply removes the code the explicitly focuses the dom window. We originally did this to work around web content focus problems. For example, when google.com loads, it focuses the editbox. Fennec was not allowing that to happen, so we added this code.

The focus code in gecko has been overhauled since then. I removed the code and the editbox at google.com was focused (and yellow) after loading. I could also start typing into the editbox with needing to tap it.

Loading planet.mozilla.org (or other large web site), then switching apps did not force fennec to pop back when the page finished loading.

Score this one to Neil Deakin!
Assignee: nobody → mark.finkle
Attachment #414652 - Flags: review?(gavin.sharp)
(In reply to comment #6)

> with something else... what breaks if we just remove it?

Nothing yet...
Attachment #414652 - Flags: review?(gavin.sharp) → review+
pushed:
https://hg.mozilla.org/mobile-browser/rev/d19f7485b029
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → Post-B5
verified FIXED on build:
Mozilla/5.0 (X11; U; Linux armv7l; Nokia N900; en-US; rv:1.9.2b5pre) Gecko/20091130 Firefox/3.6b5pre Fennec/1.0b6pre
Status: RESOLVED → VERIFIED
Component: Linux/Maemo → General
OS: Linux → Linux (embedded)
QA Contact: maemo-linux → general
tracking-fennec: ? → ---
You need to log in before you can comment on or make changes to this bug.