The WebKit team at Igalia is happy to announce a new release series of WPE WebKit. This is a summary of the most noteworthy changes from the latest release cycle.
Graphics improvements
WPE’s graphics support has seen numerous improvements with a positive impact in rendering performance, resource usage, and better rendering. Let’s have a look at some of the most significant changes:
- Compute the layers tile size, using a different strategy depending on whether GPU rendering is enabled. This optimizes resource usage depending on both hardware and software rendering mode.
- WPE now uses run-loop observers to properly schedule layer flushing and composition, which results in snappier and better performing rendering and animation.
- 2D-canvas acceleration has now improved performance, as operations are recorded for batched replay.
- Text rendering has better performance too.
- In non-composite mode, it’s now also possible to use damage propagation.
- Asynchronous scrolling has also seen performance improvements.
On top of this, as usual, many rendering issues have been fixed, making this release of WPE one of the best in terms of graphics support.
Multimedia improvements
WebRTC
When using GstWebRTC, WebRTC network access has been moved to the network process. This also requires librice, and building with the CMake USE_LIBRICE option. When this is enabled, it is still possible to choose the older libnice-based implementation at runtime by setting WEBKIT_GST_DISABLE_WEBRTC_NETWORK_SANDBOX=1 in the environment.
Having WebRTC network access in the network process is a security improvement, as it reduces the surface of attack in other more sensitive processes.
Other multimedia improvements
- Videos with BT2100-PQ colorspace are now tone-mapped to SDR, ensuring colours do not appear washed out.
- Support for the Audio Output Devices API, which allows Web content to enumerate audio devices and decide which one to use for output. This feature is disabled by default, and may be previewed using the
ExposeSpeakers,ExposeSpeakersWithoutMicrophone, andPerElementSpeakerSelectionfeature flags. - Many code improvements to the GStreamer backend that will result in a more stable multimedia experience.
WebXR
WebXR support through OpenXR has seen substantial development this cycle:
- New API has been added in order to support WebXR session permissions, querying whether a session is active and requesting to leave a session.
- Support for WebXR Hand Input module has been added for ports using OpenXR.
- Support for WebXR Hit Test Module is added with testable status, so it can be enabled at runtime (
--features=+WebXRHitTestModule) or at build time passing-DENABLE_WEBXR_HIT_TEST=ON.
API Changes
The future of the WPE API
The traditional libwpe-based API remains in WPE for this release cycle, but we are planning to sunset it starting with the following one (2.54). This applies to Cog, which is no longer in active development and won’t have any more stable releases beyond the 0.18.x series. While both libwpe and Cog will remain available, we encourage developers to transition to the new WPEPlatform API, which will be considered stable by then.
This means that it is the perfect time to test the WPEPlatform API and provide feedback, as it’s still possible to make changes to it to better suit users’ needs.
WPEPlatform API changes
New platform APIs include:
wpe_display_create_toplevel(). This way it’s possible to create a toplevel using the common API which allows the inspector to work when the application is handling toplevels.- A new
WPEDisplay::disconnectedsignal has been added, which allows platform implementations to notify when the native display gets “disconnected” and thus no longer usable. Applications can handle it to attempt recovery, or to know when they may free resources. - A new
WPEView::buffers-changedsignal, alongside the associatedWPEViewClass.buffers_changedvirtual function, have been added. These may be used to know in advance which graphics buffers will be used for rendering the content for a given web view. This feature is mainly useful for platform implementations which may need to perform additional setup in advance, before updated web view contents are provided in the buffers configured by WebKit. - Two new functions,
wpe_clipboard_content_get_text()andwpe_clipboard_content_get_bytes(), allow applications to obtain the contents held in the clipboard.
The public API has received the following changes, which might require changes to existing platform implementations:
- Multiple callbacks are now supported for
WPEScreenSyncObserver, the API has changed fromwpe_screen_sync_observer_set_callback()to a pair ofwpe_screen_sync_observer_add_callback()/_remove_callback()functions. The functions to start/stop the observer are no longer available, and instead the observer will be activated automatically when there are one or more callbacks attached to it.
The WPEPlatform API can now be used on Android.
Legacy API
The legacy libwpe-based API can be disabled at build time, by toggling the ENABLE_WPE_LEGACY_API CMake option. This allows removal of uneeded code when an application is exclusively using the new WPEPlatform API.
New WebKit API
- WebKitImage, an image abstraction that is used when taking snapshots of webviews.
- webkit_webview_get_snapshot() and webkit_webview_get_snapshot_finish() can be used to fetch a snapshot of a webview contents.
Web Standards support
As usual, this list is not exhaustive as WebKit continuously progresses in its support for new standards. Some of the highlights for this release are:
- Largest Contentful Paint is now enabled.
- Pointer and Touch Events now use more precise fractional coordinates.
- The Fetch API now accepts local connections.
- The Navigation API is now enabled.
- The Event Timing API is now enabled.
- The CSS random() function (in draft status) is now available.
- CSS field-sizing is now available.
- The Keyboard lock API is now available.
- The Origin API is now available.
- The Readable Byte Streams API is now available.
- Enabled CSS grid-lanes (a.k.a. Masonry layout), part of CSS Grid Layout Module Level 3.
Other notes
The Flatpak-based development SDK has been removed. Developers are encouraged to use the WebKit Container SDK instead.
Claudio is long-time WebKit contributor from Igalia, working in different areas of WebKit, WPE, and the stack around it.