Bug 292730

Summary: text input is misaligned when `align-content` is set to `center`
Product: WebKit Reporter: Jesper van den Ende <jespertheend>
Component: Layout and RenderingAssignee: alan <zalan>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, koivisto, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Expected result
none
Actual result
none
Patch
none
[fast-cq]Patch none

Jesper van den Ende
Reported 2025-05-08 10:33:57 PDT
Created attachment 475169 [details] Expected result To reproduce, visit https://input-text-misaligned-vertically.glitch.me Observe that the text is not centered within the text field, instead it is aligned at the bottom of the input.
Attachments
Expected result (9.02 KB, image/png)
2025-05-08 10:33 PDT, Jesper van den Ende
no flags
Actual result (7.76 KB, image/png)
2025-05-08 10:34 PDT, Jesper van den Ende
no flags
Patch (6.31 KB, patch)
2025-05-09 18:12 PDT, alan
no flags
[fast-cq]Patch (4.35 KB, patch)
2025-05-10 06:00 PDT, alan
no flags
Jesper van den Ende
Comment 1 2025-05-08 10:34:07 PDT
Created attachment 475170 [details] Actual result
Jesper van den Ende
Comment 2 2025-05-08 10:35:39 PDT
Also here is the full html just in case: <!DOCTYPE html> <html lang="en"> <head> <style> input { background: none; appearance: none; border: 1px solid black; min-height: 3em; align-content: center; } </style> </head> <body> <input value="some text" /> </body> </html>
Radar WebKit Bug Importer
Comment 3 2025-05-09 12:14:56 PDT
alan
Comment 4 2025-05-09 13:11:49 PDT
It's because we are trying to center an already centered content (This "relatively new" RenderBlockFlow::shiftForAlignContent centers the content now).
alan
Comment 5 2025-05-09 18:12:24 PDT
alan
Comment 6 2025-05-10 06:00:30 PDT
Created attachment 475181 [details] [fast-cq]Patch
EWS
Comment 7 2025-05-10 10:27:25 PDT
Committed 294750@main (c105abfa476c): <https://commits.webkit.org/294750@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 475181 [details].
alan
Comment 8 2025-05-10 10:32:16 PDT
Thank you for filing this bug. It's resolved on main now.
Jesper van den Ende
Comment 9 2025-05-10 10:57:19 PDT
Thanks for the fix! Looking forward to it landing in TP.
Note You need to log in before you can comment on or make changes to this bug.