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

3512 Коммитов

Автор SHA1 Сообщение Дата
Stephen A Pohl 6b1a03f820 Bug 1688584: Add the ability to exit window fullscreen on macOS by pressing the escape key. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D116661
2021-07-13 17:49:38 +00:00
Tooru Fujisawa cc92ef732d Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D119619
2021-07-13 11:52:42 +00:00
Markus Stange 56da3bf9e0 Bug 1715786 - Observe dynamic changes to the ScrollToClick system pref. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D119684
2021-07-12 23:17:28 +00:00
Markus Stange c4e62f99d4 Bug 1600430 - Observe changes to the full keyboard access system pref. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D119680
2021-07-12 23:17:28 +00:00
Markus Stange a59a685f73 Bug 1717129 - Don't call into the native event loop while waiting to unwind into the NSMenu tracking event loop after closing a menu. r=harry
This avoids timeouts in some automated tests in certain scenarios.

Differential Revision: https://phabricator.services.mozilla.com/D118237
2021-06-21 17:18:43 +00:00
Andi-Bogdan Postelnicu f07c975367 Bug 1519636 - Reformat recent changes to the Google coding style. r=necko-reviewers,emilio
Updated with clang-format version 12.0.0 (taskcluster-FZRqPXamQIOU_i4hF0cAcg)

Differential Revision: https://phabricator.services.mozilla.com/D117905
2021-06-17 11:00:22 +00:00
Harry Twyford 1135b0ea6b Bug 1710164 - Use appropriate system colors for in-content pages in HCM on macOS. r=mstange,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D115649
2021-06-10 16:00:40 +00:00
Noemi Erli 9d1151db1f Backed out changeset 56aa4be0522c (bug 1710164) for causing bustages in nsLookAndFeel.mm 2021-06-10 00:25:28 +03:00
Harry Twyford 61497005b9 Bug 1710164 - Use appropriate system colors for in-content pages in HCM on macOS. r=mstange,desktop-theme-reviewers,dao
Differential Revision: https://phabricator.services.mozilla.com/D115649
2021-06-09 20:02:14 +00:00
Markus Stange a36e8a2b81 Bug 1715145 - Remove now-unnecessary per-window appearance override. This reverts bug 1700371. r=emilio
Depends on D117098

Differential Revision: https://phabricator.services.mozilla.com/D117099
2021-06-08 02:01:10 +00:00
Markus Stange 4ad313f4ec Bug 1715145 - Rename widget.macos.respect-system-appearance to widget.macos.support-dark-appearance, and make the Firefox theme affect all windows if the pref is true. r=emilio
This patch also removes the pref widget.system-colors-follow-theme, which was
only true on macOS. System colors now follow the global Firefox theme.

Differential Revision: https://phabricator.services.mozilla.com/D117098
2021-06-08 02:01:10 +00:00
Kartikaya Gupta 9020180bb9 Bug 1714884 - Have the Rollup method take a strongly-typed int point. r=emilio
Depends on D116948

Differential Revision: https://phabricator.services.mozilla.com/D116949
2021-06-07 01:01:10 +00:00
Stephen A Pohl 397020df7c Bug 1714177: Correct spelling error in TextInputHandler that could have prevented us from handling escape key or Command and Period key presses correctly if ChildView were to ever implement cancelOperation:. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D116729
2021-06-04 14:10:11 +00:00
Markus Stange 4cb5ee5a2d Bug 1712358 - Call NotifyWait() when the native event loop goes idle. This fixes unintended BHR hang reports when we are in a nested native event loop, such as when a menu is open. r=florian
The 'BHR-detected hang' markers in these profiles show the difference:
Before: https://share.firefox.dev/34anZE5
After: https://share.firefox.dev/3udb8vq

Differential Revision: https://phabricator.services.mozilla.com/D115764
2021-05-24 17:02:44 +00:00
Markus Stange 14d49253c8 Bug 1710474 - Don't roll up native context menus in response to wheel events. r=mac-reviewers,spohl,bradwerth
I didn't add this check originally because the thinking was that macOS wouldn't dispatch
these events to us anyway as long as a menu is open.
However, our menu opening is asynchronous. So we can still get wheel events between the
mousedown that asks to open the menu, and the delayed perform which then ends up opening
the menu for real. We don't want to cancel opening when we get these straggler events.

Differential Revision: https://phabricator.services.mozilla.com/D115763
2021-05-24 15:14:04 +00:00
Jonathan Watt 4f2e81f238 Bug 1709598. Implement API to pin the app to the macOS Dock. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D115550
2021-05-22 23:45:55 +00:00
Butkovits Atila e5a9afcb43 Backed out changeset e706f7128abd (bug 1709598) for causing build bustages. CLOSED TREE 2021-05-23 02:06:14 +03:00
Jonathan Watt 19199944ad Bug 1709598. Implement API to pin the app to the macOS Dock. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D115550
2021-05-22 22:44:00 +00:00
Stephen A Pohl d55e345344 Bug 1707223: Add mail option to the context menu's share menu on macOS and bring it in line with the share menu that is accessible via the TouchBar where the mail option is already shown. r=mac-reviewers,harry
Differential Revision: https://phabricator.services.mozilla.com/D115382
2021-05-20 15:49:11 +00:00
Masayuki Nakano 038b637268 Bug 1520983 - part 2: Make `IMEInputHandler::InsertTextAsComittingComposition()` use `eContentCommandInsertText` event if there is no composition r=m_kato
Like the other browsers, we should stop dispatching a set of composition
events when `insertText:` is called by Emoji picker, accent character
picker of some Western keyboard layouts.  Then, corresponding
`beforeinput` event becomes cancelable like the other browsers'.

Differential Revision: https://phabricator.services.mozilla.com/D114827
2021-05-18 06:30:36 +00:00
Haik Aftandilian e84c0b8236 Bug 1708324 - [Fission] Full screen button for YouTube video embedded on Reddit doesn't work r=spohl
During fullscreen transitions on Mac, ignore occlusion events caused by the widget DOM fullscreen transition effect which uses a temporary window.

Add a test that attempts to enter fullscreen from a non-focused window. This test is to ensure the fix (and future fixes) do not regress the focus requirement for fullscreen.

Differential Revision: https://phabricator.services.mozilla.com/D115046
2021-05-18 04:54:25 +00:00
Butkovits Atila f3f08e64ba Backed out 2 changesets (bug 1520983) for causing build bustages. CLOSED TREE
Backed out changeset c09060ee8358 (bug 1520983)
Backed out changeset b4c25d047cee (bug 1520983)
2021-05-18 07:47:57 +03:00
Masayuki Nakano 684add0c4c Bug 1520983 - part 2: Make `IMEInputHandler::InsertTextAsComittingComposition()` use `eContentCommandInsertText` event if there is no composition r=m_kato
Like the other browsers, we should stop dispatching a set of composition
events when `insertText:` is called by Emoji picker, accent character
picker of some Western keyboard layouts.  Then, corresponding
`beforeinput` event becomes cancelable like the other browsers'.

Differential Revision: https://phabricator.services.mozilla.com/D114827
2021-05-17 23:52:43 +00:00
Andrew Osmond b3a88ee4db Bug 1711118 - Part 1. Allow Software WebRender for all desktop users in release. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D115078
2021-05-14 13:01:21 +00:00
Markus Stange d6591ed5d6 Bug 1710507 - Make native menus respect the XUL element's directionality. r=emilio
This affects both native context menus and menubar menus.

Doing a flush here is fine, the nsMenuX constructor already flushes via SetupIcon()
(which also uses nsComputedDOMStyle, in nsMenuItemIconX::GetIconURI).

Differential Revision: https://phabricator.services.mozilla.com/D114785
2021-05-11 20:34:17 +00:00
Neil Deakin 525d4000cd Bug 1709439, activateItem should allow any descendant of an open submenu to be used, r=mstange,emilio
This patch also fixes an issue where hidden native items could be activated, and makes the
error message consistent between both implementations in this case.

Differential Revision: https://phabricator.services.mozilla.com/D114503
2021-05-10 18:44:03 +00:00
Harry Twyford 0ec6c9422f Bug 1710269 - Use the correct system colors for Window/WindowFrame on macOS. r=mac-reviewers,mstange
The sanitize window is the only place we use these colors on macOS: https://searchfox.org/mozilla-central/search?q=Window&path=.css&case=true&regexp=false. They're also used in toolkit/themes/shared/notification.css, but we override the notification API with macOS native notifications.

Differential Revision: https://phabricator.services.mozilla.com/D114752
2021-05-10 15:47:29 +00:00
Harry Twyford 28e09c68dc Bug 1698754 - Set listbox backgrounds to controlBackgroundColor. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D114650
2021-05-07 23:33:24 +00:00
Markus Stange 0350405261 Bug 1705120 - Add OnNativeMenuWillActivateItem observer method for NativeMenu::Observer and call it at the right times. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D114435
2021-05-07 17:00:21 +00:00
Markus Stange 607f63b94a Bug 1705120 - Notify nsMenuX observers when a menu item is about to be activated, and supply the activated DOM element. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D114434
2021-05-07 17:00:20 +00:00
Markus Stange 65997668d2 Bug 1705120 - Add -[MenuDelegate menu:willActivateItem:] and call it before activating an item. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D114433
2021-05-07 17:00:20 +00:00
Markus Stange 63a342c292 Bug 1705120 - Make it clear that aSender is an NSMenuItem. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D114432
2021-05-07 17:00:19 +00:00
Harry Twyford edf7eb8fae Bug 1698763 - Part 3 - Remove custom 10.15-style toolbarbuttons. r=mac-reviewers,mstange
Differential Revision: https://phabricator.services.mozilla.com/D114410
2021-05-07 16:23:13 +00:00
Harry Twyford 0c96c48293 Bug 1698763 - Part 2 - Draw treeheadercells with NSTableHeaderCell. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D114409
2021-05-07 16:23:12 +00:00
Emilio Cobos Álvarez bb862cf713 Bug 1709647 - Use NS_SAME_AS_FOREGROUND_COLOR instead of NS_DONT_CHANGE_COLOR. r=jfkthame
I don't think they are meaningfully different.

Depends on D114390

Differential Revision: https://phabricator.services.mozilla.com/D114391
2021-05-06 09:57:19 +00:00
Emilio Cobos Álvarez 9350df750c Bug 1709634 - Fix -moz-accent-color on macOS. r=mstange,mac-reviewers
When I initially implemented it for GTK, I just followed the Highlight color
everywhere, but on macOS it makes of course a lot of sense to use
NSColor.controlAccentColor.

Differential Revision: https://phabricator.services.mozilla.com/D114430
2021-05-06 01:22:53 +00:00
Markus Stange 5bcf113e2e Bug 1704102 - On 10.14 and 10.15, make NSMenu adopt the system appearance by briefly changing the NSWindow appearance during menu opening. r=harry
This can be disabled by setting the following pref to false:
widget.macos.enable-pre-bigsur-workaround-for-dark-mode-context-menus

Differential Revision: https://phabricator.services.mozilla.com/D114037
2021-05-04 16:00:52 +00:00
Markus Stange 806ce6ffd1 Bug 1707598 - Make sure that command events from activateItem only run once the nested event loop for the NSMenu has been exited. r=harry
This avoids bugs where a menu close request (cancelTrackingWithoutAnimation) would be dropped
if the command event did certain unexpected things. I'm not 100% sure what the exact
circumstances for the bad behavior were (see bug 1707598 comment 7 for details), but
this seems like the right thing to do anyway.

We also need to delay the call to MenuClosedAsync, because MenuClosedAsync flushes any pending
command runnables (so that the command event fires before popuphiding / popuphidden). However, we
can only delay the call to MenuClosedAsync if we know thath the entire menu closes, and not just a
submenu.

Differential Revision: https://phabricator.services.mozilla.com/D113734
2021-04-30 17:45:59 +00:00
Markus Stange 1e542500e5 Bug 1707598 - Let MenuClosed know when it's called after ActivateItem. r=harry
In the next patch, it will make different decisions for how to dispatch the
MenuClosedAsync event based on this flag.

Depends on D113987

Differential Revision: https://phabricator.services.mozilla.com/D113988
2021-04-30 17:45:59 +00:00
Markus Stange 775aafc5ba Bug 1707598 - Rename ActivateItemAndClose and call cancelTrackingWithoutAnimation in NativeMenuMac::ActivateItem. r=harry
This also makes sure we call ActivateItemAfterMenuClosing on the submenu that
immediately contains the activated menu item, and not on the root menu.
This usually doesn't make a difference, except in the case where something
calls FlushMenuClosedRunnable afterwards; in that case, before this patch, we
might accidentally fired the popuphidden event for the submenu before the
command event for the clicked item.

Depends on D113733

Differential Revision: https://phabricator.services.mozilla.com/D113987
2021-04-30 17:45:58 +00:00
Markus Stange 85bc33f0da Bug 1707598 - Add -[MOZMenuOpeningCoordinator runAfterMenuClosed:]. r=harry
This is a robust way to queue runnables which won't run until after the nested
event loop of the open NSMenu has been exited.
NS_DispatchToCurrentThread is not a reliable way to achieve that, because it
puts the runnables into the Gecko event loop, and there's nothing that prevents
us from potentially visiting the Gecko event loop inside the NSMenu's event loop,
even after cancelTracking(WithoutAnimation) has been called.

Differential Revision: https://phabricator.services.mozilla.com/D113733
2021-04-30 17:45:58 +00:00
Markus Stange 83880d0070 Bug 1707598 - Make DoCommandRunnable a regular runnable, not a cancelable runnable. r=harry
It doesn't need to be cancelable - the Run() method already nulls out mMenuItem,
so once Run() has been called once, it won't do anything on subsequent invocations.
This patch also improves safety a bit, by moving the pending command runnables
out of the mPendingCommandRunnables field before running them, so that the Run()
method has no way of invalidating the array that's being iterated over.

Differential Revision: https://phabricator.services.mozilla.com/D113732
2021-04-30 17:45:58 +00:00
Markus Stange a66f2dc703 Bug 1707598 - Release MOZMenuOpeningCoordinator on shutdown. r=harry
Otherwise the singleton would be leaked. It's not a lot of bytes, but a future
patch in this series is going to add an nsDeque member to this class, and
nsDeque has leak detection which would cause test failures in debug builds if
we didn't clean up MOZMenuOpeningCoordinator on shutdown.

Differential Revision: https://phabricator.services.mozilla.com/D113731
2021-04-30 17:45:57 +00:00
Markus Stange 1148a6198f Bug 1707598 - When opening a new menu just after closing an old menu, make sure we exit the nested event loop for the old NSMenu before we ask the new NSMenu to open. r=harry
On CI, where we open and close menu items in quick succession, we sometimes got
into a state where the new menu was opened while we were still in the old menu's
nested event loop. So we had the following sequence of events:

```
 - old menu +[NSMenu popUpContextMenu:withEvent:forView:]
   - nested event loop for old menu
     - old menu -[NSMenu cancelTrackingWithoutAnimation]
     - new menu +[NSMenu popUpContextMenu:withEvent:forView:]
       - nested event loop for new menu
         - new menu -[NSMenu cancelTrackingWithoutAnimation]
     - new menu's event loop is exited, but old menu's event loop remains on the
       stack
     - shutdown hang here
```

MOZMenuOpeningCoordinator makes sure that +[NSMenu popUpContextMenu:withEvent:forView:]
is always called in sequence, never in a nested fashion.

Differential Revision: https://phabricator.services.mozilla.com/D113373
2021-04-30 17:45:57 +00:00
Hiroyuki Ikezoe 023bd8d65c Bug 1704065 - Stop consuming pan gesture events in SwipeTracker if the swiping direction is not allowed to navigate. r=spohl
This is what Safari does, i.e. once after a swipe gesture has started to a
direction where there is no navigation history, then even if the swipe gesture
switched to the opposite direction where navigation can happen, swipe navigation
will never happen. Chrome looks like they are trying to do swipe navigation in
such cases, but it looks like they sometimes fail it, the swipe navigation
indicator (an arrow image) doesn't show up sometime when the swipe navigation
goes to the opposite direction.

This change fixes stuck-in-overscroll situations where user swipes horizontally
to a direction where navigation is impossible during overscrolling, but doesn't
fix situations where navigation is possible but the user cancels the navigation.
To fix the later situations we need a different fix apart from this change.

The mochitest in this change doesn't test the stuck-in-overscroll situations at
all because we need to write a browser mochitest since swipe gesture is
implemented as a browser feature but unfortunately SpecialPowers.snapshotWindow
doesn't capture overscrolled gutter regions for some reasons, so instead the
test checks whether the swipe gesture module keeps capturing wheel events in the
situations where navigation is impossible.

Differential Revision: https://phabricator.services.mozilla.com/D113636
2021-04-30 09:08:08 +00:00
Stephen A Pohl c7760491de Bug 1708015: Replace MOZ_USE_NATIVE_POPUP_WINDOWS with mozilla::widget::NativeMenuSupport::ShouldUseNativeContextMenus() in nsToolkit.mm. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D113586
2021-04-27 22:31:11 +00:00
Stephen A Pohl 0a505ad43c Bug 1708032: Remove unused MOZ_USE_NATIVE_POPUP_WINDOWS from nsCocoaWindow.mm. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D113591
2021-04-27 21:41:55 +00:00
Stephen A Pohl 22b97a963b Bug 1707869: Disable context menu tracking when native context menus are used to avoid accidental closing of context menus in fullscreen mode. r=mstange
Depends on D113579

Differential Revision: https://phabricator.services.mozilla.com/D113580
2021-04-27 20:44:37 +00:00
Stephen A Pohl fbd8c01170 Bug 1707869: Introduce helper to detect when native context menus are enabled via prefs on macOS. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D113579
2021-04-27 20:44:37 +00:00
Cosmin Sabou 0a2f298b48 Backed out changeset 9577e2feecd1 (bug 1707598) for causing bc failures on browser_library_bookmark_pages.js. CLOSED TREE 2021-04-27 00:40:33 +03:00