Select/Option/OptGroup does not allow author to specify 'white-space'

RESOLVED DUPLICATE of bug 422128

Status

()

Core
Layout: Form Controls
RESOLVED DUPLICATE of bug 422128
10 years ago
10 years ago

People

(Reporter: mozilla-nsf, Unassigned)

Tracking

({css1, testcase})

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14

Select/Option listbox set to use monospace font however FF 2.x and FF 3 beta render it with proportional font always.  IE 5.5, 6 and 7 render it as proportional font properly.   The following is the html code:

<SELECT SIZE=6 class="SelectSched" name="ZLISTBOX">


And the following is the class from the included stylesheet:


.SelectSched {
	font-family: monospace, Arial, Helvetica;
	white-space: pre;
	width: 525px;
	font-size: 13px; 
	color:#000000; 
	padding:2px;
}

Reproducible: Always

Steps to Reproduce:
1. Create stylesheet with monospace font.
2. Create select listbox that uses that CSS stylesheet.

Actual Results:  
Contents of select listbox use proportional font instead of fixed width font.

Expected Results:  
Font should be monospaced so columns can line up.

Even tying to over-ride the style at runtime via Javascript yields no resolution to this.  Issue prevents us from giving full FF endorsement to our vertical market web server product.
(Reporter)

Comment 1

10 years ago
Correction to statement.   Ie 5.5, 6 and 7 render it as monospace font in the listbox properly.
(Reporter)

Comment 2

10 years ago
Created attachment 317183 [details]
Sample from FF2 (font is proportional instead of monospaced)
(Reporter)

Comment 3

10 years ago
Created attachment 317184 [details]
Sample from IE7 showing the font as monospaced.

Comment 4

10 years ago
Works for me, Firefox 2.0.0.14 and trunk on Linux.

Please make sure the "Allow web pages to use their own fonts..." preference is
enabled. (Under Preferences->Content->Default Font: Advanced...")
(Reporter)

Comment 5

10 years ago
Created attachment 317260 [details]
Choose own fonts selected

The option is enabled, see screenshot I just attached.   Have done more testing and found the same behavior on the following combinations:  Windows Vista w/FF 3 beta5, Windows Vista w/FF 2.0.0.13, Windows Server 2003 w/FF 2.0.0.14 and Windows XPsp2 w/FF 3 beta5.   Have posted a working testcase at http://www.simsware.com/test.html - the numbers, 1, 2, 3, 4 should line up above each other.   After more testing the problem appears to be around the "white-space: pre" in the CSS file.  Although printable characters are being treated as monospace properly, whitespace is still proportional.   Embedding non breakable spaces in the display element would appear to be a work around.

Comment 6

10 years ago
Created attachment 319765 [details]
Testcase

Comment 7

10 years ago
So, the problem is that we don't allow authors to style 'white-space'
for select, option, optgroup:
http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/style/forms.css&rev=3.151&root=/cvsroot&mark=158,250,282#242
That seems like a bug to me.

I guess you can use &emsp; as a workaround for now.
Status: UNCONFIRMED → NEW
Component: General → Layout: Form Controls
Ever confirmed: true
Keywords: css1, testcase
OS: Windows Server 2003 → All
Product: Firefox → Core
QA Contact: general → layout.form-controls
Hardware: PC → All
Summary: Select/Option Listbox not using monospace font → Select/Option/OptGroup does not allow author to specify 'white-space'
Status: NEW → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 422128
You need to log in before you can comment on or make changes to this bug.