1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

LibWeb+headless-browser: Include paint tree in layout test output

This will give us a more comprehensive look at what actually gets
rendered in the end, and also allows us to catch more behavior changes.
This commit is contained in:
Andreas Kling 2023-08-03 09:59:12 +02:00
parent 7d7c419ce6
commit 09eed8eea2
347 changed files with 4397 additions and 4 deletions

View file

@ -678,6 +678,22 @@ Messages::WebContentServer::DumpLayoutTreeResponse ConnectionFromClient::dump_la
return builder.to_deprecated_string();
}
Messages::WebContentServer::DumpPaintTreeResponse ConnectionFromClient::dump_paint_tree()
{
auto* document = page().top_level_browsing_context().active_document();
if (!document)
return DeprecatedString { "(no DOM tree)" };
document->update_layout();
auto* layout_root = document->layout_node();
if (!layout_root)
return DeprecatedString { "(no layout tree)" };
if (!layout_root->paintable())
return DeprecatedString { "(no paint tree)" };
StringBuilder builder;
Web::dump_tree(builder, *layout_root->paintable());
return builder.to_deprecated_string();
}
Messages::WebContentServer::DumpTextResponse ConnectionFromClient::dump_text()
{
auto* document = page().top_level_browsing_context().active_document();