Based on a patch from Marco Pesenti Gritti (11 years ago)
Depends on D7407
Differential Revision: https://phabricator.services.mozilla.com/D7408
--HG--
extra : moz-landing-system : lando
The assertion was reasonable check before fixing bug 1446401. However,
this is currently valid situation in UI Events spec.
Differential Revision: https://phabricator.services.mozilla.com/D7578
--HG--
extra : moz-landing-system : lando
Synthesizing keyboard events is dangerous and such API is requested only by
fuzzing test. So, we should add it into FuzzingFunctions which is built
only when |ac_add_options --enable-fuzzing| is specified and enabled by
the pref.
This patch implements the API as synthesizing keyboard events in the focused
widget and the synthesized events are propagated as native key events except
APZ (because keyboard events are synthesized only in the process). This
behavior allows to test including any default action handlers such as
EventStateManager and setting WidgetGUIEvent::mWidget since some C++ handler
checks if it's nullptr.
Differential Revision: https://phabricator.services.mozilla.com/D5516
--HG--
extra : moz-landing-system : lando
We need to port synthesizeKey() of EventUtils.js to FuzzingFunctions. So,
its helper function, _guessCodeFromKeyName() in EventUtils.js needs to be
accessible from FuzzingFunctions. Therefore, we need to reimplement it
with C++ and make it accessible via nsITextInputProcessor for EventUtils.js
for making easier to maintain.
This patch moves _guessCodeFromKeyName() into TextInputProcessor and
WidgetKeyboardEvent. Non-printable key part of _guessCodeFromKeyName() is
moved to WidgetKeyboardEvent::ComputeCodeNameIndexFromKeyNameIndex() because
of not depending on active keyboard layout. On the other hand, printable
key part needs to assume that active keyboard layout is en-US keyboard layout.
Therefore, it's moved to
TextInputProcessor::GuessCodeValueOfPrintableKeyInUSEnglishKeyboardLayout()
because any Core code shouldn't refer it as utility method for keeping that
we're i18n-aware.
Differential Revision: https://phabricator.services.mozilla.com/D5514
--HG--
extra : moz-landing-system : lando
Unfortunately there is no realiable way to tell whether there is no mouse
connected or not. So we are going to take a heuristic way here. The way is
that;
1) Count mouse type devices with SetupDiEnumDeviceInterfaces [1]
2) If the count is 1 and if the system is used as tablet or has a touch device,
the device should be COARSE
This way causes a misrecognition as if there is a mouse device in the case
where the touchscreen is disabled on the tablet even if there is no mouse
connected (i.e. the case where CountMouseDevices() returns 1 and the system
is on table mode). We will try to fix the misrecognition in a later bug
(bug 1495938).
[1] https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdienumdeviceinterfaces
Differential Revision: https://phabricator.services.mozilla.com/D7565
--HG--
extra : moz-landing-system : lando
Unfortunately there is no realiable way to tell whether there is no mouse
connected or not. So we are going to take a heuristic way here. The way is
that;
1) Count mouse type devices with SetupDiEnumDeviceInterfaces [1]
2) If the count is 1 and if the system is used as tablet or has a touch device,
the device should be COARSE
This way causes a misrecognition as if there is a mouse device in the case
where the touchscreen is disabled on the tablet even if there is no mouse
connected (i.e. the case where CountMouseDevices() returns 1 and the system
is on table mode). We will try to fix the misrecognition in a later bug
(bug 1495938).
[1] https://docs.microsoft.com/en-us/windows/desktop/api/setupapi/nf-setupapi-setupdienumdeviceinterfaces
Differential Revision: https://phabricator.services.mozilla.com/D7565
--HG--
extra : moz-landing-system : lando
Make LayerViewSupport, NPZCSupport, GeckoEditableSupport, and
SessionAccessibility use the new disposal mechanism to ensure the
disposal is performed safely.
Differential Revision: https://phabricator.services.mozilla.com/D7110
--HG--
extra : moz-landing-system : lando
Add a new mechanism in NativePtr::Detach to safely dispose objects. A
new disposer Runnable is passed to OnDetach functions. The OnDetach
functions invoke the disposer after changing the object state. The
disposer then makes sure the object hasn't been attached to another
native object in the meantime. Disposal is only performed when the
current native object matches the original one.
Differential Revision: https://phabricator.services.mozilla.com/D7109
--HG--
extra : moz-landing-system : lando
Create a new native handle first before deleting any old ones, so we can
be sure the new handle would not have the same value as the old handle,
which can confuse our code.
Differential Revision: https://phabricator.services.mozilla.com/D7107
--HG--
extra : moz-landing-system : lando
Calls to do_QueryInterface to a base class can be replaced by a static
cast, which is faster.
Differential Revision: https://phabricator.services.mozilla.com/D7224
--HG--
extra : moz-landing-system : lando
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.
Differential Revision: https://phabricator.services.mozilla.com/D6861
--HG--
extra : moz-landing-system : lando
If we do not pass the high quality scaling flag than the resulting surface will be marked as cannot substitute, which is not accurate, so we don't want.
The only place that actually tries to be smart about the size is nsImageFrame::MaybeDecodeForPredictedSize. All other cases just ask for the intrinsic size.
The two most likely cases are that there are no decoded copies of the image, or there is one decoded (or in progress) copy of the image.
In the first case we will request decode at the instrinsic size, and then if we draw at a different size that draw will request the proper size. This doesn't change with this patch.
In the second case there is a decoded copy already available, this is likely from a draw call on the image, and that is the surface size that we want. So we save a decode. If we are actually drawing the image at two different sizes the second size will be slightly delayed, but we have the wrongly sized copy of the image that we can draw until then. This seems like a good tradeoff to avoid always decoding an instrinic size copy of images.
This saves one word per static atom, per process.
The `nsGkAtoms` change is only a small part of this commit.
In regen_atoms.py:
- There is now only one link name per platform: nsGkAtoms::sAtoms[].
- But there is a new constant per atom, giving the index into
nsGkAtoms::sAtoms[].
- And the `atom!` macro for each atom indexes into nsGkAtoms::sAtoms[] using
the index constant.
- A couple of `*mut` pointers are now `*const`.
Elsewhere, the `(nsStaticAtom*)` casts within the `AppendElement()` calls are
necessary to avoid link errors, presumably due to some template instantiation
wrinkle.
--HG--
extra : rebase_source : 629642e708c8bc6e27d6057beae5f35955fdd837
Since some filesystems do not support FileIdInfo, we can't assume that it will
succeed even on Windows 8 or later.
--HG--
extra : source : 00c79940244f7a57d77db186996533cd5589c4ea
Gtk+ sets .left/.right classes to GtkBox element at GtkHeaderBar according to button placement (left/right).
We don't support that now so set .left at least to be compatible with themes - BlueMenta for instance.
Differential Revision: https://phabricator.services.mozilla.com/D6657
--HG--
extra : moz-landing-system : lando
Replace mozilla.widget.use-argb-visuals pref by -moz-gtk-csd-transparent-background media query at browser.css
to draw transparent background. The media query is set by toolkit code and enabled when compatible
window manager is detected.
Differential Revision: https://phabricator.services.mozilla.com/D6658
--HG--
extra : moz-landing-system : lando
On Mojave (or later versions) defaultCenter doesn't get the
accessibilityDisplayShouldReduceMotion changes, we need to use
sharedWorkspace.notificationCenter instead.
Note that the reason why we use defaultCenter originally is that using
sharedWorkspace.notificationCenter to post a notification (for mochitest)
crashed on MacOSX 10.10 (on a try).
Differential Revision: https://phabricator.services.mozilla.com/D6201
--HG--
extra : moz-landing-system : lando