mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibWeb: Don't let input element placeholders influence line-height
Before this change, we transferred the input element's line-height to both the editable text *and* the placeholder. This caused some strange doubling of the effective line-height when the editable text was empty, pushing down the placeholder.
This commit is contained in:
committed by
Andreas Kling
parent
e1eeb93cc6
commit
13ba491924
@@ -624,10 +624,8 @@ void HTMLInputElement::update_placeholder_visibility()
|
||||
return;
|
||||
if (this->placeholder_value().has_value()) {
|
||||
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "block"sv));
|
||||
MUST(m_inner_text_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "none"sv));
|
||||
} else {
|
||||
MUST(m_placeholder_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "none"sv));
|
||||
MUST(m_inner_text_element->style_for_bindings()->set_property(CSS::PropertyID::Display, "block"sv));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -815,7 +813,6 @@ void HTMLInputElement::create_text_input_shadow_tree()
|
||||
// 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;
|
||||
|
||||
Reference in New Issue
Block a user