diff --git a/Tests/LibWeb/Text/expected/HTML/form-image-submission.txt b/Tests/LibWeb/Text/expected/HTML/form-image-submission.txt
index 5feee74756..dc5af2eb60 100644
--- a/Tests/LibWeb/Text/expected/HTML/form-image-submission.txt
+++ b/Tests/LibWeb/Text/expected/HTML/form-image-submission.txt
@@ -1 +1 @@
- 10,20
+ 56,20
diff --git a/Userland/Libraries/LibWeb/CSS/Default.css b/Userland/Libraries/LibWeb/CSS/Default.css
index 6041790496..e10bdbfc38 100644
--- a/Userland/Libraries/LibWeb/CSS/Default.css
+++ b/Userland/Libraries/LibWeb/CSS/Default.css
@@ -29,7 +29,6 @@ label {
input:not([type=submit], input[type=button], input[type=image], input[type=reset], input[type=color], input[type=checkbox], input[type=file], input[type=radio], input[type=range]), textarea {
border: 1px solid ButtonBorder;
min-height: 16px;
- width: attr(size ch, 20ch);
cursor: text;
overflow: hidden;
}
diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
index 7051630c59..f2dd03203c 100644
--- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
+++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp
@@ -12,6 +12,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -101,6 +102,11 @@ JS::GCPtr HTMLInputElement::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 (type_state() != TypeAttributeState::FileUpload) {
+ if (style->property(CSS::PropertyID::Width)->has_auto())
+ style->set_property(CSS::PropertyID::Width, CSS::LengthStyleValue::create(CSS::Length(size(), CSS::Length::Type::Ch)));
+ }
+
return Element::create_layout_node_for_display_type(document(), style->display(), style, this);
}