Граф коммитов

30908 Коммитов

Автор SHA1 Сообщение Дата
stransky f0ffbdcf82 Bug 1791856 [Wayland] Remove rounding error workaround r=emilio
The rounding error workaround is broken - on recent Gtk it produces needless stream of move-to-rect callback.
It's because we move popup of GDK_WINDOW_TYPE_HINT_POPUP_MENU type and this is positioned by Gtk by move-to-rect even if gtk_window_move() is called.

But it looks like we don't need this workaround any more due to recent fixes (1786525, 1786588, 1786525, 1765714).

Differential Revision: https://phabricator.services.mozilla.com/D158217
2022-09-29 07:29:17 +00:00
Mark Banner 8d1ebcb9d6 Bug 1792365 - Convert toolkit/modules consumers to use ES module imports directly. r=webdriver-reviewers,perftest-reviewers,geckoview-reviewers,extension-reviewers,preferences-reviewers,desktop-theme-reviewers,application-update-reviewers,pip-reviewers,credential-management-reviewers,robwu,Gijs,sgalich,bytesized,AlexandruIonescu,dao,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D158094
2022-09-29 06:52:34 +00:00
Sandor Molnar c6f1e9ee28 Backed out 2 changesets (bug 1774317) for causing top-crash (bug 1792767) CLOSED TREE
Backed out changeset 418dec4ac3f9 (bug 1774317)
Backed out changeset 329666086b40 (bug 1774317)
2022-09-29 04:48:26 +03:00
Andrew McCreight 2da84b8ac4 Bug 1792574, part 3 - Don't include nsMemory where it isn't needed. r=xpcom-reviewers,necko-reviewers,valentin,nika
There are only 3 places where nsMemory.h is still needed (image/RasterImage.cpp,
gfx/thebes/gfxFT2FontList.cpp, and nsMemory.cpp). Remove the rest.

Differential Revision: https://phabricator.services.mozilla.com/D158213
2022-09-28 15:17:46 +00:00
Masayuki Nakano 58fa8fca99 Bug 1774317 - part 2: Make `TSFTextStore` support `GUID_PROP_URL` r=m_kato
`GUID_PROP_URL` is defined here:
https://learn.microsoft.com/en-us/windows/win32/tsf/predefined-properties

> Contains a BSTR value representing the URL of the text control source, where
> applicable.

The URL may contain sensitive information, e.g., user name, password, query
string.  However, they are already leaked via MSAA/UIA.
https://searchfox.org/mozilla-central/rev/b1e5f2c7c96be36974262551978d54f457db2cae/accessible/generic/DocAccessible.cpp#350

Therefore, this patch just has prefs to completely prevent to expose the URL
for users who don't like this feature.

Differential Revision: https://phabricator.services.mozilla.com/D157894
2022-09-28 11:46:59 +00:00
Masayuki Nakano b3600e6d25 Bug 1774317 - part 1: Make `IMEStateManager` notify `nsIWidget` of the document URL r=smaug
`TSFTextStore` needs to expose the document URL for supporting new feature
of Windows 11 22H2 update.  Therefore, the `InputContext` should have the
document URL.

Differential Revision: https://phabricator.services.mozilla.com/D157893
2022-09-28 11:46:59 +00:00
Andrew McCreight cc63625045 Bug 1792437, part 2 - Remove nsIModule. r=xpcom-reviewers,nika
I think some prior XPCOM component work removed the uses of this.

Differential Revision: https://phabricator.services.mozilla.com/D158210
2022-09-27 22:16:29 +00:00
stransky 6fd20dd767 Bug 1792125 [Wayland] Don't use move-to-rect if there are more popup parents of wl_subsurface popup type r=emilio
We can't use move-to-rect if there are more parents of wl_subsurface popups types.
It's because wl_subsurface is ignored by xgd_popup (created by move-to-rect) so our popup scenario:

toplevel -> xgd_popup(1) -> wl_subsurface(2) -> xgd_popup(3)

looks for Wayland compositor as:

toplevel -> xgd_popup(1) -> xgd_popup(3)

If xgd_popup(1) and xgd_popup(3) are not adjacent then move-to-rect applied to xgd_popup(3) fails and we get missing popup.

Depends on D158120

Differential Revision: https://phabricator.services.mozilla.com/D158121
2022-09-27 10:20:09 +00:00
stransky 666c946a5b Bug 1792125 [Wayland] Always calculate relative popup coordinates for context menu r=emilio
Wne context menu is positioned by plain move, we need relative popup coordinates. So calculate them according to context menu parent popup.

Differential Revision: https://phabricator.services.mozilla.com/D158120
2022-09-27 10:20:09 +00:00
stransky 1e3bd4ab3e Bug 1792512 [Linux] Don't skip resize if recent window size is different than requested one r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D158190
2022-09-27 09:08:13 +00:00
stransky a88baa8f03 Bug 1791977 [Linux] Don't expect CompositorWidget is always GtkCompositorWidget r=emilio
Don't crash/assert when mCompositorWidgetDelegate is different than GtkCompositorWidget.

Differential Revision: https://phabricator.services.mozilla.com/D158003
2022-09-23 09:42:50 +00:00
stransky daf65b6eb5 Bug 1792091 [Wayland] Assert when shm interface is missing r=emilio
There are some suspect crashes around Wayland SHM interface so let's make sure we have valid shm handle before we pass it to Wayland.
It covers the 'It can't happen' scenario which tends to happen despite of all premises.

Differential Revision: https://phabricator.services.mozilla.com/D157975
2022-09-23 06:19:28 +00:00
Emilio Cobos Álvarez bf26fdb5a6 Bug 1792063 - Fix menuhover background computation in some gtk themes. r=stransky
When figuring out menuhover background, make sure not to come up with
the exact same color as the menu background. This ensures we also try
gradients / background-images before giving up.

This is only an issue with the dark theme in this case, because
otherwise we use native drawing.

Differential Revision: https://phabricator.services.mozilla.com/D157963
2022-09-22 20:20:30 +00:00
stransky 4b164391e1 Bug 1789956 [Wayland] Don't use move-to-rect offset for non-adjacent popups r=emilio
move-to-rect offset does not work realibly in mutter and can lead to invisible window.
It's used mainly for tooltips so let's skip it for now.

Differential Revision: https://phabricator.services.mozilla.com/D157926
2022-09-22 19:43:33 +00:00
stransky a875f16df0 Bug 1791735 [Wayland] Don't paint to unmapped window by SW backend r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157795
2022-09-22 18:42:01 +00:00
stransky 60f547bec1 Bug 1789956 [Wayland] Use mBounds to get parent popup position r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157915
2022-09-22 18:32:16 +00:00
stransky e957b7cb4a Bug 1645677 [Linux] Fix build on X11 r=emilio
Depends on D157629

Differential Revision: https://phabricator.services.mozilla.com/D157898
2022-09-22 09:41:06 +00:00
stransky 016607e147 Bug 1645677 [Linux] Call unmap for X11 mozcontainer r=emilio
Depends on D157360

Differential Revision: https://phabricator.services.mozilla.com/D157629
2022-09-22 09:41:05 +00:00
stransky e89edaae90 Bug 1645677 [Wayland] Stop vsync before GtkWindow si hidden r=emilio
Depends on D157359

Differential Revision: https://phabricator.services.mozilla.com/D157360
2022-09-22 09:41:05 +00:00
stransky d37a4e539c Bug 1645677 [Linux] Don't use SendResumeAsync() as we need to sync render thread with main thread where Gtk operates r=emilio
Depends on D157358

Differential Revision: https://phabricator.services.mozilla.com/D157359
2022-09-22 09:41:05 +00:00
stransky cb46f7b2dd Bug 1645677 [Wayland] Update EGLSurface when wl_surface is deleted r=emilio,jgilbert
When GtkWidget is hidden, underlying wl_surface is deleted. We need to also update EGLSurface of GtkWidget (GtkCompositorWidget)
as EGLSurface is directly linked to wl_surface:

- When GtkWidget is hidden, call GtkCompositorWidget::DisableRendering(). That releases GtkCompositorWidget resources
  related to GtkWidget (XWindow/XVisual etc.) and marks the widget as hidden.
- If GtkWidget is backed by EGL call compositor resume which forces compositor to create new EGLSurface.
- Make sure GLContextEGL can create EGLSurface even when GtkWidget is hidden and wl_surface is missing.
  It prevents fallback to SW rendering or pause RenderCompositorEGL which leads to Bug 1777664 (whole browser UI freeze).
- Return early from RenderCompositorEGL::BeginFrame()/RenderCompositorEGL::EndFrame() when GtkCompositorWidget is hidden.

Depends on D157357

Differential Revision: https://phabricator.services.mozilla.com/D157358
2022-09-22 09:41:04 +00:00
stransky 24d8cfd0dd Bug 1645677 [Wayland] Attach map/unmap signals to mContainer r=emilio
Map/Unmap signals creates and deletes mContainer wayland surface and EGL window.

As we need to call the handlers in correct order (mContainer::map -> nsWindow::map and nsWindow::unmap -> mContainer::unmap)
connect the signals to mContainer widget and call mContainer::unmap from nsWindow::unmap.

Then nsWindow::unmap can update compositor before wl_surface/EGL window is released by mContainer.

Differential Revision: https://phabricator.services.mozilla.com/D157357
2022-09-22 09:41:04 +00:00
stransky b1f3f5e5af Bug 1744148 [Linux] Don't crash if we get configure event for hidden window r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157820
2022-09-22 06:24:38 +00:00
Neill Miller 627d6fe873 Bug 1768907 - Part 2: nsTransferable disk-leaks when private browsing mode is enabled by default. r=handyman
nsTransferable was modified to prevent disk leakings when copying data
in private browsing mode with Bug 1123480.
However, the context is nullptr when it is initialized, so it still
leaks if PBM is enabled by default.
Our solution is to check the browser.privatebrowsing.autostart in this
condition.

Differential Revision: https://phabricator.services.mozilla.com/D157800
2022-09-22 00:26:17 +00:00
Pier Angelo Vendrame aa21b01cfa Bug 1768907 - Part 1: Make browser.privatebrowsing.autostart a static pref. r=handyman,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D157843
2022-09-22 00:26:17 +00:00
Jamie Nicol 49c0f0ed43 Bug 1780093 - Use custom SurfaceView which allows magnifier widget to work. r=geckoview-reviewers,owlish
The android magnifier widget does not work when using our
SurfaceControl rendering path, as we no longer render in to the
Surface provided by the SurfaceView, but instead into a child Surface
we have created and attached the SurfaceControl.

To fix this, we create a SurfaceView subclass, MagnifiableSurfaceView,
which allows us to set an override Surface to be used by the
magnifier. This class works by overriding getHolder() to return a
custom SurfaceHolder, which returns our override Surface rather than
the default one when called by the Magnifier class.

Depends on D157308

Differential Revision: https://phabricator.services.mozilla.com/D157309
2022-09-21 17:30:26 +00:00
Jamie Nicol 5e60f35505 Bug 1780093 - Remove code for enabling/disabling SurfaceControl rendering path. r=geckoview-reviewers,owlish
In order to fix the magnifier widget being broken, the previous patch
in this bug added a mechanism to disable and enable the SurfaceControl
rendering path. This caused some glitches to occur, so we removed the
calls to that code in bug 1783542, but the code remained.

As we now have an alternative solution to fix the magnifier widget, we
no longer require this code. This patch therefore reverts the original
patch, to lead the way for the new solution in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D157308
2022-09-21 17:30:25 +00:00
Butkovits Atila 7d55852039 Backed out 5 changesets (bug 1645677) for causing build bustages at nsWindow.cpp.
Backed out changeset 4f164c3d0ba9 (bug 1645677)
Backed out changeset 27a918234048 (bug 1645677)
Backed out changeset ca32ff38fc67 (bug 1645677)
Backed out changeset 6841dc516087 (bug 1645677)
Backed out changeset 5ba3a56b3038 (bug 1645677)
2022-09-21 18:26:03 +03:00
stransky 58f9ba8b8d Bug 1791752 [Linux] Make sure we have correct compositor widget r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157814
2022-09-21 10:29:47 +00:00
Norisz Fay 965f18a5e2 Backed out changeset ddd9b4ac6f84 (bug 1791752) for causing multiple failures CLOSED TREE 2022-09-21 16:20:18 +03:00
Jan-Niklas Jaeschke 4265f72859 Bug 1777925: Replaced MutationObserver array container type with linked list. r=smaug
Deletion of mutation observers from a list resulted in O(n^2) behavior and could lead to massive freezes.
This is resolved by using a LinkedList instead, reducing complexity to O(n).

A safely iterable doubly linked list was implemented based on `mozilla::DoublyLinkedList`,
allowing to insert and remove elements while iterating the list.

Due to the nature of `mozilla::DoublyLinkedList`, every Mutation Observer now inherits `mozilla::DoublyLinkedListElement<T>`.
This implies that a Mutation Observer can only be part of one DoublyLinkedList.
This conflicts with some Mutation Observers, which are being added to multiple `nsINode`s.
To continue supporting this, new MutationObserver base classes `nsMultiMutationObserver` and `nsStubMultiMutationObserver` are introduced,
which create `MutationObserverWrapper` objects each time they are added to a `nsINode`.
The wrapper objects forward every call to the actual observer.

Differential Revision: https://phabricator.services.mozilla.com/D157031
2022-09-21 11:31:44 +00:00
stransky 4a1d94379a Bug 1645677 [Linux] Call unmap for X11 mozcontainer r=emilio
Depends on D157360

Differential Revision: https://phabricator.services.mozilla.com/D157629
2022-09-21 10:32:45 +00:00
stransky cc566d923e Bug 1645677 [Wayland] Stop vsync before GtkWindow si hidden r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157360
2022-09-21 10:32:45 +00:00
stransky bd787b68e0 Bug 1645677 [Linux] Don't use SendResumeAsync() as we need to sync render thread with main thread where Gtk operates r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157359
2022-09-21 10:32:44 +00:00
stransky 4a3192c560 Bug 1645677 [Wayland] Update EGLSurface when wl_surface is deleted r=emilio,jgilbert
When GtkWidget is hidden, underlying wl_surface is deleted. We need to also update EGLSurface of GtkWidget (GtkCompositorWidget)
as EGLSurface is directly linked to wl_surface:

- When GtkWidget is hidden, call GtkCompositorWidget::DisableRendering(). That releases GtkCompositorWidget resources
  related to GtkWidget (XWindow/XVisual etc.) and marks the widget as hidden.
- If GtkWidget is backed by EGL call compositor resume which forces compositor to create new EGLSurface.
- Make sure GLContextEGL can create EGLSurface even when GtkWidget is hidden and wl_surface is missing.
  It prevents fallback to SW rendering or pause RenderCompositorEGL which leads to Bug 1777664 (whole browser UI freeze).
- Return early from RenderCompositorEGL::BeginFrame()/RenderCompositorEGL::EndFrame() when GtkCompositorWidget is hidden.

Depends on D157357

Differential Revision: https://phabricator.services.mozilla.com/D157358
2022-09-21 10:32:44 +00:00
stransky 793e504659 Bug 1645677 [Wayland] Attach map/unmap signals to mContainer r=emilio
Map/Unmap signals creates and deletes mContainer wayland surface and EGL window.

As we need to call the handlers in correct order (mContainer::map -> nsWindow::map and nsWindow::unmap -> mContainer::unmap)
connect the signals to mContainer widget and call mContainer::unmap from nsWindow::unmap.

Then nsWindow::unmap can update compositor before wl_surface/EGL window is released by mContainer.

Differential Revision: https://phabricator.services.mozilla.com/D157357
2022-09-21 10:32:44 +00:00
stransky d7b6c906b3 Bug 1791752 [Linux] Make sure we have correct compositor widget r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157814
2022-09-21 10:29:47 +00:00
stransky 9c23920f74 Bug 1791469 [Wayland] Accept plain move for tooltips r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D157806
2022-09-21 10:00:13 +00:00
Ray Kraesig 5687bd89ee Bug 1776895 - [6/6] Add logging for fullscreen entry/exit r=cmartin,handyman
Add logging for fullscreen position-state saving and restoration.

Differential Revision: https://phabricator.services.mozilla.com/D153411
2022-09-20 16:22:58 +00:00
Ray Kraesig ec80afc7a4 Bug 1776895 - [5/6] Save and restore original relative position r=cmartin,handyman
When entering fullscreen and saving the original position of a window,
also save the position to which it was moved.

When leaving fullscreen, keep the window on the same screen. Restore its
_screen-relative_ position, rather than its absolute position.

Differential Revision: https://phabricator.services.mozilla.com/D153410
2022-09-20 16:22:57 +00:00
Ray Kraesig 9f7b5a31e1 Bug 1776895 - [4/6] adjust callsite of HideWindowChrome r=cmartin,handyman
`HideWindowChrome(false)` may change the reported window size on Mac:
the OS menu bar appears at the top of the screen, and this will cause the
window to shrink if it was fullscreen.

This isn't a problem yet, since we don't check the window dimensions
when exiting fullscreen... but the following commit will do exactly
that. Delay calling `HideWindowChrome` until the last possible minute --
but make sure that it _does_ get called.

Since HideWindowChrome(true) does not presently change the window size
(see bug 498835), no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D154469
2022-09-20 16:22:57 +00:00
Ray Kraesig 360f7f624e Bug 1776895 - [3/6] Cleanup: specialize further to desktop pixels r=cmartin
Use desktop pixels everywhere:
 - Store the old window position as a `DesktopRect`.
 - Since `GetRectDisplayPix` is infallible, use the convenience getter
   that hands us a `DesktopIntRect`.
 - Add a helper function that wraps `Resize()` and takes any `Rect`
   which uses `DesktopPixel`s.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153409
2022-09-20 16:22:56 +00:00
Ray Kraesig 86239750b0 Bug 1776895 - [2/6] Cleanup: remove BoundsUseDesktopPixels() condition r=cmartin
A window is fullscreenable iff it's a desktop window (that is, a
positional child of the desktop rather than of another window) -- and
desktop windows are the windows which use desktop-pixel units in
Resize().

Code coverage confirms that the branch when `BoundsUseDesktopPixels()`
returns `false` is never taken in tests.

Under the (hopefully justified) assumption that it's never taken at all,
no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153408
2022-09-20 16:22:56 +00:00
Ray Kraesig 44d02f76a7 Bug 1776895 - [1/6] Cleanup: use UniquePtr rather than manual allocation r=cmartin
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153407
2022-09-20 16:22:56 +00:00
stransky 9ae73a5923 Bug 1789581 [Wayland] Call gdk_window_move() to reset GdkWindow internal position method r=emilio
When widget is hidden gtk_window_move() does not move the widget but sets new widget coordinates
when widget is mapped again.

If popup used move-to-rect before (GdkWindow has POSITION_METHOD_MOVE_TO_RECT set),
popup will use move-to-rect again when it's mapped and we'll get bogus move-to-rect callback.

In this patch we implement nsWindow::WaylandPopupMovePlain() to perform simple popup movement.
It calls gdk_window_move() to set position_method to POSITION_METHOD_MOVE_RESIZE when popup is hidden
so we'll use simple move when popup is shown and don't slip to move-to-rect.

Depends on D156821

Differential Revision: https://phabricator.services.mozilla.com/D157432
2022-09-19 10:39:16 +00:00
stransky a2cbe9c5d7 Bug 1789581 [Wayland] Use new popup position at WaylandPopupFitsToplevelWindow() if popup is moved r=emilio
If popup is moved we can't use recent popup position (mBounds) to check popup placement but
use requested position given at nsWindow::NativeMoveResize().

Differential Revision: https://phabricator.services.mozilla.com/D156821
2022-09-19 10:39:16 +00:00
stransky 6612cb9985 Bug 1789581 [Wayland] Use move-to-rect offset to shift popup position when there's a gap between popups r=emilio
If there's a gap between popups we can't use move-to-rect as anchor needs to be placed inside of parent popup.
In such case place anchor to upper corner of parent popup and submit popup position as offset.

Differential Revision: https://phabricator.services.mozilla.com/D156820
2022-09-19 10:39:15 +00:00
Emilio Cobos Álvarez 0d39501597 Bug 1789823 - More aggressively request size mode changes if there's a state change request in flight. r=stransky
Depends on D157597

Differential Revision: https://phabricator.services.mozilla.com/D157598
2022-09-19 09:39:10 +00:00
Nick Alexander 65437af408 Bug 1790692 - Make image smaller DOM notifications/non-system (chrome-privileged) alerts. r=nrishel
This is a partial reversion of Bug 1775135.

Differential Revision: https://phabricator.services.mozilla.com/D157362
2022-09-15 23:32:10 +00:00
Iulian Moraru a50d0c82b5 Backed out changeset fe1aceefa7ac (bug 1790692) for causing xpcshell failures on test_windows_alert_service.js. CLOSED TREE 2022-09-15 20:35:03 +03:00
Nick Alexander b0e278d406 Bug 1790692 - Make image smaller for DOM notifications/non-system (chrome-privileged) alerts. r=nrishel
This is a partial reversion of Bug 1775135.

Differential Revision: https://phabricator.services.mozilla.com/D157362
2022-09-15 16:57:35 +00:00
Hiroyuki Ikezoe 81f8fd1503 Bug 1787079 - Implement nsIDOMWindowUtils.setHiDPiMode and restoreHiDPIMode on Windows. r=rkraesig
And make the APIs available on debug builds.

To implement the APIs we used undocumented APIs published in
https://github.com/lihas/windows-DPI-scaling-sample .

Differential Revision: https://phabricator.services.mozilla.com/D156265
2022-09-15 10:13:14 +00:00
Emilio Cobos Álvarez 99570efc5b Bug 1790670 - Fix color of high-contrast checkboxes. r=morgan
This restores behavior from before my patch, and makes it so that it's
easier to see which color pair ends up getting used.

Differential Revision: https://phabricator.services.mozilla.com/D157271
2022-09-14 23:14:30 +00:00
Nicholas Rishel 86976673e6 Bug 1786578 - Dismiss Windows native toast notifications when Firefox is closed in a private browsing session. r=nalexander.
Prior to this commit the `ToastNotification`'s observer registration doesn't work due to `ToastNotification` not implementing `nsIWeakReference` while attempting to register itself as an observer as a weak reference.

Differential Revision: https://phabricator.services.mozilla.com/D155764
2022-09-14 20:48:48 +00:00
Sandor Molnar cddb6cfdb3 Backed out 6 changesets (bug 1787079) for causing browser-chrome failures in layout/base/tests/browser_bug1787079.js CLOSED TREE
Backed out changeset b6075adb01a7 (bug 1787079)
Backed out changeset d5d0f8bb0be4 (bug 1787079)
Backed out changeset dce92508b5a3 (bug 1787079)
Backed out changeset 650f8d455e0e (bug 1787079)
Backed out changeset 1a9828bbf04b (bug 1787079)
Backed out changeset 3580b308ec59 (bug 1787079)
2022-09-14 06:13:39 +03:00
Hiroyuki Ikezoe 1e1595638c Bug 1787079 - Implement nsIDOMWindowUtils.setHiDPiMode and restoreHiDPIMode on Windows. r=rkraesig
And make the APIs available on debug builds.

To implement the APIs we used undocumented APIs published in
https://github.com/lihas/windows-DPI-scaling-sample .

Differential Revision: https://phabricator.services.mozilla.com/D156265
2022-09-14 01:15:54 +00:00
Nicholas Rishel 9454695dd9 Bug 1789390 - Remove scheduled and Action Center notifications during uninstall. r=nalexander
Non-MSIX notifications are not removed when Firefox is uninstalled. To handled this we've added a new `uninstall` background task and extended `nsIWindowsAlertService` to deregister notifications on uninstall.

Differential Revision: https://phabricator.services.mozilla.com/D156625
2022-09-14 00:42:43 +00:00
Iulian Moraru d07f446854 Backed out 2 changesets (bug 1789390) for causing bc failures regarding unreferenced file on BackgroundTask_uninstall.jsm. CLOSED TREE
Backed out changeset 4cec525d92f4 (bug 1789390)
Backed out changeset 6fcec3502cb2 (bug 1789390)
2022-09-13 13:20:20 +03:00
Nicholas Rishel f203d491e0 Bug 1789390 - Remove scheduled and Action Center notifications during uninstall. r=nalexander
Non-MSIX notifications are not removed when Firefox is uninstalled. To handled this we've added a new `uninstall` background task and extended `nsIWindowsAlertService` to deregister notifications on uninstall.

Differential Revision: https://phabricator.services.mozilla.com/D156625
2022-09-13 06:09:30 +00:00
Nick Alexander 7df6a78a6c Bug 1775135 - Make Windows native toasts use "ToastGeneric" template. r=nrishel
The immediate effect is to make any image larger and more prominent.
This might not be the right option for regular DOM notifications,
which support only `icon` (and not `image`) in Firefox at this time,
but we can adjust (perhaps limiting the generic template to privileged
alerts) as we need in the future.

Differential Revision: https://phabricator.services.mozilla.com/D156873
2022-09-13 02:43:17 +00:00
Nick Alexander ae5109c174 Bug 1788960 - Part 1: Round trip `name` for privileged alerts through Firefox restart. r=nrishel
On Windows, when an alert is privileged and `name` is non-empty, round
trip its `name` (as `privilegedName`) through the Windows notification
mechanism, and provide it to the "relaunch" callback.

Differential Revision: https://phabricator.services.mozilla.com/D156636
2022-09-13 02:43:17 +00:00
sotaro f0790c2c89 Bug 1790518 - Enable video overlay until early beta on non-Intel GPU on Windows r=jrmuizel,gfx-reviewers
With early beta, the video overlay could be tested more.

Differential Revision: https://phabricator.services.mozilla.com/D157176
2022-09-13 01:31:37 +00:00
Mike Kaply 0ce6d5df0f Bug 1297520 - For Snap, only install language for system locale. r=nalexander,OlivierTilloy
Differential Revision: https://phabricator.services.mozilla.com/D151052
2022-09-12 18:41:56 +00:00
Dão Gottwald f0e33014a0 Bug 1788822 - Simplify color-scheme content override pref to only be [dark, light, auto]. r=emilio,fluent-reviewers,extension-reviewers,robwu,flod
Differential Revision: https://phabricator.services.mozilla.com/D156710
2022-09-08 17:55:07 +00:00
Yannis Juglaret 2397ac1be1 Bug 1750103 - Clarify nsWindow::SubclassWindow function by splitting it in two. r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D156574
2022-09-08 15:34:47 +00:00
Yannis Juglaret 814637c4ee Bug 1750103 - Modernize nsWindow code by removing TriStateBool and using BOOL only when required. r=cmartin
Differential Revision: https://phabricator.services.mozilla.com/D156573
2022-09-08 15:34:47 +00:00
Yannis Juglaret 45f8785b00 Bug 1750103 - Reduce surface area of nsWindow by moving static members to their method of use when possible. r=cmartin
I moved the following variables to their method of use:

- sSwitchKeyboardLayout, sCanQuit to nsWindow::ProcessMessageInternal;
- sLastMousePoint, sLastMouseDownTime, sLastClickCount, sLastMouseButton to nsWindow::DispatchMouseEvent;
- sFirstTopLevelWindowCreated to nsWindow::Create;
- sHasBogusPopupsDropShadowOnMultiMonitor to nsWindow::HasBogusPopupsDropShadowOnMultiMonitor;
- gIsSleepMode (now sWasSleepMode) to nsWindow::PostSleepWakeNotification.

I also removed one dead variable called sNeedsToInitMouseWheelSettings, as well as sHaveInitializedPrefs which was not required anymore.

Two variables mentioned in the bug had already been moved out of the nsWindow namespace as part of other changesets:

- sDropShadowEnabled, now replaced by local variables shouldUseDropShadow and sShadowEnabled of nsWindow::Show in https://hg.mozilla.org/integration/autoland/rev/18a7f69d5ce4 ;
- sCustomHCursor, now replaced by local variables sCurrentHCursor and sCurrentHCursorIsCustom of nsWindow::SetCursor in https://hg.mozilla.org/integration/autoland/rev/dd95f1e386f1 .

Differential Revision: https://phabricator.services.mozilla.com/D156539
2022-09-08 15:34:46 +00:00
Ben Hearsum 83f4549190 Bug 1782295: Use Nimbus for Felt Privacy window separation r=dao
We'll be defaulting Felt Privacy features to enabled, and allowing them to be disabled by Nimbus (primarily for a holdback study).

Differential Revision: https://phabricator.services.mozilla.com/D153275
2022-09-08 13:09:10 +00:00
Kershaw Chang d164608d66 Bug 1760580 - P2: Provide a reason when request is cancelled with NS_BINDING_ABORTED, r=necko-reviewers,media-playback-reviewers,valentin,chunmin
Differential Revision: https://phabricator.services.mozilla.com/D156071
2022-09-08 09:11:19 +00:00
stransky feb00b8d6d Bug 1788910 [Wayland] Look for parents recursively at nsWindow::WaylandGetParentPosition() r=emilio
Right now we look for first parent only at nsWindow::WaylandGetParentPosition() and that's wrong.
WaylandGetParentPosition() is expected to return popup position in root coordinates regardless of popup parent nembers.

In this patch we calc popup position according to whole popup chain.

Differential Revision: https://phabricator.services.mozilla.com/D156673
2022-09-08 08:55:17 +00:00
stransky fcfb87fb3b Bug 1777269 [Wayland] Use fast popup movement for panels only r=emilio
Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/5089 don't use wl_subsurface popup for menus/tooltips, just for panels which can be resized.

Differential Revision: https://phabricator.services.mozilla.com/D156540
2022-09-06 13:48:12 +00:00
stransky 21e14041bd Bug 1777269 [Wayland] Apply workaround for Mutter enter/leave bogus events r=emilio
When we open a popup window (tooltip for instance) on top of GDK_WINDOW_TYPE_HINT_UTILITY popup, Mutter compositor sends bogus
leave/enter events to the GDK_WINDOW_TYPE_HINT_UTILITY popup (https://gitlab.gnome.org/GNOME/gtk/-/issues/5089).

That leads to immediate tooltip close. As a workaround ignore these
bogus events.

We need to check two affected window types:

- toplevel window with at least two child popups where the first one is
  GDK_WINDOW_TYPE_HINT_UTILITY.
- popup GDK_WINDOW_TYPE_HINT_UTILITY with a child popup.

We ignore two bogus leave/enter sequences which are fired by mutter together:

 1. Leave (popup) -> Enter (toplevel)
 2. Leave (toplevel) -> Enter (popup)

Differential Revision: https://phabricator.services.mozilla.com/D156301
2022-09-06 13:48:12 +00:00
Frederic Wang 39dd537031 Bug 1588733 - Make maction/semantics elements behave as an mrow with the first child. r=emilio
See https://groups.google.com/forum/#!topic/mozilla.dev.platform/BWUvjERSXUM

Differential Revision: https://phabricator.services.mozilla.com/D49285
2022-09-06 04:32:15 +00:00
stransky e0deeeffa0 Bug 1788936 [Wayland] Don't hide GDK_WINDOW_TYPE_HINT_UTILITY popup when has a correct type r=emilio
We don't need to hide/show GDK_WINDOW_TYPE_HINT_UTILITY popup type to change it's position.
Hide it only if we need to set correct popup type as such change is done in map event.

Differential Revision: https://phabricator.services.mozilla.com/D156305
2022-09-05 10:38:45 +00:00
Nick Alexander f7cb13e745 Bug 1781929 - Part 4: Pass through or launch Firefox from notification server. r=nrishel
When the notification server callback is executed by the Windows
notification system, it invokes Firefox with additional command line
parameters, most importantly the Windows-specific notification
"Windows tag".

If no appropriate Firefox is running, the command line will be
processed, the provided Windows tag will be inspected (and seen to not
be registered with this running Firefox instance) and a "launch URL"
stored as part of the Windows notification itself opened (if one is
provided).

If an appropriate Firefox is running, the remoting protocol will
forward this command line to the running instance.  If the instance
recognizes the provided `--notification-windowsTag`, the command line
will be ignored.  When the notification server exits, Windows will
fallback to the Windows 8.1 style notification callbacks registered
for this Windows tag and the existing (non notification server)
behaviour will occur.

In fact, the server therefore waits for a Windows tag-specific system
event to be signalled by the invoked Firefox (or a sibling process).
If we were to return `S_OK` from the notification server immediately,
and a running Firefox process would handle the notification via
Windows 8.1-style notification callbacks, then Windows would fall back
to those callbacks.  The invoked callbacks unregister themselves upon
completion, often before the launched Firefox has an opportunity to
process the command line.  By waiting for this system event, we allow
the invoked Firefox to process the command line while its own
notification callbacks are registered and therefore recognize that its
callbacks will handle the notification.

Differential Revision: https://phabricator.services.mozilla.com/D154468
2022-09-03 22:49:02 +00:00
Nick Alexander b15fec0115 Bug 1781929 - Part 3: Include `launchUrl` in Windows toast notification. r=nrishel
Differential Revision: https://phabricator.services.mozilla.com/D155909
2022-09-03 22:49:01 +00:00
Nick Alexander c2e7a9b4e8 Bug 1781929 - Part 1: Handle toast notifications from background tasks specially. r=nrishel
In background task mode:

1. Re-launch Firefox into the default browsing profile, not the
   (possibly ephemeral) background task profile.
2. Don't show the in-product notification settings, which won't apply
   to the relevant Firefox profile.

Differential Revision: https://phabricator.services.mozilla.com/D155908
2022-09-03 22:49:00 +00:00
Nicholas Rishel b1c91cad45 Bug 1784367 - Prevent duplicate Windows notifications from occuring due to multiple tabs receiving same notification. r=nalexander
Use the existing mName field of alert which includes the host port and tag (or uuid) for Windows notification tag.

When a notification originates from the browser chrome, generate an identify on the fly as before.

The tag is hashed in order to fit the 16 character limit for tags. Note the limit was bumped to 64 in Windows 10 Creators Update.

Differential Revision: https://phabricator.services.mozilla.com/D155140
2022-09-03 22:49:00 +00:00
Marian-Vasile Laza 08d282ce78 Backed out 5 changesets (bug 1781929, bug 1784367) for causing bc test failures. CLOSED TREE
Backed out changeset 34003f6f7b27 (bug 1781929)
Backed out changeset 8e6fe1c18e8d (bug 1781929)
Backed out changeset e50432e37751 (bug 1781929)
Backed out changeset abf6eff708d8 (bug 1781929)
Backed out changeset 15fec49b7587 (bug 1784367)
2022-09-03 02:26:04 +03:00
Nick Alexander 7ad3c38071 Bug 1781929 - Part 4: Pass through or launch Firefox from notification server. r=nrishel
When the notification server callback is executed by the Windows
notification system, it invokes Firefox with additional command line
parameters, most importantly the Windows-specific notification
"Windows tag".

If no appropriate Firefox is running, the command line will be
processed, the provided Windows tag will be inspected (and seen to not
be registered with this running Firefox instance) and a "launch URL"
stored as part of the Windows notification itself opened (if one is
provided).

If an appropriate Firefox is running, the remoting protocol will
forward this command line to the running instance.  If the instance
recognizes the provided `--notification-windowsTag`, the command line
will be ignored.  When the notification server exits, Windows will
fallback to the Windows 8.1 style notification callbacks registered
for this Windows tag and the existing (non notification server)
behaviour will occur.

In fact, the server therefore waits for a Windows tag-specific system
event to be signalled by the invoked Firefox (or a sibling process).
If we were to return `S_OK` from the notification server immediately,
and a running Firefox process would handle the notification via
Windows 8.1-style notification callbacks, then Windows would fall back
to those callbacks.  The invoked callbacks unregister themselves upon
completion, often before the launched Firefox has an opportunity to
process the command line.  By waiting for this system event, we allow
the invoked Firefox to process the command line while its own
notification callbacks are registered and therefore recognize that its
callbacks will handle the notification.

Differential Revision: https://phabricator.services.mozilla.com/D154468
2022-09-02 20:22:51 +00:00
Nick Alexander 7dff57f69c Bug 1781929 - Part 3: Include `launchUrl` in Windows toast notification. r=nrishel
Differential Revision: https://phabricator.services.mozilla.com/D155909
2022-09-02 20:22:51 +00:00
Nick Alexander 24023c68c6 Bug 1781929 - Part 1: Handle toast notifications from background tasks specially. r=nrishel
In background task mode:

1. Re-launch Firefox into the default browsing profile, not the
   (possibly ephemeral) background task profile.
2. Don't show the in-product notification settings, which won't apply
   to the relevant Firefox profile.

Differential Revision: https://phabricator.services.mozilla.com/D155908
2022-09-02 20:22:50 +00:00
Nicholas Rishel d7f6839d2f Bug 1784367 - Prevent duplicate Windows notifications from occuring due to multiple tabs receiving same notification. r=nalexander
Use the existing mName field of alert which includes the host port and tag (or uuid) for Windows notification tag.

When a notification originates from the browser chrome, generate an identify on the fly as before.

The tag is hashed in order to fit the 16 character limit for tags. Note the limit was bumped to 64 in Windows 10 Creators Update.

Differential Revision: https://phabricator.services.mozilla.com/D155140
2022-09-02 20:22:49 +00:00
Calixte 2cc3e37989 Bug 1788668 - Add 'application/pdfjs' to the list of known formats r=NeilDeakin
This way we'll be able to know if the clipboard contains some pdfjs data.

Differential Revision: https://phabricator.services.mozilla.com/D156314
2022-09-02 19:04:09 +00:00
stransky c6fa781bc2 Bug 1788909 [Linux] Reference nsWindow in event handlers r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D156299
2022-09-02 13:26:21 +00:00
stransky 5c6538d73f Bug 1785185 [Wayland] Remove useRelativeCoordinates r=emilio
gtk_window_move() popup move method uses GDK_WINDOW_TYPE_HINT_UTILITY/GDK_WINDOW_TYPE_HINT_TOOLTIP popup types only.
They're placed by relative coordinates so useRelativeCoordinates is always true.

Depends on D156226

Differential Revision: https://phabricator.services.mozilla.com/D156227
2022-09-02 09:49:22 +00:00
stransky 92c7dee304 Bug 1785185 [Wayland] Set popup type according to moving method r=emilio
See https://bugzilla.mozilla.org/show_bug.cgi?id=1785185#c8

Different popup moving methods needs different popup types:
  - gtk_window_move() needs GDK_WINDOW_TYPE_HINT_UTILITY popup type.
  - move-to-rect requires GDK_WINDOW_TYPE_HINT_POPUP_MENU popups type.
  - GDK_WINDOW_TYPE_HINT_TOOLTIP works with both methods.

Differential Revision: https://phabricator.services.mozilla.com/D156226
2022-09-02 09:49:22 +00:00
Nick Alexander e08bbee6eb Bug 1787956 - Add `nsIAlertNotification.launchURL`. r=smaug
`launchURL` captures the URL that triggered the alert, if it comes
from a DOM notification.  If Firefox is launched when not already
running to handle an alert, it will navigate to this URL.

This URL can be set, and chrome privileged alerts can use this to
launch Firefox to a specific URL when it is launched.  Toast
notifications popped by background tasks will use this to re-engage
Firefox users to a campaign-specific URL.

This functionality will be tested in the Windows-specific tests
accompanying Bug 1781929.

Differential Revision: https://phabricator.services.mozilla.com/D155907
2022-09-01 22:48:21 +00:00
Nick Alexander 174303a612 Bug 1787573 - Allow privileged Windows native notification actions to have `activationType="system"`. r=nrishel,smaug
This allows Windows native notification action buttons to access the
built-in "dismiss" and "snooze" support without requiring a Firefox
invocation.

Differential Revision: https://phabricator.services.mozilla.com/D155906
2022-09-01 22:48:21 +00:00
Karl Tomlinson 97c8b3adce Bug 1777902 Test that system font sizing is independent from ui.textScaleFactor r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D156034
2022-09-01 02:27:38 +00:00
Brad Werth 0ad858a8b7 Bug 1788105: Make video-dynamic-range: high match for macOS 10.15+. r=gfx-reviewers,jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D156000
2022-08-30 19:56:16 +00:00
Emilio Cobos Álvarez fb6380190c Bug 1786525 - Don't update untransformed anchor rect when moved by move-to-rect. r=stransky
Otherwise, it changes the move-to-rect inputs, which can change the
output as well, making us move the anchor all the way to the right.

You could, I guess, consider this a mutter bug of sorts, because it
feels weird that you pass it an anchor that has been a `move-to-rect`
output and you get another rect as an output.

But also, it's kinda silly that we're doing that to begin with, so avoid
it by telling the popup frame whether it's been positioned / moved by
move-to-rect (and keeping the anchor in that case).

The reason this works on my setup without "Large text" is just dumb luck
(the front-end computes a max-height for the panel that is small enough
to fit on the screen).

Differential Revision: https://phabricator.services.mozilla.com/D155406
2022-08-30 09:30:27 +00:00
Hiroyuki Ikezoe 65e6de2b59 Bug 1704978 - Prevent opening context menu in the case the user did right click in the overscroll gutter on Windows. r=botond,handyman
Differential Revision: https://phabricator.services.mozilla.com/D155039
2022-08-30 06:49:59 +00:00
Hiroyuki Ikezoe 1222790a59 Bug 1704978 - Remove a comment about NS_IF_RELEASE() use in nsWindow::DispatchMouseEvent. r=botond
The comment about NS_IF_RELEASE() is now useless since there's no
NS_IF_RELEASE() call.

Differential Revision: https://phabricator.services.mozilla.com/D155038
2022-08-30 06:49:58 +00:00
sotaro b59649bf10 Bug 1727215 - Check if CompositorThreadHolder is active r=gfx-reviewers,lsalzman
There were cases that the function was called when CompositorThreadHolder was not active

Differential Revision: https://phabricator.services.mozilla.com/D155929
2022-08-30 04:36:37 +00:00
Sandor Molnar 9d7f9853a2 Backed out changeset bb1d2a4a5570 (bug 1786525) for causing build bustages in xpfe/appshell/AppWindow.cpp CLOSED TREE 2022-08-30 01:26:00 +03:00
Emilio Cobos Álvarez 163b9c7bda Bug 1786588 - Don't unnecessarily MoveResize windows if they haven't moved or resize. r=stransky
I was looking into bug 1786525 and this caused some useless
notifications which we can avoid.

Differential Revision: https://phabricator.services.mozilla.com/D155407
2022-08-29 21:55:47 +00:00
Emilio Cobos Álvarez cf74fba975 Bug 1786525 - Don't update untransformed anchor rect when moved by move-to-rect. r=stransky
Otherwise, it changes the move-to-rect inputs, which can change the
output as well, making us move the anchor all the way to the right.

You could, I guess, consider this a mutter bug of sorts, because it
feels weird that you pass it an anchor that has been a `move-to-rect`
output and you get another rect as an output.

But also, it's kinda silly that we're doing that to begin with, so avoid
it by telling the popup frame whether it's been positioned / moved by
move-to-rect (and keeping the anchor in that case).

The reason this works on my setup without "Large text" is just dumb luck
(the front-end computes a max-height for the panel that is small enough
to fit on the screen).

Differential Revision: https://phabricator.services.mozilla.com/D155406
2022-08-29 21:47:34 +00:00
sotaro c0fbba3837 Bug 1787293 - Revert Bug 1780138 r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D155833
2022-08-29 13:54:48 +00:00
Nika Layzell fc835b08d2 Bug 1781129 - Part 3: Remove Shmem overload of GetSurfaceData, r=edgar
After the previous changes there was only one consumer left of the Shmem
version of GetSurfaceData, which could easily be changed to use BigBuffer,
removing the need for that overload.

After that consumer is removed, the interface was also simplified as the
generic logic in the implementation was no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D151854
2022-08-26 16:08:06 +00:00
Nika Layzell ff386ec755 Bug 1781129 - Part 2: Use BigBuffer for ShmemImage, r=edgar
The ShmemImage type was previously implemented using a Shmem, however due to
the usage patterns, `BigBuffer` is probably a better fit, and allows unifying
more code in nsContentUtils.

Differential Revision: https://phabricator.services.mozilla.com/D151853
2022-08-26 16:08:05 +00:00
Nika Layzell 91a521bf3a Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-26 16:08:05 +00:00
Cristian Tuns cabdc5ed0b Backed out 3 changesets (bug 1782295) for causing Assertion failures on nsDirectoryService.cpp CLOSED TREE
Backed out changeset b332385ffca4 (bug 1782295)
Backed out changeset 8c36812a12dc (bug 1782295)
Backed out changeset 8016b1f25509 (bug 1782295)
2022-08-26 11:50:40 -04:00
Ben Hearsum db7599985e Bug 1782295: Use Nimbus for Felt Privacy window separation r=dao
We'll be defaulting Felt Privacy features to enabled, and allowing them to be disabled by Nimbus (primarily for a holdback study).

Differential Revision: https://phabricator.services.mozilla.com/D153275
2022-08-26 14:50:13 +00:00
Mark Banner 3644b07dd2 Bug 1786197 - Turn on ESLint rule for prefer-boolean-length-check for a few test files. r=mossop
This also moves the layout disabling to the layout section - to be enabled later.

Differential Revision: https://phabricator.services.mozilla.com/D155177
2022-08-26 13:39:39 +00:00
Hiroyuki Ikezoe 4917d58c7b Bug 1786668 - Add a test case that MobileViewportManager is properly updated when browser window moves from a HiDPI monitor to normal one. r=tnikkel
Unfortunately this test doesn't run as expected on our CI since macs on our CI
are running normal DPI mode.

I tested this test works properly on my macbook, it fails without the fix in the
previous commit and it passes with the fix.

Differential Revision: https://phabricator.services.mozilla.com/D153688
2022-08-26 04:44:55 +00:00
Hiroyuki Ikezoe 0ca171b4b6 Bug 1786657 - Implement HeadlessWidget::SynthesizeNativeTouchpadPan. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D155437
2022-08-25 00:34:17 +00:00
Nicholas Rishel 37fd5be4b2 Bug 1787015 - Consolidate raw COM pointers into smart `ComPtr`. r=nalexander
Also moved from `typedef` to `using _ =` syntax to match new templated import of `ComPtr` in ToastNotificationHandler.h.

Depends on D155525

Differential Revision: https://phabricator.services.mozilla.com/D155526
2022-08-24 22:32:02 +00:00
Nicholas Rishel f965aff863 Bug 1787001 - Fix leaking COM object. r=nalexander
`ComPtr` constructor increments the refcount when initializing with a raw COM pointer.

Differential Revision: https://phabricator.services.mozilla.com/D155525
2022-08-24 22:32:02 +00:00
Sandor Molnar 23b2e332ed Backed out changeset b0af62dc599f (bug 1786657) for causing build bustage in widget/headless/HeadlessWidget.cpp CLOSED TREE 2022-08-25 00:46:51 +03:00
Hiroyuki Ikezoe 1185858506 Bug 1786657 - Implement HeadlessWidget::SynthesizeNativeTouchpadPan. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D155437
2022-08-24 21:09:10 +00:00
Csoregi Natalia f9b7f964c7 Backed out changeset 56c6e1791c69 (bug 1782295) for causing failures on browser_startup_mainthreadio.js. CLOSED TREE 2022-08-24 13:29:08 +03:00
Ben Hearsum f639b6db58 Bug 1782295: Use Nimbus for Felt Privacy window separation r=dao
We will be defaulting Felt Privacy features to enabled, and allowing them to be disabled by Nimbus (primarily for a holdback study).

Differential Revision: https://phabricator.services.mozilla.com/D153275
2022-08-23 15:30:42 +00:00
Edgar Chen cc7905e7ab Bug 1785913 - Update mIgnoreEmptyNotification in nsBaseClipboard; r=NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D148923
2022-08-23 11:05:45 +00:00
Botond Ballo 567be8f228 Bug 1784849 - Use defaulted copy constructor for MultiTouchInput. r=hiro
This ensures all fields are copied, including new ones that
may be added in the future.

Differential Revision: https://phabricator.services.mozilla.com/D155306
2022-08-23 02:30:45 +00:00
Marian-Vasile Laza 9274b092fe Backed out 4 changesets (bug 1781129) for causing mochitest failures on test_bug490879.html. CLOSED TREE
Backed out changeset 37da1d18cde9 (bug 1781129)
Backed out changeset 1ae213bfa43e (bug 1781129)
Backed out changeset dcebc98ea1f1 (bug 1781129)
Backed out changeset 0df2f2832755 (bug 1781129)
2022-08-22 23:07:56 +03:00
Ray Kraesig d37d1556d3 Bug 1786226 - Revert all patches for regressing bug 1776895 r=cmartin
This reverts the following commits:
- 21f1ada7ee6ad5839fc0d9bc98e1ff2d558ef6e7
- cde5393917c483a3516f4c883af02834ddbf11d8
- 3d2dc8de0e7147d0d991c16c29ad9a8678a25635
- 4b17fb88efc581522c0edf0740da4c54c539d39a
- 7b0893449764054af7795df66c0c2e83a370d620
- bcc0fa996f5fd7cc677ca2a5e97329dcd6b74a04
- 9547ab55535d9713c95bc3344d1cc1357520ba92

Differential Revision: https://phabricator.services.mozilla.com/D155237
2022-08-22 18:30:03 +00:00
Nika Layzell e1c2681a2f Bug 1781129 - Part 3: Remove Shmem overload of GetSurfaceData, r=edgar
After the previous changes there was only one consumer left of the Shmem
version of GetSurfaceData, which could easily be changed to use BigBuffer,
removing the need for that overload.

After that consumer is removed, the interface was also simplified as the
generic logic in the implementation was no longer necessary.

Differential Revision: https://phabricator.services.mozilla.com/D151854
2022-08-22 15:38:15 +00:00
Nika Layzell f8a40edbb1 Bug 1781129 - Part 2: Use BigBuffer for ShmemImage, r=edgar
The ShmemImage type was previously implemented using a Shmem, however due to
the usage patterns, `BigBuffer` is probably a better fit, and allows unifying
more code in nsContentUtils.

Differential Revision: https://phabricator.services.mozilla.com/D151853
2022-08-22 15:38:15 +00:00
Nika Layzell 6c8af6eff5 Bug 1781129 - Part 1: Use BigBuffer for IPCDataTransfer, r=edgar
The IPCDataTransfer type is used to transfer Clipboard/Drag & Drop payloads
over IPC to allow them to be written to or read from the relevant system
interfaces. Previously, the system which was used was somewhat complex, and
tried to use Shmem in some cases to store buffers out of line. Now that
BigBuffer is available, it can be simplified substantially.

In addition, this change removed the memory buffer overload of GetSurfaceData,
as the only consumer was using it to immediately send the payload over IPC as a
nsCString. It was changed to instead use `BigBuffer` as that is more efficient
in a large buffer situation, and reduces the number of required copies.

Differential Revision: https://phabricator.services.mozilla.com/D151852
2022-08-22 15:38:14 +00:00
Andrew Osmond c3bb735dc6 Bug 1785947 - Fix Linux 32-bit WPT backdrop filter tests. r=gfx-reviewers,jrmuizel
In CI, we fail the glxtest which disables all gfx features, including
the backdrop filter feature. We can just enable it on Linux. A follow up
series of patches will reform the blocklist to prevent these footguns in
the future in the next nightly cycle.

Differential Revision: https://phabricator.services.mozilla.com/D155041
2022-08-19 02:13:29 +00:00
Emilio Cobos Álvarez 1ee4fdcb2a Bug 1782595 - Distinguish between "preferred" and "used" color-scheme. r=tnikkel
The "preferred" one is the behavior we have for chrome docs, where we
fall back always to the document's preferred color-scheme rather than
falling back to light.

We'll use this in the next patch.

Differential Revision: https://phabricator.services.mozilla.com/D154923
2022-08-18 15:49:52 +00:00
Jamie Nicol a6a26075dc Bug 1784588 - Fix SplitDriverVersion when the string has less than 4 numbers. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D154897
2022-08-18 12:57:47 +00:00
Andrew Osmond 5a36e3dd85 Bug 1785366 - Blocklist backdrop filter on some Ivy/Sandybridge Intel Windows drivers. r=jrmuizel,emilio
Backdrop filter crashes newer Intel drivers on Windows. This patch adds
support to the blocklist infrastructure for backdrop filter, and hooks
this up with the CSS property table.

Differential Revision: https://phabricator.services.mozilla.com/D154950
2022-08-18 12:29:20 +00:00
Jamie Nicol 3b0edb46fc Bug 1783542 - Use widget size from ResumeAndResize rather than querying native window. r=gfx-reviewers,aosmond
On Android we have until now determined the compositor widget's size
by querying the values from the ANativeWindow. However, since bug
1780093 landed we can now switch between which Surface we are
rendering in to, and as a result we appear to be using the wrong size
some of the time.

This patch is a speculative attempt to fix this, by using the size
passed to ResumeAndResize() (which itself comes from the Surface's
surfaceChanged() callback) rather than querying the window.

Differential Revision: https://phabricator.services.mozilla.com/D154909
2022-08-18 12:16:46 +00:00
stransky fd3ef30a3c Bug 1784873 [Wayland] Remove outdated check for move-to-rect r=emilio
Remove outdated check for move-to-rect. It's redundant and it's implemented in more complex way by nsWindow::WaylandPopupCheckAndGetAnchor() now.

Differential Revision: https://phabricator.services.mozilla.com/D154882
2022-08-18 09:33:24 +00:00
stransky 3062502a96 Bug 1784873 [Wayland] Allow to use fast popup placement (without move-to-rect) for first popup only due to mutter bug r=emilio
Due to https://gitlab.gnome.org/GNOME/gtk/-/issues/5089 we can't use fast popup placement for nested popups.
Only first popup can be placed by gtk_window_move().

Differential Revision: https://phabricator.services.mozilla.com/D154881
2022-08-18 09:33:24 +00:00
stransky cedb3acccd Bug 1784873 [Wayland] Implement nsWindow::WaylandPopupIsFirst() helper to check popup state in popup hierarchy r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154880
2022-08-18 09:33:23 +00:00
stransky db0b337000 Bug 1784873 [Wayland] Don't hide & position popups which are on correct position r=emilio
Extra hide/show needed for gtk_window_move() produces extra flickering so avoid it if possible.

Differential Revision: https://phabricator.services.mozilla.com/D154879
2022-08-18 09:33:23 +00:00
Marian-Vasile Laza d774d6ecb3 Backed out changeset 49c7536f01db (bug 1785366) for causing xpcshell failures on test_css-properties-db.js. CLOSED TREE 2022-08-18 07:41:44 +03:00
Andrew Osmond 96648c7055 Bug 1785366 - Blocklist backdrop filter on some Ivy/Sandybridge Intel Windows drivers. r=jrmuizel,emilio
Backdrop filter crashes newer Intel drivers on Windows. This patch adds
support to the blocklist infrastructure for backdrop filter, and hooks
this up with the CSS property table.

Differential Revision: https://phabricator.services.mozilla.com/D154950
2022-08-18 03:21:27 +00:00
Botond Ballo 65a722e6e1 Bug 1746336 - Treat nsEventStatus_eIgnore as INPUT_RESULT_UNHANDLED consistently. r=hiro,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D152351
2022-08-18 02:07:14 +00:00
Ray Kraesig 7179a513ca Bug 1754803 - expand size-field to 16 digits if 8 won't suffice r=handyman
... while retaining the existing 8-wide padding for backward
compatibility with existing consumers.

Differential Revision: https://phabricator.services.mozilla.com/D154705
2022-08-17 22:46:57 +00:00
Emilio Cobos Álvarez 534f39ed75 Bug 1785310 - Remove mozilla/StaticPrefs_layout.h includes from other headers. r=dholbert
Adding layout prefs cause massive rebuilds because of this.

Differential Revision: https://phabricator.services.mozilla.com/D154928
2022-08-17 21:26:36 +00:00
Nick Alexander ba86996b7a Bug 1783051 - Turn default browser agent's `EventLog` into a Windows-only header utility. r=rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D153658
2022-08-17 20:01:58 +00:00
Ryan VanderMeulen b16f6be00a Bug 1776895 - Fix file-whitespace linter error. r=bustage on a CLOSED TREE 2022-08-17 15:08:03 -04:00
Ray Kraesig d1411e990f Bug 1776895 - [6/6] Add logging for fullscreen entry/exit r=cmartin
Add logging for fullscreen position-state saving and restoration.

Differential Revision: https://phabricator.services.mozilla.com/D153411
2022-08-17 18:51:32 +00:00
Ray Kraesig c4d109da63 Bug 1776895 - [5/6] Save and restore original relative position r=cmartin
When entering fullscreen and saving the original position of a window,
also save the original position of its screen.

When leaving fullscreen, keep the window on the same screen. Restore its
_screen-relative_ position, rather than its absolute position.

Differential Revision: https://phabricator.services.mozilla.com/D153410
2022-08-17 18:51:32 +00:00
Ray Kraesig 6700c85a61 Bug 1776895 - [4/6] adjust callsite of HideWindowChrome r=handyman
`HideWindowChrome(false)` may change the reported window size on Mac:
the OS menu bar appears at the top of the screen, and this will cause the
window to shrink if it was fullscreen.

This isn't a problem yet, since we don't check the window dimensions
when exiting fullscreen... but the following commit will do exactly
that. Delay calling `HideWindowChrome` until the last possible minute --
but make sure that it _does_ get called.

Since HideWindowChrome(true) does not presently change the window size
(see bug 498835), no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D154469
2022-08-17 18:51:31 +00:00
Ray Kraesig 3a0072feae Bug 1776895 - [3/6] Cleanup: specialize further to desktop pixels r=cmartin
Use desktop pixels everywhere:
 - Store the old window position as a `DesktopRect`.
 - Since `GetRectDisplayPix` is infallible, use the convenience getter
   that hands us a `DesktopIntRect`.
 - Add a helper function that wraps `Resize()` and takes any `Rect`
   which uses `DesktopPixel`s.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153409
2022-08-17 18:51:31 +00:00
Ray Kraesig de367482e0 Bug 1776895 - [2/6] Cleanup: remove BoundsUseDesktopPixels() condition r=cmartin
A window is fullscreenable iff it's a desktop window (that is, a
positional child of the desktop rather than of another window) -- and
desktop windows are the windows which use desktop-pixel units in
Resize().

Code coverage confirms that the branch when `BoundsUseDesktopPixels()`
returns `false` is never taken in tests.

Under the (hopefully justified) assumption that it's never taken at all,
no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153408
2022-08-17 18:51:31 +00:00
Ray Kraesig 4592637ee3 Bug 1776895 - [1/6] Cleanup: use UniquePtr rather than manual allocation r=cmartin
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153407
2022-08-17 18:51:30 +00:00
Greg Tatum 905a369a06 Bug 1782981 - Only show the macOS context menu if it is supported; r=nordzilla
This code path gets executed by existing tests, and I don't believe
there is a way to execute this behavior using our CI, since it's a macOS
version check.

Differential Revision: https://phabricator.services.mozilla.com/D154172
2022-08-17 15:41:12 +00:00
Razvan Cojocaru 88058d9bfe Bug 1781209 - Swipe navigation does not work when kinetic scroll is disabled. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D154239
2022-08-16 20:54:43 +00:00
stransky 8b6cd8361e Bug 1785072 [Wayland] Use relative position coordinates for GDK_WINDOW_TYPE_HINT_UTILITY/GDK_WINDOW_TYPE_HINT_TOOLTIP popups when moved by gtk_window_move() r=emilio
According to https://gitlab.gnome.org/GNOME/gtk/-/issues/4308 different popup types uses different coordinate systems so we need to cover that.
Use GTK_WINDOW_TYPE_HINT instead of internal Firefox popup type.

Differential Revision: https://phabricator.services.mozilla.com/D154796
2022-08-16 18:43:03 +00:00
stransky ed73cbe3bf Bug 1784336 [Linux] Don't resume compositor if mCompositorWidgetDelegate is missing r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154785
2022-08-16 11:30:13 +00:00
Emilio Cobos Álvarez a5c3cafe6f Bug 1784855 - Add basic support for drawing non-native appearance: menuitem items. r=stransky
This allows us to correctly draw items with mismatched color-scheme
on GTK.

This is a reasonably simple fix. A more elaborate fix could be not using
appearance to draw menuitems on Linux at all, just like we don't use it
to draw menupopups anymore. But in practice it's a bit harder because we
use it also to draw menubar items (which probably should be its own
appearance type instead). I can look into that, but this seems
reasonable for now.

Differential Revision: https://phabricator.services.mozilla.com/D154680
2022-08-16 09:48:07 +00:00
stransky 232c2c4865 Bug 1784067 [Linux] Fix build without Wayland r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154632
2022-08-16 09:27:42 +00:00
stransky b1c9edc1a9 Bug 1780389 [Wayland] Implement RAII class MozContainerSurfaceLock to get&lock wl_surface of moz_container r=rmader
With this patch moz_container_wayland_surface_lock() always locks MozContainer and needs to be paired with moz_container_wayland_surface_unlock() even if it fails and returns nullptr.
Split moz_container_wayland_add_initial_draw_callback() to two new functions:

- moz_container_wayland_add_initial_draw_callback_locked() is called on locked container and only adds draw callback. It asserts when MozContainer is already to draw as we don't expect it.

- moz_container_wayland_add_or_fire_initial_draw_callback() is called on unlocked container as it has it's own lock. It behaves as original moz_container_wayland_add_initial_draw_callback(), i.e. stores draw callback when MosContainer is not visible and fires draw callback when we're ready to draw.

- implement RAII class MozContainerSurfaceLock and use it to lock moz_contatier and get wl_surface of it.

Differential Revision: https://phabricator.services.mozilla.com/D152276
2022-08-16 08:46:33 +00:00
Andi-Bogdan Postelnicu eeac3728d2 Bug 1519636 - Reformat recent changes to the Google coding style. r=glandium
Updated with clang-format version 14.0.5 (taskcluster-DydCt-ryTuKvBYw1HQOugw)
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D154661
2022-08-16 07:08:27 +00:00
Edgar Chen 3e5030eb96 Bug 1755863 - Part 2: Add async API/IPC for getting matching data flavors from clipboard; r=nika,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D152516
2022-08-15 20:27:26 +00:00
Edgar Chen f6014ee7c6 Bug 1755863 - Part 1: Add async API for getting data on nsIClipboard; r=geckoview-reviewers,NeilDeakin,m_kato,nika
Differential Revision: https://phabricator.services.mozilla.com/D145378
2022-08-15 20:27:24 +00:00
David Shin 05f999536d Bug 1681183: Ignore unwriteable margins user specifies `Margins: None` for printing. r=dholbert,mstriemer
This lets users e.g. print-to-scale where it matters.
Custom margins are still clamped to unwriteable margins, even when all zeroes,
to avoid impacting user-specified & persisted margins.

Differential Revision: https://phabricator.services.mozilla.com/D152900
2022-08-15 19:55:08 +00:00
Norisz Fay 295485c15a Backed out changeset e4b5b93592b0 (bug 1780389) for causing build bustages on MozContainerWayland.h CLOSED TREE 2022-08-15 22:48:52 +03:00
stransky 616c7c35ee Bug 1780389 [Wayland] Implement RAII class MozContainerSurfaceLock to get&lock wl_surface of moz_container r=rmader
With this patch moz_container_wayland_surface_lock() always locks MozContainer and needs to be paired with moz_container_wayland_surface_unlock() even if it fails and returns nullptr.
Split moz_container_wayland_add_initial_draw_callback() to two new functions:

- moz_container_wayland_add_initial_draw_callback_locked() is called on locked container and only adds draw callback. It asserts when MozContainer is already to draw as we don't expect it.

- moz_container_wayland_add_or_fire_initial_draw_callback() is called on unlocked container as it has it's own lock. It behaves as original moz_container_wayland_add_initial_draw_callback(), i.e. stores draw callback when MosContainer is not visible and fires draw callback when we're ready to draw.

- implement RAII class MozContainerSurfaceLock and use it to lock moz_contatier and get wl_surface of it.

Differential Revision: https://phabricator.services.mozilla.com/D152276
2022-08-15 19:35:40 +00:00
stransky c83ad87f6f Bug 1767460 [Linux] Implement RAII class for nsDragService::mEventLoopDepth r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154584
2022-08-15 19:30:03 +00:00
Martin Stransky a4ab3bbff8 Bug 1767460 [Wayland] Set D&D move as default action on Wayland r=emilio
Due to different D&D handling on X11 and Wayland we should pass only GDK_ACTION_MOVE to gdk_drag_status().
Different D&D operation passed to gdk_drag_status() is returned back by gdk_drag_context_get_selected_action() so
gdk_drag_context_get_selected_action returns value set by gdk_drag_status() and not D&D modifiers set by CTRL/SHIFT

Also pass correct time to gdk_drag_status().

Depends on D154417

Differential Revision: https://phabricator.services.mozilla.com/D154418
2022-08-15 19:30:03 +00:00
Martin Stransky cbebd2904e Bug 1767460 [Wayland] Don't enable drop by default on Wayland - remove Wayland specific D&D workaround r=emilio
As we handle D&D in time now we can remove the D&D workaround.
It was used to enable D&D until D&D move handler sends reply to system but also enables D&D where should be disabled (like History menu).

Depends on D154416

Differential Revision: https://phabricator.services.mozilla.com/D154417
2022-08-15 19:30:02 +00:00
Martin Stransky 7179bc70ae Bug 1767460 [Wayland] Send D&D status back to compositor in D&D move handler r=emilio
This is an update to Bug 1730203. We need to answer to D&D inside of D&D move handler due to specific Gtk architecture.
In fix for Bug 1730203 we send the reply but we failed to update D&D status so the reply may be outdated.
In this patch we:

- Set correct D&D state and send reply to D&D motion event
- Move above code to nsDragService (nsDragService::Schedule()) so UpdateDragAction()/ReplyToDragMotion() can be private again.
- Update UpdateDragAction()/ReplyToDragMotion() to use correct GdkDragContext.
- At UpdateDragAction() call gdk_drag_context_get_selected_action() for valid GdkDragContext only.

Depends on D154415

Differential Revision: https://phabricator.services.mozilla.com/D154416
2022-08-15 19:29:58 +00:00
Martin Stransky 6b622391b0 Bug 1767460 [Linux] Log nested loop depth in D&D logs r=emilio
Depends on D154414

Differential Revision: https://phabricator.services.mozilla.com/D154415
2022-08-15 19:29:58 +00:00
Martin Stransky f5b8a06238 Bug 1767460 [Linux] D&D: Count deep of nested event loops r=emilio
D&D uses nested evenet loops to get data from system. Let's track how deep are they nested for diagnostic purpose.

Depends on D154413

Differential Revision: https://phabricator.services.mozilla.com/D154414
2022-08-15 19:29:57 +00:00
Martin Stransky df81ad2761 Bug 1767460 [Linux] Modify D&D action by gdk_drag_context_get_selected_action() on Wayland r=emilio
- When gdk_drag_context_get_selected_action() returns valid D&D operation, use it instead of default one.
- Add more D&D logging.
- It's slightly modified version of https://phabricator.services.mozilla.com/D150551 by jhorak@redhat.com

Differential Revision: https://phabricator.services.mozilla.com/D154413
2022-08-15 19:29:57 +00:00
stransky 811d4d915a Bug 1784255 [Wayland] Hide a popup when it's positioned by gtk_window_move() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154645
2022-08-15 19:14:29 +00:00
stransky aa30cf1780 Bug 1784688 [Wayland] Don't destroy invisible popups on temporary hide r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154644
2022-08-15 19:13:08 +00:00
Makoto Kato a2a31e8702 Bug 1783804 - Use std::move for InputData since copy constructor of InputData doesn't copy all member variable. r=geckoview-reviewers,calu
When turning on fission, OOP child frame doesn't receive touch events such as
`touchstart`.

When dispatching touch event from GeckoView side, some informations such as
`mLayersId` are missing since copy constructor of `MultiTouchInput` doesn't
copy all information.

Since the structure of Input data has a lot of members, we should use
`std::move` instead of copy constructor of `InputData`. It can avoid
unnecessary copy.

Differential Revision: https://phabricator.services.mozilla.com/D154242
2022-08-15 08:47:35 +00:00
Emilio Cobos Álvarez a7401488af Bug 1784265 - Drop support for flex attribute values other than 0 and 1. r=dholbert,mconley,preferences-reviewers
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.

Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).

In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.

Add a debug-only assertion to ensure we preserve behavior for now.

Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.

Differential Revision: https://phabricator.services.mozilla.com/D154394
2022-08-12 23:13:41 +00:00
Andrew McCreight ce22b38b5f Bug 1784397 - Remove Core:: Plug-ins from BUG_COMPONENT. r=handyman DONTBUILD
dom/ and dom/webidl/ : Default these files back to DOM: Core & HTML
PluginChild.jsm: Apparently this is only still used for GMP things.
browser/base/content/ : The remaining tests are mostly EME related, so I switched it over to that.
widget/tests/ : No plugin files remain, so I removed the rule.

Differential Revision: https://phabricator.services.mozilla.com/D154537
2022-08-12 22:39:41 +00:00
Marian-Vasile Laza 7f5e2711c6 Backed out 3 changesets (bug 1784265) for causing reftest failures on flex-emulation-1.xhtml. CLOSED TREE
Backed out changeset 415da4b53bdd (bug 1784265)
Backed out changeset e27b21c54b1f (bug 1784265)
Backed out changeset fcb1a053fbe2 (bug 1784265)
2022-08-13 01:14:13 +03:00
Mike Hommey 5825112e31 Bug 1784172 - Define GDK_TOUCHPAD_GESTURE_MASK as a gint. r=stransky
clang trunk doesn't like it being defined as a enum GdkEventMask,
because it doesn't fit in the value, but OTOH, it's only used in
kEvents, which is a gint.

Differential Revision: https://phabricator.services.mozilla.com/D154357
2022-08-12 20:13:34 +00:00
Emilio Cobos Álvarez a2ec6564f3 Bug 1784265 - Drop support for flex attribute values other than 0 and 1. r=dholbert,mconley,preferences-reviewers
This makes it easier to get parity between legacy and regular flex
without having to either have tons of arbitrary attribute selectors in
the xul sheet, nor adding attribute lookup hacks to the html flexbox
layout.

Also, reimplement the remaining supported flex attribute-values (0 and 1)
purely in terms of CSS rules in xul.css (regardless of whether
emulate-moz-box-with-flex is enabled).

In practice these are pretty uncommon and the style attribute does the
trick in every case I've tried.

Add a debug-only assertion to ensure we preserve behavior for now.

Add a new test with another behavior difference between flexbox
emulation and old xul layout because the old reftest now passes. Use
replaced elements, which in modern flex are treated differently.

Differential Revision: https://phabricator.services.mozilla.com/D154394
2022-08-12 19:34:34 +00:00
Timothy Nikkel 335ed01ea3 Bug 1784251. Allow widget/tests/browser/browser_test_swipe_gesture.js to test swipe to nav on linux. r=hiro
We implement SendNativeTouchpadPan/SynthesizeNativeTouchpadPan (like Windows does for this test).

I tried to use the existing functions SendNativeMouseScrollEvent/SynthesizeNativeMouseScrollEvent which are implemented on Linux and which are what we use for mac on this test, but it's already used for other stuff and it would be very clunky to overload it to make it work for this too.

I didn't see any way to "tag" the gdk events with more info, so making the observer notifier work was clunky. Similarly for getting the phase start/update/end work.

Differential Revision: https://phabricator.services.mozilla.com/D154386
2022-08-12 05:14:22 +00:00
Emilio Cobos Álvarez ff538cab0e Bug 1784349 - Don't use -moz-bool-pref for flexbox -moz-box emulation. r=dholbert,perftest-reviewers,sparky
Use a bool pref media query which allows dynamic changes to get
reflected instantly.

Differential Revision: https://phabricator.services.mozilla.com/D154449
2022-08-11 23:22:52 +00:00
Emilio Cobos Álvarez ef562aae0a Bug 774398 - Hack to make print and viewport media query listeners fire when printing. r=geckoview-reviewers,owlish,dholbert
This still doesn't fire on print settings changes, so it uses the
default page size. Which is probably better than nothing, but...

To make viewport-size media-query listeners work more generally for
printed documents, we would need to re-clone the top document
unconditionally for all print settings changes, which needs front-end
work at least, and is dubious if the page changes dynamically.

Differential Revision: https://phabricator.services.mozilla.com/D150499
2022-08-11 23:11:37 +00:00
Timothy Nikkel 63000b6623 Bug 1784183. Initialize nsWindow::mPanInProgress. r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D154331
2022-08-11 02:09:17 +00:00
Neil Deakin 8c6f5c9fee Bug 1777149, ensure the dropEffect is being set correctly when a drop ends in a different process, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D153979
2022-08-10 23:55:08 +00:00
Greg Tatum 3c686461e9 Bug 1782579 - Pass languages to the text recognition api; r=nordzilla,emilio
Differential Revision: https://phabricator.services.mozilla.com/D153668
2022-08-10 19:38:46 +00:00
Norisz Fay 8bc30afa79 Backed out 6 changesets (bug 1782578, bug 1782579) for causing mochitest failures on browser_parsable_css.js CLOSED TREE
Backed out changeset bdb42cfe6213 (bug 1782579)
Backed out changeset 5f17ee4cc4df (bug 1782578)
Backed out changeset 4f969d46dd37 (bug 1782578)
Backed out changeset b4c51d1ffa99 (bug 1782578)
Backed out changeset 98d0d6bcd37b (bug 1782578)
Backed out changeset 8332d678079e (bug 1782578)
2022-08-10 20:19:31 +03:00
Greg Tatum 980c8191a3 Bug 1782579 - Pass languages to the text recognition api; r=nordzilla,emilio
Differential Revision: https://phabricator.services.mozilla.com/D153668
2022-08-10 16:08:46 +00:00
Robert Mader 6bf01f2c2f Bug 1783924 - Enable HW-WR on all Mesa drivers in release, r=gfx-reviewers,aosmond
We have allowed it in nightly for quite a while now and of all drivers
capable of GL(ES) >= 3.0 all either have already their own rules, have
recently be tested (freedreno >= 22.2/panfrost) or are are still
experimental/niche.

So lets finally draw a line from where on rendering regressions will
be driver issues and not our business.

The choosen Mesa version is the upcoming one, containing some fixes
for freedreno. As many distros for ARM devices update their drivers
rather conservatively, the effect of this will only slowly take
effect and even in case of major issues on some drivers (maybe v3d?)
likely allow us to add block rules before hitting many users.

Differential Revision: https://phabricator.services.mozilla.com/D154134
2022-08-10 14:36:10 +00:00
Christian Holler 146a80ecff Bug 1783844 - Remove IPC::Principal type remains from codebase. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D154091
2022-08-10 13:39:11 +00:00
stransky 17afbeca30 Bug 1777269 [Wayland] Always use GDK_WINDOW_TYPE_HINT_POPUP_MENU for popups r=emilio
A workaround for Mutter/Gtk issue https://gitlab.gnome.org/GNOME/gtk/-/issues/5089

Differential Revision: https://phabricator.services.mozilla.com/D154066
2022-08-10 08:47:06 +00:00
stransky b625405b8a Bug 1709254 [Wayland] Close popups without visible parent to avoid application crash due to broken popup hierarchy r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154061
2022-08-10 08:40:04 +00:00
stransky 284f00e9d4 Bug 1783437 [Wayland] Make sure we don't use rectangle anchor with zero width/height r=emilio
Depends on D154012

Differential Revision: https://phabricator.services.mozilla.com/D154013
2022-08-10 08:35:46 +00:00
stransky c78eb7d6c6 Bug 1783437 [Wayland] Move move-to-rect config to nsWindow::WaylandPopupCheckAndGetAnchor() r=emilio
Move popup window move-to-rect config (anchor canculation, check if we need it and can use it) to a new method WaylandPopupCheckAndGetAnchor().

Depends on D153860

Differential Revision: https://phabricator.services.mozilla.com/D154012
2022-08-10 08:35:46 +00:00
stransky 8edcf038f0 Bug 1783437 [Wayland] Don't use move-to-rect when popup and its parent are not adjacent r=emilio
Move-to-rect fails to position and show a popup when the popup anchor is outside of its parent window area.
For instance we can't use a rectangle of 10x10 pixels located at -20, -20 as an anchor as it leads to invisible popup window.
But that scenario can happen so we need to use plain move in such case which works and places the popup to -20, -20 coordinates.

Differential Revision: https://phabricator.services.mozilla.com/D153860
2022-08-10 08:35:46 +00:00
stransky bf46895b5b Bug 1783437 [Wayland] Use GtkWindow to check and place tooltips r=emilio
- In order to get tooltip position we need to use gtk_window_get_position() as it cover case when GdkWindow is not placed yet.
- Use both gdk_window_move()/gdk_window_move() to reset widget position as a workaround for https://gitlab.gnome.org/GNOME/gtk/-/issues/4071.
- Apply the workaround to tooltips only as it affects only temporary windows.

Differential Revision: https://phabricator.services.mozilla.com/D153859
2022-08-10 08:35:45 +00:00
stransky 1480b61928 Bug 1782948 [Wayland] Assert if MozContainer::waiting_to_show is accessed from different threads r=emilio
Depends on D154006

Differential Revision: https://phabricator.services.mozilla.com/D154007
2022-08-10 08:25:57 +00:00
stransky d11b50aa5e Bug 1782948 [Wayland] When we fail to show wayland popup, purge webrender queue and destroy compositor of the popup to make sure we're not blocking rendering of other windows r=emilio
As popups and Firefox main window can share refresh drivers we need to remove blocked compositing requests of hidden windows to make sure
we're not blocking other windows.

Implement moz_container_wayland_clear_waiting_to_show_flag() to clear MozContainer::waiting_to_show flag.

Depends on D154005

Differential Revision: https://phabricator.services.mozilla.com/D154006
2022-08-10 08:25:57 +00:00
stransky 3b71545650 Bug 1782948 [Linux] Make RevokeTransactionIdAllocator() call part of nsBaseWidget::DestroyCompositor() r=emilio
Make RevokeTransactionIdAllocator() call part of nsBaseWidget::DestroyCompositor() so we don't need to do extra call.

Depends on D154004

Differential Revision: https://phabricator.services.mozilla.com/D154005
2022-08-10 08:25:56 +00:00
stransky 9617e399f2 Bug 1782948 [Wayland] Implement waiting_to_show flag at mozcontainer to indicate that mozcontainer is supposed to be visible but it isn't (yet) r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D154004
2022-08-10 08:25:56 +00:00
Sandor Molnar 11e0476cea Backed out 5 changesets (bug 1776895) for causing mochitest failures in widget/tests/test_bug522217.xhtml CLOSED TREE
Backed out changeset cda5c3ab282f (bug 1776895)
Backed out changeset 8a5b0ed7ccb6 (bug 1776895)
Backed out changeset 871f199ecca1 (bug 1776895)
Backed out changeset b0e8b9d7d2a4 (bug 1776895)
Backed out changeset 9a85cc74c6cc (bug 1776895)
2022-08-10 02:38:18 +03:00
Ray Kraesig a88e46a0d4 Bug 1776895 - [5/5] Add logging for fullscreen entry/exit r=cmartin
Add logging for fullscreen position-state saving and restoration.

Differential Revision: https://phabricator.services.mozilla.com/D153411
2022-08-09 20:18:40 +00:00
Ray Kraesig 6dd316e070 Bug 1776895 - [4/5] Save and restore original relative position r=cmartin
When entering fullscreen and saving the original position of a window,
also save the original position of its screen.

When leaving fullscreen, keep the window on the same screen. Restore its
_screen-relative_ position, rather than its absolute position.

Differential Revision: https://phabricator.services.mozilla.com/D153410
2022-08-09 20:18:40 +00:00
Ray Kraesig 8182e508f5 Bug 1776895 - [3/5] Cleanup: specialize further to desktop pixels r=cmartin
Use desktop pixels everywhere:
 - Store the old window position as a `DesktopRect`.
 - Since `GetRectDisplayPix` is infallible, use the convenience getter
   that hands us a `DesktopIntRect`.
 - Add a helper function that wraps `Resize()` and takes any `Rect`
   which uses `DesktopPixel`s.

No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153409
2022-08-09 20:18:40 +00:00
Ray Kraesig b100d33828 Bug 1776895 - [2/5] Cleanup: remove BoundsUseDesktopPixels() condition r=cmartin
A window is fullscreenable iff it's a desktop window (that is, a
positional child of the desktop rather than of another window) -- and
desktop windows are the windows which use desktop-pixel units in
Resize().

Code coverage confirms that the branch when `BoundsUseDesktopPixels()`
returns `false` is never taken in tests.

Under the (hopefully justified) assumption that it's never taken at all,
no functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153408
2022-08-09 20:18:39 +00:00
Ray Kraesig 7bb3ab29c0 Bug 1776895 - [1/5] Cleanup: use UniquePtr rather than manual allocation r=cmartin
No functional changes.

Differential Revision: https://phabricator.services.mozilla.com/D153407
2022-08-09 20:18:39 +00:00
Kagami Sascha Rosylight 16ea24f6cc Bug 1769290 - Part 26: Emit errors from JSHandleRootedTypedefChecker r=andi,geckoview-reviewers,owlish
Differential Revision: https://phabricator.services.mozilla.com/D151842
2022-08-09 14:13:30 +00:00
Hiroyuki Ikezoe 6fb7d475d0 Bug 1781962 - A simple test case for swipe-to-navigation on RTL. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D153902
2022-08-09 02:01:37 +00:00
Emilio Cobos Álvarez b9dd468a31 Bug 1783566 - Restore dark highlight/selecteditem color behavior after bug 1782858. r=mstange
I accidentally changed it for the highlight / highlighttext colors.

Differential Revision: https://phabricator.services.mozilla.com/D153923
2022-08-08 19:58:15 +00:00
stransky 68712cf951 Bug 1783195 [Linux] Implement MozClearHandleID to clean glib handle r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D153753
2022-08-08 17:52:20 +00:00