Closed Bug 1582545 Opened 5 years ago Closed 2 years ago

CSS setting -moz-padding-start adds too much padding for select elements

Categories

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

Desktop
Windows
defect

Tracking

()

RESOLVED FIXED
107 Branch
Tracking Status
firefox-esr102 --- wontfix
firefox69 --- wontfix
firefox70 --- wontfix
firefox71 --- wontfix
firefox105 --- wontfix
firefox106 --- wontfix
firefox107 --- fixed

People

(Reporter: feedbro.reader, Assigned: emilio)

References

(Regressed 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Attached file selectbug.html

User Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0

Steps to reproduce:

  1. Open the attachment "selectbug.html" in Firefox
  2. Look at the left side padding of the select element

Actual results:

Left-side padding is about 5 pixels (too much).

Note that using padding-inline-start causes the same incorrect result.

Expected results:

Left-side padding should be 2 pixels (as set by CSS). This works correctly in Chrome.

Hi Voltron,

Thanks for the details. I was able to reproduce the bug on Windows 10 on the following versions:

Release 69.0 (64-bit), Nightly 71.0a1 (2019-09-23) (64-bit) and Beta 70.0b3 (64-bit).

I've chosen a component. If you consider that there's another component that's more proper for this case you may change it.

Best regards, Flor.

Status: UNCONFIRMED → NEW
Component: Untriaged → Inspector: Rules
Ever confirmed: true
OS: Unspecified → Windows
Product: Firefox → DevTools
Hardware: Unspecified → Desktop
See Also: → 1578165, 1574013
Version: 69 Branch → Trunk

Pretty sure this bug is not for DevTools, but about how Gecko styles the HTML <select> element's button.
Firefox gives some extra horizontal padding to <select>s that can't be removed, probably somewhere in its shadow DOM. It's an old issue as far as I know (I remember battling it years ago).

Taking the liberty to move to Core > Layout: Forms Controls.
I haven't looked for duplicates, but since Firefox has had this issue for years it's likely we have a similar bug on file.

Component: Inspector: Rules → Layout: Form Controls
Product: DevTools → Core

It is platform specific? The padding value on my Linux box is 2px.

URL: 1560824
Priority: -- → P3

The computed value is 2px, but there is more space coming from "somewhere".

See for instance: https://codepen.io/fvsch/pen/LYPqQbm
Expected result: text touches the left border.
Actual result on macOS: text looks like it's roughly 4px away from the left border.

I bet that somewhere is here: https://searchfox.org/mozilla-central/rev/153feabebc2d13bb4c29ef8adf104ec1ebd246ae/layout/style/res/forms.css#333

See bug 1560824, this is the same but in the inline direction.

See Also: → 1560824

Gosh! I did put the bug in the URL field. :/

URL: 1560824

Will this ever get fixed? I'm all in favor of using native form elements, but this select padding is really annoying. (It's just as annoying, that you cannot add independent option padding in Blink/Webkit).

This was added in bug 1499184. We rewrote combobox select rendering so now it shouldn't be affected by display: none options. Let me look into that.

Regressed by: 1499184

We added this in bug 1499184. However since then we've reworked how
combobox sizing works (bug 1744009) so the original issue shouldn't
happen.

That way selects are sized just like buttons.

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Set release status flags based on info from the regressing bug 1499184

Pushed by ealvarez@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/79c24b3fc675
Allow padding-inline of select to be overridden by authors. r=TYLin
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/58853f2ef552
Fix a test I missed now that we have a little more space in the inline axis.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/autoland/rev/bcc65667dfb5
More reliable fix for combobox-zoom.html on OSX.

The patch landed in nightly and beta is affected.
:emilio, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox106 to wontfix.

For more information, please visit auto_nag documentation.

Flags: needinfo?(emilio)

Probably deserves some bake time.

Flags: needinfo?(emilio)
Regressions: 1802857
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: