Bug 1915739 - Part 6: Add an attribute to the top-level browser chrome element when opening a Taskbar Tab. r=firefox-desktop-core-reviewers ,mossop

Differential Revision: https://phabricator.services.mozilla.com/D234543
This commit is contained in:
Eric Chen
2025-03-03 16:40:09 +00:00
parent 11dbf7050d
commit 5e567fd9ce

View File

@@ -101,6 +101,17 @@ var gBrowserInit = {
);
toolbarMenubar.setAttribute("data-l10n-attrs", "toolbarname");
}
// If opening a Taskbar Tab window, add an attribute to the top-level element
// to inform window styling.
if (window.arguments && window.arguments[1]) {
let extraOptions = window.arguments[1];
if (
extraOptions instanceof Ci.nsIWritablePropertyBag2 &&
extraOptions.hasKey("taskbartab")
) {
window.document.documentElement.setAttribute("taskbartab", "");
}
}
// Run menubar initialization first, to avoid CustomTitlebar code picking
// up mutations from it and causing a reflow.