From 95a6019ff0e956c502b5ab11325a68cc72320b3e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 8 Oct 2020 21:58:00 +0100 Subject: [PATCH] LibWeb: Add OutOfProcessWebView::load_empty_document() This is cheating a little bit as we don't set the document to a nullptr as in InProcessWebView, but the observable outcome is the same. :^) --- Libraries/LibWeb/OutOfProcessWebView.cpp | 6 ++++++ Libraries/LibWeb/OutOfProcessWebView.h | 1 + 2 files changed, 7 insertions(+) diff --git a/Libraries/LibWeb/OutOfProcessWebView.cpp b/Libraries/LibWeb/OutOfProcessWebView.cpp index df59697373..fa760b2214 100644 --- a/Libraries/LibWeb/OutOfProcessWebView.cpp +++ b/Libraries/LibWeb/OutOfProcessWebView.cpp @@ -60,6 +60,12 @@ void OutOfProcessWebView::load_html(const StringView& html, const URL& url) client().post_message(Messages::WebContentServer::LoadHTML(html, url)); } +void OutOfProcessWebView::load_empty_document() +{ + m_url = {}; + client().post_message(Messages::WebContentServer::LoadHTML("", {})); +} + void OutOfProcessWebView::paint_event(GUI::PaintEvent& event) { GUI::ScrollableWidget::paint_event(event); diff --git a/Libraries/LibWeb/OutOfProcessWebView.h b/Libraries/LibWeb/OutOfProcessWebView.h index 56efc3680e..b39f611ad2 100644 --- a/Libraries/LibWeb/OutOfProcessWebView.h +++ b/Libraries/LibWeb/OutOfProcessWebView.h @@ -47,6 +47,7 @@ public: void load(const URL&); void load_html(const StringView&, const URL&); + void load_empty_document(); void notify_server_did_layout(Badge, const Gfx::IntSize& content_size); void notify_server_did_paint(Badge, i32 shbuf_id);