Downloadable blocklist entries did not have an explicit way to declare a
rule to affect all features prior to this patch. Instead they would
leave the "feature" attribute unset, which defaults us to
GfxDriverInfo::allFeatures. Now if it is unset, it defaults to
GfxDriverInfo::optionalFeatures. There are also explicit wildcard
feature strings, ALL and OPTIONAL respectively.
Differential Revision: https://phabricator.services.mozilla.com/D198193
In the patches above, we make some tooltips (which ignore mouse events)
actually overlap the mouse. That should be fine (and is fine on other
platforms) but Cocoa still sends mouseenter/leave events which confuse
the front-end.
This fixes that.
Differential Revision: https://phabricator.services.mozilla.com/D197905
Instead of NSColor.textColor, use NSColor.controlTextColor, which is the color observed in native controls.
When these values were originally selected in bug 517412, the system colors were the same, but they have since diverged.
Differential Revision: https://phabricator.services.mozilla.com/D197125
As much as I like the "all-static uninstantiable struct" projection of
Rust-style modules, they're an unnecessary weirdness in C++.
Shuffle the code around to just use a collection of nested namespaces.
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D197627
Add a new Glean event for the out-of-process file-dialog, marking when
it breaks and forces us to fall back to the existing in-process
behavior.
This creates a new nested pseudo-namespace struct, which is just weird
enough that it probably needs to be replaced with a true namespace. That
will be done in the next commit.
Differential Revision: https://phabricator.services.mozilla.com/D197626
As much as I like the "all-static uninstantiable struct" projection of
Rust-style modules, they're an unnecessary weirdness in C++.
Shuffle the code around to just use a collection of nested namespaces.
No functional changes.
Differential Revision: https://phabricator.services.mozilla.com/D197627
Add a new Glean event for the out-of-process file-dialog, marking when
it breaks and forces us to fall back to the existing in-process
behavior.
This creates a new nested pseudo-namespace struct, which is just weird
enough that it probably needs to be replaced with a true namespace. That
will be done in the next commit.
Differential Revision: https://phabricator.services.mozilla.com/D197626
Before bug 1869796 they had an utility type hint, now they have a
toplevel type hint, after the patch they have a notification type hint,
which seems more appropriate.
Differential Revision: https://phabricator.services.mozilla.com/D197872
This patch makes it so that we avoid blocking all features with the
blocklist, and instead continue to allow the safe subset proscribed by
GfxInfoBase::OnlyAllowFeatureOnKnownConfig. Any feature allowed in an
unknown configuration should be allowed in a blanket blocklist entry,
unless we know for a fact that we need to also block them.
Differential Revision: https://phabricator.services.mozilla.com/D197963
No other platform does this. This comes from bug 413277, but positioning
windows (in particular popups) partially offscreen is desirable in some
cases (e.g., when drawing non-native shadows).
We have protections in place to prevent content from doing things like
what caused this code to be added.
Remove a cocoa-specific test for this, and tweak another test which has
a dependent window opened from an offscreen window, and the offscreen
window positioning happens right after the load event.
The window ends up on screen even without that tweak.
Differential Revision: https://phabricator.services.mozilla.com/D197903
No other platform does this. This comes from bug 413277, but positioning
windows (in particular popups) partially offscreen is desirable in some
cases (e.g., when drawing non-native shadows).
We have protections in place to prevent content from doing things like
what caused this code to be added.
Differential Revision: https://phabricator.services.mozilla.com/D197903
This seems like the right time to call DestroyNativeWindow since we are
hiding the window and destorying the nsBaseWidget -- there's not much
else that can happen to this window. Making this call here ensures that
the native window is not maintained on the screen waiting for the
destructor to be called during garbage collection.
Differential Revision: https://phabricator.services.mozilla.com/D197214
Some features such as the GPU process (except on Android), backdrop
filter (because it always works with Software WebRender), ANGLE (because
it is generally good) and out of process WebGL (we generally want to
remote WebGL for sandboxing purposes) are special, and should not be
disabled simply because we are uncertain about our configuration. In
these situations, disable most features, but keep these enabled by
default.
Differential Revision: https://phabricator.services.mozilla.com/D197595
Before the first part of bug 1872399, that would use
WindowShadow::Default, which didn't create a vibrant effect etc, which
causes the background here.
Make it more explicit by calling this "Panel". The second part of
bug 1872399 already did this.
Differential Revision: https://phabricator.services.mozilla.com/D197648
Some features such as the GPU process (except on Android), backdrop
filter (because it always works with Software WebRender), ANGLE (because
it is generally good) and out of process WebGL (we generally want to
remote WebGL for sandboxing purposes) are special, and should not be
disabled simply because we are uncertain about our configuration. In
these situations, disable most features, but keep these enabled by
default.
Differential Revision: https://phabricator.services.mozilla.com/D197595
adwaita-icon-theme, GNOME's and GTK's default icon theme dropped
legacy X cursors recently [1] which is expected to be released with
GNOME 46. When running firefox now some of the cursors are unable to be
created and end up blank with a handful of gtk warnings.
The reason for this, is due to Firefox using the old GdkCursorType
api which doesn't guarantee the cursors requested will exist.
This is mostly legacy code from the gtk2 backend.
gdk_cursor_new_from_name (from gtk3 and onwards) can create all
the cursors firefox wants (and it's also using the same CSS3/4
conventions that firefox does intenrally).
GdkCursorType has also been dropped in GTK 4 and this patch should
help with porting the code too.
[1] https://gitlab.gnome.org/GNOME/adwaita-icon-theme/-/merge_requests/61
Differential Revision: https://phabricator.services.mozilla.com/D197272
The root cause of issue is that the link elements have not yet adopted the
activation behavior defined in the specification. This patch add a hacky way to
avoid link elements perform activation behavior if it has a child input element
which will perform activation behavior. This patch introduces new flags instead of
reusing the exiting ones, allowing us to uplift this patch more safely.
Differential Revision: https://phabricator.services.mozilla.com/D197393
The InsertText* code paths required an NSAttributedString instance but
only ever used their NSString representation. Callers nearly always have
an NSString, so this results in a lot of unnecessary NSAttributedString
allocations to satisfy this interface.
The primary caller is [ChildView insertText:replacementRange:], which
can receive either an NSString or an NSAttributedString string from the
NSTextInputClient protocol, but this is usually (always?) an NSString in
practice.
We can instead change these methods to receive NSString, simplifying the
callers and removing a bunch of short-lived NSAttributedString objects.
Differential Revision: https://phabricator.services.mozilla.com/D197451
After bug 1696988, the non-native theme can draw tooltips on macOS in some scenarios such as about:preferences. The non-native theme draws a rounded rectangle with a border that is the same color as the text, which looks pretty out-of-place on macOS--tooltips on macOS do not have rounded corners, and the border is subtle compared to the text color.
However, after bug 1871507, the window server is drawing both the correct background and border for the tooltip already. The non-native theme no longer needs to draw any background or border for tooltips on macOS.
Differential Revision: https://phabricator.services.mozilla.com/D197299
-moz-window-shadow is a chrome-only property (not exposed to the web),
and chrome stylesheets only use the none value to disable the default
behavior.
Split the style property (default/none) from the actual widget behavior.
This is useful because I want to add a distinction between
natively-styled menupopups and other panels in the following commit.
While at it rename default to "auto" which is a more common name in CSS
for something like this.
We have no use case for removing the shadow of a top-level window, so
remove it to simplify the code.
Differential Revision: https://phabricator.services.mozilla.com/D197454
The macOS menupopup corner radius was recently changed from 4px to 8px, but that does not quite match the system, which measures at 6px.
Differential Revision: https://phabricator.services.mozilla.com/D197408
This prevents a failed debug assertion in the image decoder due to color management attempting to initialize off the main thread. This is only an issue for debug builds, release builds instead return an error in color management initialization and otherwise continue on to decode the image correctly.
Differential Revision: https://phabricator.services.mozilla.com/D197028
When `nsIWindowsAlertNotification`'s `handleActions` property is set to true, actions are sent in the notification observer's `aData` field instead of the notification cookie.
Differential Revision: https://phabricator.services.mozilla.com/D196613
Native tooltips, menus, and other opaque windows on macOS receive a border from the window server, which greatly improves their appearance with dark mode. Borderless windows, such as popups, do not receive this treatment by default. However, we have been receiving this treatment for non-native menupopups by setting an effect view wrapper as the window's content view. Extending this logic to also support tooltips allows the window server to provide the appropriate border for them as well.
macOS also provides some additional padding to native tooltips, so I have updated this as well.
Differential Revision: https://phabricator.services.mozilla.com/D197122
Instead of NSColor.textColor, use NSColor.controlTextColor, which is the color observed in native controls.
When these values were originally selected in bug 517412, the system colors were the same, but they have since diverged.
Differential Revision: https://phabricator.services.mozilla.com/D197125
Lift `aIid` to compile-time, as a template parameter `InterfaceT`. This
simplifies the common case for using `Resolve()`, where the desired and
supplied interfaces are the same. (For the as-yet-unattested case where
they're not, retain the old functionality by means of a small family of
`ResolveAs()` functions.)
Additionally, to eliminate a swath of custom logic and magic-number
choices surrounding `mHResult`, eliminate `mHResult` itself as well.
Instead, since its value was derived from the creation of the underlying
`IAgileReference`, any callers that might care can acquire it as an
additional return value from a named-constructor function.
These collectively trim `AgileReference`'s footprint down to a single
`RefPtr`, with all its special member functions having only default
implementations.
Differential Revision: https://phabricator.services.mozilla.com/D196513
The documentation for AgileReference previously suggested instantiating
it within a UniquePtr. However, this isn't necessary or helpful in most
contexts.
Streamline the one place where this was done.
Differential Revision: https://phabricator.services.mozilla.com/D196366
Remove all of the code in `RefPtr` and `AgileReference` that allowed
for implicitly converting between the two in via constructors or the
assignment operator.
Replace these with a slightly-less-convenient-but-substantially-more-
explicit `Resolve` function family.
(This also eliminates the dependency that `class RefPtr` had on
`class AgileReference`.)
Differential Revision: https://phabricator.services.mozilla.com/D196365