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:
parent
7d7c419ce6
commit
09eed8eea2
347 changed files with 4397 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue