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

33232 Коммитов

Автор SHA1 Сообщение Дата
Ray Kraesig ba81de266a Bug 1915665 - [2/2] Simplify the Chromium-inherited API r=win-reviewers,handyman
The original Chromium listener code has a few infelicities in its API.

* The current session ID is always available, so the `Nothing()` branch
  is impossible. Remove the `Maybe` from the interface.

* If session-change messages for other sessions are received, discard
  them early rather than propagating them.

* Use the whole DWORD value supplied by `GUID_SESSION_DISPLAY_STATUS`,
  rather than just the first byte. (This has no effect here, since
  `MONITOR_DISPLAY_STATE` is an enum with very few values, but might if
  someone blindly copies this code with minimal adjustments to be used
  with another `PBT_POWERSETTINGCHANGE` value.)

Differential Revision: https://phabricator.services.mozilla.com/D220749
2024-09-17 19:16:46 +00:00
Ray Kraesig b81abb2971 Bug 1915665 - [1/2] Streamline WinEventHub r=win-reviewers,gfx-reviewers,handyman,bradwerth
`WinEventHub` was largely taken from Chromium, where its dynamic
connection/disconnection features are presumably more used. We don't
have any need for that, and anyway if we ever do it'll be easy to add
it alongside the static functionality or even migrate the latter over.

Hardwire the relevant message-processing and invocation directly into
the hidden window's WNDPROC, rather than providing a registration
system. Following the discoveries made in bug 1571516, also remove the
additional failure-mode checks added in bug 1852801, reverting to a
crash (which can be unified with 1571516 when it shows up).

This has, as fallout, a minor functional change to the occlusion
tracker: the subfeature prefs mentioned above are now checked at
message-receipt time, rather than at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D220639
2024-09-17 19:16:46 +00:00
Ray Kraesig 00dd01290c Bug 1915665 - [0/2] Clear out NativeEventLogger's static data on shutdown r=win-reviewers,gstoll
If a HWND whose messages are logged is not destroyed before application
shutdown, any static data in NativeEventLogger's persistent store will
not be cleared out. This can show up as a memory leak during testing.

Set up a RunOnShutdown hook to ensure that everything is actually
destroyed during shutdown, even if some other module is ill-behaved.

Differential Revision: https://phabricator.services.mozilla.com/D222382
2024-09-17 19:16:45 +00:00
Emilio Cobos Álvarez bb17d77850 Bug 1918802 - Simplify scrollbar track drawing. r=mstange,mac-reviewers
This was caught by Markus. When you hover over an overlay scrollbar on
macOS, you'd hit this the PaintScrollbar() code-path (or rather, you
won't bail out from the if (overlay && !hovered)), but macOS draws the
track in PaintScrollbarTrack().

Android doesn't hit this because android scrollbars can't ever be
hovered (they have pointer-events: none). This is a better fix than
D222172, which didn't paint the background for the non-overlay
scrollbars...

This doesn't change behavior since scrollbar and the track have the same
size (as cocoa scrollbars can never have buttons). Removing
nsSliderFrame is a refactor for another day if ever.

Differential Revision: https://phabricator.services.mozilla.com/D222194
2024-09-17 15:59:43 +00:00
Emilio Cobos Álvarez 9067a5448d Bug 1918762 - Use ElementState rather than the hover attribute to determine scrollbar hover state. r=mac-reviewers,mstange
That's what we use for painting in all platforms except macOS with
overlay scrollbars, where we make it sticky. Make the stickiness more
explicit (this also fixes the sticky state getting cleaned up too
early).

Differential Revision: https://phabricator.services.mozilla.com/D222161
2024-09-17 08:08:20 +00:00
stransky 14380dd246 Bug 1919130 [Wayland] Bind only supported wayland interface versions r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D222363
2024-09-17 05:46:28 +00:00
David Parks a2bf4beb05 Bug 1916804: Make content analysis DND use getURIForDropEvent r=dlp-reviewers,reusable-components-reviewers,gstoll,mstriemer
getURIForDropEvent delegates to getURIForBrowsingContext -- the ground truth for
CA URIs.

This also adds a check that getURIForDropEvent is correctly called in CA tests.
We do not yet test that it returns the right value -- that is future work.

Differential Revision: https://phabricator.services.mozilla.com/D222192
2024-09-17 03:48:06 +00:00
Emilio Cobos Álvarez c306597bca Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 22:02:05 +00:00
stransky 22e4949aa9 Bug 1917794 [Wayland] Store gesture nsWindow instead of wl_surface r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D222280
2024-09-16 19:25:27 +00:00
Iulian Moraru 3a3760533b Backed out changeset 62cb18f600a3 (bug 1918762) for causing build bustages related to nsITheme. CLOSED TREE 2024-09-16 22:10:00 +03:00
Emilio Cobos Álvarez 30b9476061 Bug 1918762 - Simplify theme attribute/state change invalidation. r=jwatt
We had the same list of attributes in multiple places, put it in
Theme.cpp.

Only a few states can change widget state. Just hardcode them in
RestyleManager.cpp (where there was already some of it) instead of
reusing a weird API.

Shouldn't have any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D222160
2024-09-16 17:38:52 +00:00
Noemi Erli 21c041eb39 Backed out changeset 995de6ec02fc (bug 1918762) as requested by emilio CLOSED TREE 2024-09-14 03:48:18 +03:00
Emilio Cobos Álvarez db53123e05 Bug 1918762 - Don't paint the scrollbar track twice on macOS. r=mac-reviewers,bradwerth
This was caught by Markus. When you hover over an overlay scrollbar,
you'd hit this the PaintScrollbar() code-path (or rather, you won't bail
out from the if (overlay && !hovered)), but macOS draws the track in
PaintScrollbarTrack().

Android doesn't hit this because android scrollbars can't ever be
hovered (they have pointer-events: none).

Differential Revision: https://phabricator.services.mozilla.com/D222172
2024-09-13 19:44:59 +00:00
Sam Johnson c07350c901 Bug 1912338 - Fix titlebar separator hiding workaround on macOS 11. r=mac-reviewers,bradwerth
On macOS 11, MOZTitlebarAccessoryView's viewWillMoveToWindow: is called both when transitioning to full screen, and when transitioning out of full screen. In the case of transitioning into full screen, the window passed to viewWillMoveToWindow: has titlebarAppearsTransparent=false, meaning that the condition added to this function in bug 1906034 caused the title bar separator to always be enabled when in full screen on macOS 11. This patch fixes the logic to instead check if the passed NSWindow is our ToolbarWindow or something else.

On later macOS releases, MOZTitlebarAccessoryView's viewWillMoveToWindow: is called when transitioning out of from full screen, but not when transitioning to full screen. This is why disabling the title bar separator in windowDidEnterFullScreen: is also necessary.

Differential Revision: https://phabricator.services.mozilla.com/D221909
2024-09-12 19:10:17 +00:00
Martin Stransky 7e51fa5a65 Bug 1917794 [Wayland] Use and store wl_surface passed to touch events r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D221931
2024-09-12 12:23:08 +00:00
stransky c69c2fdc1e Bug 1899299 [Linux] Listen mouse events on mShell for modal popups r=emilio
A popup attached to a modal parent window doesn't get mouse events
from Gtk as they'are directed to the modal parent. This is usually solved
by pointer grab which that doesn't work on Wayland in our current
setup as it performs show and grab in one step.

We emulate it by setting popup as modal too but then patent
window doesn't get mouse events outside of popup (Bug 1899299).
we need to listen

Surprisingly attaching events handler to mShell fixes it
and we're getting events from both parent and popup windows.

Differential Revision: https://phabricator.services.mozilla.com/D221290
2024-09-12 12:17:58 +00:00
stransky ef510545a8 Bug 1917558 [Wayland] Explicitly request wl-pointer v.3 interface r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D221617
2024-09-12 12:15:42 +00:00
Butkovits Atila 171a4c7e85 Backed out 2 changesets (bug 1915665) for causing failures at WinEventObserver.cpp. CLOSED TREE
Backed out changeset a3d4ad8b9ad8 (bug 1915665)
Backed out changeset 1428595baef7 (bug 1915665)
2024-09-12 10:59:44 +03:00
Ray Kraesig 6b590e2cd2 Bug 1915665 - [2/2] Simplify the Chromium-inherited API r=win-reviewers,handyman
The original Chromium listener code has a few infelicities in its API.

* The current session ID is always available, so the `Nothing()` branch
  is impossible. Remove the `Maybe` from the interface.

* If session-change messages for other sessions are received, discard
  them early rather than propagating them.

* Use the whole DWORD value supplied by `GUID_SESSION_DISPLAY_STATUS`,
  rather than just the first byte. (This has no effect here, since
  `MONITOR_DISPLAY_STATE` is an enum with very few values, but might if
  someone blindly copies this code with minimal adjustments to be used
  with another `PBT_POWERSETTINGCHANGE` value.)

Differential Revision: https://phabricator.services.mozilla.com/D220749
2024-09-12 01:21:13 +00:00
Ray Kraesig 16afc39f46 Bug 1915665 - [1/2] Streamline WinEventHub r=win-reviewers,gfx-reviewers,handyman,bradwerth
`WinEventHub` was largely taken from Chromium, where its dynamic
connection/disconnection features are presumably more used. We don't
have any need for that, and anyway if we ever do it'll be easy to add
it alongside the static functionality or even migrate the latter over.

Hardwire the relevant message-processing and invocation directly into
the hidden window's WNDPROC, rather than providing a registration
system. Following the discoveries made in bug 1571516, also remove the
additional failure-mode checks added in bug 1852801, reverting to a
crash (which can be unified with 1571516 when it shows up).

This has, as fallout, a minor functional change to the occlusion
tracker: the subfeature prefs mentioned above are now checked at
message-receipt time, rather than at construction time.

Differential Revision: https://phabricator.services.mozilla.com/D220639
2024-09-12 01:21:12 +00:00
David Parks ba246211e4 Bug 1910452: Part 3 - Fix some issues with synthesizeMockDragAndDrop r=m_kato
This fixes four issues:

1. The test didn't provide enough movement to generate a drag session on the
   source before moving to the target.  This meant that, when they were in
   different windows, Gecko wouldn't send dragleave to the source or dragenter
   to the target.  It also never sent dragenter to the source in the first
   place. This remedies that.
2. dragenter and dragleave weren't properly handled because the test was sending
   dragleaves instead of dragexits (the latter being what Gecko expects and the
   former being synthesized from that -- see e.g. nsNativeDragTarget::DragLeave).
   This now uses dragexits and sets the proper expectations.
3. expectProtectedDataTransferAccess was needlessly complicated and, after #1,
   gave the wrong answers for some events like dragenter called on the source.
4. The event handler wasn't checking for exceptions and the drop handler was
   intentionally causing one, which was causing it to miss the rest of its
   execution.

Differential Revision: https://phabricator.services.mozilla.com/D219550
2024-09-11 23:02:23 +00:00
David Parks 8b722be621 Bug 1910452: Part 1 - Intercept drop events for content analysis r=smaug,dlp-reviewers,gstoll,reusable-components-reviewers,mstriemer
Sends OOP drop events to content analysis for approval before sending them to
the DOM.  It intercepts drop events at the browser level and sends them to CA
before calling stopPropagation and preventDefault on them.  (CA also presents a
modal dialog over the tab.) The drag session then ends as usual in the parent
process but remains open on the related browser in the process where it would be
sent to the DOM while the drop is being analyzed.  While CA runs, the browser
dispatches an eQueryDropTargetHittest event to locate the drop target while the
event screen coordinates are still valid.  When CA is complete, a drop or
dragexit event is sent to the drop target (drop if it was approved by CA). Calls
to EndDragSession are delayed during this.

Differential Revision: https://phabricator.services.mozilla.com/D219201
2024-09-11 23:02:22 +00:00
Greg Stoll d31487f277 Bug 1917631 - clean up logic around content analysis pref r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D221648
2024-09-11 06:39:30 +00:00
Sam Johnson 6b0aeee669 Bug 1912338 - Consistently hide macOS titlebar separator for full screen windows. r=mac-reviewers,bradwerth
In bug 1906034, I attempted to preserve the workaround for the white line issue from bug 1700211, but it did not prevent the white line from appearing. Hiding the separator in response to full-screen events avoids the issue.

Differential Revision: https://phabricator.services.mozilla.com/D221576
2024-09-10 17:54:41 +00:00
Ray Kraesig 978be7ce60 Bug 1598915 - [3/2] Fix sense of preference-test r=win-reviewers,handyman
The sense of the test-condition here was reversed: as the preference's
name states, this should run when the preference is false (as it is by
default).

Differential Revision: https://phabricator.services.mozilla.com/D221234
2024-09-10 17:28:04 +00:00
Fatih 6ab4e9bf01 Bug 1834307: Change StaticPrefs::general_smoothScroll() calls with nsLayoutUtils::IsSmoothScrollingEnabled. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D221363
2024-09-10 14:41:23 +00:00
Fatih d9402246b9 Bug 1826051: Improve PointerEvents RFP target for Android. r=tjr
- This patch separates RFPTarget::PointerEvents into PointerEvents and PointerId.
- PointerId protection is disabled for Android.
- WidgetEvents emit non-primary mouse events on Android because any touch other than 1nd touch is considered non-primary
- Sets maximum touch points to 5 on Android

Differential Revision: https://phabricator.services.mozilla.com/D221241
2024-09-10 14:37:50 +00:00
Emilio Cobos Álvarez c4cf618c6c Bug 1917715 - Rename nsLayoutUtils::GetColor. r=longsonr,dholbert
It's suitable for foreground colors only.

Differential Revision: https://phabricator.services.mozilla.com/D221557
2024-09-09 23:12:05 +00:00
Martin Stransky a108f647bd Bug 1915596 [Wayland] Get touchpad hold event directly from Wayland display r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D220551
2024-09-06 09:16:28 +00:00
Masayuki Nakano c13abd36f2 Bug 1915057 - Make `HTMLEditor::NotifyRootChanged()` notifies `IMEStateManager` of the editor root change r=smaug,m_kato
When `HTMLEditor` handles the design mode, `IMEContentObserver` observes the
`<body>` if there is.  However, web apps may remove it.  Then, we need to
recreate `IMEContentObserver` with emulating a focus move because it's difficult
to compute the difference between the old root and the new root (IME focus
notification sends all content to the parent, it's faster in most cases in this
situation). This was fixed in bug 1911010.  However, there are remaining issues
after that.

When new `<body>` or the original `<body>` is connected again,
`IMEContentObserver` does not restart to observe the new `<body>`.  So,
`IMEContentObserver` working differently after the `<body>` is even temporarily
removed.  This make it harder to reproduce reported bugs.

Additionally, if the document element is removed, `IMEContentObserver` won't
be recreated until the document gets focus again even after new root and/or
`<body>` element is connected.  This makes IME users inconvenient with such
tricky editors.

This patch makes `HTMLEditor::NotifyRootChanged` notifies `IMEStateManager`
of the editor root element change.  Then, the new method of `IMEStateManager`
updates IME enabled state and recreate `IMEContentObserver` with emulating
a focus move.

Differential Revision: https://phabricator.services.mozilla.com/D220362
2024-09-05 00:35:50 +00:00
Greg Stoll b8436fd050 Bug 1914068 - pass correct URL to Content Analysis for same-origin iframes r=dlp-reviewers,win-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D220168
2024-09-04 19:55:29 +00:00
delthas 5f4990c6aa Bug 1815783 - Expose media URL in MPRIS metadata r=media-playback-reviewers,padenot
Differential Revision: https://phabricator.services.mozilla.com/D219160
2024-09-04 16:16:56 +00:00
Masayuki Nakano 49bd0ece94 Bug 1913925 - Allow `WidgetMouseEvent` whose `mIgnoreCapturingContent` and/or `mSynthesizeMoveAfterDispatch` is `true` to cross a process boundary r=smaug
We didn't have any ideas of crossing mouse/pointer events which finally cause
synthesized move event to dispatch corresponding boundary events.  However,
`mSynthesizeMoveAfterDispatch` of `eMouseUp` is set to `true` in most cases
because the preceding `ePointerUp` causes releasing implicit capture and
`eMouseUp` may be handled in `EventStateManager::HandleCrossProcessEvent` if
there is a remote target underneath the pointer after `ePointerUp` is handled.
Therefore, we should allow such `eMouseUp` events to cross the process
boundary, but we don't need to copy the members (See the comment in
`ParamTraits<mozilla::WidgetMouseEvent>` for the reason).

I have no idea how to write the xorigin test within WPT. Therefore, this patch
does not contain new test.

Differential Revision: https://phabricator.services.mozilla.com/D220773
2024-09-04 00:28:10 +00:00
Brad Werth 1b2d79c224 Bug 1880582: Use more correct teardown semantics in nsCocoaWindow::Destroy. r=mstange
This patch moves the call to BaseWindow::Destroy() and ::OnDestroy() to
the end of nsCocoaWindow::Destroy(). It adds a death grip on this before
remove this from mParent. This should keep the window in a more stable
state throughout the function scope.

Differential Revision: https://phabricator.services.mozilla.com/D216066
2024-09-03 16:14:17 +00:00
Olli Pettay e1fad67026 Bug 1914513 - Add a pref to disable mutation events, r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D219934
2024-09-02 13:29:57 +00:00
Makoto Kato 1ae9b0e33a Bug 1902949 - button and buttons property of contextmenu should be touch contact. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D220508
2024-09-02 02:50:04 +00:00
Kagami Sascha Rosylight 369450f48c Bug 1912074 - Add more validity checks r=nalexander,nrishel,win-reviewers,gstoll
Differential Revision: https://phabricator.services.mozilla.com/D218776
2024-08-31 10:38:24 +00:00
Gregory Pappas cf796e320f Bug 1914578 - Remove EventTracer r=perftest-reviewers,geckoview-reviewers,win-reviewers,profiler-reviewers,mstange,sparky,gstoll,owlish
Differential Revision: https://phabricator.services.mozilla.com/D219955
2024-08-31 03:39:50 +00:00
Emilio Cobos Álvarez 8cf487b56e Bug 1851775 - Make sure calls to BeginPaint/EndPaint are balanced. r=rkraesig
As mentioned in previous review comments, there were various error cases
which could end up with unbalanced calls.

Differential Revision: https://phabricator.services.mozilla.com/D187534
2024-08-30 15:42:30 +00:00
Norisz Fay 9e27b342a4 Backed out changeset 494bc0426f70 (bug 1851775) for causing mochitest failures on browser_startup.js 2024-08-29 22:55:47 +03:00
Emilio Cobos Álvarez 0a61f56ec2 Bug 1851775 - Make sure calls to BeginPaint/EndPaint are balanced. r=rkraesig
As mentioned in previous review comments, there were various error cases
which could end up with unbalanced calls.

Differential Revision: https://phabricator.services.mozilla.com/D187534
2024-08-29 17:23:36 +00:00
Florian Quèze 757717524a Bug 1915228 - Remove expired telemetry scalar startup.skeleton_ui_disabled_reason, r=win-reviewers,TravisLong,gstoll.
Depends on D220334

Differential Revision: https://phabricator.services.mozilla.com/D220335
2024-08-28 19:44:36 +00:00
Florian Quèze 8fb63116dd Bug 1915228 - Remove expired telemetry scalars widget.gtk_theme_has_scrollbar_buttons and widget.gtk_theme_scrollbar_uses_images, r=TravisLong.
Depends on D220333

Differential Revision: https://phabricator.services.mozilla.com/D220334
2024-08-28 19:44:35 +00:00
Florian Quèze 9a84e38e6c Bug 1915228 - Remove expired telemetry scalar startup.is_restored_by_macos, r=TravisLong.
Depends on D220332

Differential Revision: https://phabricator.services.mozilla.com/D220333
2024-08-28 19:44:35 +00:00
Gregory Pappas bfbc544e6c Bug 1914559 - Remove fallback to hidden window in WindowsUIUtils::UpdateInTabletMode r=win-reviewers,rkraesig
If there aren't any browser windows, we're either very early in startup
or shutting down. In these cases, it's probably fine to not know if
tablet mode is enabled.

Differential Revision: https://phabricator.services.mozilla.com/D219945
2024-08-28 19:30:43 +00:00
Makoto Kato 8d8645b6a8 Bug 1546267 - Detect system locale/timezone change. r=geckoview-reviewers,owlish
We should notify system locale and timezone of changes to Gecko.

Differential Revision: https://phabricator.services.mozilla.com/D218514
2024-08-27 08:40:58 +00:00
Masayuki Nakano b546eb7e32 Bug 1911010 - Make `IMEContentObserver` observe `ParentChainChanged` and let `IMEStateManager` know that r=smaug
`mozAutoDocUpdate` does not make it in a document change when container node
of `insertBefore` has already been removed from the tree.  Therefore, once
`IMEContentObserver::mRootElement` is removed from the DOM tree without a
focus move, `IMEContentObserver` is notified mutations not in a document change.

Similar situations are handled in `IMEStateManager::OnRemoveContent` with
emulating a focus change and that will destroy the active `IMEContentObserver`.
Therefore, if `IMEContentObserver::mRootElement` is removed, we should emulate
a focus move when `IMEStateManager` does not have focused element but there
is active `IMEContentObserver` (that means it is/was in the design mode).

However, checking whether the removed node contains the observing node of the
active `IMEContentObserver` may be expensive.  So, doing expensive things in
`IMEStateManager::OnRemoveContent` may make mutations slower.  Therefore, this
patch makes `IMEContentObserver` observe `ParentChainChanged` and it let
`IMEStateManager` know that with calling its
`OnParentChainChangedOfObservingElement`.  Finally, it calls
`IMEStateManager::OnRemoveContent` to emulate "blur" (and refocus if it's
required).

Differential Revision: https://phabricator.services.mozilla.com/D218696
2024-08-27 07:55:26 +00:00
Norisz Fay 6ad5adeba2 Backed out changeset 4b2edb2c26d4 (bug 1880582) for causing mochitest failures on test_fullscreen-api-race.html CLOSED TREE 2024-08-27 09:02:12 +03:00
Stanca Serban ada4e189a4 Backed out changeset 125344f9e446 (bug 1911010) for causing linux bustages in nsINode.cpp. 2024-08-27 07:54:54 +03:00
sotaro 7e09cc440e Bug 1899454 - Re-enable zero copy video of hardware decoded video with NVIDIA GPUs to release r=win-reviewers,handyman
No regressions have been reported reported since  Bug 1882001, then it seems OK to re-enable zero copy video of hardware decoded video with NVIDIA GPUs to release.

Differential Revision: https://phabricator.services.mozilla.com/D219838
2024-08-27 04:21:14 +00:00