Leading/trailing whitespace in button labels stripped out even with fixed font




Layout: Form Controls
14 years ago
10 years ago


(Reporter: mike.blackwell, Unassigned)



Firefox Tracking Flags

(Not tracked)




14 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

The html snippet below produces submit buttons of the same size on Mozilla
1.0.4.   With the current version, the size of the button varies depending on
whether the caracter at the beginning/end of the value= is a space.  Space
appears to be treated differently, even though a fixed size font is selected.

input { font-family: monospace; }
<input type="submit" name="foo"   value=" foo ">
<input type="submit" name="fubar" value="fubar">
<input type="submit" name="bar"   value="  b  ">

Reproducible: Always

Steps to Reproduce:
1.  Just load the attached snippet
Actual Results:  
The second button is larger than the other two.

Expected Results:  
All buttons should be the same width.

This does not seem to be simply a missized space character in the font, as
spaces within the value= text are rendered correctly.

Comment 1

14 years ago
Using the same monospace style with a <select> yields the expected results in
both 1.0.4 and this version.  I.e.  a space is rendered at the same width as
other characters.
This is done on purpose, actually.  See the long comment at
which describes the reason we do it and the steps to take to maybe be able to
stop doing it (no guarantees on that).
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
Assignee: layout.form-controls → nobody
QA Contact: ian → layout.form-controls
The url in comment 2 should now be http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/layout/forms/nsGfxButtonControlFrame.cpp&rev=1.144&mark=259-275#254
Ever confirmed: true
Summary: Input type="submit" with fixed font not sized consistantly - improper handling of space character? → Leading/trailing whitespace in button labels stripped out even with fixed font
You need to log in before you can comment on or make changes to this bug.