LibWeb: Let flexbox stretch auto-width text inputs

Don't rewrite text input 'width: auto' to 'size()ch' in
'HTMLInputElement::adjust_computed_style()'. That turns the control into
a definite-width flex item and prevents 'align-items: stretch' from
expanding it across the flex container.

Fixes the layout of the input element on the element matrix login page.
This commit is contained in:
Shannon Booth
2026-04-11 16:59:12 +02:00
committed by Jelle Raaijmakers
parent 46fcf51bf7
commit 482e5e770f
Notes: github-actions[bot] 2026-04-13 07:58:05 +00:00
7 changed files with 70 additions and 39 deletions

View File

@@ -185,11 +185,6 @@ void HTMLInputElement::adjust_computed_style(CSS::ComputedProperties& style)
if (style.display().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::LengthUnit::Ch)));
}
// NOTE: Other browsers apply a minimum height of a single line's line-height to single-line input elements.
if (is_single_line() && style.property(CSS::PropertyID::Height).has_auto()) {
auto current_line_height = style.line_height().to_double();