mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
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.
This commit is contained in:
parent
fde9c1bfb2
commit
655f054b4f
Notes:
sideshowbarker
2024-07-17 18:29:59 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/655f054b4f Pull-request: https://github.com/SerenityOS/serenity/pull/12669 Reviewed-by: https://github.com/awesomekling
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue