mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-09 01:06:11 +00:00
LibWeb/HTML: Update Text Input Styling
So that it is closer to the spec. https://www.w3.org/TR/css-ui-4/#input-rules
This commit is contained in:
committed by
Andreas Kling
parent
9ed2669fc8
commit
13cd653d1c
@@ -793,9 +793,14 @@ void HTMLInputElement::create_text_input_shadow_tree()
|
||||
|
||||
m_placeholder_element = MUST(DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML));
|
||||
m_placeholder_element->set_use_pseudo_element(CSS::Selector::PseudoElement::Type::Placeholder);
|
||||
|
||||
// https://www.w3.org/TR/css-ui-4/#input-rules
|
||||
MUST(m_placeholder_element->set_attribute(HTML::AttributeNames::style, R"~~~(
|
||||
width: 100%;
|
||||
height: 1lh;
|
||||
align-items: center;
|
||||
text-overflow: clip;
|
||||
white-space: nowrap;
|
||||
)~~~"_string));
|
||||
MUST(element->append_child(*m_placeholder_element));
|
||||
|
||||
@@ -804,10 +809,14 @@ void HTMLInputElement::create_text_input_shadow_tree()
|
||||
m_placeholder_text_node->set_editable_text_node_owner(Badge<HTMLInputElement> {}, *this);
|
||||
MUST(m_placeholder_element->append_child(*m_placeholder_text_node));
|
||||
|
||||
// https://www.w3.org/TR/css-ui-4/#input-rules
|
||||
m_inner_text_element = MUST(DOM::create_element(document(), HTML::TagNames::div, Namespace::HTML));
|
||||
MUST(m_inner_text_element->set_attribute(HTML::AttributeNames::style, R"~~~(
|
||||
width: 100%;
|
||||
height: 1lh;
|
||||
align-items: center;
|
||||
text-overflow: clip;
|
||||
white-space: nowrap;
|
||||
)~~~"_string));
|
||||
MUST(element->append_child(*m_inner_text_element));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user