Plan to improve Wayland support in Firefox

Martin Stransky, Firefox package maintainer on Fedora and RHEL, who has been porting Firefox to Wayland, has published a report reviewing the latest developments in how Firefox works in Wayland protocol-based environments.

We plan to address issues with the clipboard and popup handling seen in Wayland builds in upcoming releases of Firefox. These features could not be immediately implemented due to differences in the approach to their implementation in X11 and Wayland. In the first case, the difficulties arose due to the Wayland clipboard running in asynchronous mode, which required the creation of a separate layer to abstract access to the Wayland clipboard. This layer will be added to Firefox 93 and enabled by default in Firefox 94.

As for popup dialogs, the main difficulty was that Wayland requires a strict hierarchy of popups, i.e. the parent window can create a child window with a popup, but the next popup initiated from that window must chain to the original child window. In Firefox, each window could spawn multiple non-hierarchical popups. The problem was that when using Wayland, closing one of the popups requires rebuilding the entire chain of windows with other popups, while having several open popups is not uncommon, since popups implement menus, popups tooltips, add-on dialogs, permission requests, etc. The situation was also complicated by flaws in Wayland and GTK, due to which making small changes could lead to various regressions. However, Wayland's pop-up handling code has been tweaked and is planned to be included in Firefox 94.

Other Wayland-related improvements mention the addition of changes in Firefox 93 related to scaling on screens with different DPI, which eliminated flickering when moving a window to the edge of the screen in multi-monitor configurations. In Firefox 95, we plan to address issues that arise when using the drag&drop interface, such as copying files from external sources to local file systems and moving tabs.

With the release of Firefox 96, the Wayland port of Firefox is expected to achieve overall feature parity with the X11 build, at least when running in Fedora's GNOME environment. After that, the attention of developers will be switched to honing work in the Wayland environments of the GPU process, which contains the code for interacting with graphics adapters and which protects the main browser process from crashing in case of driver failures. It is also planned to move the code for video decoding using VAAPI to the GPU process, which is currently running in content processing processes.

Additionally, we can note the inclusion for a small percentage of users of the stable branches of Firefox, the mode of strict isolation of sites, which was developed as part of the Fission project. In contrast to the previously used arbitrary distribution of tab processing across the available process pool (8 by default), the isolation line mode moves the processing of each site into its own separate process, divided not by tabs, but by domains (Public Suffix), which allows you to further isolate content of external scripts and iframes. The activation of Fission mode is controlled through the "fission.autostart=true" variable in about:config or on the about:preferences#experimental page.

The strict isolation mode helps protect against side-channel attacks, such as those associated with Specter class vulnerabilities, and also reduces memory fragmentation, returns memory to the operating system more efficiently, minimizes the impact of garbage collection and intensive computation on pages in other processes, and increases the efficiency of load balancing on different CPU cores and improves stability (the crash of the process processing the iframe will not pull the main site and other tabs).

Known issues with lockdown include a noticeable increase in memory and file descriptor consumption when a large number of tabs are open, as well as broken add-ons, iframe content disappearing when printing and calling the screenshot capture function, caching of iframe documents becomes less efficient, loss of the contents of completed but not submitted forms when the session is restored after a crash.

Other changes in Firefox include the completion of a migration to the Fluent localization system, an improvement in High Contrast Mode, the addition of a one-click recording of process performance profiles to about:processes, and the removal of the setting to revert to the old new tab page style that used to be up to Firefox 89.

Source: opennet.ru

Add a comment