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

33168 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano b00bd62d5f Bug 1910287 - Make `NativeKey::GetFollowingCharMessage()` return `true` even if `wParam` of `WM_DEADCHAR` is `0` r=m_kato
Although I don't know why Ergo-L keyboard layout behave differently on my
environment and the reporter's environment.  In the reporter's environment,
second dead key press causes `WM_DEADCHAR` with `0` `wParam`. Then,
`GetFollowingCharMessage()` returns `false` so that it's not stored into
`mFollowingCharMsgs`.  Then, `NativeKey::IsFollowedByDeadCharMessage()` returns
`false` and `NativeKey::mIsDeadKey` is set to `false`.  Therefore, `NativeKey`
dispatches only `eKeyDown` event but whose `.key` is `"g"` rather than
`DeadKey` and finally, fails to call `KeyboardLayout::ActivateDeadKeyState()`.
Therefore the following dead key sequence is not treated as so.

This patch makes it return `true` for such `WM_DEADCHAR` message so that the
`WM_KEYDOWN` message will be treated as a dead key sequence.

Differential Revision: https://phabricator.services.mozilla.com/D219317
2024-08-20 05:30:43 +00:00
Masayuki Nakano 151b00226e Bug 1793267 - Make `PostEventHandler::CheckPointerCaptureState` synthesize `ePointerMove` and `eMouseMove` if nobody captures the pointer anymore r=smaug
When an element starts capturing a pointer, pointer/mouse boundary events are
dispatched by `EventStateManager::PreHandleEvent` [1].  However, when the
capturing element loses the capture, they are not dispatched.

When the pointer capture is implicitly released, the pointer may be over another
document.  Therefore, this patch synthesizes an internal `ePointerMove` and
`eMouseMove` on the widget to make `PresShell::HandleEvent` redirects the event
to proper document under the pointer.

Unfortunately, I add 2 manual tests into WPT.  The reason is, a drag operation
across document boundary with test driver does not work even if I specify the
pointer position within the parent document coordinates.  This is same both on
Firefox and Chrome.  Additionally, writing the new tests as a mochitest won't
work too.  If I use synthesized mouse events, I see similar failure.
Additionally, when I use native events, it works, but unstable to run on CI.

1. https://searchfox.org/mozilla-central/rev/669fac9888b173c02baa4c036e980c0c204dfe02/dom/events/EventStateManager.cpp#1139-1140

Differential Revision: https://phabricator.services.mozilla.com/D218896
2024-08-20 03:42:26 +00:00
Masayuki Nakano 0cdfefa076 Bug 1656377 - Implement `PointerEvent.azimuthAngle` and `PointerEvent.altitudeAngle` r=smaug
Currently, we set `tiltX` and `tiltY` on Windows, macOS and Linux.  However,
they don't let us know the new values directly.  Therefore, they are required
only for the DOM `PointerEvent`.

Differential Revision: https://phabricator.services.mozilla.com/D219128
2024-08-17 07:43:46 +00:00
Emilio Cobos Álvarez 4e8cf2fc99 Bug 1913104 - Remove X11 mask code. r=stransky,desktop-theme-reviewers,dao
It's only used in non-compositing WMs, to implement popup transparency,
and it's completely untested.

Instead, do not draw shadows and rounded corners on those WMs.

Differential Revision: https://phabricator.services.mozilla.com/D219141
2024-08-16 12:48:28 +00:00
Sandor Molnar 1910ca7633 Backed out changeset 2822f96450d4 (bug 1913104) for causing dt failures @ browser_rules_container-queries.js CLOSED TREE 2024-08-16 13:08:16 +03:00
Emilio Cobos Álvarez 6073058701 Bug 1913104 - Remove X11 mask code. r=stransky,desktop-theme-reviewers,dao
It's only used in non-compositing WMs, to implement popup transparency,
and it's completely untested.

Instead, do not draw shadows and rounded corners on those WMs.

Differential Revision: https://phabricator.services.mozilla.com/D219141
2024-08-16 08:11:18 +00:00
stransky d51fabd3e8 Bug 1899299 [Linux] Remove GetFirstNSWindowForGDKWindow() as we don't use widget plugins r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216912
2024-08-16 06:54:58 +00:00
stransky 9a2adb38a8 Bug 1899299 [Linux] Remove mRetryPointerGrab as it's unused r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216911
2024-08-16 06:54:57 +00:00
David Parks 5899e85856 Bug 1911486: Leave DragSession connected to BrowserChild while sending dragend r=win-reviewers,gstoll
During EndDragSession and the dispatch of the dragend event in a content process
(e.g. in an extension), accessing the event's dataTransfer didn't work because
the session was already disconnected from the BrowserChild.  This broke things
like tab dragging from web-extension-based tabbars.  This leaves the drag
session in place until after EndDragSession is done.  It also makes the
reciprocal change to InvokeDragSession.

Differential Revision: https://phabricator.services.mozilla.com/D218667
2024-08-13 22:30:25 +00:00
Iulian Moraru 6f079c6bc4 Backed out 5 changesets (bug 1899299) for causing multiple functional regressions on Linux. CLOSED TREE
Backed out changeset 25389422d457 (bug 1899299)
Backed out changeset e0e1f122e646 (bug 1899299)
Backed out changeset d300cc8b778e (bug 1899299)
Backed out changeset d6e1dbfd1002 (bug 1899299)
Backed out changeset a0c9c1dcb19c (bug 1899299)
2024-08-13 16:27:08 +03:00
Emilio Cobos Álvarez ec0b5e5239 Bug 1911768 - Add WinUtils::RegionToHRGN and WinUtils::ToWinRect. r=win-reviewers,rkraesig
Much like HRGNToRegion. This will be used to address some of the
comments on the patches for bug 1911763.

Differential Revision: https://phabricator.services.mozilla.com/D218629
2024-08-12 21:03:06 +00:00
Nipun Shukla 984598d14d Bug 1794159 - Part 2: Add LAF unlocking and check for pinning status using new APIs r=nalexander,nrishel
Differential Revision: https://phabricator.services.mozilla.com/D213331
2024-08-12 17:05:47 +00:00
stransky 0a31247811 Bug 1899299 [Linux] Keep propagating relocated mShell events to child widgets r=emilio
Depends on D216914

Differential Revision: https://phabricator.services.mozilla.com/D216946
2024-08-12 06:35:00 +00:00
stransky 9ee6cbe65e Bug 1899299 [Linux] Reformat widget event code r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216914
2024-08-12 06:35:00 +00:00
stransky 492e3608ef Bug 1899299 [Linux] Move some widget events from mContainer to mShell r=emilio
- Move more widget events from mContainer to mShell. We generally want to listen on mShell and use mContainer
  for GtkContainer related events only.
- Set correct event masks for mShell/mContainer

Differential Revision: https://phabricator.services.mozilla.com/D216913
2024-08-12 06:34:59 +00:00
stransky 322eda6772 Bug 1899299 [Linux] Remove GetFirstNSWindowForGDKWindow() as we don't use widget plugins r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216912
2024-08-12 06:34:59 +00:00
stransky 3e8af7ed5a Bug 1899299 [Linux] Remove mRetryPointerGrab as it's unused r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D216911
2024-08-12 06:34:58 +00:00
Emilio Cobos Álvarez 9b4c15c8b4 Bug 1901769 - Make nsMenuPopupFrame offset handling simpler. r=edgar,NeilDeakin,TYLin
* Make mXPos/mYPos work in terms of margin (mExtraMargin).
 * When we have no anchor, explicitly upgrade them to anchored-to-point.

Differential Revision: https://phabricator.services.mozilla.com/D215444
2024-08-11 16:41:46 +00:00
Alex T f4fd19f638 Bug 1896774 - Expose length in MPRIS metadata r=media-playback-reviewers,alwu,frontend-codestyle-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D212940
2024-08-09 16:39:25 +00:00
Alex T 698806aee4 Bug 1634192 - Implement Seek and SetPosition for MPRIS r=media-playback-reviewers,stransky,alwu,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D212939
2024-08-09 16:39:25 +00:00
Eitan Isaacson 03a9fd6883 Bug 1900668 - Use GDBusProxy for platform a11y enabled check. r=Jamie
Also, listen for changes in IsEnabled property.

Differential Revision: https://phabricator.services.mozilla.com/D212593
2024-08-09 16:17:17 +00:00
stransky d35449d57e Bug 1912160 [Linux] Don't do drag drop after D&D operation end r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D218850
2024-08-09 11:48:28 +00:00
pstanciu c1412adc7a Backed out 3 changesets (bug 1794159) for causing bc failures on browser_browserGlue_telemetry.js CLOSED TREE
Backed out changeset 764e14e5df4a (bug 1794159)
Backed out changeset 76b8d6cebe8b (bug 1794159)
Backed out changeset f28a29199ba8 (bug 1794159)
2024-08-08 11:16:27 +03:00
Noemi Erli 8b5f3c41e5 Backed out changeset c4dd6ccf94ac (bug 1901769) for causing failures in browser_navigator_clipboard_contextmenu_suppression.js CLOSED TREE 2024-08-08 06:21:19 +03:00
Nipun Shukla d6e05077e9 Bug 1794159 - Part 2: Add LAF unlocking and check for pinning status using new APIs r=nalexander,nrishel
Differential Revision: https://phabricator.services.mozilla.com/D213331
2024-08-08 02:48:50 +00:00
Nika Layzell bdb401316d Bug 1908725 - Part 2: Make the ChildID available in the same places as OtherPid, r=ipc-reviewers,media-playback-reviewers,win-reviewers,alwu,rkraesig,gfx-reviewers,mccr8,nical
This requires quite a bit of piping to get the ChildID passed everywhere where
we currently pass the pid in IPC. This is done by adding a new struct type
(EndpointProcInfo), which is passed around instead of OtherPid in these places,
and contains the full pid.

In most cases, it was a fairly painless change to move over, however in some
cases, more complex changes were required, as the pid was being stored
previously in something like an Atomic<...>, and needed to be switched to using
a mutex-protected value.

In the future, it may be possible to remove OtherPid from IPDL actors once
everything is migrated to ChildID, but we're still a long way off from that, so
for now we unfortunately need to pass both around.

Differential Revision: https://phabricator.services.mozilla.com/D217118
2024-08-07 20:39:39 +00:00
Nipun Shukla 317ff1aa10 Bug 1904436 - Implement private browser pinning using new Windows taskbar APIs r=nrishel,win-reviewers,rkraesig
Differential Revision: https://phabricator.services.mozilla.com/D214757
2024-08-07 13:12:20 +00:00
Emilio Cobos Álvarez 144adbef9c Bug 1901769 - Make nsMenuPopupFrame offset handling simpler. r=edgar,NeilDeakin,TYLin
* Make mXPos/mYPos work in terms of margin (mExtraMargin).
 * When we have no anchor, explicitly upgrade them to anchored-to-point.

Differential Revision: https://phabricator.services.mozilla.com/D215444
2024-08-07 12:54:01 +00:00
Emilio Cobos Álvarez adad1a02a6 Bug 1911773 - Simplify nsWindow::SetWindowTranslucencyInner. r=rkraesig,win-reviewers
We no longer have the parent/child window set-up for popups, so we can
just use mWnd.

Remove the HideWindowChrome() stuff. That landed once already in [1],
but was backed out along with other stuff, due to it causing buttons to
show up on non-native notifications (which is the only top level that
hits this code-path).

Eventually, I want to handle this more like other platforms (via D209502
and D207303) but until those land, just explicitly set hidechrome="true"
on that window in order to be able to land this simplification
separately.

Bug 1454589 doesn't happen with this change, and there's no reason to
apply size mode in SetWindowTranslucencyInner, so remove that chunk of
code too.

[1]: https://hg.mozilla.org/mozilla-central/rev/24dc60b32e21

Differential Revision: https://phabricator.services.mozilla.com/D218635
2024-08-07 11:02:21 +00:00
Norisz Fay e0d9d31d41 Backed out changeset 0d53cc2130df (bug 1901769) for causing bc failure on browser_navigator_clipboard_clickjacking.js CLOSED TREE 2024-08-07 09:17:31 +03:00
Narcis Beleuzu 0fb8ac8e50 Backed out changeset de9fbd4835b7 (bug 1900668) for mochitest leakchecks. CLOSED TREE 2024-08-06 23:53:19 +03:00
Eitan Isaacson 17d06ccb0d Bug 1900668 - Use GDBusProxy for platform a11y enabled check. r=Jamie
Also, listen for changes in IsEnabled property.

Differential Revision: https://phabricator.services.mozilla.com/D212593
2024-08-06 18:36:11 +00:00
Emilio Cobos Álvarez b14382b87b Bug 1901769 - Make nsMenuPopupFrame offset handling simpler. r=edgar,NeilDeakin,TYLin
* Make mXPos/mYPos work in terms of margin (mExtraMargin).
 * When we have no anchor, explicitly upgrade them to anchored-to-point.

Differential Revision: https://phabricator.services.mozilla.com/D215444
2024-08-06 12:58:07 +00:00
Hiroyuki Ikezoe b94489a2ea Bug 1831649 - Propagate the software keyboard height change into nsPresContext. r=botond,geckoview-reviewers,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D204166
2024-08-06 07:46:21 +00:00
Brad Werth 0ac2dc146e Bug 1906527 Part 1: Rename SurfaceFormat::YUV422 to YUY2, and rename YUV to YUV420. r=jgilbert
This is just a renaming patch, motivated by a need for clarity before
addding more YUV formats. Comments and log messages are updated as well,
and one function in MacIOSurface is renamed.

There is one small change in TextureHost.cpp  to satisfy clang-tidy.

Differential Revision: https://phabricator.services.mozilla.com/D217883
2024-08-05 17:59:15 +00:00
Noemi Erli 39b81764ff Backed out 3 changesets (bug 1901769) for causing mochitest failures CLOSED TREE
Backed out changeset bf75c1b988a0 (bug 1901769)
Backed out changeset 2eeba3d06bf9 (bug 1901769)
Backed out changeset d5c4e504dfd6 (bug 1901769)
2024-08-05 18:41:58 +03:00
Emilio Cobos Álvarez d38b2da8c8 Bug 1901769 - Make browser_test_clipboard_contextmenu.js work with native macOS context menus. r=fix 2024-08-05 17:24:48 +03:00
stransky fff57a2dbc Bug 1904424 [Linux/X11] Don't steal focus on X11 r=emilio
The patch comes from https://gitlab.com/redhat/centos-stream/rpms/firefox/-/merge_requests/94

Firefox isn't currently handling window focusing right on X11... There's a few problems:

If no startup id is provided, it tries to get user time from g_get_monotonic_time when there's no guarantee that timestamp is synchronized or even in a compatible unit. This merge request addressed that by dropping the code that uses g_get_monotonic_time entirely, and instead adding a heuristic to synthesize a startup id based on the time of the last user interaction on the display. This makes an assumption that firefox was started as a result of user interaction, which might not always hold true, but it's more likely than not, and is basically the same assumption firefox is already making by trying to use a timestamp of "now" (g_get_monotonic_time) when focusing the window.

If a startup id is provided, it fails to tell gtk to use it when focusing the window because it calls gtk_window_present_with_time with some other random timestamp instead of passing GDK_CURRENT_TIME (which is the magic value that means "use startup id for timestamp"). This commit tries to detect when a startup id is available, and the display is X11, and if so use a timestamp of GDK_CURRENT_TIME.

Differential Revision: https://phabricator.services.mozilla.com/D217174
2024-08-01 13:24:14 +00:00
stransky b92720f261 Bug 1910468 [Wayland] Add more wl_surface_commit() related logs r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D218180
2024-08-01 07:19:58 +00:00
Makoto Kato d31b62f1e5 Bug 1910824 - Show text substitution panel correctly. r=masayuki
This is a typo by bug 1149826.

Differential Revision: https://phabricator.services.mozilla.com/D218175
2024-08-01 00:55:00 +00:00
Stanca Serban 2bd144af0e Backed out changeset 7ffa1c954c6b (bug 1904424) for causing linux build bustages in nsWindow.cpp. CLOSED TREE 2024-07-30 17:00:53 +03:00
stransky 64294a9d9f Bug 1904424 [Linux/X11] Don't steal focus on X11 r=emilio
The patch comes from https://gitlab.com/redhat/centos-stream/rpms/firefox/-/merge_requests/94

Firefox isn't currently handling window focusing right on X11... There's a few problems:

If no startup id is provided, it tries to get user time from g_get_monotonic_time when there's no guarantee that timestamp is synchronized or even in a compatible unit. This merge request addressed that by dropping the code that uses g_get_monotonic_time entirely, and instead adding a heuristic to synthesize a startup id based on the time of the last user interaction on the display. This makes an assumption that firefox was started as a result of user interaction, which might not always hold true, but it's more likely than not, and is basically the same assumption firefox is already making by trying to use a timestamp of "now" (g_get_monotonic_time) when focusing the window.

If a startup id is provided, it fails to tell gtk to use it when focusing the window because it calls gtk_window_present_with_time with some other random timestamp instead of passing GDK_CURRENT_TIME (which is the magic value that means "use startup id for timestamp"). This commit tries to detect when a startup id is available, and the display is X11, and if so use a timestamp of GDK_CURRENT_TIME.

Differential Revision: https://phabricator.services.mozilla.com/D217174
2024-07-30 12:18:55 +00:00
Masayuki Nakano 0ddf10ff5e Bug 1904279 - Get rid of `dom.w3c_pointer_events.dispatch_click_as_pointer_event` pref r=smaug,pip-reviewers,search-reviewers,devtools-reviewers,urlbar-reviewers,nchevobbe,dao,jteow,mconley
Keep supporting the pref makes a lot of `click`, `auxclick` and `contextmenu`
event creators complicated (and look messy).  So, let's delete it as soon as
possible.

Differential Revision: https://phabricator.services.mozilla.com/D217225
2024-07-30 06:49:42 +00:00
Masayuki Nakano 4f410b0098 Bug 1905267 - part 2: Make `PresShell` not use non-element event target when target frame is destroyed and the event wants `Element` target r=smaug
When event target frame is destroyed, `PresShell::NotifyDestroyingFrame` updates
current event target content to the frame content.  However, event target of
some DOM events need to be `Element`.  Therefore,
`PresShell::mCurrentEventTarget` needs to store at least the handling
`EventMessage` to consider whether the event target can be non-element content
node or only element node.  So, we need to make `PresShell::EventTargetInfo`
store `EventMessage`.  Then, we can make `PresShell::NotifyDestroyingFrame`
prefer inclusive ancestor element as new event target from the `EventMessage`.

Although I don't understand what's going on the reported case, but I found the
simple case when event target is changed to a `Text` with the assertion in
`PresShell::DispatchEventToDOM`.  Therefore, this patch has a new test.

Note that if target frame is a frame for element, e.g., when event target is
a focused element, `IsForbiddenDispatchingToNonElementContent` result won't
change the behavior.  Therefore, its implementation is not optimized for
non-user input events.

Differential Revision: https://phabricator.services.mozilla.com/D217205
2024-07-30 00:06:10 +00:00
Tom Schuster dbabfc004e Bug 1809713 - Change nsIClipboard to use the ClipboardType enum. r=nika,geckoview-reviewers,win-reviewers,gstoll,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D217807
2024-07-29 11:52:34 +00:00
Ray Kraesig 9d2ecc1a48 Bug 1883943 - Let the out-of-process file-picker ride the trains r=win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D217849
2024-07-26 17:45:30 +00:00
Makoto Kato ba148ef600 Bug 1149826 - Part 2. Support text substitution. r=masayuki
macOs has the feature for auto-correction.

Other browsers already has this feature, and can control this by
`autocorrect` attribute [*1] that is still non-standard.

Since content script can modify source text for autocorrect by
any event handers, autocorrect is run when source text isn't
changed only.

The event order for this implementation is the following.

1. `keydown` event by space
2. `keypress` event by space
3. `beforeinput` event (`insertText`) by space
4. `input` event (`insertText`) by space
5. `beforeinput` event (`insertReplacementText`) by autocorrect
6. `input` event (`insertReplacementText`) by autocorrect
7. `keyup` event by space

Also, Safari's order is that input event for space is fired after
`insertReplacementText`. And, Chrome's is broken. When typing
`"omw"`, "w"'s keyup is fired after dismissing a picker. And they
don't use `insertReplacementText`.

And, Saferi can prevent this when calling `event.preventDefault()`
on `keypress` event handler for space/enter key. But I guess that
there is no way to get event handler calls `preventDefault()` from
widget side on Chrome process.

*1 https://github.com/whatwg/html/pull/5841

Differential Revision: https://phabricator.services.mozilla.com/D213512
2024-07-26 06:38:52 +00:00
Makoto Kato 6b14dceb59 Bug 1149826 - Part 1. Add eContentCommandReplaceText. r=masayuki
When using autocorrect, we should use `insertReplacementText` according
to https://github.com/w3c/input-events/issues/152. So I would like to
add eContentCommandReplaceText command for this.

Also, this command has an option that is source string text. When
processing text subsitution, parent process doesn't know whether
target replaced text is modified. So I add this option for check.

Differential Revision: https://phabricator.services.mozilla.com/D213511
2024-07-26 06:38:52 +00:00
Ryan VanderMeulen 5f14dd1f7c Backed out changeset 60b8f96f35ec (bug 1645571) for causing bug 1907766. 2024-07-25 11:25:41 -04:00
Stanca Serban e863c64d52 Backed out changeset 0218b28ab8ed (bug 1904436) for crashes related to taskbar pinning. a=backout 2024-07-25 17:28:14 +03:00