Closed Bug 1404442 Opened 7 years ago Closed 7 years ago

Text input with line-height:1 and border-radius makes the input too short for the text, chopping off descenders. Other browsers do not do this.

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

RESOLVED DUPLICATE of bug 752790
Tracking Status
firefox57 --- wontfix
firefox58 --- affected

People

(Reporter: wisniewskit, Unassigned)

References

Details

(Whiteboard: [webcompat])

Attachments

(1 file)

Attached file testcase.html
For the attached testcase, Firefox seems to presume the height of the input should be based on the given line-height of 1, and it chops off the text's descenders. Chrome, Edge, and Safari all make the input tall enough for the full text including the descenders.

This just bit eBay's search bar in https://webcompat.com/issues/10562

Note that it this only happens when the CSS appearance is off (that is, using -moz-appearance:none instead of border-radius does the same thing).
Flags: webcompat?
Jonathan: WDYT? Is this something we can fix in the browser stylesheet?
Flags: needinfo?(jfkthame)
Priority: -- → P3
I see clipping even with the default appearance (no -moz-appearance, no border-radius) at least on macOS:

  data:text/html,<input style="line-height:1" value="Testing">

clips the descender of the "g".

It would help here if we can change the UA stylesheet for form elements to replace the use of   overflow-clip-box: content-box;  for <input> (and presumably <textarea>) elements with  overflow-clip-box: padding-box;  (or just remove it, as that should be the initial value anyhow).

But I'm not sure what that would break.... looks like Mats might know more about the background here.
Flags: needinfo?(jfkthame) → needinfo?(mats)
See Also: → 1403118
isn't that very similar to Bug 752790 or more exactly a fix in Bug 752790 would solve this issue?
See Also: → 752790
(In reply to Jonathan Kew (:jfkthame) from comment #2)
> But I'm not sure what that would break....

It would break <input> and <textarea> in general.  Try for example:

data:text/html,<input style="padding:1em" value="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX">

The text is intentionally clipped at the content edge since that's
how HTML <input> and <textarea> has always worked, unlike CSS2 overflow
which clips overflow at the padding edge.  'overflow-clip-box' controls
which clipping you get.  We have 'content-box' as the initial value for
a few form control elements that have this layout.

I guess we could make 'overflow-clip-box' a shorthand and add -block/-inline
properties, then make <input> (but not <textarea>) overflow the padding in
the block direction only...
Flags: needinfo?(mats)
And yeah, this is a dupe of bug 752790.  I'll repeat my suggestion there...
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: