mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
LibWebView: Move the DumpLayoutTree utility to LibWebView
This patch has no functional changes.
This commit is contained in:
parent
dcbbbf5b4a
commit
97a67f5501
4 changed files with 2 additions and 2 deletions
27
Userland/Libraries/LibWebView/DumpLayoutTree/main.cpp
Normal file
27
Userland/Libraries/LibWebView/DumpLayoutTree/main.cpp
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibWebView/OutOfProcessWebView.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto window = GUI::Window::construct();
|
||||
window->set_title("DumpLayoutTree");
|
||||
window->resize(800, 600);
|
||||
window->show();
|
||||
auto& web_view = window->set_main_widget<WebView::OutOfProcessWebView>();
|
||||
web_view.load(URL::create_with_file_protocol(argv[1]));
|
||||
web_view.on_load_finish = [&](auto&) {
|
||||
auto dump = web_view.dump_layout_tree();
|
||||
write(STDOUT_FILENO, dump.characters(), dump.length() + 1);
|
||||
_exit(0);
|
||||
};
|
||||
return app->exec();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue