Closed Bug 712527 Opened 8 years ago Closed 8 years ago

Closing a tab will wipe the content area and will not refresh

Categories

(Firefox for Android :: General, defect, major)

ARM
Android
defect
Not set
major

Tracking

()

VERIFIED FIXED
Firefox 12
Tracking Status
firefox11 --- fixed
firefox12 --- fixed

People

(Reporter: tchung, Assigned: pcwalton)

Details

Attachments

(3 files, 1 obsolete file)

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>).
Attached patch Proposed patch. (obsolete) — Splinter Review
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.
Assignee: nobody → pwalton
Status: NEW → ASSIGNED
Attachment #583381 - Flags: review?(mark.finkle)
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.
Attachment #583381 - Flags: review?(mark.finkle) → review+
Whiteboard: [fennec-aurora]
Patch version 2. Carrying forward r+.
Attachment #583381 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/4e42899e1b1e
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12
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.
Status: RESOLVED → VERIFIED
Comment on attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

[Approval Request Comment]
We need this on aurora to fix the rendering issue
Attachment #583387 - Flags: review+
Attachment #583387 - Flags: approval-mozilla-aurora?
Whiteboard: [fennec-aurora]
Comment on attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

[Triage Comment]
Mobile only - approved for Aurora.
Attachment #583387 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
You need to log in before you can comment on or make changes to this bug.