Open Bug 429302 Opened 12 years ago Updated 3 years ago

Select changes width when option has padding: 0px


(Core :: Layout: Form Controls, defect)

Windows XP
Not set





(Reporter: martijn.martijn, Unassigned)



(Keywords: regression, testcase)


(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:
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
Closed: 3 years ago
Resolution: --- → WORKSFORME
Resolution: WORKSFORME → ---
You need to log in before you can comment on or make changes to this bug.