Closed Bug 180085 Opened 22 years ago Closed 22 years ago

[FIX]button text is shifted to right

Categories

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

defect

Tracking

()

RESOLVED FIXED
mozilla1.3alpha

People

(Reporter: axlrey, Assigned: bzbarsky)

References

(Depends on 1 open bug, )

Details

(Keywords: regression, testcase)

Attachments

(6 files, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021113
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021113

Text in small "ok" button in top left corner text is not centered. Whole text is
shifted to right. Part of letter "k" is not visible.

1.2b Builds showing this correctly.

Reproducible: Always

Steps to Reproduce:
1. Go To URL
2. Watch "ok" button int top left corner





Testcase will follow.
Attached file Testcase from bug URL
Attached file even worse
setting button width to 20px give very strange results
Attached file new testcase
Confirming on Linux, (it behaves like that for about 2 days). When you specify
only width and no padding input takes 100% of available space (second case in
testcase)
Keywords: regression, testcase
I also see this in the test cases.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Confirming with 2002111308 on win98se.

I also noticed that adding

  padding: 0;

to input[type=button], input[type=submit], input[type=reset] is an effective
workaround.  However, those characteristics are not inherited by
input[type=button]:hover, input[type=submit]:hover, input[type=reset]:hover or
by input[type=button]:hover:active, input[type=submit]:hover:active,
input[type=reset]:hover:active and they should be, correct?
So the problem here is that buttons have box-sizing border-box.  So when you set
the width, that sets the width of the whole thing, including borders, padding,
etc.  The left+padding on inputs is about 20px or so.  So setting anything less
than 20px as the width will lead to weird results (that need to be fixed).

Setting something that's _bigger_ than 20px is a separate issue...  The only
reason the code on that site works with older builds is that those have no
built-in left/right padding.  If we _do_ have padding, border-box sizing means
that we're not leaving enough space for the text.

Could someone test this with a browser other than WinIE?  In particular, I would
like to know how MacIE handles this.

jkeiser?  Thoughts?
Assignee: form → bzbarsky
OS: Windows 2000 → All
Priority: -- → P1
Hardware: PC → All
Target Milestone: --- → mozilla1.3alpha
Oh, an no. hovered buttons should not "inherit" the padding; if you specify
padding there, you're on your own to make sure the hover and active effects
still work right.
I thought I'd cced jkeiser... ;)
OK.  I think the right solution is to more or less center the text inside the
button no matter what the width is (in other words, decrease the left offset as
needed so that the text is centered in those testcases).  Need to not break the
:hover stuff in the process, of course.
And not clear what the right solution for <button> is.
Attached file more complete testcase
Attached patch something like this..... (obsolete) — Splinter Review
Attached patch Need this too... (obsolete) — Splinter Review
Yay webmasters working around IE broken-ness and breaking in every other
browser....
Attachment #106262 - Attachment is obsolete: true
Attachment #106267 - Flags: review?(jkeiser)
Attached patch by popular request.... (obsolete) — Splinter Review
Attachment #106267 - Attachment is obsolete: true
Attachment #106267 - Flags: review?(jkeiser)
Attachment #106271 - Flags: review?(jkeiser)
Comment on attachment 106271 [details] [diff] [review]
by popular request....

r=jkeiser with a comment explaining how the spaces thing is TEMPORARY and
caused largely by the fact that our focus border makes us take up an excessive
amount of space for the border.
Attachment #106271 - Flags: review?(jkeiser) → review+
Attached patch mmm... comment (obsolete) — Splinter Review
Attachment #106271 - Attachment is obsolete: true
Attached patch Better commentSplinter Review
Attachment #106367 - Attachment is obsolete: true
Attachment #106368 - Flags: superreview?(roc+moz)
Comment on attachment 106368 [details] [diff] [review]
Better comment

r=jkeiser, I just wish the comment was more verbose ;)
Attachment #106368 - Flags: review+
Summary: button text is shifted to right → [FIX]button text is shifted to right
Comment on attachment 106368 [details] [diff] [review]
Better comment

sr=roc+moz
Attachment #106368 - Flags: superreview?(roc+moz) → superreview+
*** Bug 180471 has been marked as a duplicate of this bug. ***
fixed
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
We should migrate these tests to reftest or something.
Flags: in-testsuite?
I checked in a reftest, but I'm not sure it's really good enough to test this... I'm not sure any of our existing test suites can _really_ test the expectations here.  :(  At least not without a good bit more in the way of assumptions about our form controls focuspaddings, etc.
Blocks: 476669
Depends on: 590007
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: