) [9,35 200x24] overflow: [9,35 409.859375x25]
PaintableWithLines (BlockContainer
) [11,36 196x22] overflow: [11,36 407.859375x22]
TextPaintable (TextNode<#text>)
+ PaintableWithLines (BlockContainer
) [207,36 0x22]
diff --git a/Tests/LibWeb/Layout/input/input-placeholder-with-line-height.html b/Tests/LibWeb/Layout/input/input-placeholder-with-line-height.html
new file mode 100644
index 00000000000..ef11e717d4b
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/input-placeholder-with-line-height.html
@@ -0,0 +1,7 @@
+text
diff --git a/Userland/Libraries/LibWeb/CSS/Default.css b/Userland/Libraries/LibWeb/CSS/Default.css
index 7d51222c6d2..9bf16ac00e1 100644
--- a/Userland/Libraries/LibWeb/CSS/Default.css
+++ b/Userland/Libraries/LibWeb/CSS/Default.css
@@ -45,6 +45,7 @@ textarea {
input::placeholder, textarea::placeholder {
color: GrayText;
+ line-height: initial;
}
button, input[type=submit], input[type=button], input[type=reset], select {
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index df459fe4c35..352314f5505 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -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;