Ladybird can run without any graphical window, making it straightforward to integrate into automated pipelines, regenerate test expectations, and inspect how the engine interprets a page without ever opening a display. Three headless output modes are available — plain text, layout tree dumps, and screenshot capture — and a dedicatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ladybirdBrowser/ladybird/llms.txt
Use this file to discover all available pages before exploring further.
test-web runner coordinates the full LibWeb test suite against all of them.
Headless Output Modes
Pass--headless with an output mode to load a page without opening the browser UI:
| Flag | Output |
|---|---|
--headless=text | Serialized plain-text representation of the page |
--headless=layout-tree | Dump of the internal layout tree |
--headless + --test-mode | Screenshot capture used for Screenshot tests |
Screenshot Tests and —test-mode
Screenshot tests compare a rendered screenshot of a test page against a reference image. To generate a reference screenshot for a new test, run Ladybird in headless mode with--test-mode and point it at the test HTML file:
Running the Full Test Suite
The LibWeb test suite (Text, Layout, Ref, and Screenshot tests) is run by thetest-web binary. The easiest way to invoke it is through ladybird.py:
Rebaselining Text and Layout Tests
After changing behavior, regenerate expected output files with--rebaseline:
Running via ctest
For CI environments that callctest directly:
LADYBIRD_SOURCE_DIR to the repository root if the tests require it:
Use Cases
CI Automation
Run
test-web in a pipeline to catch regressions on every commit. Text and Layout tests produce deterministic text output that is trivial to diff.Screenshot Generation
Use
--headless --test-mode to produce reference screenshots for new visual tests without needing a display server.Layout Inspection
Use
--headless=layout-tree to examine how Ladybird builds the layout tree for any HTML file during development.Troubleshooting
Race condition on systems with llvmpipe
On UNIX systems where the llvmpipe software rasterizer is the active GPU driver — common in virtual machines — running The likely cause is that
--headless=text or --headless=layout-tree occasionally causes Ladybird to crash on exit with:atexit handlers are registered twice due to llvmpipe and fork/exec interaction issues when the WebContent process is spawned.