Closed Bug 259724 Opened 20 years ago Closed 20 years ago

wrong behaviour of toolbarbutton when it is disabled

Categories

(Core :: XUL, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: surkov, Assigned: Stefan.Borggraefe)

References

Details

(Keywords: regression)

Attachments

(2 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7) Gecko/20040616

If disabled toolbarbutton has attributes type="radio" or type="checkbox" then
toolbarbutton is pressed on mouse click.

Reproducible: Always
Steps to Reproduce:
1 write: <toolbarbutton label="press me" type="checkbox" disabled="true"/>
2 click on the button
Actual Results:  
toolbarbutton will be checked

Expected Results:  
toolbarbutton should not be checked
Attached file test case
Oops. Fallout from bug 230854 :-[
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
Assignee: jag → Stefan.Borggraefe
OS: Windows 2000 → All
Hardware: PC → All
Attached patch Patch (obsolete) — Splinter Review
Attachment #159353 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 159353 [details] [diff] [review]
Patch

>+              (this.autoCheck || !this.hasAttribute("autoCheck"))) {
>+
>+            if (this.type == "checkbox") {
Any particular reason for the blank line?

>       <handler event="click" button="0">
>       <![CDATA[
>-        if (this.autoCheck || !this.hasAttribute("autoCheck")) {
>-          if (this.type == "checkbox") {
>-            this.checked = !this.checked;
>-          } else if (this.type == "radio") {
>-            this.checked = true;
>-          }
>-        }
>+        this._handleClick();
>       ]]>
>       </handler>
This cleanup is nice but I think would be that little bit nicer using the
action attribute on the handler instead of a body.
Attached patch Patch V1.1Splinter Review
Uses the action attribute of <handler>.

I think the blank line improves the readability of the code.
Attachment #159353 - Attachment is obsolete: true
Attachment #159353 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #159356 - Flags: review?(neil.parkwaycc.co.uk)
Comment on attachment 159356 [details] [diff] [review]
Patch V1.1

r+sr=me although I'm not 100% convinced about the blank line...
Attachment #159356 - Flags: review?(neil.parkwaycc.co.uk) → review+
Fix checked in. (With the blank line.) ;-)
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
[Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.8.1a2) Gecko/20060518 SeaMonkey/1.1a] (nightly) (W98SE)

V.Fixed (on MOZILLA_1_8_BRANCH), with testcase in bug 282180.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: