LibWeb: Fix input field placeholder vertical alignment

Input elements with a placeholder were positioned lower than inputs
without a placeholder or inputs with text. This was caused by the
placeholder element missing height height and overflow properties that
the inner text element had.

This fix makes sure both the placeholder and inner text elements let
show the same position of the input field.
This commit is contained in:
MichielN19
2026-02-21 14:39:28 +01:00
committed by Jelle Raaijmakers
parent 9ee2bb5570
commit 98f1813f5d
Notes: github-actions[bot] 2026-03-02 12:25:39 +00:00
7 changed files with 141 additions and 43 deletions

View File

@@ -8,6 +8,7 @@
* Copyright (c) 2024, Fernando Kiotheka <fer@k6a.dev>
* Copyright (c) 2025, Felipe Muñoz Mazur <felipe.munoz.mazur@protonmail.com>
* Copyright (c) 2025, Glenn Skrzypczak <glenn.skrzypczak@gmail.com>
* Copyright (c) 2026, Michiel Nijenhuis <michielmitsjol@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -861,7 +862,10 @@ static GC::Ref<CSS::CSSStyleProperties> placeholder_style_when_visible()
style = CSS::CSSStyleProperties::create(internal_css_realm(), {}, {});
style->set_declarations_from_text(R"~~~(
width: 100%;
height: 1lh;
align-items: center;
overflow: hidden;
scrollbar-width: none;
text-overflow: clip;
white-space: nowrap;
)~~~"sv);