summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorKenneth Myhra <kennethmyhra@gmail.com>2022-02-20 10:03:10 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-20 10:57:30 +0100
commit655f054b4fa2ed6239f61071ad1c44e85548711c (patch)
tree0135735737c713c01ba35dae5591bc7c77a7fbf3 /Userland/Libraries/LibWeb
parentfde9c1bfb2e00cef2e0681a0ed03609696250e32 (diff)
downloadserenity-655f054b4fa2ed6239f61071ad1c44e85548711c.zip
LibWeb: Add default padding around contents of text <input> elements
This patch adds a default padding around the contents of text <input> elements. It adds these defaults to the existing style attribute in 'HTMLInputElement::create_shadow_tree_if_needed()'. Use a default padding for text <input> elements: - padding-top and padding-bottom: 1px - padding-left and padding-right: 2px These values seems to align with what other browsers do.
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index 9bc18e12de..03bce5f0b4 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -172,7 +172,7 @@ void HTMLInputElement::create_shadow_tree_if_needed()
if (initial_value.is_null())
initial_value = String::empty();
auto element = document().create_element(HTML::TagNames::div);
- element->set_attribute(HTML::AttributeNames::style, "white-space: pre");
+ element->set_attribute(HTML::AttributeNames::style, "white-space: pre; padding-top: 1px; padding-bottom: 1px; padding-left: 2px; padding-right: 2px");
m_text_node = adopt_ref(*new DOM::Text(document(), initial_value));
m_text_node->set_always_editable(true);
m_text_node->set_owner_input_element({}, *this);