mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 02:37:35 +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();
|
||||
|
|
|
@ -75,6 +75,7 @@ private:
|
|||
virtual void inspect_accessibility_tree() override;
|
||||
virtual Messages::WebContentServer::GetHoveredNodeIdResponse get_hovered_node_id() override;
|
||||
virtual Messages::WebContentServer::DumpLayoutTreeResponse dump_layout_tree() override;
|
||||
virtual Messages::WebContentServer::DumpPaintTreeResponse dump_paint_tree() override;
|
||||
virtual Messages::WebContentServer::DumpTextResponse dump_text() override;
|
||||
virtual void set_content_filters(Vector<String> const&) override;
|
||||
virtual void set_autoplay_allowed_on_all_websites() override;
|
||||
|
|
|
@ -53,6 +53,7 @@ endpoint WebContentServer
|
|||
run_javascript(DeprecatedString js_source) =|
|
||||
|
||||
dump_layout_tree() => (DeprecatedString dump)
|
||||
dump_paint_tree() => (DeprecatedString dump)
|
||||
dump_text() => (DeprecatedString dump)
|
||||
|
||||
get_selected_text() => (DeprecatedString selection)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue