Note: Sorry in advance that this patch is so big. Unfortunately
splitting it up would create lots of redundant changes.
This should be the last big refactoring for the Wayland compositor
backend for now.
Up until now SurfacePoolWayland was a pool of actual `wl_surface`s,
as before bug 1718569 we had no direct access to `wl_buffer`s when
using EGL. However, the way `SurfacePoolCA` manages native surfaces
is closer to what in Wayland terminology would be a buffer pool:
buffers are heavy-weight and expansive to allocate, while
`wl_surface` objects are cheap to recreate.
So instead of having a pool of surfaces, each of them having its
own pool of buffers, make `wl_surface`s part of tiles and make
`SurfacePoolWayland` manage `wl_buffer`s (in the form of SHM- or
DMABuf buffers). This will allow us to share buffers (especially
depth buffers) more efficiently, reducing VRAM usage and allocation
times.
Apart from that it will also simplify our tile management logic.
Most importantly, we'll need to reorder `wl_surface`s less often and
less complex (no `place_below` the parent surface) and can also drop
reattaching subsurfaces to compositors. Especially the former will
likely decrease CPU time in compositors.
Overall this patch makes `NativeLayerWayland` behave more like
`NativeLayerCA` while taking in lessons learned from
`WindowSurfaceWaylandMB`.
Differential Revision: https://phabricator.services.mozilla.com/D119993
We used to set doNotFireFrameUpdates on all the target actors
created from the server, and as a result, we would never populate
the iframe dropdown.
The original concern was that since we can have multiple targets
now (when fission is enabled), different frameUpdate events would
be fired which would cause issues in the iframe dropdown.
But at the moment, we know that the iframe dropdown does not support
Fission (remote frames are not displayed), as the toolbox only listen
for frame-update events emitted from the top-level target.
With this patch, we'll emit frameUpdate event only from top-level targets,
so we don't send unnecessary RDP packet to client.
A test is added that checks multiple scenarios with pages adding and
removing iframes, as well as navigating so we can assert the dropdown
berhaviour with server side targets.
The test is tagged as fail-if on Fission as we're missing remote frames
in the dropdown.
Differential Revision: https://phabricator.services.mozilla.com/D121601
Going through each of the headers in the 304 response and setting it on the
cached response head will cause us to only keep the last instance when
duplicate header names are present.
We should instead use the GetHeader method which properly handles merging the
response.
Differential Revision: https://phabricator.services.mozilla.com/D121527
_save() is only used by _saveImmediately(), which is test only code.
"Save" action in the android platform occurs in FormAutofillPrompter.promptToSaveCreditCard
Differential Revision: https://phabricator.services.mozilla.com/D121658
This is a prerequisite for adding a marker API. There is the same API for C++
as `profiler_can_accept_markers`. This API can both be used as an external API
before adding an expensive payload to the profile marker, and it can be used as
an internal function to check it inside the new `add_marker` API that will be
introduced soon.
Differential Revision: https://phabricator.services.mozilla.com/D121535
_save() is only used by _saveImmediately(), which is test only code.
"Save" action in the android platform occurs in FormAutofillPrompter.promptToSaveCreditCard
Differential Revision: https://phabricator.services.mozilla.com/D121658
Actually, Gecko cannot set caret position that is out of composing range. When
having composition, caret (in other word, IME caret) has to be within composing
string.
But Android's text framework can set caret position (selection) that is out of
composing range. Example, Android can have the following. `"ABCD[]"` is current
text and `[]` is selection and AB is composing string. But Gecko cannot.
So if this situation, we have to remove composing state then set selection from
Android's.
Differential Revision: https://phabricator.services.mozilla.com/D121502
It handles selection indexes really roughly since it does it only when
start index is same or greater then removing index. So, only end index
may be greater than the removing index, and if the start index is 0, it
sets `-1` to selection start.
I don't find any other issues around setting selection indexes. However,
for detecting wrong selection index management, this patch adds
`MOZ_DIAGNOSTIC_ASSERT` to every setter.
Differential Revision: https://phabricator.services.mozilla.com/D121592
I still haven't figured out why this is happening, so since we can make it
non-fatal on release builds, we should, given the crash volume.
I don't want to completely silence the issue in non-release builds, since
something is clearly still wrong.
Differential Revision: https://phabricator.services.mozilla.com/D121686
The new tests in testing/xpcshell/example/ cover the following scenarios:
- Local AND remote xpcshell tests. In contrast, modifications to
selftest.py in bug 1635227 only covered runxpcshelltests.
- `prefs=` inheritance from ancestor manifests as implemented by
https://hg.mozilla.org/mozilla-central/rev/ac51a01611dc
- Per-file `prefs` setters (used in bug 1638099).
- Multiple prefs and comments per `prefs` line.
Differential Revision: https://phabricator.services.mozilla.com/D121632
This code ultimately loads resource:///modules/AttributionCode.jsm which only exists in Firefox. It's now causing test crashes in Thunderbird due to bug 1721627, or it was, but I've temporarily hacked them into working.
Differential Revision: https://phabricator.services.mozilla.com/D121588
This allows the check from bug 1719189 to be used by the WDBA without
duplication, and keeps it close to the rest of the UserChoice logic.
Differential Revision: https://phabricator.services.mozilla.com/D121559
Replaced the old certificate error page icon with the warning triangle. Set the color to monochrome for high contrast. Adjusted the shrinking behavior to move the icon to the top center when the viewport becomes smaller. Removed the old unused certificate error page icon.
Differential Revision: https://phabricator.services.mozilla.com/D121387
The `CompilationStencil::delazifySelfHostedFunction` code erroneously delazified
the outer script before its full set of inner functions. This can result in a
nullptr deref under some conditions. Instead, instantaiate inner functions first
which is also consistent with the normal Stencil instantiation flow.
Differential Revision: https://phabricator.services.mozilla.com/D121637
Let running AudioContext also prevents tab from being suspended by asking/revoking the page awake via the browsing context.
Differential Revision: https://phabricator.services.mozilla.com/D119839
Before we use AudioContext's state as a hack to know the suspend status of window, but now we will prevent AudioContext from being suspended in the following patch.
So we need to add a chrome-only attribute to expose that to the test.
Differential Revision: https://phabricator.services.mozilla.com/D119838
To support more cases, change this value to more general name and use a count instead, if the count is larger than zero, then we would not suspend the page.
In addition, this value now can be set in any processes (but still for the top level only), which is different from before where we would only set the value from the chrome process.
Differential Revision: https://phabricator.services.mozilla.com/D119837