Closed Bug 237138 Opened 20 years ago Closed 20 years ago

Disabled form controls are not always grayed out.

Categories

(Core Graveyard :: GFX, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bps7j, Unassigned)

References

Details

(4 keywords)

Attachments

(5 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040302 Firefox/0.8.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040302 Firefox/0.8.0+

Disabled form controls are not always grayed out.  The example I have seen is

<input type="radio" disabled="1">

Other values for the "disabled" attribute will cause it to gray out.

Reproducible: Always
Steps to Reproduce:
1.  Load the attached test case.
Actual Results:  
The form control is only grayed out sometimes.

Expected Results:  
Should have always grayed out the form control.
Seeing this in Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:)
Gecko/20040309 too.

--> Browser
Assignee: firefox → general
Component: General → Browser-General
Product: Firefox → Browser
QA Contact: general
Version: unspecified → Trunk
I couldn't find a duplicate for this. I confirm this bug also because
disabled="disabled" which is perfectly valid in HTML 4 will not be rendered
accordingly. Upon further examination of 
Program Files\Common Files\mozilla.org\GRE\[]\res\forms.css file,
I can not explain this. Additional testcase coming.
Status: UNCONFIRMED → NEW
Component: Browser-General → Layout: Form Controls
Ever confirmed: true
MSIE 6 SP1 for windows renders all radio buttons of this testcase with a gray
background color.
The forms.css file has:

input[type="radio"][disabled],
input[type="radio"][disabled]:active,
{
  color: GrayText ! important;
  background-color: ThreeDFace ! important;
}

So, I can not see/explain why radio buttons with disabled="disabled" do not have
a gray background when active and when not active.
Mozilla 1.7b 2004031008 here under XP Pro SP1.
Mozilla 1.4 and Mozilla 1.5 renders all disabled[=string] radio buttons with a
gray background. So this has to be a regression.
Keywords: regression
I renamed radio buttons so that each group of radio buttons has only 1 that is
checked[=checked]
Attachment #143641 - Attachment is obsolete: true
Assignee: general → core.layout.form-controls
Keywords: testcase
All three of the native theme impls screw up checking of boolean attrs on HTML
elements.  Such attrs are true if set at all, no matter what value.  See
http://lxr.mozilla.org/seamonkey/ident?i=CheckBooleanAttr for the function in
question.  Someone probably needs to check over the callers to make sure that
it's in fact only used for boolean attrs when HTML is concerned...

When native theming is off, the code in forms.css is used and this bug disappears.
Assignee: core.layout.form-controls → general
Component: Layout: Form Controls → GFX
Keywords: helpwanted
OS: Windows XP → All
QA Contact: general → ian
Hardware: PC → All
*** Bug 235563 has been marked as a duplicate of this bug. ***
I think we should fix this for 1.7.... it's pretty bad from a usability
perspective....
Flags: blocking1.7?
Not only that, but <input disabled> serializes as <input disabled="disabled">
Attached patch Windows fixSplinter Review
I couldn't figure out how to duplicate this bug on linux as I can't persuade my
build to support native theme form controls...
I know this doesn't have a lot of votes/ccs or anything, but if the patch
works... this can be a major usability problem.

After all, if a checkbox is disabled, it should look so - if it doesn't, people
might try to check it, and wonder why it won't check.  This can cause confusion
when the checkbox (or radio button...) should be disabled to indicate something.

Thanks,
-[Unknown]
Comment on attachment 144173 [details] [diff] [review]
Windows fix

Neil, how about just fixing nsNativeTheme::CheckBooleanAttr, and eliminating
the static functions in nsNativeThemeWin and nsNativeThemeGTK altogether?
Attached patch Mac fixSplinter Review
Of course we still need to make the other two native theme implementations
inherit from the so-called shared implementation...
Comment on attachment 144173 [details] [diff] [review]
Windows fix

r+sr=bzbarsky for this to go on the 1.7 branch only.  On the trunk, the other
patch is what we want.

Could this please be approved for 1.7?	It fixes the styling of disabled
"native themed" controls in HTML to actually look disabled (most of the time,
they did not).
Attachment #144173 - Flags: superreview+
Attachment #144173 - Flags: review+
Attachment #144173 - Flags: approval1.7?
> inherit from the so-called shared implementation...

Done for Windows.  See bug 232175.
(In reply to comment #17)
>>inherit from the so-called shared implementation...
>Done for Windows.  See bug 232175.
What about nsNativeThemeGTK? Do we need a branch patch as per attachment 144173 [details] [diff] [review]
and a new bug to fix the trunk as per bug 232175 too?
Ideally, yes to both.....
Comment on attachment 146453 [details] [diff] [review]
GTK branch fix

r+sr=bzbarsky.

Again, this would be nice to have on the 1.7 branch.
Attachment #146453 - Flags: superreview+
Attachment #146453 - Flags: review+
Attachment #146453 - Flags: approval1.7?
Comment on attachment 146407 [details] [diff] [review]
Mac fix

r+sr=bzbarsky here too.  Yay copy/paste code.
Attachment #146407 - Flags: superreview+
Attachment #146407 - Flags: review+
Attachment #146407 - Flags: approval1.7?
Comment on attachment 146453 [details] [diff] [review]
GTK branch fix

-  return attr.EqualsIgnoreCase("true"); // This handles the XUL case.
+  content->GetAttr(kNameSpaceID_None, aAtom, attr);
+  return attr.Equals(NS_LITERAL_STRING("true")); // This handles the XUL case.

this is no longer ignoring case, intentionally?
And yes, ignoring case is totally incorrect.  XUL is completely case-sensitive.
Comment on attachment 144173 [details] [diff] [review]
Windows fix

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #144173 - Flags: approval1.7? → approval1.7+
Comment on attachment 146407 [details] [diff] [review]
Mac fix

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #146407 - Flags: approval1.7? → approval1.7+
Comment on attachment 146453 [details] [diff] [review]
GTK branch fix

a=asa (on behalf of drivers) for checkin to 1.7
Attachment #146453 - Flags: approval1.7? → approval1.7+
144173, 146407, 146453 checked in to the branch.

Spun off bug 241070 on the GTK issue (comment 18).
Status: NEW → RESOLVED
Closed: 20 years ago
Keywords: fixed1.7
Resolution: --- → FIXED
Neil, are you going to check in the nsNativeTheme.cpp fix on trunk too?  We
really do want it there....
Whoops, oversight :-[
Flags: blocking1.7?
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: