Open Bug 429302 Opened 12 years ago Updated 3 years ago

Select changes width when option has padding: 0px

Categories

(Core :: Layout: Form Controls, defect)

x86
Windows XP
defect
Not set

Tracking

()

REOPENED

People

(Reporter: martijn.martijn, Unassigned)

References

Details

(Keywords: regression, testcase)

Attachments

(3 files)

Attached file testcase
See testcase, I would think that both select elements would have the same widths, but they don't.

This regressed between 2007-05-03 and 2007-05-05:
http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-05-03+04&maxdate=2007-05-05+07&cvsroot=%2Fcvsroot
Regression from bug 364510?
Attached file reftest
Attached file reference
Hmm.  So by default, options have 8px of padding.  The display area has 4px of padding.  So normally, the display area can't be wider than an option with the same text (unless the author does some careful font styling, of course, in which case all bets are off).

In this case, though, the display area is 4px + text length, so it can be wider than the widest option.  What we used to do was cut off part of the text, basically.  We no longer do that, with the change from bug 364510.

I bet you could get a similar effect with negative margins on <option> without changing the padding.

The obvious options here (no pun intended) are to leave things as-is, to disallow changing <option> padding, to introduce 4px of spacing in <option>s that can't be turned off, or to somehow change the intrinsic width algorithm to take each option text, add the display frame padding, and max over those, not just the current text of the display frame.  That still wouldn't solve the font-size thing, of course.

My gut instinct here is to do nothing, to be honest.
Just a fyi, I found this bug on some site where it was causing a widening of a table column, so this doesn't come completely out of the blue.
Duplicate of this bug: 401281
See Also: → 1139853
See Also: → 924068
See Also: → 545685, 527676
See Also: → 1142634
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Status: RESOLVED → REOPENED
Resolution: WORKSFORME → ---
You need to log in before you can comment on or make changes to this bug.