Closed Bug 739393 Opened 12 years ago Closed 12 years ago

New tab opened in background is not set to inactive

Categories

(Firefox for Android Graveyard :: General, defect)

All
Android
defect
Not set
normal

Tracking

(blocking-fennec1.0 +)

VERIFIED FIXED
Firefox 14
Tracking Status
blocking-fennec1.0 --- +

People

(Reporter: mbrubeck, Assigned: mbrubeck)

Details

Attachments

(1 file, 1 obsolete file)

Attached patch patch (obsolete) — Splinter Review
Steps to reproduce:
1. Long-press on a link
2. Choose "open in new tab"

Expected results: The new tab opens in the background and its docshell is inactive (e.g. JavaScript timers are throttled).

Actual results: The new tab opens in the background and its docshell is active (timers are unthrottled).

The fix is simple but we should probably also have tests for this.
Attachment #609471 - Flags: review?(mark.finkle)
Attachment #609471 - Flags: review?(mark.finkle) → review+
Comment on attachment 609471 [details] [diff] [review]
patch

This patch does not work correctly.  Setting browser.docShell.isActive too soon after the browser is created has no effect, and also seems to prevent later assignements from having any effect.  It also seems to cause an intermittent exception during startup that leaves the browser in a broken state.

We might need to call setActive after a timeout, or something.
Attachment #609471 - Flags: review-
Desktop Firefox sets docShellIsActive=false on all newly-created <browser> elements without a timeout... I haven't figured out yet why this isn't working in Fennec.
blocking-fennec1.0: --- → ?
blocking-fennec1.0: ? → +
Attached patch patch v2Splinter Review
I found out that docShellIsActive will only work after the <browser> element has been added to the DOM.
Attachment #609471 - Attachment is obsolete: true
Attachment #616419 - Flags: review?(mark.finkle)
Comment on attachment 616419 [details] [diff] [review]
patch v2

In hindsight it makes perfect sense. Nice catch.
Attachment #616419 - Flags: review?(mark.finkle) → review+
https://hg.mozilla.org/mozilla-central/rev/7a227bcb5bde
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 14
Verified fixed on:
-build: Firefox for Android 21.0a1 (2013-02-11)
-device: Samsung Galaxy Nexus 
-OS: Android 4.1.2
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: