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

31443 Коммитов

Автор SHA1 Сообщение Дата
Gijs Kruitbosch 039b75b9c8 Bug 1823077, r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D173032
2023-03-20 20:55:56 +00:00
Marian-Vasile Laza f078cd0274 Backed out changeset 18595f6364ea (bug 1822521) for wpt failures on popover-focus-child-dialog.html. CLOSED TREE 2023-03-20 21:17:55 +02:00
Stephen A Pohl c5b3821d9f Bug 1819739: Add glean telemetry for startup::is_restored_by_macos. r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D172288
2023-03-20 18:01:39 +00:00
Cathie Chen 1529996e68 Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-20 17:01:11 +00:00
Marian-Vasile Laza a8ccc1f226 Backed out changeset 6dc913a054e9 (bug 1822521) for bc failures on browser_parsable_css.js. CLOSED TREE 2023-03-18 16:06:04 +02:00
Cathie Chen c289513d2f Bug 1822521 - Update UA stylesheet for popover. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D172700
2023-03-18 12:56:18 +00:00
Emilio Cobos Álvarez da7fa43d4a Bug 1809084 - Stop using XUL layout for menu popups. r=desktop-theme-reviewers,dao,dshin
The underlying issue here is an invalidation bug with XUL layout. When a
popup opens, we try to lay it out at full size, then post a reflow
callback to constrain it.

There's an intermediate step there where the popup might remain at full
size, and the constraining operates directly on mRect, which isn't quite
sound and doesn't update the scrollport of descendants.

Make nsMenuPopupFrame inherit from nsBlockFrame instead, doing
potentially two layout passes when constrained.

This fixes the issue at hand, and removes XUL layout from menu popups,
so it's a win-win.

To make reasoning about it a bit easier, factor out a bunch of the XUL
positioning code to be const. The mutation of mRect etc which was going
on otherwise was pretty hard to reason about.

Differential Revision: https://phabricator.services.mozilla.com/D170368
2023-03-16 19:09:14 +00:00
Emilio Cobos Álvarez 6c885e916b Bug 1820405 - Ignore bogus enter-leave by default in lg3d/qtile. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D172656
2023-03-16 14:49:08 +00:00
Emilio Cobos Álvarez 341583af94 Bug 1822315 - Ignore empty env vars in desktop environment detection. r=stransky
At least on my system you can get on an state where XDG_CURRENT_DESKTOP is set
to the empty string (I think this comes from sddm when launching a legacy
WM).

Found this while trying to repro bug 1820542. Unclear if this is enough to fix
the issues in comment 0 but locally it's enough to fix fvwm detection here.

Differential Revision: https://phabricator.services.mozilla.com/D172568
2023-03-16 14:48:39 +00:00
Masayuki Nakano e5f024930b Bug 1820972 - Make `nsBaseDragService::FireDragEventAtSource` update `mSourceNode` if it's disconnected while `HTMLEditor` deletes selection caused by a drag operation r=edgar
The source node is typically a text node, and it may be editable by
`contenteditable` or `designMode`.  In that case, the source node may be removed
during the DnD session even without tricky JS code.  In this case, Blink and
WebKit updates the source node to dispatch `dragend` to the editing host.
This behavior does not conform to the standardized DnD behavior, however,
this is reasonable for editor apps which want to listen to events in editing
host or window/document for footprint and/or performance reason.  Therefore,
we should follow their behavior.

Differential Revision: https://phabricator.services.mozilla.com/D172091
2023-03-16 06:37:18 +00:00
Olivia Hall 41785a703d Bug 1659818 - Android window.print Implemented for Nightly r=emilio,m_kato,geckoview-reviewers
This bug implements and opens window.print() for Android in Nightly.
Adds "GeckoView:DotPrintRequest" and "GeckoView:DotPrintFinish" events.
GeckoView:DotPrintRequest requests a PDF of the current window.print
page for Android to print. GeckoView:DotPrintFinish releases the static
browser clone created by window.print. PDF generation was additionally
adjusted to get the expected canonical browser context when printing
iframes.

Differential Revision: https://phabricator.services.mozilla.com/D171159
2023-03-15 21:23:12 +00:00
Nika Layzell 3b40268cc1 Bug 1818305 - Part 2: Add a streamStatus method to nsIInputStream, r=xpcom-reviewers,necko-reviewers,geckoview-reviewers,valentin,jesup,m_kato,mccr8
This is semantically similar to the existing available() method, however will
not block, and doesn't need to do the work to actually determine the number of
available bytes.

As part of this patch, I also fixed one available() implementation which was
incorrectly throwing NS_BASE_STREAM_WOULD_BLOCK.

Differential Revision: https://phabricator.services.mozilla.com/D170697
2023-03-15 19:52:34 +00:00
serge-sans-paille 144eeecbf1 Bug 1820580 - Make toolkit/mozapps/defaultagent buildable outside of a unified build environment r=andi
Differential Revision: https://phabricator.services.mozilla.com/D171738
2023-03-15 07:30:39 +00:00
Hiroyuki Ikezoe be5af8fe49 Bug 1784772 - Preserve APZEventResult.mHandledResult when we set `eConsumeDoDefault` for the APZEventResult in InputQueue::ReceivePanGestureInput(). r=botond
The `mHandledResult` is set in the ctor of APZEventResult based on an incoming
TargetConfirmationFlags, we shouldn't clobber the original `mHandledResult` when
we set `eConsumeDoDefault` for pan events.

Note that we should probably do the same thing for other
SetStatusAsConsumeDoDefault call sites basically, but for now I'd like to make
this change as mimumum as possible.

Differential Revision: https://phabricator.services.mozilla.com/D172525
2023-03-14 21:01:02 +00:00
Hiroyuki Ikezoe d96b738428 Bug 1784772 - Queue SwipeEventQueue only if we don't know whether the pan event wasn't consumed by APZ. r=botond
If we queue the SwipeEventQueue in the case where the corresponding pan-start
event was consumed by the root content APZC, we wait for a response from the
content. And if the consumed pan-start event scrolled to the edge of the scroll
container and if the new scrolled position has been reached to the content
process before we tell whether the scroll position of the scroll container is
at the edge [1], we report it back to the SwipeTracker as the event should be
an event as a start of swipe navigation gestures. Thus, once after we got a
pan-end event, we trigger a swipe navigation. It results timeouts on a test case
waiting for an APZ:TransformEnd notification which never happens due to the page
navigation.

There's also a similar race condition where a pan-start event was consumed by a
non-root content APZC. But I haven't been able to reproduce the similar case
manually so I just filed bug 1821967 for the race and I am not going to handle
the race here. Note that I haven't been able to reproduce the original race
condition manually either though.

[1] https://searchfox.org/mozilla-central/rev/2f9a79d1c4ae7090cf50d93be86ba9dc2767a733/dom/events/EventStateManager.cpp#3727-3728

Differential Revision: https://phabricator.services.mozilla.com/D172391
2023-03-14 21:01:01 +00:00
Ray Kraesig 68184463ff Bug 1815987 - Rewrite data-read loop in OnDataAvailable r=yjuglaret
The read-loop in OnDataAvailable is needlessly baroque and uses a very
strange dialect of Hungarian notation. Factor out the zero-element case
for simplicity (of explication, if nothing else), and add justificatory
comments as appropriate.

Differential Revision: https://phabricator.services.mozilla.com/D171001
2023-03-14 19:54:26 +00:00
Noemi Erli 51cdfe05ee Backed out 6 changesets (bug 1820168) for causing multiple failures CLOSED TREE
Backed out changeset 03bc416d3399 (bug 1820168)
Backed out changeset 8da35371cbdf (bug 1820168)
Backed out changeset ebde44bcb736 (bug 1820168)
Backed out changeset 7b01e0445133 (bug 1820168)
Backed out changeset b32a9cf041fc (bug 1820168)
Backed out changeset e29e5a3349f4 (bug 1820168)
2023-03-14 19:53:58 +02:00
Markus Stange edb2deabbd Bug 1820168 - Let the system re-set the current cursor when needed. r=mac-reviewers,bradwerth
This renames nsMacCursorManager to MOZDynamicCursor and makes it implement NSCursor.

We also install a cursor rect which covers the entire ChildView and which refers
to the MOZDynamicCursor singleton.

With the help of the cursor rect, the -[NSCursor set] implementation is now called
at the right times.

Here's a profile which contains the stacks under which -[MOZDynamicCursor set]
is now called: https://share.firefox.dev/3yEXLsC

Differential Revision: https://phabricator.services.mozilla.com/D172484
2023-03-14 16:30:05 +00:00
Markus Stange edb89e49ae Bug 1820168 - Remove unused method -[nsCursorManager dispose]. r=mac-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D172483
2023-03-14 16:30:05 +00:00
Markus Stange 16d90191d4 Bug 1820168 - Some nsCursorManager cleanup. Tweak method names and return types, and remove excessive doc comments. r=mac-reviewers,bradwerth
Differential Revision: https://phabricator.services.mozilla.com/D172482
2023-03-14 16:30:04 +00:00
Markus Stange 3b8f615944 Bug 1820168 - Remove unnecessary respondsToSelector checks. These cursors have all been supported on 10.6+. r=mac-reviewers,bradwerth
Depends on D172480

Differential Revision: https://phabricator.services.mozilla.com/D172481
2023-03-14 16:30:04 +00:00
Markus Stange 75417dc7bf Bug 1820168 - Stop using nsMacCursor. r=mac-reviewers,bradwerth
Happy code deletion day!

nsMacCursor was used so that animated cursors could be treated like non-animated cursors.
But we don't have animated cursors anymore! Nothing calls -[nsMacCursor cursorWithFrames:type:].

Depends on D172479

Differential Revision: https://phabricator.services.mozilla.com/D172480
2023-03-14 16:30:04 +00:00
Markus Stange 53398b83dc Bug 1820168 - Remove ObjC exception guards in nsCursorManager methods. r=mac-reviewers,bradwerth
These guards are only needed at the boundary to C++, see https://bugzilla.mozilla.org/show_bug.cgi?id=1693392 .

Differential Revision: https://phabricator.services.mozilla.com/D172479
2023-03-14 16:30:03 +00:00
CanadaHonk 3bbca01da2 Bug 1736914 - Implement prefers-reduced-transparency media query r=geckoview-reviewers,emilio,jonalmeida,ohall
Implemented the prefers-reduced-transparency media query for all
platforms.

Windows and Mac have specific settings which are used, others (Android
and Linux/GTK) have it enabled if prefers-reduced-motion is also enabled
as there is no dedicated setting to check.

Locked behind new pref `layout.css.prefers-reduced-transparency.enabled`,
off by default always for now.

Also added new WPT tests (none previously).

Demo video: https://goose.icu/firefox_prt.mp4
Test page: https://goose.icu/prefers-reduced-transparency

Differential Revision: https://phabricator.services.mozilla.com/D172424
2023-03-13 21:30:17 +00:00
Adam Vandolder ff783c3ecb Bug 1818287 - Disabled form-associated custom elements with delegateFocus should receive focus and keyboard events. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D171416
2023-03-13 18:36:24 +00:00
Brad Werth 49b7d27c66 Bug 1821213: Make CocoaWindow check its maximized state against the screen maximum size. r=mstange
For some reason, the frame passed to windowWillUseStandardFrame:defaultFrame:
is not reliably a frame representing the maximum frame for the window's
screen. This is possibly a bug in Cocoa. To compensate, we return the
frame of the window's screen and rely upon the Cocoa caller to shrink it
enough to fit between the menubar and the dock (which does seem to work).

Differential Revision: https://phabricator.services.mozilla.com/D172167
2023-03-10 16:32:10 +00:00
Hiroyuki Ikezoe 639a2d2d9f Bug 1784772 - Forcibly flush scroll position change. r=botond
The lack of the flush is one of the causes of the test timeouts. Without the
flush, the content in question is not overscrollable, thus a swipe gesture
triggers a navigation back to the previous content rather than overscrolling.

Differential Revision: https://phabricator.services.mozilla.com/D172170
2023-03-10 04:00:07 +00:00
stransky a69939c237 Bug 1802844 [Linux] Disable HW_DECODED_VIDEO_ZERO_COPY on AMD hardware r=aosmond
Depends on D171554

Differential Revision: https://phabricator.services.mozilla.com/D171555
2023-03-09 08:57:42 +00:00
Brad Werth b208a0eb8b Bug 1798360: Once again allow WebRender on Wayland R600 devices with new-enough drivers. r=aosmond
Upstream driver fixes noted in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17822 imply
that the root cause has been fixed. Bug 1673939 has been closed and it's
not clear we should keep these drivers on the blacklist.

Differential Revision: https://phabricator.services.mozilla.com/D169789
2023-03-08 19:47:16 +00:00
Brad Werth 2c3fa7062f Bug 1820699: Make nsCocoaWindow choose a fallback normal size if it can't unmaximize when requested. r=mstange
Without this change, it is possible for a macOS window in maximized state
to be unable to return to normal state via a SetSizeMode call. This means
that a JS call to "window.restore()" has no effect. This patch fixes that
case by detecting the failure and resizing to  a slightly smaller size
that qualifies for the normal state.

This also implements windowWillUseStandardFrame:defaultFrame: in a trivial
way, which seems to be necessary for the window.zoomed property to return
YES only when the window frame fills the screen.

This is very difficult to test intentionally with a window that is
maximized and has forgotten its Cocoa-tracked "user state". But that state
is reached in our test harness and this will get us out of it. It has the
desirable(?) side effect of making the macOS menu bar action Window->Zoom
do something with a window that is already maximized to the screen.

Differential Revision: https://phabricator.services.mozilla.com/D171831
2023-03-08 17:23:02 +00:00
Hiroyuki Ikezoe 6ad0a4c41b Bug 1820761 - Observe "APZ:TransformEnd" directly rather than using function in apz_test_native_event_utils.js. r=botond
Also use a relatively bigger "apz.overscroll.damping" value to avoid the situation
where the overscroll gutter has been already restored when we observe
"APZ:TransformEnd".

Differential Revision: https://phabricator.services.mozilla.com/D171938
2023-03-08 02:10:53 +00:00
Andrew Osmond d91c1383f9 Bug 1820267 - Unship EGL on Linux for older NVIDIA binary drivers. r=gfx-reviewers,lsalzman
After landing bug 1819466, we started seeing a consistent uptick in
crashes on older drivers using WebGL. Given the limited population on
older drivers on nightly, this is a sign we are unable to ship EGL on
these drivers without further investigation.

Differential Revision: https://phabricator.services.mozilla.com/D171915
2023-03-07 23:05:04 +00:00
Sandor Molnar 5cc178c0e7 Backed out changeset 237c814b5bee (bug 1820699) for causing multiple failures in widget/cocoa/nsCocoaWindow. CLOSED TREE 2023-03-07 23:28:03 +02:00
Brad Werth b20523226d Bug 1820699: Make nsCocoaWindow choose a fallback normal size if it can't unmaximize when requested. r=mstange
Without this change, it is possible for a macOS window in maximized state
to be unable to return to normal state via a SetSizeMode call. This means
that a JS call to "window.restore()" has no effect. This patch fixes that
case by detecting the failure and resizing to  a slightly smaller size
that qualifies for the normal state.

This is very difficult to test intentionally with a window that is
maximized and has forgotten its Cocoa-tracked "user state". But that state
is reached in our test harness and this will get us out of it. It has the
desirable(?) side effect of making the macOS menu bar action Window->Zoom
do something with a window that is already maximized to the screen.

Differential Revision: https://phabricator.services.mozilla.com/D171831
2023-03-07 20:41:51 +00:00
Neil Deakin 1ec0930f6b Bug 1819760, don't modify extensions when trying to create a desktop shortcut, r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D171639
2023-03-07 14:01:04 +00:00
Hiroyuki Ikezoe f6eeba9f7b Bug 1816032 - Schedule a timeout to avoid waiting for the browser gesture responce forever. r=botond
The browser mochitest in this change causes a timeout without this fix since
the overscroll gutter gets stuck thus we will never get "APZ:TransformEnd".

Differential Revision: https://phabricator.services.mozilla.com/D171421
2023-03-07 03:36:07 +00:00
Brad Werth ee9a12ee0d Bug 1631735 Part 3: Update test expectations to note macOS transitions are async. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D170841
2023-03-06 19:38:11 +00:00
Brad Werth c01f7ba390 Bug 1631735 Part 1: Make nsCocoaWindow animated transitions asynchronous and atomic. r=mstange
This patch attempts to make nsCocoaWindow transitions (fullscreen,
windowed, minimize, zoom) atomic operations that can't be disrupted by
user action or by programmatic triggers. To accomplish this, it defines a
transition queue which ensures that when a transition is submitted, it is
always run to completion before another transition is started. Native
transitions execute asynchronously, and emulated ones execute
synchronously.

Additionally, this patch adds intermediary transitions to handle
programmatic transitions which aren't allowed by macOS, which include:

1) Attempting to minimize a fullscreen window will first transition to
windowed state.
2) Any transition on a minimized window will first transition to windowed
state.

A later part of this patch stack tests this behavior.

Differential Revision: https://phabricator.services.mozilla.com/D166450
2023-03-06 19:38:10 +00:00
Emilio Cobos Álvarez f66702754b Bug 1820204 - Simplify some wayland vsync code. r=rmader
That code only runs in the parent process by design. And we use
infallible new so there's no need to release-assert that allocation
succeeded.

Differential Revision: https://phabricator.services.mozilla.com/D171579
2023-03-03 20:47:51 +00:00
Andrew Osmond 0e9a5d22fd Bug 1820181 - Update threadsafe GL and DMABUF blocklist to include NVIDIA 530.30.02. r=gfx-reviewers,lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D171567
2023-03-03 15:31:31 +00:00
Sandor Molnar 5df475dc34 Backed out 3 changesets (bug 1631735) for causing assertion failures in xpfe/appshell/AppWindow.cpp
Backed out changeset 1c7dffec620f (bug 1631735)
Backed out changeset 4a7049e0f50d (bug 1631735)
Backed out changeset 0ae84866d35d (bug 1631735)
2023-03-03 04:27:11 +02:00
Andrew Osmond 9e362622bf Bug 1820055 - Block threadsafe GL and DMABUF on NVIDIA binary drivers older than 530.0. r=gfx-reviewers,gw
We are seeing a large uptick in crashes across all channels with the
NVIDIA binary drivers, including 470, 510, 515, 520, and 525. This
crash is tracked in bug 1788573.

Differential Revision: https://phabricator.services.mozilla.com/D171512
2023-03-03 01:25:23 +00:00
Brad Werth db4fef854b Bug 1631735 Part 3: Update test expectations to note macOS transitions are async. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D170841
2023-03-02 22:26:56 +00:00
Brad Werth 35295e5966 Bug 1631735 Part 1: Make nsCocoaWindow animated transitions asynchronous and atomic. r=mstange
This patch attempts to make nsCocoaWindow transitions (fullscreen,
windowed, minimize, zoom) atomic operations that can't be disrupted by
user action or by programmatic triggers. To accomplish this, it defines a
transition queue which ensures that when a transition is submitted, it is
always run to completion before another transition is started. Native
transitions execute asynchronously, and emulated ones execute
synchronously.

Additionally, this patch adds intermediary transitions to handle
programmatic transitions which aren't allowed by macOS, which include:

1) Attempting to minimize a fullscreen window will first transition to
windowed state.
2) Any transition on a minimized window will first transition to windowed
state.

A later part of this patch stack tests this behavior.

Differential Revision: https://phabricator.services.mozilla.com/D166450
2023-03-02 22:26:56 +00:00
Ray Kraesig 35bd8dac49 Bug 772424 - Reenable TestWinDND.cpp r=handyman
TestWinDND.cpp was disabled when libxul became a separate library which
could no longer be used by cppunittests.

Add a few shims to turn it into a gtest instead, and hook it back up.

Differential Revision: https://phabricator.services.mozilla.com/D171280
2023-03-02 19:09:44 +00:00
filips 20d7c9c0d8 Bug 1747722 - Allow changing window class hints using attributes. r=emilio,stransky
This patch adds two new attributes to the window's `html` element, `windowclass` and `windowname`, to allow directly controlling the window's class hints on Xorg/Wayland (`res_class` and `res_name`) from the chrome/JS code. When they are set, values are used as class hints for their window. When they are not set, the current behavior of determining `res_class` and `res_name` (using `gdk_get_program_class` for `res_class` and parsing `windowtype` for `res_name`) is preserved.

Changes in `widget/nsIWidget.h` and `widget/nsBaseWidget.h` are only interface changes so that `setWindowClass` can accept three attributes. Although this patch does not affect Windows, `widget/windows/nsWindow.h` and `widget/windows/nsWindow.cpp` have been updated to comply with the new interface. `xpfe/appshell/AppWindow.cpp` has been updated to get the additional attributes and call `setWindowClass` with them. The main changes are in `widget/gtk/nsWindow.h` and `widget/gtk/nsWindow.cpp`.

Differential Revision: https://phabricator.services.mozilla.com/D169720
2023-03-02 16:22:05 +00:00
Nika Layzell d9c8a6fcbe Bug 1542802 - Part 1: Replace LazyIdleThread with a thin wrapper around nsThreadPool, r=jesup,gstoll
This does not reduce the number of threads we end up using in these
cases, but simplifies the complex implementation substantially by
relying on the idle thread lifetime management logic from nsThreadPool.

The nsISerialEventTarget implementation is maintained by wrapping the
nsThreadPool with a TaskQueue.

As a result of using these more reliable backing implementations, the
type is now also safe to use from any thread, rather than requiring
dispatches to all occur from the creator thread.

Unfortunately, this required some changes to the
UntrustedModulesProcessor, which was relying on the ability to fetch the
PRThread* (and from that the HANDLE) from the lazy thread in order to
perform priority changes on it. This was fixed by using a
nsIThreadPoolListener to watch the thread being created and destroyed,
and manually record a HANDLE to the thread which can be used for these
priority changes.

Differential Revision: https://phabricator.services.mozilla.com/D168017
2023-03-02 15:52:32 +00:00
Iulian Moraru ee40e40786 Backed out changeset 7ecdee3d9f27 (bug 772424) for causing bp-hybrid build bustages on TestWinDND.cpp. CLOSED TREE 2023-03-02 08:33:20 +02:00
Ray Kraesig 774d379b0b Bug 772424 - Reenable TestWinDND.cpp r=handyman
TestWinDND.cpp was disabled when libxul became a separate library which
could no longer be used by cppunittests.

Add a few shims to turn it into a gtest instead, and hook it back up.

Differential Revision: https://phabricator.services.mozilla.com/D171280
2023-03-02 01:19:12 +00:00
Masayuki Nakano dab48fb890 Bug 1797796 - Make `eSetSelection` event not handled if `Selection` is set to same offset and length r=m_kato
`ContentEventHandler` may not replace open/close tags of inline elements and
close tags of block elements with a line break etc.  Therefore, one offset may
mean multiple points in the DOM tree.  From the DOM tree point of view, every
DOM point may have different meaning and styles.  Therefore, if IME sets
`Selection` to current range, we should not update `Selection` with the log of
`ContentEventHandler`.  Otherwise, new content will appear at different position
in the DOM tree and it may cause different style text, etc.

`IMEContentObserver` has cache of `Selection` while an editor has focus.
Therefore, for avoiding the query cost of `Selection` for each `eSetSelection`
event, `ContentEventHandler` should be used in `IMEContentObserver` instead if
an instance is available.  Therefore, this patch makes `TextComposition`
delegate the handling to `IMEContentObserver` and check `Selection` range only
when `IMEContentObserver` is available.  Note that `eSetSelection` is probably
used only when editable element has focus.  Therefore, it must be fine to skip
selection range check in the other cases.

Differential Revision: https://phabricator.services.mozilla.com/D171179
2023-03-01 05:57:32 +00:00
Makoto Kato 051c921a72 Bug 1813573 - Part 2. Restart vsync when refresh rate is changed. r=geckoview-reviewers,owlish
When refresh rate is changed, `DisplayListener` is called. So we restart vsync
when refresh rate may be changed.

Differential Revision: https://phabricator.services.mozilla.com/D168666
2023-03-01 03:12:32 +00:00
Makoto Kato 9aca857df0 Bug 1813573 - Part 1. Clean up AndroidVsyncSource to get current refresh rate when enabling vsync. r=geckoview-reviewers,owlish
Newer Android supports multiple refresh rate that is dynamically changed.
Actually, GeckoView will always pass the refresh rate value to vsync when
getting it first time.

So this fix changes that GeckoView gets the refresh rate when vsync is started.

Differential Revision: https://phabricator.services.mozilla.com/D168665
2023-03-01 03:12:31 +00:00
Brad Werth eccc3d51b1 Bug 1768495 Part 3: Remove redundant pause-on-minimize in nsCocoaWindow, remove pref. r=gfx-reviewers,ahale
Differential Revision: https://phabricator.services.mozilla.com/D169346
2023-02-28 23:16:57 +00:00
Brad Werth ce9e905fc3 Bug 1768495 Part 1: Add a method nsIWidget::PauseOrResumeCompositor, and override it in nsCocoaWindow. r=gfx-reviewers,emilio,ahale
This change does not affect behavior, it's just prepatory for a later
caller to the newly-defined method.

Differential Revision: https://phabricator.services.mozilla.com/D169344
2023-02-28 23:16:56 +00:00
Andrew Osmond bf1c2d1d90 Bug 1819466 - Ship X11 EGL to NVIDIA 340.108+ users on Linux to early beta and nightly. r=gfx-reviewers,lsalzman
As part of our goal to reduce GLX usage, and our exposure to its known
threading issues, let's try to ship EGL on X11 for NVIDIA binary driver
users with version 340.108 and higher. This lowers the requirement from
470.82 and higher.

Note that this does not impact shipping WebRender support to these
users. We keep the requirement for hardware acceleration at 470.82 and
higher. Thus this should predominantly impact WebGL.

Differential Revision: https://phabricator.services.mozilla.com/D171278
2023-02-28 22:51:07 +00:00
Lee Salzman 8b49232f3b Bug 1819133 - Don't error on unrecognized blocklist features. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D171272
2023-02-28 22:02:32 +00:00
Emilio Cobos Álvarez 18cac670c1 Bug 1794577 - Enable aspect-ratio locking on KDE too. r=stransky
Seems to work nicely.

Differential Revision: https://phabricator.services.mozilla.com/D171077
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez 799cf59ddb Bug 1794577 - Set dummy titlebar for always-undecorated windows. r=stransky
This prevents the system titlebar from showing up in Plasma+Wayland.

Differential Revision: https://phabricator.services.mozilla.com/D171076
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez 0989a7f163 Bug 1794577 - Clear decorations from PiP window earlier during creation. r=stransky
What is going on here is a bad interaction between the
aspect-ratio-locking that PiP uses and CSD.

The Wayland window starts off with CSD decorations. That adds some
margin to our windows. When we un-decorate the window then eventually
GDK removes those margins, which means that we end up with a different
size, due to the aspect ratio.

PiP is special enough that is probably ok to just do this.

Differential Revision: https://phabricator.services.mozilla.com/D171075
2023-02-28 14:20:39 +00:00
Emilio Cobos Álvarez c548fc1e68 Bug 1794577 - Minor clean-up to CSD code. r=stransky
No behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D171074
2023-02-28 14:20:38 +00:00
Emilio Cobos Álvarez 35d0536284 Bug 1819034 - Reset LookAndFeel only if color scheme is really changed r=stransky
We get sometimes two color-scheme changes on GNOME + Wayland at least,
which do unnecessary work. Avoiding that extra work is rather
straight-forward.

This is a slightly simpler approach than D171065.

Differential Revision: https://phabricator.services.mozilla.com/D171081
2023-02-28 14:08:37 +00:00
Andrew Osmond 14eac2383e Bug 1818992 - Ship X11 EGL on Mesa 17+ to match WebRender. r=webdriver-reviewers,gfx-reviewers,whimboo,lsalzman
When we initially shipped X11 EGL on Mesa 21+, it was chosen
specifically to avoid CI issues. These appear to have mostly been
resolved with minimal annotations required to enable EGL on release.
This will allow the majority of Linux Mesa users to switch away from
GLX.

With this patch, we will match shipping X11 EGL on where we chose to
ship WebRender. Specifically that is Mesa 17+ in general, and 18.2+ for
Nouveau.

Differential Revision: https://phabricator.services.mozilla.com/D171089
2023-02-27 21:33:24 +00:00
Fred Chasen 42c8df00ac Bug 1793220 - Use at-page size rule as paper size when printing to PDF r=dholbert,AlaskanEmily
Adds a usePageRuleSizeAsPaperSize setting to allow overriding the default paper size when printing to a PDF file.

Print preview now checks for at-page size rules and when enabled will use that size for the previewed sheet of paper.

The preview will also return the page width and height (in inches) during its callback for the frontend to use to override the default paper settings.

Differential Revision: https://phabricator.services.mozilla.com/D160303
2023-02-27 20:22:18 +00:00
Molly Howell 4cf1876637 Bug 1817768 - Filter out illegal file extensions. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D170531
2023-02-27 18:01:10 +00:00
Emilio Cobos Álvarez 22b93499fa Bug 1818811 - Make -moz-box-layout: flex default, and clean-up CSS. r=Gijs,extension-reviewers,settings-reviewers,desktop-theme-reviewers,dao
Now it's on by default everywhere, so all this is not needed. No behavior
change effectively since the xul.css bits being removed effectively achieve the
same.

Differential Revision: https://phabricator.services.mozilla.com/D170944
2023-02-27 12:41:13 +00:00
stransky 186789dac5 Bug 1809026 [Linux] Reference DMABufSurface when it's created/imported r=emilio
Recently we add DMABufSurface reference when DMABufSurface is exported over IPC bridge by Serialize().
That no longer works as Serialize() may be called more times due to WebGL integration.

In this patch remove ref add in Serialize() (GlobalRefCountExport) and add global ref when it's
created/imported by IPC bridge.

That better matches DMABufSurface cycle in compositor as DMABufSurface is referenced on create and undef when it's deleted on compositor side.

Also add logging to ref/unref and print warning if surface ref count is already zero (we're trying to unref already 'unused' surface).

Differential Revision: https://phabricator.services.mozilla.com/D170624
2023-02-27 11:20:33 +00:00
Csoregi Natalia 43261efa2b Backed out 2 changesets (bug 1777849) for causing webgl crashes. CLOSED TREE
Backed out changeset af3c076c00d6 (bug 1777849)
Backed out changeset 536f32f1cf47 (bug 1777849)
2023-02-25 15:29:32 +02:00
Lee Salzman 0621e7027b Bug 1777849 - Disable FEATURE_THREADSAFE_GL on libX11 < 1.7. r=gfx-reviewers,ahale
LibX11 versions prior to 1.7 have a race condition that made it unsafe to use
in multiple threads. Since Firefox 104, we created a CanvasRender thread that
is used to service WebGL commands off the Renderer thread so that WebGL does
not block WebRender. If WebGL uses GLX, this can lead us to using GLX on the
two different threads. In combination with an unsafe version of libX11, this
can lead to severe instability.

We already have a FEATURE_THREADSAFE_GL in place to denote this, which was
currently used mainly for Nouveau which is also unsafe to use on multiple
threads. If this feature fails, the CanvasRender thread is not used, and
all WebGL commands go back to being on the Renderer thread as normal, avoiding
the problem.

Thus, this detects the presence of libX11 version 1.7 or greater, and if not
found, we disable FEATURE_THREADSAFE_GL to disable the CanvasRender thread.

Differential Revision: https://phabricator.services.mozilla.com/D170992
2023-02-25 07:27:31 +00:00
Florian Quèze 3540a4910c Bug 834343 - [Windows] reset the idle time of the user idle service for mouse move events only if the mouse moved by at least 1 pixel, r=cmartin.
Differential Revision: https://phabricator.services.mozilla.com/D170904
2023-02-24 15:24:13 +00:00
Jonathan Kew aeec9224a6 Bug 688085 - Remove IDL method nsIFontEnumerator::UpdateFontList; just call gfxPlatform directly from widget/windows code where needed. r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D170328
2023-02-23 21:45:12 +00:00
Emilio Cobos Álvarez 9a87a13d7c Bug 1818500 - Try to re-enable test_picker_no_crash.html. r=rkraesig
This seems to consistently leak an nsFilePickerProxy, at least on Linux,
tho...

Differential Revision: https://phabricator.services.mozilla.com/D170758
2023-02-23 20:02:35 +00:00
Kelsey Gilbert b8188c30a3 Bug 1807403 - Blocklist WebGPU on all macOS. r=gfx-reviewers,aosmond
WGPU doesn't have bounds checks on Metal yet, so WebGPU is too unsafe to
expose by default for now.

Differential Revision: https://phabricator.services.mozilla.com/D170702
2023-02-23 19:07:50 +00:00
Cristina Horotan cdf1b4667d Merge mozilla-central to autoland a=merge on a CLOSED TREE 2023-02-23 19:25:58 +02:00
Emilio Cobos Álvarez ddfb394572 Bug 1818500 - Fix serialization of nsIFilePicker::Mode. r=ipc-reviewers,mccr8 a=RyanVM
modeOpenMultiple is the last variant, this reproduces clicking on:

  data:text/html,<input type=file multiple>

Differential Revision: https://phabricator.services.mozilla.com/D170756
2023-02-23 14:33:57 +00:00
stransky c0e0c3d0ea Bug 1813407 [Linux] Remove unused nsWindow::GetMozContainerSize() r=emilio
Depends on D169907

Differential Revision: https://phabricator.services.mozilla.com/D169908
2023-02-23 10:52:15 +00:00
stransky ba4ca0b344 Bug 1813407 [Linux] Get window size from compositor widget if possible in WindowSurfaceWaylandMultiBuffer backend r=emilio
- We want to get window size from compositor widget as it matches window size used by parent RenderCompositorSWGL rendrer.
- For main thread rendering mCompositorWidget is not available so get window size directly from nsWindow.

Depends on D169906

Differential Revision: https://phabricator.services.mozilla.com/D169907
2023-02-23 10:52:15 +00:00
stransky e86924571a Bug 1813407 [Linux] Allow to initialize WindowSurfaceProvider with GtkCompositorWidget for OMTC rendering r=emilio
Depends on D169905

Differential Revision: https://phabricator.services.mozilla.com/D169906
2023-02-23 10:52:14 +00:00
Ray Kraesig 771bdc853e Bug 1816740 [6/6] - remove ManualDealloc from ColorPicker and FilePicker r=ipc-reviewers,nika
The existing manual-deallocation code isn't actually doing anything
interesting. Strip it out.

(No functional changes.)

Differential Revision: https://phabricator.services.mozilla.com/D169855
2023-02-22 21:05:25 +00:00
Ray Kraesig 7b51dc72b7 Bug 1816740 [5/6] - convert nsIFilePicker::capture* to a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various capture* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Additionally, unlike the previous two enums, reduce the size of
CaptureTarget to 8 bits. This is a workaround for its use with
nsAttrValue, which at present very specifically requires that parseable
enums' values fit within an `int16_t` -- and a `uint16_t` does not.

Differential Revision: https://phabricator.services.mozilla.com/D169854
2023-02-22 21:05:24 +00:00
Ray Kraesig fa4832237d Bug 1816740 [4/6] - convert nsIFilePicker::mode* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various mode* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D169853
2023-02-22 21:05:24 +00:00
Ray Kraesig 8ff42fa236 Bug 1816740 [3/6] - convert nsIFilePicker::result* into a proper enum r=ipc-reviewers,karlt,mstange,handyman,nika
Convert the various result* constants in nsIFilePicker into a proper
enum, and perform validation when passing it across IPC.

Differential Revision: https://phabricator.services.mozilla.com/D169852
2023-02-22 21:05:23 +00:00
Emilio Cobos Álvarez 1afc31ccf4 Bug 1817634 - Remove "show keyboard cues" handling. r=cmartin
Other browsers don't do this, and it might confuse users, see e.g., [1]
and bug 1813684.

Before Firefox 110, we didn't do it consistently, but I fixed that in
bug 1807687. See comments in the patch for context, [2] in particular:

> The code being removed here is intended to implement the Windows
> setting 'Underline access keys' in the Keyboard Accessibility
> control panel, which somewhat confusingly also controls whether
> focus rings appear by default when clicking on controls. The former
> part -- the showing and hiding of the underlines based on the
> setting -- was never yet implemented, this is bug 25894. The focus
> rings part was implemented.

Given:

 * This setting is confusing.
 * Modern windows apps and other browsers don't follow it.
 * We already provide other means of achieving the same behavior
   (browser.display.show_focus_rings=true).

It seems better to remove. I asked Neil in bug 1813684 in case he felt
more strongly about this, and didn't hear back.

[1]: https://www.reddit.com/r/firefox/comments/116n3kp/why_is_firefox_110_now_putting_a_blue_box_around/
[2]: https://phabricator.services.mozilla.com/D165578#5448547

Differential Revision: https://phabricator.services.mozilla.com/D170395
2023-02-22 14:25:38 +00:00
Masayuki Nakano 0dfc1d00f9 Bug 1810406 - Handle asynchronous composition without synthesized `GDK_KEY_PRESS` event r=m_kato
IME for ibus may send composition after filtering `GDK_KEY_PRESS` event
asynchronously.  In that case, IME or ibus usually synthesize `GDK_KEY_PRESS`
again for letting the application know what's being handled.  However, according
to the bug report, IME may send composition without synthesizing the
`GDK_KEY_PRESS` event.

Without this patch, `IMContextWrapper` dispatches only
`eContentCommandInsertText` event.  Then, it'll cause only a set of
`beforeinput` and `input` events.  Therefore, web apps may fail to do something
if they listen only composition and keyboard events only in Gecko.  For avoiding
Gecko only failure in this case, we should make `IMContentWrapper` handle the
composition with `GDK_KEY_PRESS` event in the queue which it has not handled
yet.  Then, web apps can work with `keydown` events whose `key` is `"Process"`.

Differential Revision: https://phabricator.services.mozilla.com/D170031
2023-02-21 22:51:43 +00:00
Stanca Serban 200dca5cfb Backed out 4 changesets (bug 1813407) for causing Linux bp-hybrid bustages in WindowSurfaceProvider.h. CLOSED TREE
Backed out changeset 897b95c7fdad (bug 1813407)
Backed out changeset aba3e370a587 (bug 1813407)
Backed out changeset 61c79624c2ab (bug 1813407)
Backed out changeset f99d85efb04c (bug 1813407)
2023-02-21 12:54:32 +02:00
stransky b2f02e0367 Bug 1813407 [Linux] Remove unused nsWindow::GetMozContainerSize() r=emilio
Depends on D169907

Differential Revision: https://phabricator.services.mozilla.com/D169908
2023-02-21 09:30:12 +00:00
stransky d170405210 Bug 1813407 [Linux] Get window size from compositor widget if possible in WindowSurfaceWaylandMultiBuffer backend r=emilio
- We want to get window size from compositor widget as it matches window size used by parent RenderCompositorSWGL rendrer.
- For main thread rendering mCompositorWidget is not available so get window size directly from nsWindow.

Depends on D169906

Differential Revision: https://phabricator.services.mozilla.com/D169907
2023-02-21 09:30:11 +00:00
stransky 1b56bde4d2 Bug 1813407 [Linux] Allow to initialize WindowSurfaceProvider with GtkCompositorWidget for OMTC rendering r=emilio
Depends on D169905

Differential Revision: https://phabricator.services.mozilla.com/D169906
2023-02-21 09:30:10 +00:00
Jonathan Kew 4594ae314a Bug 1815404 - Replace most uses of gfxContext::CreateOrNull with stack-allocated contexts. r=gfx-reviewers,lsalzman
Depends on D170370

Differential Revision: https://phabricator.services.mozilla.com/D170371
2023-02-21 07:28:25 +00:00
Jonathan Kew 5b9588f1aa Bug 1815404 - Eliminate gfxContext::CreatePreservingTransformOrNull, and replace callers with stack-allocated gfxContext. r=gfx-reviewers,lsalzman
Depends on D170369

Differential Revision: https://phabricator.services.mozilla.com/D170370
2023-02-21 07:28:24 +00:00
Jonathan Kew 1b3e69f8aa Bug 1815404 - Remove refcounting from gfxContext. r=gfx-reviewers,lsalzman
Depends on D170367

Differential Revision: https://phabricator.services.mozilla.com/D170369
2023-02-21 07:28:24 +00:00
Emilio Cobos Álvarez c096b29240 Bug 1817396 - Try to draw the native GTK tooltip a bit harder. r=stransky
If we know that the light and dark foreground colors are the same we can
probably get away with it.

Differential Revision: https://phabricator.services.mozilla.com/D170247
2023-02-20 16:18:26 +00:00
stransky bfffdac75d Bug 1811637 [Linux] Detach accessible from moz_container before it's deleted r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D169197
2023-02-20 12:29:05 +00:00
Emilio Cobos Álvarez 9906d6868c Bug 1817451 - Make auto-style outline always non-native. r=cmartin,stransky,mac-reviewers,bradwerth
The datetime picker uses `outline-style: auto` (no other piece of chrome
UI does yet, afaict), and it looks real bad on Linux because
outline-style: auto is broken.

It's also slow, since we don't support webrender for it.

On Windows it's a 1px black outline, which is also terrible and can be
achieved in other ways.

On macOS the outline looks nice, but it seems better to make it
consistent across platforms, which allows the front-end to use it (I
don't think there's a use for the non-native outline).

Differential Revision: https://phabricator.services.mozilla.com/D170222
2023-02-20 11:58:38 +00:00
Andreas Pehrson 24035fdfb6 Bug 1816139 - In HeadlessWidget don't by default focus alwaysontop windows. r=karlt
webrtcIndicator is an alwaysontop window of type Dialog or TopLevel, but should
not receive focus by default.

Differential Revision: https://phabricator.services.mozilla.com/D169788
2023-02-20 08:05:08 +00:00
Andreas Pehrson dea5671716 Bug 1816139 - In HeadlessWidget for default focus, check WindowType::TopLevel instead of mTopLevel. r=karlt
webrtcLegacyIndicator is a parentless window of type Popup, but should not
receive focus by default.

Differential Revision: https://phabricator.services.mozilla.com/D169787
2023-02-20 08:05:08 +00:00
Emilio Cobos Álvarez 49f269b507 Bug 1812868 - Tweak scrollbar scaling set-up. r=mstange
This is to make GetDPIRatioForScrollbarPart thread-safe for stylo usage.

This was using the widget for bug 1727289, but just looking at the print
preview scale is enough to fix that.

Reviewed in: https://phabricator.services.mozilla.com/D168148
2023-02-20 00:01:12 +01:00
Sandor Molnar 0e3779abe6 Merge autoland to mozilla-central. a=merge 2023-02-18 11:01:10 +02:00
Sandor Molnar 2bc700c04b Backed out 2 changesets (bug 1812868) for causing bug 1817539. CLOSED TREE
Backed out changeset 07c689de250c (bug 1812868)
Backed out changeset e7d370501c50 (bug 1812868)
2023-02-18 09:34:04 +02:00
Emilio Cobos Álvarez f6bc72679b Bug 1817071 - Remove unused image-region support from cocoa code. r=mstange,mac-reviewers
Nobody sets -moz-image-region on macOS anyways, remove the dead code.

Differential Revision: https://phabricator.services.mozilla.com/D170008
2023-02-18 01:16:28 +00:00
Emilio Cobos Álvarez ad4bd6a3ba Bug 1812868 - Expose scrollbar-inline-size as a CSS variable to chrome code. r=mstange
For that we need to:

 * Make GetDPIRatioForScrollbarPart thread-safe: This was using the
   widget for bug 1727289, but just looking at the print preview scale
   is enough to fix that.

 * Make nsPresContext::UseOverlayScrollbars() thread-safe: We store the
   RDM pane stuff in the pres context.

The rest is pretty straight-forward.

Differential Revision: https://phabricator.services.mozilla.com/D168148
2023-02-17 21:15:06 +00:00