Closed
Bug 1017892
Opened 10 years ago
Closed 6 years ago
visibility change not firing for window.open
Categories
(Firefox OS Graveyard :: Gaia::System::Window Mgmt, defect)
Tracking
(tracking-b2g:backlog)
RESOLVED
WONTFIX
tracking-b2g | backlog |
People
(Reporter: nick, Unassigned)
References
Details
(Whiteboard: [games])
Attachments
(1 file)
836 bytes,
application/zip
|
Details |
See attached apps. STR: 1. Open index.html in desktop FF. 2. Click link 3. close tab that was just opened. 4. Notice two visibiltychange events fired (one for window.open, one for navigating back). 5. Add app to App manager and push to phone (though hosting locally and navigating to your ip addr should work). 6. Click link 7. Close window. Expected: two visibility changes. Actual: zero visibility changes. ignore the rAF code. FxOS 1.4 git commit info 2014-05-09
Comment 1•10 years ago
|
||
Triage team: Nick has isolated this bug as the cause of 2 instances of unexpected behavior on a game we're working on for 1.4.
blocking-b2g: --- → 1.4?
Comment 2•10 years ago
|
||
Marking qawanted to check 1.3.
Component: General → Gaia::System::Window Mgmt
Keywords: qawanted
Updated•10 years ago
|
QA Contact: lmauritson
Comment 3•10 years ago
|
||
Testing on a 1.3 Buri, the result is the same as on 1.4. The two lines of text do not appear when returning to the page with the link from the other page. However, if the device is left alone on the link page and falls asleep the two lines of text will appear after unlocking the device. (This occurs on both 1.4 and 1.3) Device: Buri Build ID: 20140602024006 Gaia: 5bd226b03a2d63dfe9df204f7c0afb9984e8fd42 Gecko: 14b755c65af8 Version: 28.0 (1.3) Firmware Version: v1.2device.cfg
Keywords: qawanted
Comment 4•10 years ago
|
||
In the partner app in question here, can this problem be worked around?
Flags: needinfo?(nick)
Reporter | ||
Comment 5•10 years ago
|
||
Even if we could stop the game loop upon window.open calls, we still cannot know when the opened window is closed. So we could figure out when we become "invisible" programmatically, but we cannot programatically detect when we become visible again. Some idea's for a work around: ```javascript pauseGameEngine(); var a = window.open(); a.onunload = unpauseGameEngine; //or a.document.onvisibilitychange = unpauseGameEngine; ``` I will work on a test case to verify one of these in FxOS.
Flags: needinfo?(nick)
Reporter | ||
Comment 6•10 years ago
|
||
The first idea didn't work: https://bugzilla.mozilla.org/show_bug.cgi?id=1020621
Comment 7•10 years ago
|
||
QA, Please verify me and lets test this before landing.
blocking-b2g: 1.4? → 1.4+
Keywords: verifyme
Comment 9•10 years ago
|
||
Erin, Can we please make sure this gets tested prior to landing on 1.4?
Flags: needinfo?(elancaster)
Comment 10•10 years ago
|
||
QA is happy to test a try build once a fix/patch is available but first we need an assignee. Any ideas?
Updated•10 years ago
|
Flags: needinfo?(elancaster) → needinfo?(praghunath)
Comment 11•10 years ago
|
||
Tim Can you please review from Window Management?
Flags: needinfo?(praghunath) → needinfo?(timdream)
Comment 12•10 years ago
|
||
Sadly this is yet another result of we overloading setVisible(). Alive, is this intentional? I suspect we defer or not calling setVisible() for pop-ups because of transition. (In reply to Preeti Raghunath(:Preeti) from comment #9) > Erin, > > Can we please make sure this gets tested prior to landing on 1.4? I would like to revisit blocking 1.4 decision here since we shipped with this behavior on 1.3, or maybe even 1.2. What prompts the block? Can this block 2.0 instead? Are we blocking random releases based on what's currently inflight?
Flags: needinfo?(timdream)
Flags: needinfo?(praghunath)
Flags: needinfo?(alive)
Comment 14•10 years ago
|
||
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #12) > Sadly this is yet another result of we overloading setVisible(). > > Alive, is this intentional? I suspect we defer or not calling setVisible() > for pop-ups because of transition. > For popup we don't want to kill the popup opener so we never send the popup to background. For the use case described in comment 5, since bug 1020621 thinks this is not a platform bug, I don't think gaia could do anything to move this forward.
Flags: needinfo?(alive)
Comment 15•10 years ago
|
||
(In reply to Alive Kuo [:alive][NEEDINFO!] from comment #14) > For popup we don't want to kill the popup opener so we never send the popup > to background. ... you mean "we never send the popup 'opener' to background"? Would you point us the bug that add this behavior?
Flags: needinfo?(alive)
Comment 16•10 years ago
|
||
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #15) > (In reply to Alive Kuo [:alive][NEEDINFO!] from comment #14) > > For popup we don't want to kill the popup opener so we never send the popup > > to background. > > ... you mean "we never send the popup 'opener' to background"? yes. opener who opens the window. > > Would you point us the bug that add this behavior? I think this is existing from v1.0 popup.
Flags: needinfo?(alive)
Comment 17•10 years ago
|
||
(In reply to Nick Desaulniers [:\n] from comment #5) > Even if we could stop the game loop upon window.open calls, we still cannot > know when the opened window is closed. So we could figure out when we > become "invisible" programmatically, but we cannot programatically detect > when we become visible again. > > Some idea's for a work around: > ```javascript > pauseGameEngine(); > var a = window.open(); > a.onunload = unpauseGameEngine; > //or > a.document.onvisibilitychange = unpauseGameEngine; > ``` > > I will work on a test case to verify one of these in FxOS. I just found a dirty workaround to know an opened window is closed. http://jsfiddle.net/zuul/namuj/
Comment 18•10 years ago
|
||
Given the fact, I am more confident to say we shouldn't block 1.4 for this bug. A proper fix would be to decouple visibility state with memory management here. (In reply to Alive Kuo [:alive][NEEDINFO!] from comment #17) > I just found a dirty workaround to know an opened window is closed. > http://jsfiddle.net/zuul/namuj/ This is not a solution I am comfortable with, but that's what we have right now :'(
blocking-b2g: 1.4+ → 1.4?
Comment 20•10 years ago
|
||
(In reply to Tim Guan-tin Chien [:timdream] (MoCo-TPE) (please ni?) from comment #13) > qawanted to verify 1.3 behavior. comment 4 already clarified this is reproducible on 1.3.
Keywords: qawanted
Comment 22•10 years ago
|
||
Un-noming. Thank you, :timdream and :alive. We really appreciate the help with the workaround.
blocking-b2g: 1.4? → ---
Comment 23•10 years ago
|
||
Moving this to backlog for an better solution.
blocking-b2g: --- → backlog
Flags: needinfo?(praghunath)
Comment 24•10 years ago
|
||
The proper solution might be use the new setVisible browser API to tell gecko the opener should go to background with higher priority. It's still in planning so I don't have a platform bug handy.
Assignee | ||
Updated•9 years ago
|
blocking-b2g: backlog → ---
tracking-b2g:
--- → backlog
Comment 25•6 years ago
|
||
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•