Open Bug 441901 Opened 16 years ago Updated 2 years ago

SessionStore does not always save hideable window features

Categories

(Firefox :: Session Restore, enhancement)

enhancement

Tracking

()

People

(Reporter: morac, Unassigned)

References

(Blocks 1 open bug)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

Looking at the code the SessionStore component code, it looks like it is supposed to be saving the hideable window features (see below) such that if one or more of these is hidden in the browser window, a "hidden" variable is supposed to be created to store the hidden window features for restoration later.  The "hidden" variable is never created when any of these is hidden.

The code which checks for hidden elements is in the _updateWindowFeatures function as follows:

const WINDOW_HIDEABLE_FEATURES = [
  "menubar", "toolbar", "locationbar", 
  "personalbar", "statusbar", "scrollbars"
];

    var hidden = WINDOW_HIDEABLE_FEATURES.filter(function(aItem) {
      return aWindow[aItem] && !aWindow[aItem].visible;
    });


The problem is that when any of these items are hidden, they aren't setting the variables that the code is checking.  For example hiding the status bar doesn't set a window["statusbar"] variable.  It set's the "hidden" attribute on the "status-bar" element.  So the visible status of the status bar isn't correctly saved.

In addition, many of the other items in the WINDOW_HIDEABLE_FEATURES array don't even appear to correctly reference the element that they are referring too.


Reproducible: Always

Steps to Reproduce:
1. Hide the status bar using the View menu and crash the browser
2. Choose to restore the session when starting the browser.

Actual Results:  
Status bar is visible

Expected Results:  
Status bar should not be visible

It looks like this piece of code may be left over from the old Crash Recovery extension in that it appears to be looking for Mozilla suite data.
The code you cite does still work as expected, just not always, as there are several ways of hiding e.g. the statusbar. What we correctly detect is elements which were set as hidden features through window.open (as seen in many popup windows).

What we don't detect at all, however, is when the element is collapsed/hidden while the window is open (that's saved/restored through localstore.rdf). Confirming this bug thus as an enhancement request to that end.
Severity: normal → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Summary: SessionStore does not correctly save hideable window features → SessionStore does not always save hideable window features
Blocks: 450886
Depends on: 454051
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.