Backed out changeset 9d9fe1cd50ec (bug 1930292) for causing Win11 visual regressions. CLOSED TREE

This commit is contained in:
Butkovits Atila 2024-11-21 13:12:06 +02:00
parent c3d046b004
commit 15b1a753aa
5 changed files with 22 additions and 11 deletions

View File

@ -69,9 +69,11 @@ var TabsInTitlebar = {
!Object.keys(this._disallowed).length; !Object.keys(this._disallowed).length;
if (allowed) { if (allowed) {
document.documentElement.setAttribute("tabsintitlebar", "true"); document.documentElement.setAttribute("tabsintitlebar", "true");
document.documentElement.setAttribute("chromemargin", "0,0,0,0");
if (AppConstants.platform == "macosx") { if (AppConstants.platform == "macosx") {
document.documentElement.setAttribute("chromemargin", "0,-1,-1,-1");
document.documentElement.removeAttribute("drawtitle"); document.documentElement.removeAttribute("drawtitle");
} else {
document.documentElement.setAttribute("chromemargin", "0,2,2,2");
} }
} else { } else {
document.documentElement.removeAttribute("tabsintitlebar"); document.documentElement.removeAttribute("tabsintitlebar");

View File

@ -17,7 +17,11 @@
#endif #endif
data-l10n-args="{"content-title":"CONTENTTITLE"}" data-l10n-args="{"content-title":"CONTENTTITLE"}"
data-l10n-attrs="data-content-title-default, data-content-title-private, data-title-default, data-title-private" data-l10n-attrs="data-content-title-default, data-content-title-private, data-title-default, data-title-private"
chromemargin="0,0,0,0" #ifdef XP_WIN
chromemargin="0,2,2,2"
#else
chromemargin="0,-1,-1,-1"
#endif
tabsintitlebar="true" tabsintitlebar="true"
windowtype="navigator:browser" windowtype="navigator:browser"
macanimationtype="document" macanimationtype="document"

View File

@ -1995,16 +1995,22 @@ static Result<Ok, PreXULSkeletonUIError> CreateAndStorePreXULSkeletonUIImpl(
sCaptionHeight = sCaptionHeight =
sVerticalResizeMargin + sGetSystemMetricsForDpi(SM_CYCAPTION, sDpi); sVerticalResizeMargin + sGetSystemMetricsForDpi(SM_CYCAPTION, sDpi);
// These match the offsets that we get with default prefs. We don't use the // These match the margins set in browser-tabsintitlebar.js with default prefs
// skeleton ui if tabsInTitlebar is disabled, see bug 1673092. // on Windows. We don't use the skeleton ui if tabsInTitlebar is disabled, see
// bug 1673092.
const Margin nonClientMargin{0, 2, 2, 2};
if (sMaximized) { if (sMaximized) {
sNonClientOffset.top = sCaptionHeight - sVerticalResizeMargin; sNonClientOffset.top = sCaptionHeight - sVerticalResizeMargin;
} else { } else {
// See nsWindow::NormalWindowNonClientOffset() // See nsWindow::NormalWindowNonClientOffset()
sNonClientOffset.top = sCaptionHeight; sNonClientOffset.top = sCaptionHeight;
sNonClientOffset.bottom = sVerticalResizeMargin; sNonClientOffset.bottom =
sNonClientOffset.left = sHorizontalResizeMargin; std::min(sVerticalResizeMargin, nonClientMargin.bottom);
sNonClientOffset.right = sHorizontalResizeMargin; sNonClientOffset.left =
std::min(sHorizontalResizeMargin, nonClientMargin.left);
sNonClientOffset.right =
std::min(sHorizontalResizeMargin, nonClientMargin.right);
} }
if (sMaximized) { if (sMaximized) {

View File

@ -197,9 +197,8 @@ add_task(async function test_found_resize() {
info(`values: ${JSON.stringify(values)}`); info(`values: ${JSON.stringify(values)}`);
info(`resizedValues: ${JSON.stringify(resizedValues)}`); info(`resizedValues: ${JSON.stringify(resizedValues)}`);
isfuzzy(resizedValues[0], values[0], 2, "first value"); isfuzzy(resizedValues[0], values[0], 2, "first value");
const kSlop = 50; Assert.greater(resizedValues[1] - 50, values[1], "second value");
Assert.greaterOrEqual(resizedValues[1] - kSlop, values[1], "second value"); Assert.greater(resizedValues[2] - 50, values[2], "third value");
Assert.greaterOrEqual(resizedValues[2] - kSlop, values[2], "third value");
endFn(); endFn();

View File

@ -5,7 +5,7 @@
height="300" height="300"
width="300" width="300"
sizemode="normal" sizemode="normal"
chromemargin="0,0,0,0" chromemargin="0,2,2,2"
id="window" id="window"
persist="height width sizemode"> persist="height width sizemode">
<script type="application/javascript"><![CDATA[ <script type="application/javascript"><![CDATA[