mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-24 05:25:13 +00:00
Userland: Use Web::PageView::load_html() in the "html" utility
This commit is contained in:
parent
2ba9e9b9c9
commit
c9d55e3b80
Notes:
sideshowbarker
2024-07-19 05:27:46 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c9d55e3b80e
1 changed files with 2 additions and 11 deletions
|
@ -32,15 +32,7 @@
|
|||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
#include <LibWeb/CSS/StyleResolver.h>
|
||||
#include <LibWeb/DOM/Element.h>
|
||||
#include <LibWeb/Dump.h>
|
||||
#include <LibWeb/PageView.h>
|
||||
#include <LibWeb/Layout/LayoutBlock.h>
|
||||
#include <LibWeb/Layout/LayoutInline.h>
|
||||
#include <LibWeb/Layout/LayoutNode.h>
|
||||
#include <LibWeb/Parser/CSSParser.h>
|
||||
#include <LibWeb/Parser/HTMLParser.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
@ -60,12 +52,11 @@ int main(int argc, char** argv)
|
|||
return 1;
|
||||
}
|
||||
|
||||
String html = String::copy(f->read_all());
|
||||
auto document = Web::parse_html_document(html);
|
||||
auto html = f->read_all();
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
auto& widget = window->set_main_widget<Web::PageView>();
|
||||
widget.set_document(document);
|
||||
widget.load_html(html, URL());
|
||||
if (!widget.document()->title().is_null())
|
||||
window->set_title(String::format("%s - HTML", widget.document()->title().characters()));
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue