Integrating the Servo Web Engine with Qt using Rust: A Project Update

KDAB Company announced about component development Servo WebView for Qt using a browser engine Servo instead of a module Qt WebEngine (on the base Chromium) for displaying web content in QML applications. It is expected that the project will help reduce the attack surface on Qt applications using the WebView API by using a component in which, thanks to the Rust language, the occurrence of vulnerabilities caused by errors when working with memory is minimized. Servo WebView code for Qt distributed by licensed under MPL-2.0.

To organize the work of Servo code written in Rust in a C++ environment, a layer is used CXX-Qt. CXX-Qt allows you to create Rust components that integrate with C++ programs using Qt. Using CXX-Qt makes it possible to create QObject subclasses in Rust, which can be used in C++, QML and JavaScript code. It is also possible to create Rust programs that call C++ code, for which Rust bindings are provided over the standard QtCore and QtGui classes.

The Servo project was originally developed by Mozilla, but then came under the auspices of the Linux Foundatuin organization. The engine is distinguished by its support for multi-threaded rendering of web pages, parallelization of operations with the DOM (Document Object Model) and the use of safe programming mechanisms provided by the Rust language. At the time of Servo's founding, the Firefox browser engine was unable to fully exploit the potential of modern multi-core systems due to the use of single-threaded content processing schemes. Servo is natively designed to support breaking DOM and rendering code into smaller subtasks that can run in parallel and make more efficient use of multi-core CPU resources. Firefox already integrates some parts of Servo, such as the multi-threaded CSS engine and the WebRender rendering system.

Among related developments, the project is also noted Tauri-Servodeveloping the backend to the library WRY based on the Servo engine, which allows you to use Servo in applications based on the Tauri framework (a platform competing with Electron for creating custom applications using browser technologies).

Thanks for reading: