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

VERIFIED FIXED in Firefox 11

Status

()

Firefox for Android
General
--
major
VERIFIED FIXED
6 years ago
6 years ago

People

(Reporter: tchung, Assigned: pcwalton)

Tracking

Trunk
Firefox 12
ARM
Android
Points:
---

Firefox Tracking Flags

(firefox11 fixed, firefox12 fixed)

Details

Attachments

(3 attachments, 1 obsolete attachment)

(Reporter)

Description

6 years ago
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.
(Reporter)

Comment 1

6 years ago
Created attachment 583369 [details]
after closing tab screenshot
(Assignee)

Comment 2

6 years ago
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>).
(Assignee)

Comment 3

6 years ago
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.
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]
(Assignee)

Comment 5

6 years ago
Created attachment 583387 [details] [diff] [review]
Proposed patch, version 2.

Patch version 2. Carrying forward r+.
Attachment #583381 - Attachment is obsolete: true
(Assignee)

Comment 6

6 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/4e42899e1b1e

Comment 7

6 years ago
https://hg.mozilla.org/mozilla-central/rev/4e42899e1b1e
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 12

Comment 8

6 years ago
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?
status-firefox11: --- → affected
status-firefox12: --- → fixed
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+
https://hg.mozilla.org/releases/mozilla-aurora/rev/25076e8c8dbb
status-firefox11: affected → fixed
You need to log in before you can comment on or make changes to this bug.