mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-10 20:05:49 +00:00
Backed out changeset 37ba4f932f57 (bug 1375335) for failing browser_windowopen_reflows.js on OS X. r=backout
This commit is contained in:
parent
2f2796d731
commit
51ddd73782
@ -148,19 +148,13 @@ var TabsInTitlebar = {
|
||||
document.documentElement.setAttribute("tabsintitlebar", "true");
|
||||
updateTitlebarDisplay();
|
||||
|
||||
// Reset the custom titlebar height if the menubar is shown,
|
||||
// because we will want to calculate its original height.
|
||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0") &&
|
||||
(menubar.getAttribute("inactive") != "true" ||
|
||||
menubar.getAttribute("autohide") != "true")) {
|
||||
$("titlebar-buttonbox").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 tabsHeight = rect($("TabsToolbar")).height;
|
||||
// Get the full height of the tabs toolbar:
|
||||
let tabsToolbar = $("TabsToolbar");
|
||||
let tabsStyles = window.getComputedStyle(tabsToolbar);
|
||||
let fullTabsHeight = rect(tabsToolbar).height + verticalMargins(tabsStyles);
|
||||
// Buttons first:
|
||||
let captionButtonsBoxWidth = rect($("titlebar-buttonbox-container")).width;
|
||||
|
||||
@ -182,12 +176,12 @@ var TabsInTitlebar = {
|
||||
|
||||
// Begin setting CSS properties which will cause a reflow
|
||||
|
||||
// On Windows 10, adjust the window controls to span the entire
|
||||
// tab strip height if we're not showing a menu bar.
|
||||
if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
|
||||
if (!menuHeight) {
|
||||
titlebarContentHeight = tabsHeight;
|
||||
if (!menuHeight && window.windowState == window.STATE_MAXIMIZED) {
|
||||
titlebarContentHeight = Math.max(titlebarContentHeight, fullTabsHeight);
|
||||
$("titlebar-buttonbox").style.height = titlebarContentHeight + "px";
|
||||
} else {
|
||||
$("titlebar-buttonbox").style.removeProperty("height");
|
||||
}
|
||||
}
|
||||
|
||||
@ -220,7 +214,7 @@ var TabsInTitlebar = {
|
||||
|
||||
// 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 = tabsHeight + fullMenuHeight;
|
||||
let tabAndMenuHeight = fullTabsHeight + fullMenuHeight;
|
||||
|
||||
if (tabAndMenuHeight > titlebarContentHeight) {
|
||||
// We need to increase the titlebar content's outer height (ie including margins)
|
||||
|
@ -52,6 +52,16 @@ if (Services.appinfo.OS == "Darwin") {
|
||||
|
||||
if (Services.appinfo.OS == "WINNT") {
|
||||
EXPECTED_REFLOWS.push(
|
||||
{
|
||||
stack: [
|
||||
"verticalMargins@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"_update@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"init@chrome://browser/content/browser-tabsintitlebar.js",
|
||||
"handleEvent@chrome://browser/content/tabbrowser.xml",
|
||||
],
|
||||
times: 2, // This number should only ever go down - never up.
|
||||
},
|
||||
|
||||
{
|
||||
stack: [
|
||||
"handleEvent@chrome://browser/content/tabbrowser.xml",
|
||||
|
@ -7,11 +7,9 @@
|
||||
%define glassActiveBorderColor rgb(37, 44, 51)
|
||||
%define glassInactiveBorderColor rgb(102, 102, 102)
|
||||
|
||||
@media (-moz-os-version: windows-win7) {
|
||||
@media not all and (-moz-windows-classic) {
|
||||
#main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
|
||||
margin-top: 1px;
|
||||
}
|
||||
@media not all and (-moz-windows-classic) {
|
||||
#main-window[sizemode="normal"] > #tab-view-deck > #browser-panel > #navigator-toolbox > #toolbar-menubar {
|
||||
margin-top: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,11 +81,16 @@
|
||||
.titlebar-button {
|
||||
border: none;
|
||||
margin: 0 !important;
|
||||
padding: 8px 17px;
|
||||
padding: 10px 17px;
|
||||
-moz-context-properties: stroke;
|
||||
stroke: var(--titlebar-text-color);
|
||||
}
|
||||
|
||||
:root[sizemode=maximized] .titlebar-button {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
}
|
||||
|
||||
.titlebar-button > .toolbarbutton-icon {
|
||||
width: 12px;
|
||||
height: 12px;
|
||||
|
Loading…
Reference in New Issue
Block a user