Bug 1390448 - Restore vertical margin calculation in browser-tabsintitlebar.js, add 1px to window control margin on Windows 10. r=dao

MozReview-Commit-ID: LXR2zrAZS0k

--HG--
extra : rebase_source : 807e7c6da20958261b4da2a79b36a9e710931af1
This commit is contained in:
Johann Hofmann 2017-08-15 14:18:22 +02:00
Родитель 05d6db29ff
Коммит 1277f8d21b
2 изменённых файлов: 16 добавлений и 3 удалений

Просмотреть файл

@ -160,7 +160,9 @@ var TabsInTitlebar = {
// then later set the properties affecting layout together in a batch.
// Get the height of the tabs toolbar:
let tabsHeight = rect($("TabsToolbar")).height;
let tabsToolbar = $("TabsToolbar");
let tabsStyles = window.getComputedStyle(tabsToolbar);
let fullTabsHeight = rect($("TabsToolbar")).height + verticalMargins(tabsStyles);
// Buttons first:
let captionButtonsBoxWidth = rect($("titlebar-buttonbox-container")).width;
@ -186,7 +188,8 @@ var TabsInTitlebar = {
// tab strip height if we're not showing a menu bar.
if (AppConstants.isPlatformAndVersionAtLeast("win", "10.0")) {
if (!menuHeight) {
titlebarContentHeight = tabsHeight;
// Add a pixel to slightly overlap the navbar border.
titlebarContentHeight = fullTabsHeight + 1;
$("titlebar-buttonbox").style.height = titlebarContentHeight + "px";
}
}
@ -220,7 +223,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)

Просмотреть файл

@ -80,6 +80,16 @@ if (Services.appinfo.OS == "WINNT") {
if (Services.appinfo.OS == "WINNT" || Services.appinfo.OS == "Darwin") {
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: [
"rect@chrome://browser/content/browser-tabsintitlebar.js",