Closed Bug 230854 Opened 21 years ago Closed 21 years ago

autoCheck attribute of buttons elements isn't work

Categories

(Core :: XBL, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: surkov, Assigned: hyatt)

References

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007 If I have group of buttons, in instance, with attribute autoCheck="true" (or without this attribute that is equivalent) then button will not checked automaticaly on command event. Because event handler on oncommand event isn't called in binging chrome://global/content/bindings/button.xml#button-base at all. Reproducible: Always Steps to Reproduce: 1. Create document with next content 2. <button group="1" type="radio" cheched="true"/> <button group="1" type="radio"/> <button group="1" type="radio"/> 3. Actual Results: Activated button isn't checked Expected Results: Activated button should be checked
Sorry. I was wrong. Problem appears only when I have attribute command. In this case event handler on command event isn't called. In instance: <command oncommand="alert(1)" label="test" id="cmd-test"/> <button command="cmd-test" oncommand="alert(2)"/> You'll see only message box with text "1". The same maner binding button.xml#button-base provides work of autoCheck attribute.
Attached patch Proposed patchSplinter Review
We can't rely on command events, the comment was copied from checkbox.xml
Attachment #139015 - Flags: review?(varga)
Comment on attachment 139015 [details] [diff] [review] Proposed patch I guess it's not possible to use capturing. r=varga
Attachment #139015 - Flags: review?(varga) → review+
Comment on attachment 139015 [details] [diff] [review] Proposed patch Jan, phases are irrelevent on the event target...
Attachment #139015 - Flags: superreview?(jag)
Comment on attachment 139015 [details] [diff] [review] Proposed patch Looks good. Perhaps it would be better to put this code in a helper function instead of duplicating it? sr=jag either way. Are there other bindings with this problem? Wouldn't <handler event="command" phase="capturing"> cause this code to be executed before other command listeners?
Attachment #139015 - Flags: superreview?(jag) → superreview+
Fix checked in.
Status: UNCONFIRMED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Neil explained to me that the element bound to never sees the command event, it's redirected to the <command> element pointed to, hence the need for onclick and onkey handlers.
s/onclick/click/ and s/onkey/keypress/.
[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: