Give a man a fish, and he eats for a day. Teach a man to fish, and he eats for a lifetime.I like poetry, long walks on the beach and poking dead things with a stick.Please do not PM me for personal support. Keep posts here in the Forums instead and we all learn.

One thing I've found in my experimenting is that Firefox sets the #main-window attribute "tabsintitlebar=true" when Firefox is maximized, tabs are on top and the menubar is hidden. What I'd like to figure out is a JavaScript to cause this attribute to be also set when Firefox is in "sizemode=normal". I think being able to manipulate the tabsintitlebar attribute would eliminate the need for a lot of style rules and make the option safer for different system configurations.

Does anyone know how Firefox sets and clears the tabsintitlebar attribute?

After digging and researching, I think I can pull this off pretty seamlessly if I could just figure out one thing. How to set an observer that will allow me to fire an event when the menubar is hidden or unhidden. If I could detect this then I could set an observer to the #main-window like maybe "cctabsintitlebar=true". In turn I could marry up every style rule that references "#main-window[tabsintitlebar]" with a second reference that started like "#main-window[cctabsintitlebar][tabsontop]". For instance:

Well I'll be damn, I just searched W3C for CSS selectors and discovered the "~" is a "general sibling combinator". What it does is set the style rule for an object if it is preceded by the referenced sibling. For instance "E ~ T" would set the style rule for object "T" when it appeared after object "E". How slick is that.

This still doesn't help me as I the Titlebar comes well before the menubar so I can't qualify it using "#toolbar-menubar[inactive]". So I still need a way to change the state of my attribute "cctabsintitlebar" when the menubar is hidden/unhidden.

(I feel like I'm having a conversation with myself, but hopefully if I post what I find as I research, someone will have a spark of brilliance they will share with me that helps me accomplish my goal.

Ha! Yeah, ~ is a nice selector. I like to use it instead of + just in case some extension decides to comes along and add an element between my selectors. It is pretty trivial to use a binding to create an observer. Try binding this to #main-window:

Is there a way to change the name of the menubar attribute "inactive" as it is set to #main-window? The reason I ask is that setting the attribute to "inactive" seems really generic and could easily cause future conflicts if Mozilla decided to use that attribute name for something else.

KLB wrote:I'm getting real close with this, I just can't figure out how Firefox moves the tabs to fit between the Firefox app button and the title bar buttons when tabs are in the titlebar.

If you inspect the menubar and tabs toolbar, you will see four new elements, called .titlebar-placeholder. These hold the space for the appbutton and the window-control-buttons. This line in content/browser.css controls their visibility:

So when you push the tabs up you need to switch this to display: -moz-box!important; and that should make the spaces. Also remember to press the Alt button and make sure you are allowing the menu to be shown. But if you are able to set tabsintitlebar attribute then all of this should be automatic.

Edit: I just remembered it isn't inactive=true you need to monitor, it's autohide=true. When you press Alt, inactive will disappear. So the autohide attribute should be descriptive enough without changing the name:

The placeholders only affect the menubar, however, I did figure out how to measure the width of the app button and title bar button box dynamically and apply it to a stylesheet. It works slick as snot.

Here is my first test version of pushing tabs into the title bar when not maximized (both the theme CC and extension CCO are needed):

To enable this behavior go to the "menus & tabs" tab in the CCO options panel and change the setting "display tabs in title bar" to "always". My feeling is this is a pretty radical feature so it is best for it to be an optional setting.