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 Repro: 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. planet.mozilla.org) 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. Expected: - content doesn't go blank after closing a different tab Actual: - content area goes blank.
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>).
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 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.
Created attachment 583387 [details] [diff] [review] Proposed patch, version 2. Patch version 2. Carrying forward r+.
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 on attachment 583387 [details] [diff] [review] Proposed patch, version 2. [Approval Request Comment] We need this on aurora to fix the rendering issue
Comment on attachment 583387 [details] [diff] [review] Proposed patch, version 2. [Triage Comment] Mobile only - approved for Aurora.