Closed Bug 1456052 Opened 7 years ago Closed 4 years ago

Textarea padding crops text to the content box in the block direction, unlike other browsers.

Categories

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

61 Branch
Unspecified
All
defect

Tracking

()

RESOLVED FIXED
87 Branch
Webcompat Priority revisit
Tracking Status
firefox61 --- wontfix
firefox70 --- wontfix
firefox87 --- fixed

People

(Reporter: karlcow, Assigned: emilio)

References

()

Details

(Whiteboard: [webcompat])

Attachments

(1 file)

This is a spin-off of https://webcompat.com/issues/16534 The textarea for comment is cutting off the placeholder text in there. <textarea aria-label="Adding a comment will re-open this discussion"></textarea> Because of the padding and fixed height. When playing with the padding ```html <textarea class="dcs-a-dcs-db-dcs-se" autocomplete="false" x-webkit-speech="" speech="" role="combobox" aria-autocomplete="list" aria-label="Adding a comment will re-open this discussion" style=""></textarea> ``` So indeed the height is fixed for this `textarea` until you make a big padding. ```css .dcs-a-dcs-lb-dcs-db-dcs-eb .dcs-a-dcs-db-dcs-se { background-color: #fff; border: 1px solid #c9d4ec; height: 23px; font-size: 12px; } .dcs-a-dcs-db-dcs-se { border: 1px solid #c8c8c8; box-sizing: border-box; -moz-box-sizing: border-box; -ms-box-sizing: border-box; -webkit-box-sizing: border-box; color: #999; font-family: Arial,sans-serif; font-size: 13px; margin: 0; overflow-x: hidden; overflow-y: hidden; outline-width: 0!important; padding: 6px; resize: none; width: 100%; } ``` Changing the padding value grows the textarea box, but it does slightly differently in Chrome and Firefox. I don't know if we are in unspecified territories or if one of the browser is more right than the other. See screenshots in the webcompat issue.
Flags: webcompat?
Priority: -- → P3

Migrating Webcompat whiteboard priorities to project flags. See bug 1547409.

Webcompat Priority: --- → ?

See bug 1547409. Migrating whiteboard priority tags to program flags.

Webcompat Priority: ? → revisit
Flags: webcompat?

Emilio, can you give this a better title? It kinda seems related to Bug 1561794 (in spirit, at least).

Flags: needinfo?(emilio)

So a reduced test-case would be something like:

  • data:text/html,<textarea placeholder="foo barr baz foo barr baz foo barr baz foo barr baz" style="max-width: 100px; height: 23px; padding: 6px; box-sizing: border-box; resize: none; overflow: hidden"></textarea>

If I understand correctly. Seems like Chrome doesn't clip the bottom to the content box but the padding box. The Gecko behavior is caused by this line.

It seems this is bug 752790, but for textareas.

Type: enhancement → defect
Flags: needinfo?(emilio)
Summary: Small allocated space for “Comments” hint text field → Textarea padding crops text to the content box in the block direction, unlike other browsers.
Assignee: nobody → emilio
See Also: → 752790

Looks like we should update these pages in response to this change:
https://developer.mozilla.org/en-US/docs/Mozilla/Gecko/Chrome/CSS/overflow-clip-box
https://developer.mozilla.org/en-US/docs/Mozilla/Gecko/Chrome/CSS/overflow-clip-box-block

Right now, those pages have a note saying ...<input type="text"> and similar use the value content-box...

Keywords: dev-doc-needed

(As of this bug, <input type="text"> and similar will use the compound value padding-box content-box.)

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/8514a3095fca Change overflow-clip-box of textarea to be consistent with text inputs and match other browsers. r=dholbert

Fixed the test, thanks Andrei :)

Flags: needinfo?(emilio)
Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/97e691afc504 Change overflow-clip-box of textarea to be consistent with text inputs and match other browsers. r=dholbert
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Regressions: 1569078

Backed out in bug 1569078.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---

There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:emilio, could you have a look please?
For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Was backed out due to a regression.

Flags: needinfo?(emilio)

I have updated the notes on the pages dholbert referenced, as advised. Let me know if that looks OK for the docs.

Oops, sorry Chris -- this change was actually backed out (see comment 13), so the pages' old content is back to being accurate (and the update has inadvertently made it inaccurate).

Would you mind reverting the MDN change? Perhaps this patch will re-land at some point and we'll want to make the change again, but for now we're back to where we started. :)

Flags: needinfo?(cmills)

[--> restoring the "dev-doc-needed" keyword as a reminder that we'll want to perform this MDN edit again, once this bug is fixed.]

(In reply to Daniel Holbert [:dholbert] from comment #17)

Oops, sorry Chris -- this change was actually backed out (see comment 13), so the pages' old content is back to being accurate (and the update has inadvertently made it inaccurate).

Would you mind reverting the MDN change? Perhaps this patch will re-land at some point and we'll want to make the change again, but for now we're back to where we started. :)

Ah, no worries - reverted!

Flags: needinfo?(cmills)
Blocks: 1099204

It doesn't seem like GTranslate breaks with a rebased version of the patch, so I'll try to reland this.

Pushed by ealvarez@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bfa4852bf11f Change overflow-clip-box of textarea to be consistent with text inputs and match other browsers. r=dholbert
Status: REOPENED → RESOLVED
Closed: 6 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: mozilla70 → 87 Branch

This is Firefox internal content, so not in the remit of the MDN writers team any more (it currently shows on MDN as archived, and we are hoping it'll be moved off MDN soonish). I'm therefore removing dev-doc-needed from here.

Keywords: dev-doc-needed
Regressions: 1692142
Regressions: 1702162
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: