Closed Bug 79927 Opened 23 years ago Closed 22 years ago

submit button with single character value is too small

Categories

(Core :: Layout: Form Controls, defect, P5)

defect

Tracking

()

VERIFIED FIXED
Future

People

(Reporter: glob, Assigned: rods)

References

()

Details

Attachments

(6 files, 1 obsolete file)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9) Gecko/20010505
BuildID:    2001050515

with normal submit buttons, the value of the button (ie what is shown on the
rendered html page) has gaps between the text and the side of the widget.  if
you set the value of a submit button to a single character, the spacing isn't
there, and it looks like the character is truncated.

Reproducible:
  Always

Steps to Reproduce:
  <input type="submit" value="x">

Actual Results:
  the button appears to have it's title truncated.

Expected Results:
  put a gap of a few pixels between the title and the edges of the button.
-> HTML Form Controls && confirming.
Assignee: trudelle → rods
Status: UNCONFIRMED → NEW
Component: XP Toolkit/Widgets → HTML Form Controls
Ever confirmed: true
QA Contact: jrgm → vladimire
For what is worth we size the same as Nav 4.x, but smaller than IE
Status: NEW → ASSIGNED
Target Milestone: --- → Future
This also happens with some two-letter buttons, such as the Iridium (77 Ir)
button at http://www.csrri.iit.edu/periodic-table.html.
Priority: -- → P4
bz, this is the bug we were talking about. Narrow buttons are too narrow, and wide 
buttons are too wide.
OS: Windows 2000 → All
Hardware: PC → All
The interesting thing is that while <input type="button|reset|submit"> is sized
wrong, <button> is sized correctly.  Attaching testcase.
Attached file testcase
Attached image IE's fugly button sizes
rods' patch to bug 96630 hardcoded quirks compatibility mode for buttons.
OK.  I see a few problems here...

1)  nsGfxButtonControlFrame::DoNavQuirksReflow has the following comment:

    // Note: The Quirks sizing includes a 2px border in its calculation of
    // "desiredSize"

    This is incorrect.  As far as I can tell, the quirks sizing algorithm does
    nothing of the sort.  So we lose 4px of width here for no reason.  This is
    the root of the problem.  Not subtracting those 4px off makes us size
    correctly (or at least not cut off the text).  Attaching a patch for this.

2)  The left/right padding for these controls in forms.css is 0px!  I'm not sure 
    why <button> is rendering as it does, but it would make sense to me to fix
    <button> to use the same algorithm and make the padding nonzero. IE/Win and
    IE/Mac both seem to do about 5-10 pixels of padding, as do Opera/Mac and
    iCab/Mac (see screenshots in bug 108424 and the IE screenshot in this bug).

This should be the topic of a separate bug, in my opinion.
Attached patch proposed patch (obsolete) — Splinter Review
Oh, and as regards the original testcase... The "bad" cases should be fixed by
this patch and some default padding. The "too much" case is there for
compatibility with IE/Win, unfotunately. And it's not likely to go away...
Keywords: patch, review
Attachment #56494 - Attachment is obsolete: true
*** Bug 115996 has been marked as a duplicate of this bug. ***
*** Bug 117606 has been marked as a duplicate of this bug. ***
Attached patch patchSplinter Review
I can live with this patch, but anything else will change the button sizes too
much.
rods: I don't really like the special-casing there.  Why does it make sense to
subtract out the 2-pixel border when there is one character but not when there
are others?  Does IE do that?  Does it *matter* whether IE does that when it
comes to 2 pixels in a form control, which most people render differently anyway?

bz: I don't think we should be changing the heights of text/select/submit to be
the same in this bug, though I *do* think that should be a new bug.  While I
personally think it makes a great deal of sense to make them the same size by
default, I am not sure of the ramifications to compatibility/page sizing/etc. are.

I vote for the obsoleted patch :)
rods: can the sizing be moved to quirks.css ?
Why would we move it to the Quirks stylesheet? As far as I can tell, this is not
a quirks vs. standard mode compatibility thing. All other browsers size their
buttons like bz's patch - I think we should go with that patch.
Just to clarify.  My patch does not make us size like other browsers.  It just
makes us not cut off the text.  So does rods' patch.  Other browsers actually
put padding around the text too...  we will not with my patch, or rods'.

The "size as other browsers" issue is still being hashed out (unlike the
"cutting off text issue", which everyone agrees is bad).
*** Bug 119461 has been marked as a duplicate of this bug. ***
Blocks: 123569
Priority: P4 → P5
Is there a reason that this hasn't gone in?
My patch didn't go in because rods (module owner) was opposed to it.  Rod's
patch did not go in because it does not really fix the bug in my testing (eg
using two lowercase 'L's with variable-width font).
Blocks: 170238
Depends on: 167236
fixed by bug 167236
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
v 2002111308-trunk/WinXP
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: