Last Comment Bug 712527 - Closing a tab will wipe the content area and will not refresh
: Closing a tab will wipe the content area and will not refresh
Product: Firefox for Android
Classification: Client Software
Component: General (show other bugs)
: Trunk
: ARM Android
: -- major (vote)
: Firefox 12
Assigned To: Patrick Walton (:pcwalton)
: Sebastian Kaspari (:sebastian)
Depends on:
  Show dependency treegraph
Reported: 2011-12-20 19:03 PST by Tony Chung [:tchung]
Modified: 2012-01-10 14:16 PST (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

before closing tab screenshot (133.02 KB, image/png)
2011-12-20 19:03 PST, Tony Chung [:tchung]
no flags Details
after closing tab screenshot (79.24 KB, image/png)
2011-12-20 19:03 PST, Tony Chung [:tchung]
no flags Details
Proposed patch. (1.37 KB, patch)
2011-12-20 20:47 PST, Patrick Walton (:pcwalton)
mark.finkle: review+
Details | Diff | Splinter Review
Proposed patch, version 2. (1.38 KB, patch)
2011-12-20 21:12 PST, Patrick Walton (:pcwalton)
mark.finkle: review+
akeybl: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Tony Chung [:tchung] 2011-12-20 19:03:11 PST
Created attachment 583368 [details]
before closing tab screenshot

If you close a different tab that's not the same site already opened in the background, the content area will get wiped and go blank.  Refreshing the site or reloading the page will not bring the content back.

See screenshots

1) install 12-20-2011, 12.0a1 fennec nightly.  SGS2 and Galaxy Nexus
2) open > 2 tabs with sites previously loaded 
3) have a page open, then bring down the tab menu (eg.
4) select a tab that isn't already opened in the background, and close it (eg. espn home)
5) Verify after closing the tab, the content goes blank
6) verify exiting the tab menu, you cannot reload the same page or refresh the URL to bring any content back.  It remains blank, until you open another tab and revert back.

- content doesn't go blank after closing a different tab

- content area goes blank.
Comment 1 Tony Chung [:tchung] 2011-12-20 19:03:29 PST
Created attachment 583369 [details]
after closing tab screenshot
Comment 2 Patrick Walton (:pcwalton) 2011-12-20 20:06:41 PST
This only seems to happen when you close a tab that you opened before the current tab. Also note that commenting out the BrowserApp.deck.removeChild(this.vbox); line fixes this issue (but then won't destroy the old xul <browser>).
Comment 3 Patrick Walton (:pcwalton) 2011-12-20 20:47:50 PST
Created attachment 583381 [details] [diff] [review]
Proposed patch.

The problem seems to be that the selected panel of a XUL <deck> does not remain stable when elements are removed. (Maybe it's using an element index internally? I haven't checked but it seems to square with the evidence.) In any case, it looks like saving and restoring the selected panel across the element removal fixes this bug.
Comment 4 Mark Finkle (:mfinkle) (use needinfo?) 2011-12-20 21:08:37 PST
Comment on attachment 583381 [details] [diff] [review]
Proposed patch.

>+    // Make sure the previously selected panel remains selected. The selected panel of a deck is
>+    // not stable when panels are removed.
>+    let prevSelectedPanel = BrowserApp.deck.selectedPanel;

prevSelectedPanel -> selectedPanel

this should work because when closing a tab in Java, we always select the next tab before closing the specified tab.

>     BrowserApp.deck.removeChild(this.vbox);
>+    BrowserApp.deck.selectedPanel = prevSelectedPanel;

iirc, we had to do something similar in XUL fennec for the same reasons.
Comment 5 Patrick Walton (:pcwalton) 2011-12-20 21:12:11 PST
Created attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

Patch version 2. Carrying forward r+.
Comment 6 Patrick Walton (:pcwalton) 2011-12-20 21:15:05 PST
Comment 7 Ed Morley [:emorley] 2011-12-21 04:29:01 PST
Comment 8 Carla Nadastean 2011-12-22 07:24:09 PST
Retested with:
Mozilla/5.0 (Android; Linux armv7l; rv:12.0a1) Gecko/20111222 Firefox/12.0a1 Fennec/12.0a1
HTC Desire Z (Android 2.3)

Bug no longer reproducible. Content area is displayed properly, if a background tab is closed.
Verifying bug.
Comment 9 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-06 23:18:37 PST
Comment on attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

[Approval Request Comment]
We need this on aurora to fix the rendering issue
Comment 10 Alex Keybl [:akeybl] 2012-01-09 14:54:26 PST
Comment on attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

[Triage Comment]
Mobile only - approved for Aurora.
Comment 11 Mark Finkle (:mfinkle) (use needinfo?) 2012-01-10 14:16:01 PST

Note You need to log in before you can comment on or make changes to this bug.