Closed Bug 422128 Opened 16 years ago Closed 16 years ago

white-space:pre; ignored in <select><option>s

Categories

(Core :: Layout: Form Controls, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: ric.shepard, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080201 SeaMonkey/1.1.8
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b4) Gecko/2008030318 Firefox/3.0b4

Pre-formatted text is incorrectly displayed in <select> <option>s.
This problem does not exist in Firefox 2.x.x or Seamonkey 1.x.x.


Reproducible: Always

Steps to Reproduce:
1. create a <select> element with <option> elements using style="white-space:pre;"
2.
3.
Actual Results:  
The <select> <option> elements will be displayed as if the style is white-space:normal.

Expected Results:  
The <select> <option> elements would be displayed as pre-formatted text, as is expected from elements with style="white-space:pre;".
Component: Form Manager → Layout: Form Controls
Product: Firefox → Core
QA Contact: form.manager → layout.form-controls
Hmm.  The problem is that white-space does two things: control space-collapsing behavior and control wrapping.  Right now we have

  option { white-space: nowrap !important }

in forms.css because options should never be wrapping.  But then you can't change the whitespace-collapsing behavior, which is what you want to do here.

I suppose we could just remove that style and let options do whatever the <select> is doing, with it defaulting to "white-space: nowrap" as it does now.  Or we could remove the !important and let pages that really care style the options by hand.  Or we could leave things as they are.

David, do you have a preference?
Blocks: 363858
Status: UNCONFIRMED → NEW
Ever confirmed: true
Behavior in various browsers:

Gecko 1.8:  Setting white-space:pre preserves whitespace.  Setting "white-space: normal" leaves min-width as pref-width but allows options to wrap if width is less than the min-width.

Opera 9.25: white-space is treated as "nowrap" just like on trunk.
Safari 3:  Same as Opera 9.25 and Gecko trunk.
David says IE7 has the same behavior as trunk Gecko, Safari, and Opera as well.  Given that, I think we want the behavior we have now.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: