LibWeb: Rasterize each Navigable independently on its own thread

Previously, iframes were rasterized synchronously as nested display
lists inside their parent's display list: the parent's paint walk called
record_display_list() on each hosted iframe document and emitted a
PaintNestedDisplayList command that the player would recurse into. Only
the top-level traversable's RenderingThread was ever active, even though
every Navigable already owned one.

The motivation for splitting this apart:
- Work in the outer document no longer has to be re-recorded when only
  an iframe changes. The parent's cached display list now references the
  iframe's rasterized output live via an ExternalContentSource, so an
  iframe invalidation just needs the parent's display list replayed, not
  re-recorded.
- Each iframe now has a self-contained rasterization pipeline, which is
  prep work for moving iframes into separate sandboxed processes.
This commit is contained in:
Aliaksandr Kalenik
2026-04-05 17:00:40 +02:00
committed by Alexander Kalenik
parent 115531eef1
commit ad2ee4fe7a
Notes: github-actions[bot] 2026-04-07 13:10:43 +00:00
8 changed files with 132 additions and 82 deletions

View File

@@ -487,15 +487,19 @@ void EventLoop::update_the_rendering()
// FIXME: 21. For each doc of docs, mark paint timing for doc.
// 22. For each doc of docs, update the rendering or user interface of doc and its node navigable to reflect the current state.
for (auto& document : docs) {
auto navigable = document->navigable();
if (!navigable->is_traversable())
continue;
auto traversable = navigable->traversable_navigable();
traversable->process_screenshot_requests();
for (auto& doc : docs.in_reverse()) {
auto navigable = doc->navigable();
if (!navigable->needs_repaint())
continue;
if (navigable->is_svg_page())
continue;
if (auto document = navigable->active_document())
document->update_layout(DOM::UpdateLayoutReason::HTMLEventLoopRenderingUpdate);
navigable->paint_next_frame();
if (navigable->is_traversable()) {
auto traversable = navigable->traversable_navigable();
traversable->process_screenshot_requests();
}
}
// 23. For each doc of docs, process top layer removals given doc.