WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
167209
Safari input elements don't respect line-heights smaller than 'normal'.
https://bugs.webkit.org/show_bug.cgi?id=167209
Summary
Safari input elements don't respect line-heights smaller than 'normal'.
Michelle
Reported
2017-01-19 12:18:13 PST
Here's a minimal reproduction:
https://jsfiddle.net/mchl/dxc9geqc/
The placeholder text respects the `0.9em` line-height. However, once you start typing, the input text does not.
Attachments
Fixed centering and sizing
(5.56 MB, video/quicktime)
2023-05-27 21:26 PDT
,
alan
no flags
Details
overflow content needs clipping (caret does not look ok either)
(66.44 KB, video/quicktime)
2023-05-27 21:27 PDT
,
alan
no flags
Details
WIP
(3.77 KB, patch)
2023-05-27 21:28 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(7.58 KB, patch)
2023-05-29 15:32 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(7.58 KB, patch)
2023-05-31 07:34 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(7.58 KB, patch)
2023-05-31 08:13 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(15.33 KB, patch)
2023-05-31 19:46 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Patch
(18.77 KB, patch)
2023-06-01 07:51 PDT
,
alan
no flags
Details
Formatted Diff
Diff
Show Obsolete
(5)
View All
Add attachment
proposed patch, testcase, etc.
alan
Comment 1
2023-05-26 16:04:47 PDT
This looks like an incorrectly positioned (vertically centered) inner text control (shadow dom)
alan
Comment 2
2023-05-27 21:25:33 PDT
Sadly RenderTextControlSingleLine does no support cases with layout overflow. The attached test case sets the height of the input box to 0.9em causing layout overflow. Even if the inner renderer wascentered, since RenderTextControlSingleLine does not support proper clipping, text would simply spill out of the input box (on trunk, placeholder text already overflows :( it requires 1, centering 2, loosening up on the height cap on the inner renderer (see desiredLogicalHeight in RenderTextControlSingleLine::layout) 3, adding clipping support (see attached screen recordings)
alan
Comment 3
2023-05-27 21:26:16 PDT
Created
attachment 466519
[details]
Fixed centering and sizing
alan
Comment 4
2023-05-27 21:27:06 PDT
Created
attachment 466520
[details]
overflow content needs clipping (caret does not look ok either)
alan
Comment 5
2023-05-27 21:28:05 PDT
Created
attachment 466521
[details]
WIP
alan
Comment 6
2023-05-28 22:01:14 PDT
Apparently clipping is reserved for text fields (?) with decorations. bool RenderTextControlSingleLine::hasControlClip() const { // Apply control clip for text fields with decorations. return !!containerElement(); } will need to do some digging through history.
alan
Comment 7
2023-05-29 08:11:08 PDT
1. hasControlClip was initially added at
19393@main
to specifically clip overflowing magnifier glass/cancel button in search fields ( hasControlClip() const { return m_cancelButton; }) 2.
79370@main
slightly changed behavior by switching over to checking !!containerElement(). It expands clipping for other, single line text field types like password -anything with container based shadow DOM (not just a simple contenteditable inside input) which introduced some inconsistencies <style> input { font-size: 38px; height: 20px; } </style> <input type="password" placeholder="this is clipped"> <input type="text" placeholder="this is NOT clipped">
alan
Comment 8
2023-05-29 15:32:20 PDT
Created
attachment 466532
[details]
Patch
alan
Comment 9
2023-05-31 07:34:41 PDT
Created
attachment 466545
[details]
Patch
alan
Comment 10
2023-05-31 08:13:42 PDT
Created
attachment 466548
[details]
Patch
alan
Comment 11
2023-05-31 19:46:41 PDT
Created
attachment 466558
[details]
Patch
alan
Comment 12
2023-06-01 07:51:54 PDT
Created
attachment 466563
[details]
Patch
EWS
Comment 13
2023-06-01 11:49:02 PDT
Committed
264802@main
(7590b24a0d02): <
https://commits.webkit.org/264802@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 466563
[details]
.
Radar WebKit Bug Importer
Comment 14
2023-06-01 11:50:20 PDT
<
rdar://problem/110126574
>
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug