mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-27 05:05:32 +03:00
Ladybird: Remove the mode to dump the layout tree
This use case is now handled by headless-browser.
This commit is contained in:
parent
127d2e2098
commit
50cef4708c
Notes:
sideshowbarker
2024-07-17 01:27:18 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/50cef4708c Pull-request: https://github.com/SerenityOS/serenity/pull/17836 Reviewed-by: https://github.com/linusg ✅
@ -67,13 +67,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
|
||||
StringView raw_url;
|
||||
StringView webdriver_content_ipc_path;
|
||||
bool dump_layout_tree = false;
|
||||
|
||||
Core::ArgsParser args_parser;
|
||||
args_parser.set_general_help("The Ladybird web browser :^)");
|
||||
args_parser.add_positional_argument(raw_url, "URL to open", "url", Core::ArgsParser::Required::No);
|
||||
args_parser.add_option(webdriver_content_ipc_path, "Path to WebDriver IPC for WebContent", "webdriver-content-path", 0, "path");
|
||||
args_parser.add_option(dump_layout_tree, "Dump layout tree and exit", "dump-layout-tree", 'd');
|
||||
args_parser.parse(arguments);
|
||||
|
||||
auto get_formatted_url = [&](StringView const& raw_url) -> URL {
|
||||
@ -85,22 +83,6 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||
return url;
|
||||
};
|
||||
|
||||
if (dump_layout_tree) {
|
||||
WebContentView view({});
|
||||
view.set_viewport_rect(Gfx::IntRect({}, { 800, 600 }));
|
||||
view.on_load_finish = [&](auto&) {
|
||||
auto dump = view.dump_layout_tree().release_value_but_fixme_should_propagate_errors();
|
||||
outln("{}", dump);
|
||||
fflush(stdout);
|
||||
|
||||
event_loop.quit(0);
|
||||
app.quit();
|
||||
};
|
||||
|
||||
view.load(get_formatted_url(raw_url));
|
||||
return app.exec();
|
||||
}
|
||||
|
||||
auto sql_server_paths = TRY(get_paths_for_helper_process("SQLServer"sv));
|
||||
auto sql_client = TRY(SQL::SQLClient::launch_server_and_create_client(move(sql_server_paths)));
|
||||
auto database = TRY(Browser::Database::create(move(sql_client)));
|
||||
|
Loading…
Reference in New Issue
Block a user