diff --git a/Userland/Libraries/LibWeb/CSS/Default.css b/Userland/Libraries/LibWeb/CSS/Default.css index e10bdbfc387..7cb14010c40 100644 --- a/Userland/Libraries/LibWeb/CSS/Default.css +++ b/Userland/Libraries/LibWeb/CSS/Default.css @@ -38,8 +38,6 @@ textarea { display: inline-block; overflow: auto; font-family: monospace; - width: attr(cols ch, 20ch); - height: attr(rows lh, 2lh); } input::placeholder, textarea::placeholder { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 3de54081b8e..4e15f7b2eb1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -37,6 +38,11 @@ JS::GCPtr HTMLTextAreaElement::create_layout_node(NonnullRefPtrdisplay().is_inline_outside() && style->display().is_flow_inside()) style->set_property(CSS::PropertyID::Display, CSS::DisplayStyleValue::create(CSS::Display::from_short(CSS::Display::Short::InlineBlock))); + if (style->property(CSS::PropertyID::Width)->has_auto()) + style->set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(cols(), CSS::Length::Type::Ch))); + if (style->property(CSS::PropertyID::Height)->has_auto()) + style->set_property(CSS::PropertyID::Height, CSS::LengthStyleValue::create(CSS::Length(rows(), CSS::Length::Type::Lh))); + return Element::create_layout_node_for_display_type(document(), style->display(), style, this); }