summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-01-30 23:15:40 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-30 23:16:41 +0100
commit74c8490acd9fa1c0687804f30e2f1ec336442c4d (patch)
tree86ae4d3245d8fdf613cd819176e98fd176e6b319 /Userland
parent32a363ded50e8c45ec3b5005a63a655c5ca4e08b (diff)
downloadserenity-74c8490acd9fa1c0687804f30e2f1ec336442c4d.zip
LibWeb: Don't try to create GUI::TextBox inside multi-process web views
This is a workaround until we can implement a proper <input type=text> in terms of LibWeb primitives. This makes google.com not crash in multi-process mode (but there is no search box.)
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp4
-rw-r--r--Userland/Libraries/LibWeb/InProcessWebView.h1
-rw-r--r--Userland/Libraries/LibWeb/Page/Page.h1
-rw-r--r--Userland/Services/WebContent/PageHost.h1
4 files changed, 7 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index c5654c3530..2f0d16168d 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -81,6 +81,10 @@ RefPtr<Layout::Node> HTMLInputElement::create_layout_node()
if (type() == "checkbox")
return adopt(*new Layout::CheckBox(document(), *this, move(style)));
+ // FIXME: Implement <input type=text> in terms of LibWeb primitives.
+ if (page.client().is_multi_process())
+ return nullptr;
+
auto& text_box = page_view.add<GUI::TextBox>();
text_box.set_text(value());
text_box.on_change = [this] {
diff --git a/Userland/Libraries/LibWeb/InProcessWebView.h b/Userland/Libraries/LibWeb/InProcessWebView.h
index 084c3a01c4..cad88401cd 100644
--- a/Userland/Libraries/LibWeb/InProcessWebView.h
+++ b/Userland/Libraries/LibWeb/InProcessWebView.h
@@ -85,6 +85,7 @@ private:
// ^Web::PageClient
virtual Gfx::Palette palette() const override { return GUI::ScrollableWidget::palette(); }
+ virtual bool is_multi_process() const override { return false; }
virtual void page_did_change_title(const String&) override;
virtual void page_did_set_document_in_main_frame(DOM::Document*) override;
virtual void page_did_start_loading(const URL&) override;
diff --git a/Userland/Libraries/LibWeb/Page/Page.h b/Userland/Libraries/LibWeb/Page/Page.h
index 5d7325d283..375bc3c75f 100644
--- a/Userland/Libraries/LibWeb/Page/Page.h
+++ b/Userland/Libraries/LibWeb/Page/Page.h
@@ -81,6 +81,7 @@ private:
class PageClient {
public:
+ virtual bool is_multi_process() const = 0;
virtual Gfx::Palette palette() const = 0;
virtual void page_did_set_document_in_main_frame(DOM::Document*) { }
virtual void page_did_change_title(const String&) { }
diff --git a/Userland/Services/WebContent/PageHost.h b/Userland/Services/WebContent/PageHost.h
index 0ee9e393d9..6983421840 100644
--- a/Userland/Services/WebContent/PageHost.h
+++ b/Userland/Services/WebContent/PageHost.h
@@ -50,6 +50,7 @@ public:
private:
// ^PageClient
+ virtual bool is_multi_process() const override { return true; }
virtual Gfx::Palette palette() const override;
virtual void page_did_invalidate(const Gfx::IntRect&) override;
virtual void page_did_change_selection() override;