From 240068a48ccd136c0c54203e1a1b471309d4b5fc Mon Sep 17 00:00:00 2001 From: Adam Hodgen Date: Thu, 17 Feb 2022 21:44:50 +0000 Subject: [PATCH] LibWeb: Improve display of input elements * Display input[type=reset] as a button * Display allother input elements as text entry boxes * Set overflow: hidden on input elements --- Userland/Libraries/LibWeb/CSS/Default.css | 13 ++++++++++++- Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/Default.css b/Userland/Libraries/LibWeb/CSS/Default.css index 1b5c9d17a69..4ed18ed86a0 100644 --- a/Userland/Libraries/LibWeb/CSS/Default.css +++ b/Userland/Libraries/LibWeb/CSS/Default.css @@ -211,10 +211,21 @@ ol ol ul { } /* FIXME: This is a temporary hack until we can render a native-looking frame for these. */ -input[type=text] { +input { border: 1px solid black; min-width: 80px; min-height: 16px; + width: 120px; + cursor: text; + overflow: hidden; +} + +input[type=submit], input[type=button], input[type=reset], input[type=checkbox], input[type=radio] { + border: none; + min-width: unset; + min-height: unset; + width: unset; + cursor: unset; } option { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index 06a80791a2e..5f470092189 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -34,7 +34,7 @@ void HTMLInputElement::did_click_button(Badge) // FIXME: This should be a PointerEvent. dispatch_event(DOM::Event::create(EventNames::click)); - if (type().equals_ignoring_case("submit")) { + if (type() == "submit") { if (auto* form = first_ancestor_of_type()) { form->submit_form(this); } @@ -55,7 +55,7 @@ RefPtr HTMLInputElement::create_layout_node(NonnullRefPtr