зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1356920 - Don't calculate and flush layout inside browser-tabsintitlebar.js. r=dao
Folded together the following revisions: Bug 1356920 - Remove all toolbar layout code from browser-tabsintitlebar. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7805 *** Bug 1356920 - Move TabsToolbar and toolbar-menubar into the titlebar, and put the titlebar into the navigator-toolbox. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7806 *** Bug 1356920 - Put a spacer in the menubar to push titlebar items to the end, and stop the menu from stretching vertically. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7822 *** Bug 1356920 - Adjust CSS rules for new XUL document structure. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7807 *** Bug 1356920 - Fix placement of tracking protection icon. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7808 *** Bug 1356920 - Get rid of the spacer before the window caption buttons now in the TabsToolbar. r=dao The spacer isn't necessary, since the tabbrowser-tabs node will flex to fill the available space anyways. Differential Revision: https://phabricator.services.mozilla.com/D7809 *** Bug 1356920 - Move movingtab attribute to navigator-toolbox to account for TabsToolbar not being a sibling of nav-bar anymore. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7810 *** Bug 1356920 - Hide the window caption buttons hbox if the native titlebar is being drawn. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7811 *** Bug 1356920 - Keep the macOS window caption buttons vertically centered when drag space is enabled. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7812 *** Bug 1356920 - Switch window caption XUL nodes from IDs to classes so that more than one can exist per doc. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7813 *** Bug 1356920 - Move titlebar items out into a preprocessed file to be included at build-time. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7814 *** Bug 1356920 - Reorganize TabsToolbar contents to force most items to the bottom of it. r=dao Differential Revision: https://phabricator.services.mozilla.com/D9669 *** Bug 1356920 - Update CSS to account for new DOM structure under TabsToolbar. r=dao Differential Revision: https://phabricator.services.mozilla.com/D9670 *** Bug 1356920 - Fix titlebar button rendering when using a lwtheme without the Windows compositor. r=dao Differential Revision: https://phabricator.services.mozilla.com/D9671 *** Bug 1356920 - Put an ordinal rule on the window caption buttons to help ensure they stay at the end of the toolbar. r=dao This is to ensure that the buttons are placed after the post-tabs titlebar placeholder. Differential Revision: https://phabricator.services.mozilla.com/D7815 *** Bug 1356920 - Stretch window caption buttons to fill vertical space on Windows 8+ when using extra drag space. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7817 *** Bug 1356920 - Update onViewToolbarsPopupShowing to search for toolbars that are grandchildren of the toolbox. r?jaws Differential Revision: https://phabricator.services.mozilla.com/D7818 *** Bug 1356920 - Hide the titlebar items in the TabsToolbar if the menubar is being displayed. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7825 *** Bug 1356920 - Fix selector for titlebar. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7826 *** Bug 1356920 - Fix titlebar themeing on Linux. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7828 *** Bug 1356920 - Remove browser-tabsintitlebar layout flushes from performance test whitelist. r?florian Differential Revision: https://phabricator.services.mozilla.com/D7829 *** Bug 1356920 - Fix bottom border of tabbar to account for new DOM structure. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7830 *** Bug 1356920 - Hide the titlebar-buttonbox-container when in fullscreen mode. r=dao Differential Revision: https://phabricator.services.mozilla.com/D7833 --HG-- extra : rebase_source : fe4acce0443df2fad8e15bf54733b7d810cdd2ca
This commit is contained in:
Родитель
7020e04316
Коммит
b457d05277
|
@ -8,44 +8,11 @@ var TabsInTitlebar = {
|
|||
this._readPref();
|
||||
Services.prefs.addObserver(this._prefName, this);
|
||||
|
||||
// We need to update the appearance of the titlebar when the menu changes
|
||||
// from the active to the inactive state. We can't, however, rely on
|
||||
// DOMMenuBarInactive, because the menu fires this event and then removes
|
||||
// the inactive attribute after an event-loop spin.
|
||||
//
|
||||
// Because updating the appearance involves sampling the heights and margins
|
||||
// of various elements, it's important that the layout be more or less
|
||||
// settled before updating the titlebar. So instead of listening to
|
||||
// DOMMenuBarActive and DOMMenuBarInactive, we use a MutationObserver to
|
||||
// watch the "invalid" attribute directly.
|
||||
let menu = document.getElementById("toolbar-menubar");
|
||||
this._menuObserver = new MutationObserver(this._onMenuMutate);
|
||||
this._menuObserver.observe(menu, {attributes: true});
|
||||
|
||||
this.onAreaReset = function(aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this.update();
|
||||
};
|
||||
this.onWidgetAdded = this.onWidgetRemoved = function(aWidgetId, aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this.update();
|
||||
};
|
||||
CustomizableUI.addListener(this);
|
||||
|
||||
window.addEventListener("resolutionchange", this);
|
||||
window.addEventListener("resize", this);
|
||||
|
||||
gDragSpaceObserver.init();
|
||||
|
||||
this._initialized = true;
|
||||
this.update();
|
||||
},
|
||||
|
||||
whenWindowLayoutReady() {
|
||||
this._windowLayoutReady = true;
|
||||
this.update();
|
||||
},
|
||||
|
||||
allowedBy(condition, allow) {
|
||||
if (allow) {
|
||||
if (condition in this._disallowed) {
|
||||
|
@ -82,54 +49,9 @@ var TabsInTitlebar = {
|
|||
this._readPref();
|
||||
},
|
||||
|
||||
handleEvent(aEvent) {
|
||||
switch (aEvent.type) {
|
||||
case "resolutionchange":
|
||||
if (aEvent.target == window) {
|
||||
this.update();
|
||||
}
|
||||
break;
|
||||
case "resize":
|
||||
if (window.fullScreen || aEvent.target != window) {
|
||||
break;
|
||||
}
|
||||
// We use resize events because the window is not ready after
|
||||
// sizemodechange events. However, we only care about the event when
|
||||
// the sizemode is different from the last time we updated the
|
||||
// appearance of the tabs in the titlebar.
|
||||
let sizemode = document.documentElement.getAttribute("sizemode");
|
||||
if (this._lastSizeMode == sizemode) {
|
||||
break;
|
||||
}
|
||||
let oldSizeMode = this._lastSizeMode;
|
||||
this._lastSizeMode = sizemode;
|
||||
// Don't update right now if we are leaving fullscreen, since the UI is
|
||||
// still changing in the consequent "fullscreen" event. Code there will
|
||||
// call this function again when everything is ready.
|
||||
// See browser-fullScreen.js: FullScreen.toggle and bug 1173768.
|
||||
if (oldSizeMode == "fullscreen") {
|
||||
break;
|
||||
}
|
||||
this.update();
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
_onMenuMutate(aMutations) {
|
||||
for (let mutation of aMutations) {
|
||||
if (mutation.attributeName == "inactive" ||
|
||||
mutation.attributeName == "autohide") {
|
||||
TabsInTitlebar.update();
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_initialized: false,
|
||||
_windowLayoutReady: false,
|
||||
_disallowed: {},
|
||||
_prefName: "browser.tabs.drawInTitlebar",
|
||||
_lastSizeMode: null,
|
||||
|
||||
_readPref() {
|
||||
this.allowedBy("pref",
|
||||
|
@ -159,148 +81,11 @@ var TabsInTitlebar = {
|
|||
}
|
||||
}
|
||||
|
||||
this._layOutTitlebar(allowed);
|
||||
|
||||
ToolbarIconColor.inferFromText("tabsintitlebar", allowed);
|
||||
},
|
||||
|
||||
_layOutTitlebar(drawInTitlebar) {
|
||||
if (!this._windowLayoutReady) {
|
||||
return;
|
||||
}
|
||||
|
||||
let $ = id => document.getElementById(id);
|
||||
let rect = ele => ele.getBoundingClientRect();
|
||||
let verticalMargins = cstyle => parseFloat(cstyle.marginBottom) + parseFloat(cstyle.marginTop);
|
||||
|
||||
let titlebar = $("titlebar");
|
||||
let menubar = $("toolbar-menubar");
|
||||
|
||||
if (!drawInTitlebar) {
|
||||
if (AppConstants.platform == "macosx") {
|
||||
let secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width;
|
||||
this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth);
|
||||
}
|
||||
|
||||
// Reset styles that might have been modified:
|
||||
titlebar.style.marginBottom = "";
|
||||
menubar.style.paddingBottom = "";
|
||||
return;
|
||||
}
|
||||
|
||||
let titlebarContent = $("titlebar-content");
|
||||
let titlebarButtons = $("titlebar-buttonbox");
|
||||
|
||||
// Reset the custom titlebar height if the menubar is shown,
|
||||
// because we will want to calculate its original height.
|
||||
let buttonsShouldMatchTabHeight =
|
||||
AppConstants.isPlatformAndVersionAtLeast("win", "10.0") ||
|
||||
AppConstants.platform == "linux";
|
||||
if (buttonsShouldMatchTabHeight &&
|
||||
(menubar.getAttribute("inactive") != "true" ||
|
||||
menubar.getAttribute("autohide") != "true")) {
|
||||
titlebarButtons.style.removeProperty("height");
|
||||
}
|
||||
|
||||
// Try to avoid reflows in this code by calculating dimensions first and
|
||||
// then later set the properties affecting layout together in a batch.
|
||||
|
||||
// Get the height of the tabs toolbar:
|
||||
let fullTabsHeight = rect($("TabsToolbar")).height;
|
||||
|
||||
// Buttons first:
|
||||
let captionButtonsBoxWidth = rect(titlebarButtons).width;
|
||||
|
||||
let secondaryButtonsWidth, menuHeight, fullMenuHeight, menuStyles;
|
||||
if (AppConstants.platform == "macosx") {
|
||||
secondaryButtonsWidth = rect($("titlebar-secondary-buttonbox")).width;
|
||||
// No need to look up the menubar stuff on OS X:
|
||||
menuHeight = 0;
|
||||
fullMenuHeight = 0;
|
||||
} else {
|
||||
// Otherwise, get the height and margins separately for the menubar
|
||||
menuHeight = rect(menubar).height;
|
||||
menuStyles = window.getComputedStyle(menubar);
|
||||
fullMenuHeight = verticalMargins(menuStyles) + menuHeight;
|
||||
}
|
||||
|
||||
// And get the height of what's in the titlebar:
|
||||
let titlebarContentHeight = rect(titlebarContent).height;
|
||||
|
||||
// Begin setting CSS properties which will cause a reflow
|
||||
|
||||
// Adjust the window controls to span the entire
|
||||
// tab strip height if we're not showing a menu bar.
|
||||
if (buttonsShouldMatchTabHeight && !menuHeight) {
|
||||
titlebarContentHeight = fullTabsHeight;
|
||||
titlebarButtons.style.height = titlebarContentHeight + "px";
|
||||
}
|
||||
|
||||
// If the menubar is around (menuHeight is non-zero), try to adjust
|
||||
// its full height (i.e. including margins) to match the titlebar,
|
||||
// by changing the menubar's bottom padding
|
||||
if (menuHeight) {
|
||||
// Calculate the difference between the titlebar's height and that of the menubar
|
||||
let menuTitlebarDelta = titlebarContentHeight - fullMenuHeight;
|
||||
let paddingBottom;
|
||||
// The titlebar is bigger:
|
||||
if (menuTitlebarDelta > 0) {
|
||||
fullMenuHeight += menuTitlebarDelta;
|
||||
// If there is already padding on the menubar, we need to add that
|
||||
// to the difference so the total padding is correct:
|
||||
if ((paddingBottom = menuStyles.paddingBottom)) {
|
||||
menuTitlebarDelta += parseFloat(paddingBottom);
|
||||
}
|
||||
menubar.style.paddingBottom = menuTitlebarDelta + "px";
|
||||
// The menubar is bigger, but has bottom padding we can remove:
|
||||
} else if (menuTitlebarDelta < 0 && (paddingBottom = menuStyles.paddingBottom)) {
|
||||
let existingPadding = parseFloat(paddingBottom);
|
||||
// menuTitlebarDelta is negative; work out what's left, but don't set negative padding:
|
||||
let desiredPadding = Math.max(0, existingPadding + menuTitlebarDelta);
|
||||
menubar.style.paddingBottom = desiredPadding + "px";
|
||||
// We've changed the menu height now:
|
||||
fullMenuHeight += desiredPadding - existingPadding;
|
||||
}
|
||||
}
|
||||
|
||||
// Next, we calculate how much we need to stretch the titlebar down to
|
||||
// go all the way to the bottom of the tab strip, if necessary.
|
||||
let tabAndMenuHeight = fullTabsHeight + fullMenuHeight;
|
||||
|
||||
if (tabAndMenuHeight > titlebarContentHeight) {
|
||||
// We need to increase the titlebar content's outer height (ie including margins)
|
||||
// to match the tab and menu height:
|
||||
let extraMargin = tabAndMenuHeight - titlebarContentHeight;
|
||||
if (AppConstants.platform != "macosx") {
|
||||
titlebarContent.style.marginBottom = extraMargin + "px";
|
||||
}
|
||||
|
||||
titlebarContentHeight += extraMargin;
|
||||
} else {
|
||||
titlebarContent.style.removeProperty("margin-bottom");
|
||||
}
|
||||
|
||||
// Then add a negative margin to the titlebar, so that the following elements
|
||||
// will overlap it by the greater of the titlebar height or the tabstrip+menu.
|
||||
let maxTitlebarOrTabsHeight = Math.max(titlebarContentHeight, tabAndMenuHeight);
|
||||
titlebar.style.marginBottom = "-" + maxTitlebarOrTabsHeight + "px";
|
||||
|
||||
// Finally, size the placeholders:
|
||||
if (AppConstants.platform == "macosx") {
|
||||
this._sizePlaceholder("fullscreen-button", secondaryButtonsWidth);
|
||||
}
|
||||
this._sizePlaceholder("caption-buttons", captionButtonsBoxWidth);
|
||||
},
|
||||
|
||||
_sizePlaceholder(type, width) {
|
||||
Array.forEach(document.querySelectorAll(".titlebar-placeholder[type='" + type + "']"),
|
||||
function(node) { node.style.width = width + "px"; });
|
||||
},
|
||||
|
||||
uninit() {
|
||||
Services.prefs.removeObserver(this._prefName, this);
|
||||
this._menuObserver.disconnect();
|
||||
CustomizableUI.removeListener(this);
|
||||
gDragSpaceObserver.uninit();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -89,6 +89,7 @@ toolbar[customizable="true"] {
|
|||
%ifdef XP_MACOSX
|
||||
#toolbar-menubar {
|
||||
-moz-binding: none;
|
||||
visibility: collapse;
|
||||
}
|
||||
%endif
|
||||
|
||||
|
@ -153,7 +154,7 @@ panelview[mainview] > .panel-header {
|
|||
#tabbrowser-tabs[hasadjacentnewtabbutton]:not([overflow="true"]) ~ #new-tab-button,
|
||||
#tabbrowser-tabs[overflow="true"] > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#tabbrowser-tabs:not([hasadjacentnewtabbutton]) > .tabbrowser-arrowscrollbox > .tabs-newtab-button,
|
||||
#TabsToolbar[customizing="true"] > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
|
||||
#TabsToolbar[customizing="true"] #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .tabs-newtab-button {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
|
@ -240,16 +241,16 @@ panelview[mainview] > .panel-header {
|
|||
|
||||
/* The next 3 rules allow dragging tabs slightly outside of the tabstrip
|
||||
* to make it easier to drag tabs. */
|
||||
#TabsToolbar[movingtab] {
|
||||
#navigator-toolbox[movingtab] > #titlebar > #TabsToolbar {
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
|
||||
#TabsToolbar[movingtab] > #tabbrowser-tabs {
|
||||
#navigator-toolbox[movingtab] #tabbrowser-tabs {
|
||||
padding-bottom: 15px;
|
||||
margin-bottom: -15px;
|
||||
}
|
||||
|
||||
#TabsToolbar[movingtab] + #nav-bar {
|
||||
#navigator-toolbox[movingtab] > #nav-bar {
|
||||
margin-top: -15px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
@ -286,32 +287,40 @@ window:not([chromehidden~="toolbar"]) #nav-bar[nonemptyoverflow] > .overflow-but
|
|||
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > .titlebar-placeholder,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > .titlebar-item,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar .titlebar-placeholder,
|
||||
%endif
|
||||
%ifndef MOZ_WIDGET_COCOA
|
||||
#main-window:not([sizemode=normal]) .titlebar-placeholder[type="pre-tabs"],
|
||||
%endif
|
||||
#main-window:not([chromemargin]) > #titlebar,
|
||||
#main-window[inFullscreen] > #titlebar,
|
||||
#main-window:not([chromemargin]) .titlebar-buttonbox-container,
|
||||
#main-window[inFullscreen] .titlebar-buttonbox-container,
|
||||
#main-window[inFullscreen] .titlebar-placeholder,
|
||||
#main-window:not([tabsintitlebar]) .titlebar-placeholder {
|
||||
display: none;
|
||||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar[autohide=true]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container {
|
||||
visibility: hidden;
|
||||
}
|
||||
%endif
|
||||
|
||||
#titlebar {
|
||||
-moz-window-dragging: drag;
|
||||
}
|
||||
|
||||
#titlebar-spacer {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #titlebar-buttonbox {
|
||||
#main-window[tabsintitlebar] .titlebar-buttonbox {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox {
|
||||
#main-window:not([tabsintitlebar]) .titlebar-buttonbox {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
#personal-bookmarks {
|
||||
|
@ -322,23 +331,27 @@ toolbarpaletteitem {
|
|||
-moz-window-dragging: no-drag;
|
||||
}
|
||||
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
|
||||
%ifdef XP_MACOSX
|
||||
#titlebar-fullscreen-button {
|
||||
-moz-appearance: -moz-mac-fullscreen-button;
|
||||
}
|
||||
|
||||
/* Fullscreen and caption buttons don't move with RTL on OS X so override the automatic ordering. */
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(ltr),
|
||||
#titlebar-buttonbox-container:-moz-locale-dir(rtl),
|
||||
.titlebar-placeholder[type="fullscreen-button"]:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="caption-buttons"]:-moz-locale-dir(rtl) {
|
||||
/**
|
||||
* On macOS, the window caption buttons are on the left side of the window titlebar,
|
||||
* even when using the RTL UI direction. Similarly, the fullscreen button is on the
|
||||
* right side of the window titlebar, even when using the RTL UI direction. These
|
||||
* next rules enforce that ordering.
|
||||
*/
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(ltr) {
|
||||
-moz-box-ordinal-group: 1000;
|
||||
}
|
||||
|
||||
#titlebar-secondary-buttonbox:-moz-locale-dir(rtl),
|
||||
#titlebar-buttonbox-container:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="caption-buttons"]:-moz-locale-dir(ltr),
|
||||
.titlebar-placeholder[type="fullscreen-button"]:-moz-locale-dir(rtl) {
|
||||
.titlebar-buttonbox-container:-moz-locale-dir(ltr) {
|
||||
-moz-box-ordinal-group: 0;
|
||||
}
|
||||
%endif
|
||||
|
|
|
@ -1333,10 +1333,6 @@ var gBrowserInit = {
|
|||
});
|
||||
|
||||
this._setInitialFocus();
|
||||
|
||||
// Update the UI density before TabsInTitlebar lays out the titlbar.
|
||||
gUIDensity.init();
|
||||
TabsInTitlebar.whenWindowLayoutReady();
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
|
@ -1393,6 +1389,7 @@ var gBrowserInit = {
|
|||
}
|
||||
|
||||
// Misc. inits.
|
||||
gUIDensity.init();
|
||||
TabletModeUpdater.init();
|
||||
CombinedStopReload.ensureInitialized();
|
||||
gPrivateBrowsingUI.init();
|
||||
|
@ -5584,7 +5581,7 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) {
|
|||
|
||||
var firstMenuItem = aInsertPoint || popup.firstElementChild;
|
||||
|
||||
let toolbarNodes = gNavToolbox.children;
|
||||
let toolbarNodes = gNavToolbox.querySelectorAll("toolbar");
|
||||
|
||||
for (let toolbar of toolbarNodes) {
|
||||
if (!toolbar.hasAttribute("toolbarname")) {
|
||||
|
@ -5861,7 +5858,6 @@ var gUIDensity = {
|
|||
}
|
||||
}
|
||||
|
||||
TabsInTitlebar.update();
|
||||
gBrowser.tabContainer.uiDensityChanged();
|
||||
},
|
||||
};
|
||||
|
|
|
@ -723,110 +723,98 @@ xmlns="http://www.w3.org/1999/xhtml"
|
|||
</popupset>
|
||||
<box id="appMenu-viewCache" hidden="true"/>
|
||||
|
||||
<vbox id="titlebar">
|
||||
<hbox id="titlebar-content">
|
||||
<spacer id="titlebar-spacer" flex="1"/>
|
||||
<hbox id="titlebar-buttonbox-container">
|
||||
<hbox id="titlebar-buttonbox" class="titlebar-color">
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-min" oncommand="window.minimize();"/>
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-max" oncommand="onTitlebarMaxClick();"/>
|
||||
<toolbarbutton class="titlebar-button" id="titlebar-close" command="cmd_closeWindow"/>
|
||||
</hbox>
|
||||
</hbox>
|
||||
#ifdef XP_MACOSX
|
||||
<!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
|
||||
buttonbox from reversing order in RTL by forcing an LTR direction. -->
|
||||
<hbox id="titlebar-secondary-buttonbox" dir="ltr">
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
<hbox id="titlebar-fullscreen-button"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<toolbox id="navigator-toolbox">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar"
|
||||
class="browser-toolbar chromeclass-menubar titlebar-color"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
|
||||
<vbox id="titlebar">
|
||||
<!-- Menu -->
|
||||
<toolbar type="menubar" id="toolbar-menubar"
|
||||
class="browser-toolbar chromeclass-menubar titlebar-color"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
#ifdef MENUBAR_CAN_AUTOHIDE
|
||||
toolbarname="&menubarCmd.label;"
|
||||
accesskey="&menubarCmd.accesskey;"
|
||||
autohide="true"
|
||||
toolbarname="&menubarCmd.label;"
|
||||
accesskey="&menubarCmd.accesskey;"
|
||||
autohide="true"
|
||||
#endif
|
||||
context="toolbar-context-menu">
|
||||
<toolbaritem id="menubar-items" align="center">
|
||||
context="toolbar-context-menu">
|
||||
<toolbaritem id="menubar-items" align="center">
|
||||
# The entire main menubar is placed into browser-menubar.inc, so that it can be
|
||||
# shared with other top level windows in macWindow.inc.xul.
|
||||
#include browser-menubar.inc
|
||||
</toolbaritem>
|
||||
</toolbaritem>
|
||||
<spacer flex="1" />
|
||||
#include titlebar-items.inc.xul
|
||||
</toolbar>
|
||||
|
||||
#ifndef XP_MACOSX
|
||||
<hbox class="titlebar-placeholder" type="caption-buttons" ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
#endif
|
||||
</toolbar>
|
||||
<toolbar id="TabsToolbar"
|
||||
class="browser-toolbar titlebar-color"
|
||||
fullscreentoolbar="true"
|
||||
customizable="true"
|
||||
customizationtarget="TabsToolbar-customization-target"
|
||||
mode="icons"
|
||||
aria-label="&tabsToolbar.label;"
|
||||
context="toolbar-context-menu"
|
||||
flex="1">
|
||||
<vbox flex="1" class="toolbar-items">
|
||||
<spacer flex="1000"/>
|
||||
|
||||
<toolbar id="TabsToolbar"
|
||||
class="browser-toolbar titlebar-color"
|
||||
fullscreentoolbar="true"
|
||||
customizable="true"
|
||||
mode="icons"
|
||||
aria-label="&tabsToolbar.label;"
|
||||
context="toolbar-context-menu">
|
||||
<hbox class="titlebar-placeholder" type="pre-tabs"
|
||||
skipintoolbarset="true"/>
|
||||
<hbox id="TabsToolbar-customization-target" flex="1">
|
||||
<hbox class="titlebar-placeholder" type="pre-tabs"
|
||||
skipintoolbarset="true"/>
|
||||
|
||||
<tabs id="tabbrowser-tabs"
|
||||
flex="1"
|
||||
setfocus="false"
|
||||
tooltip="tabbrowser-tab-tooltip"
|
||||
stopwatchid="FX_TAB_CLICK_MS">
|
||||
<tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
|
||||
</tabs>
|
||||
<tabs id="tabbrowser-tabs"
|
||||
flex="1"
|
||||
setfocus="false"
|
||||
tooltip="tabbrowser-tab-tooltip"
|
||||
stopwatchid="FX_TAB_CLICK_MS">
|
||||
<tab class="tabbrowser-tab" selected="true" visuallyselected="true" fadein="true"/>
|
||||
</tabs>
|
||||
|
||||
<toolbarbutton id="new-tab-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltip="dynamic-shortcut-tooltip"
|
||||
ondrop="newTabButtonObserver.onDrop(event)"
|
||||
ondragover="newTabButtonObserver.onDragOver(event)"
|
||||
ondragenter="newTabButtonObserver.onDragOver(event)"
|
||||
ondragexit="newTabButtonObserver.onDragExit(event)"
|
||||
cui-areatype="toolbar"
|
||||
removable="true"/>
|
||||
<toolbarbutton id="new-tab-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional"
|
||||
label="&tabCmd.label;"
|
||||
command="cmd_newNavigatorTab"
|
||||
onclick="checkForMiddleClick(this, event);"
|
||||
tooltip="dynamic-shortcut-tooltip"
|
||||
ondrop="newTabButtonObserver.onDrop(event)"
|
||||
ondragover="newTabButtonObserver.onDragOver(event)"
|
||||
ondragenter="newTabButtonObserver.onDragOver(event)"
|
||||
ondragexit="newTabButtonObserver.onDragExit(event)"
|
||||
cui-areatype="toolbar"
|
||||
removable="true"/>
|
||||
|
||||
<toolbarbutton id="alltabs-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
|
||||
oncommand="gTabsPanel.showAllTabsPanel();"
|
||||
label="&listAllTabs.label;"
|
||||
tooltiptext="&listAllTabs.label;"
|
||||
removable="false"/>
|
||||
<toolbarbutton id="alltabs-button"
|
||||
class="toolbarbutton-1 chromeclass-toolbar-additional tabs-alltabs-button badged-button"
|
||||
oncommand="gTabsPanel.showAllTabsPanel();"
|
||||
label="&listAllTabs.label;"
|
||||
tooltiptext="&listAllTabs.label;"
|
||||
removable="false"/>
|
||||
|
||||
<hbox class="titlebar-placeholder" type="post-tabs"
|
||||
ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
<hbox class="titlebar-placeholder" type="post-tabs"
|
||||
ordinal="1000"
|
||||
skipintoolbarset="true"/>
|
||||
</hbox>
|
||||
</vbox>
|
||||
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
ordinal="1000"
|
||||
aria-live="polite" skipintoolbarset="true"/>
|
||||
<hbox class="private-browsing-indicator" skipintoolbarset="true"
|
||||
ordinal="1000"/>
|
||||
<hbox class="titlebar-placeholder" type="caption-buttons"
|
||||
#ifndef XP_MACOSX
|
||||
ordinal="1000"
|
||||
#endif
|
||||
skipintoolbarset="true"/>
|
||||
<button class="accessibility-indicator titlebar-item" tooltiptext="&accessibilityIndicator.tooltip;"
|
||||
ordinal="1000"
|
||||
aria-live="polite" skipintoolbarset="true"/>
|
||||
<hbox class="private-browsing-indicator titlebar-item" skipintoolbarset="true"
|
||||
ordinal="1000"/>
|
||||
#include titlebar-items.inc.xul
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
<hbox class="titlebar-placeholder" type="fullscreen-button"
|
||||
skipintoolbarset="true"/>
|
||||
<!-- OS X does not natively support RTL for its titlebar items, so we prevent this secondary
|
||||
buttonbox from reversing order in RTL by forcing an LTR direction. -->
|
||||
<hbox id="titlebar-secondary-buttonbox" dir="ltr">
|
||||
<button class="accessibility-indicator" tooltiptext="&accessibilityIndicator.tooltip;" aria-live="polite"/>
|
||||
<hbox class="private-browsing-indicator"/>
|
||||
<hbox id="titlebar-fullscreen-button"/>
|
||||
</hbox>
|
||||
#endif
|
||||
</toolbar>
|
||||
</toolbar>
|
||||
|
||||
</vbox>
|
||||
|
||||
<toolbar id="nav-bar"
|
||||
class="browser-toolbar"
|
||||
|
|
|
@ -5359,6 +5359,8 @@ var TabBarVisibility = {
|
|||
this._initialUpdateDone = true;
|
||||
|
||||
toolbar.collapsed = collapse;
|
||||
let navbar = document.getElementById("nav-bar");
|
||||
navbar.setAttribute("tabs-hidden", collapse);
|
||||
|
||||
document.getElementById("menu_closeWindow").hidden = collapse;
|
||||
document.getElementById("menu_close").setAttribute("label",
|
||||
|
|
|
@ -590,7 +590,7 @@
|
|||
|
||||
if (this.getAttribute("movingtab") != "true") {
|
||||
this.setAttribute("movingtab", "true");
|
||||
this.parentNode.setAttribute("movingtab", "true");
|
||||
gNavToolbox.setAttribute("movingtab", "true");
|
||||
if (!draggedTab.multiselected)
|
||||
this.selectedItem = draggedTab;
|
||||
}
|
||||
|
@ -717,7 +717,7 @@
|
|||
}
|
||||
|
||||
this.removeAttribute("movingtab");
|
||||
this.parentNode.removeAttribute("movingtab");
|
||||
gNavToolbox.removeAttribute("movingtab");
|
||||
|
||||
this._handleTabSelect();
|
||||
]]></body>
|
||||
|
@ -1143,7 +1143,7 @@
|
|||
<parameter name="aContainer"/>
|
||||
<body><![CDATA[
|
||||
if (aContainer.ownerDocument == document &&
|
||||
aContainer.id == "TabsToolbar") {
|
||||
aContainer.id == "TabsToolbar-customization-target") {
|
||||
this._updateNewTabVisibility();
|
||||
}
|
||||
]]></body>
|
||||
|
|
|
@ -18,35 +18,6 @@ const EXPECTED_REFLOWS = [
|
|||
*/
|
||||
];
|
||||
|
||||
if (Services.appinfo.OS == "WINNT") {
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"whenWindowLayoutReady@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 2, // This number should only ever go down - never up.
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"rect@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"whenWindowLayoutReady@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
// These numbers should only ever go down - never up.
|
||||
maxCount: Services.appinfo.OS == "WINNT" ? 5 : 4,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* This test ensures that there are no unexpected
|
||||
* uninterruptible reflows or flickering areas when opening new windows.
|
||||
|
@ -115,31 +86,6 @@ add_task(async function() {
|
|||
await BrowserTestUtils.firstBrowserLoaded(win, false);
|
||||
await BrowserTestUtils.browserStopped(win.gBrowser.selectedBrowser, "about:home");
|
||||
|
||||
if (Services.appinfo.OS == "WINNT" && win.windowState == win.STATE_MAXIMIZED) {
|
||||
// The reflows below are triggered by maximizing the window after
|
||||
// layout. They should be fixed by bug 1447864.
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"rect@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"handleEvent@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 4,
|
||||
},
|
||||
{
|
||||
stack: [
|
||||
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_layOutTitlebar@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"handleEvent@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
],
|
||||
maxCount: 2,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
await new Promise(resolve => {
|
||||
// 10 is an arbitrary value here, it needs to be at least 2 to avoid
|
||||
// races with code initializing itself using idle callbacks.
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
<hbox class="titlebar-buttonbox-container titlebar-item">
|
||||
<hbox class="titlebar-buttonbox titlebar-color">
|
||||
<toolbarbutton class="titlebar-button titlebar-min" oncommand="window.minimize();"/>
|
||||
<toolbarbutton class="titlebar-button titlebar-max" oncommand="onTitlebarMaxClick();"/>
|
||||
<toolbarbutton class="titlebar-button titlebar-close" command="cmd_closeWindow"/>
|
||||
</hbox>
|
||||
</hbox>
|
|
@ -53,10 +53,6 @@
|
|||
-moz-box-orient: vertical; /* for flex hack */
|
||||
}
|
||||
|
||||
#main-menubar {
|
||||
-moz-box-flex: 1; /* make menu items expand to fill toolbar height */
|
||||
}
|
||||
|
||||
#navigator-toolbox {
|
||||
-moz-appearance: none;
|
||||
background-color: transparent;
|
||||
|
@ -75,7 +71,7 @@
|
|||
border-style: none;
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
/* This is needed for some toolbar button animations. Gross :( */
|
||||
position: relative;
|
||||
|
@ -617,14 +613,6 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
|||
border-radius: inherit;
|
||||
}
|
||||
|
||||
/* Hide the titlebar explicitly on versions of GTK+ where
|
||||
* it's rendered by window manager. */
|
||||
@media (-moz-gtk-csd-available: 0) {
|
||||
#titlebar {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* We draw to titlebar when Gkt+ CSD is available */
|
||||
@media (-moz-gtk-csd-available) {
|
||||
/* Some Gtk+ themes use non-rectangular toplevel windows. To fully support
|
||||
|
@ -639,17 +627,10 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
|||
}
|
||||
}
|
||||
|
||||
:root[tabsintitlebar] > #titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
:root[tabsintitlebar] #titlebar-content:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
:root[tabsintitlebar] > #titlebar {
|
||||
:root[tabsintitlebar] > #navigator-toolbox > #titlebar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: -moz-window-titlebar-maximized;
|
||||
}
|
||||
:root[tabsintitlebar][sizemode="normal"] > #titlebar {
|
||||
:root[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: -moz-window-titlebar;
|
||||
}
|
||||
|
||||
|
@ -659,12 +640,13 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
|||
padding-top: var(--space-above-tabbar);
|
||||
}
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
padding-top: calc(-1 * var(--space-above-tabbar));
|
||||
/**
|
||||
* Titlebar items (window caption buttons, private browsing indicator,
|
||||
* accessibility indicator, etc)
|
||||
*/
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item {
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* Make #TabsToolbar transparent as we style underlying #titlebar with
|
||||
|
@ -681,7 +663,7 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
|||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events.
|
||||
*/
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
z-index: 1;
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
@ -690,37 +672,37 @@ notification[value="translation"] menulist > .menulist-dropmarker {
|
|||
* Use full scale icons here as the Gtk+ does.
|
||||
*/
|
||||
@media (-moz-gtk-csd-minimize-button) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
-moz-appearance: -moz-window-button-minimize;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-minimize-button: 0) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-gtk-csd-maximize-button) {
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
-moz-appearance: -moz-window-button-maximize;
|
||||
}
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
-moz-appearance: -moz-window-button-restore;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-maximize-button: 0) {
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-gtk-csd-close-button) {
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
-moz-appearance: -moz-window-button-close;
|
||||
}
|
||||
}
|
||||
@media (-moz-gtk-csd-close-button: 0) {
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,11 +85,6 @@
|
|||
-moz-box-pack: center;
|
||||
}
|
||||
|
||||
#titlebar-content {
|
||||
/* Ensure the the content part of the titlebar does not shrink. */
|
||||
min-height: inherit;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox > .titlebar-button {
|
||||
display: none;
|
||||
}
|
||||
|
@ -103,15 +98,15 @@
|
|||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox-container {
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: center;
|
||||
}
|
||||
|
||||
/* These would be margin-inline-start/end if it wasn't for the fact that OS X
|
||||
* doesn't reverse the order of the items in the titlebar in RTL mode. */
|
||||
.titlebar-placeholder[type="caption-buttons"],
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
margin-left: 12px;
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* The fullscreen button doesnt show on Yosemite(10.10) or above so dont give it a
|
||||
|
@ -122,18 +117,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
#main-window:not([tabsintitlebar]) > #titlebar {
|
||||
height: 22px; /* The native titlebar on OS X is 22px tall. */
|
||||
}
|
||||
|
||||
/**
|
||||
* For tabs in titlebar on OS X, we stretch the titlebar down so that the
|
||||
* tabstrip can overlap it.
|
||||
*/
|
||||
#main-window[tabsintitlebar] > #titlebar {
|
||||
min-height: calc(var(--tab-min-height) + var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/** End titlebar **/
|
||||
|
||||
#main-window[chromehidden~="toolbar"][chromehidden~="location"][chromehidden~="directories"] {
|
||||
|
@ -148,9 +131,9 @@
|
|||
|
||||
/* Draw the bottom border of the tabs toolbar when it's not using
|
||||
-moz-appearance: toolbar. */
|
||||
#main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
|
||||
#main-window:not([tabsintitlebar]) #TabsToolbar:not([collapsed="true"]) + #nav-bar,
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar:-moz-lwtheme {
|
||||
#main-window:-moz-any([sizemode="fullscreen"],[customize-entered]) #nav-bar:not([tabs-hidden="true"]),
|
||||
#main-window:not([tabsintitlebar]) #nav-bar:not([tabs-hidden="true"]),
|
||||
#nav-bar:not([tabs-hidden="true"]):-moz-lwtheme {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
|
||||
|
@ -164,12 +147,12 @@
|
|||
--tabs-border-color: rgba(0,0,0,.05);
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #TabsToolbar:not([collapsed="true"]) + #nav-bar:not(:-moz-lwtheme) {
|
||||
#main-window[tabsintitlebar] #nav-bar:not([tabs-hidden="true"]):not(:-moz-lwtheme) {
|
||||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
/* The toolbar buttons that animate are only visible when the #TabsToolbar is not collapsed.
|
||||
The animations use position:absolute and require a positioned #nav-bar. */
|
||||
position: relative;
|
||||
|
@ -643,14 +626,9 @@ html|input.urlbar-input {
|
|||
}
|
||||
|
||||
#TabsToolbar {
|
||||
-moz-appearance: none;
|
||||
padding-top: var(--space-above-tabbar);
|
||||
}
|
||||
|
||||
:root:not([customizing]):not([tabsintitlebar]):not([inFullscreen]) #TabsToolbar:not(:-moz-lwtheme) {
|
||||
-moz-appearance: toolbar;
|
||||
}
|
||||
|
||||
#TabsToolbar:not(:-moz-lwtheme) {
|
||||
color: #333;
|
||||
text-shadow: @loweredShadow@;
|
||||
|
@ -961,10 +939,10 @@ html|*.addon-webext-perm-list {
|
|||
|
||||
/* Private browsing and accessibility indicators */
|
||||
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #titlebar > #titlebar-content > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
:root[accessibilitymode][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #titlebar > #TabsToolbar > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary][tabsintitlebar]:not([inFullscreen]) > #navigator-toolbox > #titlebar > #TabsToolbar > .private-browsing-indicator,
|
||||
:root[accessibilitymode]:not([tabsintitlebar]) > #navigator-toolbox > #titlebar > #TabsToolbar > #titlebar-secondary-buttonbox > .accessibility-indicator,
|
||||
:root[privatebrowsingmode=temporary]:not([tabsintitlebar]) > #navigator-toolbox > #titlebar > #TabsToolbar > #titlebar-secondary-buttonbox > .private-browsing-indicator {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,11 +4,6 @@
|
|||
|
||||
%include ../shared/compacttheme.inc.css
|
||||
|
||||
/* Get rid of 1px bright strip at the top of window */
|
||||
#main-window[tabsintitlebar] #titlebar-content {
|
||||
background: var(--lwt-accent-color);
|
||||
}
|
||||
|
||||
#TabsToolbar:-moz-lwtheme-darktext {
|
||||
-moz-appearance: -moz-mac-vibrant-titlebar-light;
|
||||
-moz-font-smoothing-background-color: -moz-mac-vibrant-titlebar-light;
|
||||
|
|
|
@ -151,6 +151,7 @@
|
|||
visibility: collapse;
|
||||
overflow: hidden;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-inline-end: -20px;
|
||||
}
|
||||
|
||||
|
@ -172,7 +173,6 @@
|
|||
#tracking-protection-icon-box > #tracking-protection-icon-animatable-box {
|
||||
position: absolute;
|
||||
overflow: hidden;
|
||||
top: calc(50% - 10px); /* half the height of the sprite */
|
||||
margin-inline-start: 4px;
|
||||
width: 16px;
|
||||
height: 20px;
|
||||
|
|
|
@ -512,7 +512,7 @@
|
|||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab > .tab-stack > .tab-background,
|
||||
#toolbar-menubar:not([autohide=true]) + #TabsToolbar .tabbrowser-tab > .tab-stack > .tab-background,
|
||||
%endif
|
||||
:root:not([tabsintitlebar]) .tab-background,
|
||||
:root[extradragspace] .tab-background {
|
||||
|
@ -554,7 +554,7 @@
|
|||
background-color: rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background:not([selected=true]) {
|
||||
background-color: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
|
@ -570,12 +570,12 @@
|
|||
transform: none;
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]):not([multiselected]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true]):not([multiselected]) {
|
||||
background-color: rgba(255,255,255,.2);
|
||||
}
|
||||
|
||||
.tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected],
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected] {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab:hover > .tab-stack > .tab-background > .tab-line:not([selected=true])[multiselected] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
|
@ -585,7 +585,7 @@
|
|||
background-color: rgba(0,0,0,.1);
|
||||
}
|
||||
|
||||
#TabsToolbar[brighttext] > #tabbrowser-tabs > .tabbrowser-tab[multiselected] > .tab-stack > .tab-background:not([selected=true]) {
|
||||
#TabsToolbar[brighttext] .tabbrowser-tab[multiselected] > .tab-stack > .tab-background:not([selected=true]) {
|
||||
background-color: rgba(255,255,255,.1);
|
||||
}
|
||||
|
||||
|
@ -668,7 +668,7 @@
|
|||
}
|
||||
|
||||
%ifdef MENUBAR_CAN_AUTOHIDE
|
||||
:root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] + #TabsToolbar > #tabbrowser-tabs > .tabbrowser-tab::after,
|
||||
:root[tabsintitlebar]:not([extradragspace]) #toolbar-menubar[autohide=true] + #TabsToolbar .tabbrowser-tab::after,
|
||||
%else
|
||||
:root[tabsintitlebar]:not([extradragspace]) .tabbrowser-tab::after,
|
||||
%endif
|
||||
|
@ -717,8 +717,7 @@
|
|||
/* New tab button */
|
||||
|
||||
.tabs-newtab-button,
|
||||
#TabsToolbar > #new-tab-button ,
|
||||
#TabsToolbar > toolbarpaletteitem > #new-tab-button {
|
||||
#TabsToolbar #new-tab-button {
|
||||
list-style-image: url(chrome://browser/skin/add.svg);
|
||||
}
|
||||
|
||||
|
|
|
@ -83,7 +83,7 @@ toolbar[brighttext] {
|
|||
padding: 0 var(--toolbarbutton-inner-padding) !important;
|
||||
}
|
||||
|
||||
#navigator-toolbox:not(:hover) > #TabsToolbar > #tabbrowser-tabs > .tabbrowser-arrowscrollbox > .scrollbutton-down:not([highlight]) {
|
||||
#navigator-toolbox:not(:hover) > #TabsToolbar .tabbrowser-arrowscrollbox > .scrollbutton-down:not([highlight]) {
|
||||
transition: 1s background-color ease-out;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,9 +8,33 @@
|
|||
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
@media (-moz-windows-classic: 0) {
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #toolbar-menubar {
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar:not([autohide="true"]) > #menubar-items,
|
||||
#main-window[sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .toolbar-items {
|
||||
margin-top: 1px;
|
||||
}
|
||||
/**
|
||||
* For all Windows configurations except for Windows Aero and
|
||||
* Windows Aero Basic, the -moz-window-button-box appearance on
|
||||
* the .titlebar-buttonbox adds an unwanted margin at the top of
|
||||
* the button box.
|
||||
*
|
||||
* For Windows Aero:
|
||||
* We want the -moz-window-button-box applied in the restored case,
|
||||
* and -moz-window-button-box-maximized in the maximized case.
|
||||
*
|
||||
* For Windows Aero Basic:
|
||||
* The margin is also unwanted in the maximized case, but we want
|
||||
* it in the restored window case.
|
||||
*/
|
||||
#main-window[sizemode="normal"] .titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box;
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor) {
|
||||
#main-window[sizemode="maximized"] .titlebar-buttonbox {
|
||||
-moz-appearance: -moz-window-button-box-maximized;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -77,7 +101,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
#titlebar-buttonbox,
|
||||
.titlebar-buttonbox,
|
||||
.titlebar-button {
|
||||
-moz-appearance: none !important;
|
||||
}
|
||||
|
@ -95,35 +119,35 @@
|
|||
height: 12px;
|
||||
}
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize.svg);
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize.svg);
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore.svg);
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close.svg);
|
||||
}
|
||||
|
||||
:root[lwtheme-image] .titlebar-button {
|
||||
-moz-context-properties: unset;
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-min {
|
||||
:root[lwtheme-image] .titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-max {
|
||||
:root[lwtheme-image] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image][sizemode="maximized"] #titlebar-max {
|
||||
:root[lwtheme-image][sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore-themes.svg);
|
||||
}
|
||||
:root[lwtheme-image] #titlebar-close {
|
||||
:root[lwtheme-image] .titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close-themes.svg);
|
||||
}
|
||||
|
||||
|
@ -197,12 +221,12 @@
|
|||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#titlebar-close:hover {
|
||||
.titlebar-close:hover {
|
||||
stroke: white;
|
||||
background-color: hsl(355,86%,49%);
|
||||
}
|
||||
|
||||
#titlebar-close:hover:active {
|
||||
.titlebar-close:hover:active {
|
||||
background-color: hsl(355,82%,69%);
|
||||
}
|
||||
}
|
||||
|
@ -217,19 +241,19 @@
|
|||
stroke: HighlightText;
|
||||
}
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/minimize-highcontrast.svg);
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/maximize-highcontrast.svg);
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-max {
|
||||
:root[sizemode="maximized"] .titlebar-max {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/restore-highcontrast.svg);
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
list-style-image: url(chrome://browser/skin/window-controls/close-highcontrast.svg);
|
||||
}
|
||||
}
|
||||
|
@ -243,7 +267,7 @@
|
|||
-moz-appearance: -moz-win-borderless-glass;
|
||||
}
|
||||
|
||||
:root[sizemode="maximized"] #titlebar-buttonbox {
|
||||
:root[sizemode="maximized"] .titlebar-buttonbox {
|
||||
margin-inline-end: 3px;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,10 +79,6 @@
|
|||
-moz-box-orient: vertical; /* for flex hack */
|
||||
}
|
||||
|
||||
#main-menubar {
|
||||
-moz-box-flex: 1; /* make menu items expand to fill toolbar height */
|
||||
}
|
||||
|
||||
#main-menubar > menu {
|
||||
-moz-appearance: none;
|
||||
color: inherit;
|
||||
|
@ -105,12 +101,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* Hides the titlebar-placeholder underneath the window caption buttons when we
|
||||
are not autohiding the menubar. */
|
||||
#toolbar-menubar:not([autohide="true"]) + #TabsToolbar > .titlebar-placeholder[type="caption-buttons"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar {
|
||||
padding-top: var(--space-above-tabbar);
|
||||
|
@ -196,17 +186,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
#main-window[tabsintitlebar] #titlebar-content:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
-moz-window-dragging: drag;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* In the classic themes, the titlebar has a horizontal gradient, which is
|
||||
* problematic for reading the text of background tabs when they're in the
|
||||
|
@ -275,7 +254,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
#TabsToolbar:not([collapsed="true"]) + #nav-bar {
|
||||
#nav-bar:not([tabs-hidden="true"]) {
|
||||
/* This is needed for some toolbar button animations. Gross :( */
|
||||
position: relative;
|
||||
}
|
||||
|
@ -284,7 +263,7 @@
|
|||
box-shadow: 0 -@navbarTabsShadowSize@ 0 var(--tabs-border-color);
|
||||
}
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#TabsToolbar[collapsed="true"] + #nav-bar {
|
||||
#nav-bar[tabs-hidden="true"] {
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
@ -299,61 +278,84 @@
|
|||
|
||||
/* ::::: titlebar ::::: */
|
||||
|
||||
#main-window[sizemode="normal"] > #titlebar {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar {
|
||||
-moz-appearance: -moz-window-titlebar;
|
||||
}
|
||||
|
||||
#main-window[sizemode="maximized"] > #titlebar {
|
||||
#main-window[tabsintitlebar][sizemode="maximized"] > #navigator-toolbox > #titlebar {
|
||||
-moz-appearance: -moz-window-titlebar-maximized;
|
||||
}
|
||||
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
/**
|
||||
* Anytime we're not using the compositor on Windows, the -moz-window-titlebar
|
||||
* and -moz-window-titlebar-maximized values for -moz-appearance override
|
||||
* backgrounds supplied by lwthemes. We make the #titlebar itself hidden, but
|
||||
* it's children visible in order to hide the background but keep the margin and
|
||||
* padding that comes from those -moz-window-titlebar rules.
|
||||
*/
|
||||
#titlebar:-moz-lwtheme {
|
||||
visibility: hidden;
|
||||
}
|
||||
#toolbar-menubar:-moz-lwtheme,
|
||||
#TabsToolbar:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
@media (-moz-windows-classic) {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #toolbar-menubar {
|
||||
#main-window[tabsintitlebar][sizemode="normal"] > #navigator-toolbox > #titlebar > #toolbar-menubar {
|
||||
margin-top: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
/* The button box must appear on top of the navigator-toolbox in order for
|
||||
* click and hover mouse events to work properly for the button in the restored
|
||||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events. It will also place the buttons above the fog on
|
||||
* Windows 7 with Aero Glass.
|
||||
*/
|
||||
#titlebar-buttonbox {
|
||||
.titlebar-buttonbox {
|
||||
/* For all Windows configurations except for Windows Aero and Windows Aero Basic,
|
||||
* the default -moz-appearance of -moz-window-button-box and
|
||||
* -moz-window-button-box-maximized adds unwanted margins to the button box. We
|
||||
* special case Windows Aero and Windows Aero Basic in browser-aero.css.
|
||||
*/
|
||||
-moz-appearance: none;
|
||||
/* The button box must appear on top of the navigator-toolbox in order for
|
||||
* click and hover mouse events to work properly for the button in the restored
|
||||
* window state. Otherwise, elements in the navigator-toolbox, like the menubar,
|
||||
* can swallow those events. It will also place the buttons above the fog on
|
||||
* Windows 7 with Aero Glass.
|
||||
*/
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
#titlebar-buttonbox-container {
|
||||
-moz-box-align: center;
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: stretch;
|
||||
}
|
||||
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
/* Preserve window control buttons position at the top of the button box. */
|
||||
#titlebar-buttonbox-container {
|
||||
.titlebar-buttonbox-container {
|
||||
-moz-box-align: start;
|
||||
}
|
||||
}
|
||||
|
||||
/* titlebar command buttons */
|
||||
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
-moz-appearance: -moz-window-button-minimize;
|
||||
}
|
||||
|
||||
#titlebar-max {
|
||||
.titlebar-max {
|
||||
-moz-appearance: -moz-window-button-maximize;
|
||||
}
|
||||
|
||||
#main-window[sizemode="maximized"] #titlebar-max {
|
||||
#main-window[sizemode="maximized"] .titlebar-max {
|
||||
-moz-appearance: -moz-window-button-restore;
|
||||
}
|
||||
|
||||
#titlebar-close {
|
||||
.titlebar-close {
|
||||
-moz-appearance: -moz-window-button-close;
|
||||
}
|
||||
|
||||
@media (-moz-windows-classic: 0) {
|
||||
#titlebar-min {
|
||||
.titlebar-min {
|
||||
margin-inline-end: 2px;
|
||||
}
|
||||
}
|
||||
|
@ -946,21 +948,21 @@ notification[value="translation"] {
|
|||
|
||||
/* End customization mode */
|
||||
|
||||
/* Private browsing and accessibility indicators */
|
||||
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
/**
|
||||
* Titlebar items (window caption buttons, private browsing indicator,
|
||||
* accessibility indicator, etc)
|
||||
*/
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] > .titlebar-item {
|
||||
margin-top: calc(-1 * var(--space-above-tabbar));
|
||||
}
|
||||
|
||||
/* Compensate for 4px extra margin on top of the tabs toolbar on Windows 7. */
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] #TabsToolbar > .accessibility-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .private-browsing-indicator,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .accessibility-indicator {
|
||||
:root[sizemode="normal"][chromehidden~="menubar"] .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar > .titlebar-item,
|
||||
:root[sizemode="normal"] #toolbar-menubar[autohide="true"][inactive] > .titlebar-item {
|
||||
margin-top: calc(-1 * (var(--space-above-tabbar) + 4px));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
broken. So instead just show the normal titlebar in that case, and override
|
||||
the window color as transparent when the compositor is available. */
|
||||
@media (-moz-windows-compositor: 0) {
|
||||
#main-window[tabsintitlebar] #titlebar:-moz-lwtheme {
|
||||
#main-window[tabsintitlebar] > #navigator-toolbox > #titlebar:-moz-lwtheme {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,10 +55,6 @@ toolbarbutton[disabled="true"] {
|
|||
}
|
||||
|
||||
@media (-moz-windows-default-theme: 0) {
|
||||
:root[lwtheme-image] toolbarbutton {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
:root[lwtheme-image] toolbarbutton:not([disabled="true"]) {
|
||||
text-shadow: inherit;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче