Closed Bug 373381 Opened 17 years ago Closed 17 years ago

Rendering of radios/checkboxes with auto width has regressed

Categories

(Core :: Layout: Form Controls, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: sharparrow1)

References

()

Details

(Keywords: regression)

Attachments

(2 files)

STEPS TO REPRODUCE:  Load the testcase in the URL field

EXPECTED RESULTS: Radio button

ACTUAL RESULTS: Weird rectangular thing.  NOT round.

This regressed between 2007-02-06-01 and 2007-02-07-01.  Checkin range:

http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=MozillaTinderboxAll&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-02-06+01%3A00%3A00&maxdate=2007-02-07+01%3A00%3A00&cvsroot=%2Fcvsroot

Looks like a regression from bug 177805 somehow...

This is making radio buttons pretty unusable whenever I hit sites that style them like that.
Flags: blocking1.9?
Keywords: regression
Aha, so that's why form control frames have a default width... ugh.

I'll have a patch sometime soon.
Blocks: 370373
Then again, maybe we don't really care...

What do other browsers do here?
If such sites exist, we should probably fix this.  After all, they ought to act like replaced elements.
Attached patch PatchSplinter Review
Blech, this is messy, but I think it's correct.
Attachment #258067 - Flags: review?(roc)
On a side note, why doesn't Linux have themed form controls?  (On Windows, to get this to show up I have to use <meta http-equiv="msthemecompatible" content="no">.)
please add a test for this, since it has slipped through the review process this time, and probably will again.
Flags: in-testsuite?
I had a patch to use themed form controls on Linux...
http://weblogs.mozillazine.org/roc/archives/2006/02/cairo_linux_and_gtk2_themes.html

We turned it off because it turns out most GTK2 themes look really bad when applied to HTML content. They tend to draw with the assumption that the underlying window has the GTK2 theme background color. For example, most Clearlooks-based themes draw text boxes with rounded corners by filling in the corners with what they presume is the window background color, which looks absolutely ugly when it isn't the background color, and in most HTML content it isn't.
Comment on attachment 258067 [details] [diff] [review]
Patch

If your intent is to have a default border-box size of 13 pixels assuming a 2-pixel wide border, could you say so in a comment?
Attachment #258067 - Flags: superreview+
Attachment #258067 - Flags: review?(roc)
Attachment #258067 - Flags: review+
Attached patch Final patchSplinter Review
Fixed comment, and added a simple reftest.  (I'll check this in sometime soon.)
Comment on attachment 258140 [details] [diff] [review]
Final patch

>Index: reftests/bugs/373381-1.html
>+<meta http-equiv="msthemecompatible" content="no">

It's probably worth having a second test (and second reference) without that.

>+<input type="radio" style="width: auto">

You could add two more to the same test file (and then put two more unstyled in the reference):

<input type="radio" style="height: auto">
<input type="radio" style="height: auto; width: auto">
(In reply to comment #10)
> >+<input type="radio" style="width: auto">
> 
> You could add two more to the same test file (and then put two more unstyled in
> the reference):
> 
> <input type="radio" style="height: auto">
> <input type="radio" style="height: auto; width: auto">

Will do.

BTW, what exactly do we expect to happen if someone uses "height: 50px" on a checkbox?  IE and Fx with theming on Windows on put a square checkbox in 50px-high box, and Fx without theming draws a rectangular checkbox.  Hmm, I guess the way to fix it is to mess with how we draw checkboxes and radio buttons a bit.  (We also might want to address what to do if someone does "height: 50px; width: auto;", which could be different.)

> >+<meta http-equiv="msthemecompatible" content="no">
> 
> It's probably worth having a second test (and second reference) without that.

Okay... I'm actually running into issues with height: auto and themed checkboxes.  (Why only themed and only height?  I don't know.  I'll have to see if I can figure it out easily... probably some odd interaction between the border-box declaration, theming, and way the height gets computed.)  I guess I'll file another bug on it.
Checked in.

Filed Bug 373852 on the themed checkbox issue.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Flags: blocking1.9?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: