Commit Graph

750379 Commits

Author SHA1 Message Date
Markus Stange
ea9ef4937e Bug 1698997 - Add NativeMenu::ShowAsContextMenu. r=harry
Depends on D109180

Differential Revision: https://phabricator.services.mozilla.com/D109181
2021-03-23 14:38:29 +00:00
Markus Stange
29451fe8f3 Bug 1698997 - Add nsCocoaUtils::GeckoPointToCocoaPoint. r=harry
Depends on D109179

Differential Revision: https://phabricator.services.mozilla.com/D109180
2021-03-23 14:38:28 +00:00
Markus Stange
7555ea54af Bug 1698997 - Disable the Services item in context menus for now. r=harry
Bug 660452 tracks turning this on for the appropriate menus.

Depends on D108721

Differential Revision: https://phabricator.services.mozilla.com/D109179
2021-03-23 14:38:28 +00:00
Markus Stange
070f09c1ac Bug 1698997 - Allow OnOpen() to be called before MenuOpened(), and track the state correctly. r=harry
This will be useful for native context menus: We can call OnOpen() before we
ask the OS to open the menu. This way, popupshowing handlers can prevent the
menu from opening.
I was also planning to use this to call OnOpen during menuNeedsUpdate, which is
where the Apple docs say we should do our menu modifications. However, doing so
has some other effects so I will hold off on making that change.

This patch also clarifies our inability to interfere with menu opening, which
clashes a little bit with the cross-platform expectations around popupshowing
events, but should hopefully not make a difference in practice.

Differential Revision: https://phabricator.services.mozilla.com/D108721
2021-03-23 14:38:28 +00:00
Markus Stange
8709112586 Bug 1698997 - Make it possible to listen for NativeMenu opening/closing. r=harry
This will be used for native context menus. I'm planning for nsMenuPopupFrame to
be the owner of the NativeMenu, and it only wants to keep the object around
while the menu is open. So it needs to be notified when it closes.

Differential Revision: https://phabricator.services.mozilla.com/D109178
2021-03-23 14:38:27 +00:00
Markus Stange
1e0cd74133 Bug 1698997 - Make it possible to listen for nsMenuX opening and closing. r=harry
Depends on D108722

Differential Revision: https://phabricator.services.mozilla.com/D109177
2021-03-23 14:38:27 +00:00
Markus Stange
86224f1db6 Bug 1698997 - When an item in a menu is clicked, make sure that the command event is fired before the popuphiding event. r=harry
If a menu item is clicked, macOS calls menuDidClose before it calls menuItemHit.
This means that, before this patch, we would fire the popuphiding event before
we run the command handler for the clicked menu item.

This seems to work fine for the menubar menus, but it causes problems for
context menus: We have a lot of front-end code that expects item command
handlers to be run *before* popuphiding handlers. For example, for the content
area context menu, many commands use gContextMenu in their implementation and
expect gContextMenu to be non-null. But gContextMenu is set to null in the
popuphiding handler.

So we need to reverse the native order of events.

Using a runnable for MenuClosedAsync() delays the popuphiding event just enough
that menuItemHit can run first.

Differential Revision: https://phabricator.services.mozilla.com/D108722
2021-03-23 14:38:26 +00:00
Paul Adenot
c56df9bd85 Bug 1693070 - Don't schedule a task when out of test-cases. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D109485
2021-03-23 14:31:54 +00:00
Kagami Sascha Rosylight
710889efe3 Bug 1672141 - Part 3: Add touchstart logging to tocuh_action_helpers r=edgar
This is to check whether the intermittent failure is missing only touchend or missing the whole touch event sequences.

Differential Revision: https://phabricator.services.mozilla.com/D109482
2021-03-23 14:18:03 +00:00
Gijs Kruitbosch
d2f0e414a7 Bug 1690245 - tests for NTFS special paths, r=valentin
Differential Revision: https://phabricator.services.mozilla.com/D103768
2021-03-23 14:12:40 +00:00
Markus Stange
a0e4c576bb Bug 1699792 - Move nsMenuGroupOwnerX::Create into the constructor. r=harry
Depends on D109175

Differential Revision: https://phabricator.services.mozilla.com/D109176
2021-03-23 13:40:33 +00:00
Markus Stange
27c0002558 Bug 1699792 - Move nsMenuBarX::Create into the constructor. r=harry
Depends on D109174

Differential Revision: https://phabricator.services.mozilla.com/D109175
2021-03-23 13:40:32 +00:00
Markus Stange
ed80258ead Bug 1699792 - Remove vestigal nsMenuX::Create declaration. r=harry
The implementation for this method is long gone, and it wasn't called anywhere,
so the compiler and linker didn't notice anything wrong.

Depends on D109173

Differential Revision: https://phabricator.services.mozilla.com/D109174
2021-03-23 13:40:32 +00:00
Markus Stange
53bed1aa5d Bug 1699792 - Split off the inner parts of nsStandaloneNativeMenu into a new class called NativeMenuMac. r=harry
NativeMenuMac implements a new mozilla::widget::NativeMenu interface.
This interface is intended to be used by cross-platform C++ code.

nsStandaloneNativeMenu is now only used to implement the IDL interface (which
is used from JavaScript code), and C++ code can use NativeMenu with its more
ergonomic C++ interface.

Differential Revision: https://phabricator.services.mozilla.com/D109173
2021-03-23 13:40:32 +00:00
Markus Stange
0d867635df Bug 1699792 - Remove nsMenuParentType enum. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109134
2021-03-23 13:40:31 +00:00
Markus Stange
75b980101a Bug 1699792 - Remove unnecessary assert. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109133
2021-03-23 13:40:31 +00:00
Markus Stange
762b29c242 Bug 1699792 - Make Insert/RemoveChildNativeMenuItem methods of nsMenuParentX. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109132
2021-03-23 13:40:31 +00:00
Markus Stange
f0cdca9030 Bug 1699792 - Rename nsMenuObjectX to nsMenuParentX. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109131
2021-03-23 13:40:30 +00:00
Markus Stange
d9ae34b385 Bug 1699792 - Move fixed command IDs to nsMenuGroupOwnerX.h. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109130
2021-03-23 13:40:30 +00:00
Markus Stange
b0e14a5695 Bug 1699792 - Make nsMenuItemX not inherit from nsMenuObjectX. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109129
2021-03-23 13:40:29 +00:00
Markus Stange
743d168998 Bug 1699792 - Make nsStandaloneNativeMenu not inherit from nsMenuObjectX. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109128
2021-03-23 13:40:29 +00:00
Markus Stange
9badbf6ad6 Bug 1699792 - Make nsMenuX's aParent pointer optional, and stop giving nsStandaloneNativeMenu as a parent. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109127
2021-03-23 13:40:29 +00:00
Markus Stange
348d69b859 Bug 1699792 - Make nsMenuGroupOwnerX::Create infallible. r=harry
All callers supply a non-null argument.

Depends on D109125

Differential Revision: https://phabricator.services.mozilla.com/D109126
2021-03-23 13:40:28 +00:00
Markus Stange
1d65aa575f Bug 1699792 - Use composition instead of inheritance for nsMenuGroupOwnerX. r=harry
I find composition easier to reason about.

Depends on D109124

Differential Revision: https://phabricator.services.mozilla.com/D109125
2021-03-23 13:40:28 +00:00
Markus Stange
3ea9ba140e Bug 1699792 - Add a menubar accessor to nsMenuGroupOwnerX. r=harry
I want to make nsMenuGroupOwnerX stop inheriting from nsMenuObjectX, and this makes that easier.

Depends on D109123

Differential Revision: https://phabricator.services.mozilla.com/D109124
2021-03-23 13:40:27 +00:00
Markus Stange
c620ce5b02 Bug 1699792 - Share representedObject between all menu items of the same group owner. r=harry
They all contained the same menu group owner pointer anyway, and nothing else.
Differentiating menu items is done based on the item's tag, not based on its
representedObject.

Depends on D109122

Differential Revision: https://phabricator.services.mozilla.com/D109123
2021-03-23 13:40:27 +00:00
Markus Stange
ad7989e6dc Bug 1699792 - Implement icon update listening without help from nsMenuObjectX. r=harry
Depends on D109121

Differential Revision: https://phabricator.services.mozilla.com/D109122
2021-03-23 13:40:27 +00:00
Markus Stange
10f6d5b657 Bug 1699792 - Add InsertChildNativeMenuItem and RemoveChildNativeMenuItem. r=harry
And tweak the comments on the CalculateNativeInsertionPoint methods.

Differential Revision: https://phabricator.services.mozilla.com/D109121
2021-03-23 13:40:26 +00:00
Markus Stange
4af232ec92 Bug 1699792 - Account for the app menu in nsMenuBarX::CalculateNativeInsertionPoint. r=harry
Depends on D109119

Differential Revision: https://phabricator.services.mozilla.com/D109120
2021-03-23 13:40:26 +00:00
Markus Stange
01e132c5e9 Bug 1699792 - Remove nsMenuUtilsX::CalculateNativeInsertionPoint. r=harry
Depends on D109117

Differential Revision: https://phabricator.services.mozilla.com/D109119
2021-03-23 13:40:26 +00:00
Markus Stange
5599f8f44b Bug 1699792 - Add nsMenuX::CalculateNativeInsertionPoint. r=harry
Depends on D109116

Differential Revision: https://phabricator.services.mozilla.com/D109117
2021-03-23 13:40:25 +00:00
Markus Stange
425b006875 Bug 1699792 - Add nsMenuBarX::CalculateNativeInsertionPoint. r=harry
Depends on D109115

Differential Revision: https://phabricator.services.mozilla.com/D109116
2021-03-23 13:40:25 +00:00
Markus Stange
7f1858f04e Bug 1699792 - Only support nsMenuBarX and nsMenuX parents in CalculateNativeInsertionPoint, because now it's only called for those. r=harry
Differential Revision: https://phabricator.services.mozilla.com/D109115
2021-03-23 13:40:24 +00:00
Markus Stange
e4245a36ed Bug 1699792 - Fix a bug in the handling of dynamic collapsed/hidden attribute changes. r=harry
In the case of nsStandaloneNativeMenu, the root nsMenuX has the nsStandaloneNativeMenu as its parent.
But the parent's NativeNSMenu() is the root nsMenuX's NativeNSMenu().
So when we were removing the collapsed="true" attribute from the root nsMenuX of an nsStandaloneNativeMenu,
`parentMenu` and `mNativeMenu` were the same object. So we would insert mNativeMenuItem into mNativeMenu (as a subitem),
and then also set mNativeMenuItem.submenu = mNativeMenu, creating a cyclic menu structure.

I've added a test for this scenario.
It turns out though that without this patch, the test doesn't actually fail, because the collapsed attribute
handling also calls SetRebuild(true). So while the test would briefly create the cyclic structure, this
bug would be corrected by the MenuOpened calls which would rebuild the menu contents, and then all the
checks from the test would still succeed.

Depends on D109113

Differential Revision: https://phabricator.services.mozilla.com/D109114
2021-03-23 13:40:24 +00:00
Markus Stange
5caa594efa Bug 1699792 - Remove nativeData IDL property and use the NativeNSMenu() C++ method instead. r=harry
Depends on D109022

Differential Revision: https://phabricator.services.mozilla.com/D109113
2021-03-23 13:40:24 +00:00
Anshul Sahai
ac27227839 Bug 1700195 - Replace BrowserTestUtils.waitForCondition with TestUtils.waitForCondition in browser_fxAccounts.js. r=prathiksha
Differential Revision: https://phabricator.services.mozilla.com/D109490
2021-03-23 12:56:31 +00:00
Harry Twyford
c88947d0e3 Bug 1699821 - Restore border to standalone search bar. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D109350
2021-03-23 12:49:08 +00:00
Henrik Skupin
111a18b54e Bug 1680407 - [geckodriver] Remove --android-storage argument and always use external storage for profile folder. r=webdriver-reviewers,agi,jgraham
Differential Revision: https://phabricator.services.mozilla.com/D109407
2021-03-23 12:46:43 +00:00
Jan de Mooij
aea9bb3ae0 Bug 1696178 part 8 - Use initSlot instead of setSlot in a few places. r=jonco
These are all setting newly added slots so we can avoid the pre-barrier.

Differential Revision: https://phabricator.services.mozilla.com/D108412
2021-03-23 12:43:58 +00:00
Jan de Mooij
6a438c4dac Bug 1696178 part 7 - Add a faster path for when the shape can be reused directly. r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D108409
2021-03-23 12:43:57 +00:00
Jan de Mooij
3419c19c24 Bug 1696178 part 6 - Add a fast path for Object.assign with plain objects. r=anba
Websites like Reddit and Slack call Object.assign thousands of times. The vast majority
of these calls (more than 95%) are with plain objects. This patch adds a fast path for
this case.

This lets us bypass the generic SetProperty code and some of the JSClass checks
that aren't relevant for PlainObject.

Differential Revision: https://phabricator.services.mozilla.com/D108408
2021-03-23 12:43:57 +00:00
Jan de Mooij
755982cb52 Bug 1696178 part 5 - Add ObjectFlag::HasNonWritableOrAccessorExcludingProto. r=jonco
This will be used by the next patch to optimize Object.assign.

Differential Revision: https://phabricator.services.mozilla.com/D108407
2021-03-23 12:43:57 +00:00
Jan de Mooij
daf19abe4f Bug 1696178 part 4 - Add NativeObject::setLastPropertyForNewDataProperty. r=jonco
NativeObject::addEnumerableDataProperty is very hot and this is a measurable speedup
because it's not as branchy as setLastProperty.

Depends on D108405

Differential Revision: https://phabricator.services.mozilla.com/D108406
2021-03-23 12:43:56 +00:00
Jan de Mooij
3c9df0e777 Bug 1696178 part 3 - Remove Shape::slotSpan overload with JSClass argument. r=jonco
One of the advantages of the Shape/BaseShape overhaul is that non-dictionary
shapes never change their BaseShape, because the BaseShape no longer contains
the ShapeTable and "owned" BaseShapes don't exist anymore.

This lets us simplify some comments and code.

Differential Revision: https://phabricator.services.mozilla.com/D108405
2021-03-23 12:43:56 +00:00
Jan de Mooij
bee8e634aa Bug 1696178 part 2 - Don't handle proxies in Shape::slotSpan. r=jonco
Checking for proxies was slowing us down for no good reason. Non-native objects
already manage their own layout; slotSpan only applies to native objects.

Differential Revision: https://phabricator.services.mozilla.com/D108404
2021-03-23 12:43:55 +00:00
Jan de Mooij
dd542f9bdb Bug 1696178 part 1 - Simplify/optimize shape check in TryAssignNative and TryEnumerableOwnPropertiesNative. r=anba
When we had unboxed objects, not every object had a shape, but now we can just
do a shape check without checking it's a NativeObject first.

Differential Revision: https://phabricator.services.mozilla.com/D108403
2021-03-23 12:43:55 +00:00
Simon Giesecke
ae75c3faa8 Bug 1601556 - Make Result<V, E> a literal type if V and E are literal types and PackingStrategy is not Variant. r=emilio
Also make CompactPair<A, B> a literal type if A and B are literal types,
and add MaybeStorageBase that ought to be used as a basis of MaybeStorage
in a follow-up patch.

Differential Revision: https://phabricator.services.mozilla.com/D55930
2021-03-23 12:35:19 +00:00
smolnar
f74737684e Backed out changeset c5708498541f (bug 1680407) for causing linux build bustage in makefiles/rust.mk. CLOSED TREE 2021-03-23 14:36:54 +02:00
sotaro
51f31c2181 Bug 1699598 - Create GLContext for CompositorOGL when sw-wr is enabled on Android r=jnicol
Confirmed that the change work on Mali-400 MP device.
GLContextProviderEGL::CreateForCompositorWidget() with aWebRender=true failed to create GLContext when GLES3 is not supported on device. When aWebRender=false, it does not request depth buffer nor GLES3. Though when android device supports GLES3, GLES3 context was created on android devices that I tested.

Differential Revision: https://phabricator.services.mozilla.com/D109015
2021-03-23 12:10:58 +00:00
Andrew Creskey
8fc0c422ec Bug 1698515 - Remove spaces from PerfStats metric names r=barret
Removing spaces from PerfStat metric names because they break the perfherder/perftest tokenization.

Differential Revision: https://phabricator.services.mozilla.com/D109364
2021-03-23 12:09:55 +00:00