Commit Graph
284 Commits
Author SHA1 Message Date
Stephen A Pohl 77b69c73de Bug 1154697: Add an Edit menu to the Profile Manager and Create Profile wizard on macOS. r=mac-reviewers,fluent-reviewers,frontend-codestyle-reviewers,bradwerth,mossop,bolsson
The macOS Profile Manager (toolkit/profile/content/profileSelection.xhtml) and the Create Profile wizard (createProfileWizard.xhtml) are presented very early in startup, before the hidden window is created, and ship with no <menubar> of their own. As a result the system menu bar shows only the auto-populated "Firefox" application menu while either window is up. The wizard can open a native NSOpenPanel sheet via its "Choose Folder..." button and from there a "New Folder" sub-sheet, which is the canonical reproducer for the bug: without a parent <menubar>, the sub-sheet's text field has no key equivalents to invoke, so Cmd+V (and the other Edit menu shortcuts) don't reach the field via the macOS responder chain.

This patch:

  * Adds a `<menubar>` to both windows containing the standard Edit menu items, wrapped in `#ifdef XP_MACOSX` so non-macOS platforms don't gain a visible in-window menu strip. The menubar fragment lives in a new shared include, `toolkit/content/editMenubar.inc.xhtml`, which is consumed by both call sites. It pulls in the existing toolkit `editMenuKeys.inc.xhtml` for the shortcut <key> nodes; each consumer also loads `editMenuOverlay.js` for the matching <command> set.

  * Marks both xhtml files for preprocessing (`*` prefix in toolkit/profile/jar.mn) so the `#ifdef` / `#include` directives are resolved at packaging time, and adds them to .prettierignore so Prettier doesn't collapse adjacent preprocessor directives.

  * Adds a `profile-window-menu-edit` Fluent string in toolkit/locales/en-US/toolkit/global/textActions.ftl, co-located with the existing `text-action-*` strings the new menubar already references for its child menu items. The ID names the Edit menu in its profile-window use case, rather than placing it in the `text-action-*` namespace where every sibling string is an action item rather than the menu that contains them.

  * Updates AppWindow::OnChromeLoaded() in xpfe/appshell/AppWindow.cpp so that native menu loading is no longer indefinitely queued waiting for the hidden window in flows where no hidden window will be created. Without this, the Profile Manager and wizard windows hit OnChromeLoaded with `sWaitingForHiddenWindowToLoadNativeMenus = true` and queue themselves into a list that no one drains until normal startup runs `createHiddenWindow`, which happens only after the Profile Manager dialog returns. The workaround is to check `nsIAppShellService::hasHiddenWindow` at OnChromeLoaded time: if no hidden window exists by then, none is coming, and we can proceed with native menu setup.

With this, the wizard's New Folder sub-sheet (and the Profile Manager's own modal sub-prompts, e.g. Rename Profile) get a real parent Edit menu, AppKit's responder chain dispatches Cmd+C/V/X/Z correctly into the sheet's NSText field, and the system menu bar shows the Edit menu while either window is up.

Depends on bug 2040844 (the ChildView undo:/redo: overrides) and bug 2040851 (don't mirror the XUL command disabled state to the NSMenuItem for standard Edit menu items) so that the menu-bar shortcuts, not just paste, work and stay enabled inside native sheets.

Differential Revision: https://phabricator.services.mozilla.com/D301466
2026-05-27 12:57:11 +00:00
Stephen A Pohl baeabedf94 Bug 2038980: Set explicit fullscreen collection behavior at window creation to avoid AppKit's non-deterministic heuristic on macOS 15.3. r=mac-reviewers,bradwerth
Default resizable titled top-level windows to FullScreenPrimary +
FullScreenAllowsTiling so the green window-control button keeps its
fullscreen-enter arrows; non-resizable titled windows default to
FullScreenAuxiliary + FullScreenDisallowsTiling. SetSupportsNativeFullscreen
sets all four bits consistently so AppKit never falls back to the
non-deterministic _implicitlyAllowsFullScreenPrimary heuristic that
caused the bug 2031249 crash.

In AppWindow.cpp, only call SetSupportsNativeFullscreen when the XUL
macnativefullscreen attribute is actually present, and read its value as
a boolean. With HasAttribute as the previous gate, windows without the
attribute were forced to FullScreenAuxiliary, which would regress the
zoom button to '+' on every XHTML window that doesn't carry the
attribute (only two do today). Leaving them at the creation-time default
preserves the existing fullscreen UX without requiring per-window XHTML
edits.

Differential Revision: https://phabricator.services.mozilla.com/D301471
2026-05-21 04:41:10 +00:00
agoloman c864ab28d0 Revert "Bug 2038980: Set explicit fullscreen collection behavior at window creation to avoid AppKit's non-deterministic heuristic on macOS 15.3. r=mac-reviewers,bradwerth" for causing mochitest failures @test_bug522217.xhtml.
This reverts commit 58cf61ddab.
2026-05-21 00:48:53 +00:00
Stephen A Pohl 58cf61ddab Bug 2038980: Set explicit fullscreen collection behavior at window creation to avoid AppKit's non-deterministic heuristic on macOS 15.3. r=mac-reviewers,bradwerth
Default resizable titled top-level windows to FullScreenPrimary +
FullScreenAllowsTiling so the green window-control button keeps its
fullscreen-enter arrows; non-resizable titled windows default to
FullScreenAuxiliary + FullScreenDisallowsTiling. SetSupportsNativeFullscreen
sets all four bits consistently so AppKit never falls back to the
non-deterministic _implicitlyAllowsFullScreenPrimary heuristic that
caused the bug 2031249 crash.

In AppWindow.cpp, only call SetSupportsNativeFullscreen when the XUL
macnativefullscreen attribute is actually present, and read its value as
a boolean. With HasAttribute as the previous gate, windows without the
attribute were forced to FullScreenAuxiliary, which would regress the
zoom button to '+' on every XHTML window that doesn't carry the
attribute (only two do today). Leaving them at the creation-time default
preserves the existing fullscreen UX without requiring per-window XHTML
edits.

Differential Revision: https://phabricator.services.mozilla.com/D301471
2026-05-20 22:46:37 +00:00
Emilio Cobos Álvarez 1ddad57128 Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 07:38:27 +00:00
Silaghi ce61f876cc Revert "Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug" for causing wpt failures at BaseContentList
This reverts commit cde3e5607b.
2026-04-28 03:43:46 +00:00
Emilio Cobos Álvarez cde3e5607b Bug 2034055 - Clean up NodeList / HTMLCollection set-up. r=smaug
Make them concrete classes rather than interfaces, and make the
inheritance chain simpler.

Differential Revision: https://phabricator.services.mozilla.com/D296484
2026-04-28 00:24:11 +00:00
Josh Aas f9cbf257dd Bug 2012902 - When creating a new window immediately after moving a window between displays, make sure the new window opens on the correct display. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D295128
2026-04-21 13:22:52 +00:00
serge-sans-paille f81328e365 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-22 08:35:47 +00:00
Alexandru Marc 04e5f74151 Revert "Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio"
This reverts commit a64dec2665.
2026-03-19 17:29:58 +00:00
serge-sans-paille a64dec2665 Bug 2023519 - Make our codebase modernize-use-equals-default + modernize-use-equals-delete -safe wrt. clang-tidy r=sylvestre,necko-reviewers,media-playback-reviewers,profiler-reviewers,dom-storage-reviewers,layout-reviewers,dom-worker-reviewers,valentin,jesup,padenot,edenchuang,emilio
The changeset has been generated automatically through:

    ./mach static-analysis check --output ./clang-tidy-bugprone.json --format json --fix

followed by manual adjustment when needed or when the auto-fixer bailed out.

This paves the way for Bug 2023527

Differential Revision: https://phabricator.services.mozilla.com/D287941
2026-03-18 17:25:01 +00:00
Sylvestre Ledru c28a667ae6 Bug 2023419 - Remove Emacs/Vim modelines from xpfe/ r=emilio
replaced by .editorconfig
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D287879
2026-03-16 17:22:12 +00:00
Emilio Cobos Álvarez 12db753018 Bug 2013871 - Make gtktiledwindow a regular boolean attribute. r=desktop-theme-reviewers,sfoster
No behavior change, just a bit simpler.

Differential Revision: https://phabricator.services.mozilla.com/D281432
2026-02-12 00:14:04 +00:00
Vincent Hilla d18ed53cf6 Bug 2015886 - Set IsDocumentPiP earlier on chrome browsing context. r=edgar
Set IsDocumentPiP immediately after creating the chrome window, instead of
after the browser chrome loads. This ensures browser CSS immediately gets the
picture-in-picture display-mode.

Differential Revision: https://phabricator.services.mozilla.com/D276863
2026-02-11 16:13:55 +00:00
Vincent Hilla 67b246b157 Bug 2003244 - Don't crash when failing to initialize docshell. r=dom-core,mccr8,smaug
Bug 543435 changed nsDocShell::Initialize from always returning true to
returning whether CreateInitialDocumentViewer succeeded. If this fails,
it is propagated up to ContentChild::RecvConstructBrowser where we crash.
The call to CreateDocumentViewerForActor that existed before bug 543435 in
nsWebBrowser::Create would've failed silently.

This commit restores avoids a crash by restoring the silent failure.

Differential Revision: https://phabricator.services.mozilla.com/D277765
2026-01-06 08:57:08 +00:00
Vincent Hilla 346191b515 Bug 2002767 - Show initial about:blank as soon as possible after start-up. r=smaug,firefox-desktop-core-reviewers ,Gijs
To improve perceived performance, bug 1336227 showed a blank window early after
start-up. Bug 543435 (sync-about-blank) broke this because the navigation for
the initial about:blank cannot be stopped. win.stop() wouldn't cause a state
stop and to prevent the completing load from breaking other code, we loaded
nothing at all.
This commit introduces a more explicit method to show the initial document.

Differential Revision: https://phabricator.services.mozilla.com/D277151
2025-12-29 08:37:24 +00:00
Emilio Cobos Álvarez f465bef00d Bug 2006320 - Clean up WindowMoved / WindowResized to use typed units. r=win-reviewers,gstoll
Make sure that we notify of outer position and inner sizes.

Differential Revision: https://phabricator.services.mozilla.com/D276645
2025-12-16 22:27:48 +00:00
Vincent Hilla 182bb259bf Bug 1858562 - Part 4: Browser Chrome Document Picture-in-Picture adjustments. r=mconley,smaug,sthompson,dom-core,webidl,sessionstore-reviewers,dao,urlbar-reviewers
Implement a basic UI/UX for Document Picture-in-Picture.
- The opener URI is shown in the PiP window's location bar.
- Fullscreen via F11 and session restore are blocked for PiP windows.

Differential Revision: https://phabricator.services.mozilla.com/D267248
2025-12-16 19:10:13 +00:00
Chris Peterson c22d71ab11 Bug 2002864 - Replace MOZ_CONSTINIT with C++20 constinit in desktop app code. r=firefox-desktop-core-reviewers ,mossop
Differential Revision: https://phabricator.services.mozilla.com/D274497
2025-12-09 06:59:28 +00:00
Martin Stransky cd8414274d Bug 1998188 Allow only one recursion of AppWindow::Center() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D275039
2025-12-05 12:24:08 +00:00
Emilio Cobos Álvarez dc2e8729cf Bug 2000504 - Make PresShell drive more of painting. r=jwatt
This changes the widget size constraints to be applied once per frame
before painting (like popups), but that seems acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D272831
2025-11-25 14:12:49 +00:00
agoloman e318afd777 Revert "Bug 2000504 - Make PresShell drive more of painting. r=jwatt" for causing assertions.
This reverts commit 68078cc21e.
2025-11-25 12:26:04 +00:00
Emilio Cobos Álvarez 68078cc21e Bug 2000504 - Make PresShell drive more of painting. r=jwatt
This changes the widget size constraints to be applied once per frame
before painting (like popups), but that seems acceptable.

Differential Revision: https://phabricator.services.mozilla.com/D272831
2025-11-25 11:42:18 +00:00
Henri SivonenandVincent Hilla 39a8a4171b Bug 543435 - Make initial about:blank not get overwritten by an async about:blank load. r=sessionstore-reviewers,sfoster,timhuang,credential-management-reviewers,issammani,webidl,extension-reviewers,tabbrowser-reviewers,migration-reviewers,home-newtab-reviewers,hsivonen,cookie-reviewers,fxview-reviewers,firefox-desktop-core-reviewers ,dao,valentin,mossop,smaug,geckoview-reviewers,Jamie,mtigley,thecount,media-playback-reviewers,padenot,dom-worker-reviewers,jesup,jdescottes,asuth,robwu,karlt,profiler-reviewers,kpatenio,devtools-reviewers,tcampbell,nchevobbe
Co-authored-by: Vincent Hilla <[email protected]>
Signed-off-by: Vincent Hilla <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D155376
2025-11-24 05:34:22 +00:00
Emilio Cobos Álvarez b9bd75cab0 Bug 1999619 - Remove nsIBaseWindow.repaint(). r=tnikkel,smaug,layout-reviewers,dom-core
It's unused. Found when removing more view code.

Differential Revision: https://phabricator.services.mozilla.com/D272204
2025-11-12 07:55:27 +00:00
serge-sans-paille b9ab86d508 Bug 1998400 - Make empty global variables of type nsTArray MOZ_CONSTINIT instead of MOZ_RUNINIT r=emilio,geckoview-reviewers,media-playback-reviewers,places-reviewers,ohall,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D271390
2025-11-06 16:30:12 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Emilio Cobos Álvarez d2eb173cee Bug 1995049 - Simplify widget move/resize APIs. r=stransky,mac-reviewers,mstange
We no longer have child windows which means that all widgets use desktop
pixels. Make the type system enforce that.

We want to start storing coordinates in DesktopPixels for GTK, to deal
correctly with fractional scaling, so move mBounds to the relevant
subclasses.

There's no behavior change. Some of the changes uncover coordinate
system confusions in Windows that I plan to fix in followups.

Android / iOS / PuppetWidgets don't care about the coordinate
differences, because their DesktopToLayoutDeviceScale is 1.0. Still I
made puppet widgets go through the coordinate conversion because it
seemed easier than casting or what not.

Differential Revision: https://phabricator.services.mozilla.com/D269091
2025-10-17 23:33:52 +00:00
Emilio Cobos Álvarez 5d95a0922d Bug 1994893 - Avoid null InitData in widget init. r=mac-reviewers,geckoview-reviewers,bradwerth,m_kato
widget/cocoa was already dereferencing without checking. There were two
callers with null init data which were for headless / puppet widgets,
but this is clearer.

Differential Revision: https://phabricator.services.mozilla.com/D268978
2025-10-17 08:10:05 +00:00
Emilio Cobos Álvarez 55dc8c84fe Bug 1986208 - Avoid a bunch of work in macOS' nsLookAndFeel::EnsureInit(). r=mac-reviewers,desktop-theme-reviewers,places-reviewers,dao,mstange
Avoid having to create an NSWindow, which is expensive, by performing
two changes:

 * Compute titlebar layout direction per document, instead of globally.

 * Make the unified toolbar looks work by removing the titlebar
   separator (macos 11.0+), instead of having to know how tall the
   titlebar is. It might look a bit funky on older macOS but I think we
   should be able to live with that, 11.0 is big sur which has been
   around for a while now...

This avoids the contention here (plus our regular windows are not titled
so they shouldn't need to grab that lock at that point at least).

Differential Revision: https://phabricator.services.mozilla.com/D260561
2025-08-31 16:58:10 +00:00
Emilio Cobos Álvarez 8e96ad62ed Bug 1980856 - Allow for a menubar to opt out of the native menu code. r=mac-reviewers,mstange
Allow to use the nonnative attribute to exclude them from the native
menu code. This will be used by the places window which is currently
working around this by creating a totally different DOM on macOS.

This doesn't even work on Linux if you enable the (disabled by default
but on the works) native menu support.

Differential Revision: https://phabricator.services.mozilla.com/D259793
2025-08-06 06:40:03 +00:00
Emilio Cobos Álvarez 8cd79d0bd4 Bug 1977581 - Cleanup nsIBaseWindow::GetMainWidget usage. r=smaug
AppWindow::GetMainWidget() is just mWindow. Add a helper to simplify
GetMainWidget() usage and use it across the tree, simplifying users.

Differential Revision: https://phabricator.services.mozilla.com/D258744
2025-08-05 09:19:20 +00:00
Emilio Cobos Álvarez 1aa98365af Bug 1977581 - Keep activating the parent window on Windows when destroying a child. r=win-reviewers,handyman
Bug 1902315 removed a PlaceBehind call here, which in this case happened
to also activate the window (via the aActivate = true parameter).

Keep raising the window manually, but with simpler APIs.

Differential Revision: https://phabricator.services.mozilla.com/D258743
2025-08-05 09:14:39 +00:00
David Shin 8090f17c2b Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-14 21:28:23 +00:00
pstanciu 7a21072acf Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing failures @ anchor-name-003.html
This reverts commit 5e12720896.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 27a56d04a1.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 69b2bd0242.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 23c707d5a7.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit c0d1d8808d.
2025-07-12 02:02:55 +00:00
David Shin 69b2bd0242 Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-11 15:21:42 +00:00
Atila Butkovits 0b2944a3d2 Revert "Bug 1969305: Adjust WPT expectations. r=layout-reviewers,emilio" for causing bustages at GeckoBindings.cpp.
This reverts commit 49a7b8afce.

Revert "Bug 1969305: Pass anchor resolution params for maxsize. r=layout-reviewers,emilio"

This reverts commit 0b615836cf.

Revert "Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio"

This reverts commit 359badb60e.

Revert "Bug 1969305: Pass anchor resolution params for margin. r=layout-reviewers,emilio"

This reverts commit 17f7f64cd8.

Revert "Bug 1969305: Implement anchor size resolution. r=layout-reviewers,emilio"

This reverts commit 47197ef7ab.
2025-07-11 01:18:14 +00:00
David Shin 359badb60e Bug 1969305: Pass anchor resolution params for size. r=layout-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D256290
2025-07-10 20:58:21 +00:00
Jan Horak c422c6cdf0 Bug 1960607 Add preference to disable state restoration for kiosk DE; r=smaug,emilio
There's a Gnome Kiosk [1] compositor which allows to set window position,
size and state during start. Firefox restoring state conflicts with
this feature. This patch adds browser.restoreWindowState.disabled preference
which disables the state restoration for this case.

[1] https://github.com/GNOME/gnome-kiosk

Differential Revision: https://phabricator.services.mozilla.com/D249071
2025-05-26 09:18:36 +00:00
David Shin 85c922b0dd Bug 1923959: Resolve anchor for (max) sizes. r=firefox-style-system-reviewers,emilio
Differential Revision: https://phabricator.services.mozilla.com/D240864
2025-04-08 02:29:18 +00:00
Edgar Chen 249820655d Bug 1937603 - Do not handle screen orientation on windowless browser; r=smaug
This patch reuses the existing but unused `mWindowless` flag. The flag is now
propagated to the BrowsingContext created under the windowless browser.

Differential Revision: https://phabricator.services.mozilla.com/D238584
2025-02-19 09:42:18 +00:00
Gijs Kruitbosch 7c11085b0c Bug 1946485 - Remove unused bits of nsIXULBrowserWindow, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D237069
2025-02-06 20:37:29 +00:00
Emilio Cobos Álvarez 4eaad99f2b Bug 581863 - Fix nsWindow coordinates to make sense. r=stransky,win-reviewers,rkraesig,devtools-reviewers,ochameau
I stumbled upon this bug while realizing that some of the math I'm doing
for PiP windows doesn't work at all on Linux (bug 1934760), because
screenX != mozInnerScreenX, even though outerWidth == innerWidth.

I've tested this on X11 and Wayland (plasma and Gnome) with CSD and SSD,
and in general, this is the same thing Windows does, so should be fine.

The basic idea is:

 * Keep mBounds being frame manager bounds (so, outer* and screen*),
   relative to mShell.

 * Keep mClientMargin to translate from mBounds to client bounds.

This is both simpler and makes the math consistent.

Differential Revision: https://phabricator.services.mozilla.com/D230981
2025-02-03 17:08:44 +00:00
Emilio Cobos Álvarez f5a475af9c Bug 1944998 - Explicitly opt in per window to mica backdrop. r=desktop-theme-reviewers,dao
Otherwise windows we want to be fully transparent get a backdrop, or
windows that don't have a tab list get the wrong backdrop (bug 1934140).

Differential Revision: https://phabricator.services.mozilla.com/D236372
2025-01-31 21:09:33 +00:00