Text input with "display: inline" has takes up no horizontal space
<input style="display: inline"></input>
Firefox:
Servo:
The default display value for input fields is inline-block: https://github.com/servo/servo/blob/main/resources/user-agent.css#L360
This affects <textarea> the same way.
https://html.spec.whatwg.org/multipage/rendering.html#form-controls
For input elements where the type attribute is not in the Hidden state or the Image Button state, and that are being rendered, are expected to act as follows:
- The inner display type is always 'flow-root'.
So it should stay as an inline-block even with display: inline.
I'd like to try this
@Loirooriol do you think we should also apply the same behavior for textarea (display inline always 'flow-root')?
Yes: https://html.spec.whatwg.org/multipage/rendering.html#the-textarea-element-2
The textarea element is a devolvable widget expected to render as an 'inline-block' box depicting a multiline text control.