Open Bug 559005 Opened 15 years ago Updated 2 years ago

The last tab with 'about:blank' should have a close button, and hide it when CloseWithLastWindow is false

Categories

(Firefox :: Tabbed Browser, defect)

defect

Tracking

()

People

(Reporter: alfredkayser, Unassigned)

Details

Now that bug 501714 is fixed (the last tab should have a close button), there now a special case to be considered: When the last tab is 'empty' (when it is displaying 'about:blank') the close button should not be visible/active, as there is nothing to close.
The logic should as follows: if (only one tab is displayed, and it is empty (showing about:blank)) { if (closeWindowWithLastTab = true) show close button //as one can close the last tab, closing the whole window else hide close button //The last tab (when empty) can not be closed. } Compare with Chrome which has 'closeWindowWithLastTab' behaviour: the last tab always has a close button, and always close the window. Compare with Opera which has 'closeWindowWithLastTab=false' behaviour: the last tab never has a close button, and never closes the window. Using the following CSS I can simulate the desired behaviour: /* With closeWindowWithLastTab=false, with only one tab, and empty, don't show close button */ .tabbrowser-tab[label="New Tab"]:first-of-type:last-of-type > .tab-close-button{ display:none} /* With closeWindowWithLastTab=true, with only one tab, and empty, do show close button (even if not empty) */ .tabbrowser-tabs[closebuttons="noclose"]>.tabbrowser-tab:first-of-type:last-of-type >.tab-close-button{ display:-moz-box}
Summary: With 'closeWindowWithLastTab=false' the last tab with 'about:blank' should NOT have a close button → The last tab with 'about:blank' should have a close button, and hide it when CloseWithLastWindow is false
Notes from bug 490166: Replace :first-of-type:last-of-type with :only-of-type. [label="New Tab"] is not good enough indeed. I need something else to test for 'empty page' status, this needs something in browser.js to indicate 'empty' status.
Bug 501714 enables the close button on the last tab (empty) when closeWindowWithLastTab == false . This was done due to inconsistency problems between mouse and keyboard. Now you want to disable the close button if closeWindowWithLastTab == false? I'm sorry, but this doesn't make any sense. Maybe you need to explain your request a little bit further?
Oh, forget about my last comment, misunderstood you. I'm sorry about that.
Severity: minor → S4
You need to log in before you can comment on or make changes to this bug.