Closed Bug 254238 Opened 20 years ago Closed 20 years ago

<input type="radio"> fires onChange twice for each click

Categories

(Core :: DOM: UI Events & Focus Handling, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: MatsPalmgren_bugz, Unassigned)

References

()

Details

(Keywords: testcase)

Attachments

(2 files)

Followup from bug 253299 comment 7:

Here is another problem that could be a regression from bug 17602.
Clicking the radio buttons, I see:
in Mozilla 1.7:   focus, click, change
in 2004-07-26-07: focus, click, change, change
Blocks: 275413
This is a pretty major DOM bug to have around....  See bug 275413 comment 3 for an 
idea of why this is happening.  Aaron, Brian, do you have any idea what's going on?
Flags: blocking1.8a6?
Blocks: 276279
Aaron, time is getting pretty short for Alpha6. Can you take a look at this soon?
Flags: blocking1.8a6? → blocking1.8a6+
I'll try, but I'm on vacation. If possible can someone else take a look?
Johnny, are you available to look at this for 1.8a6?
Attached patch Possible patchSplinter Review
It looks to me like all munging of the BF_CHECKED_IS_TOGGLED flag, of the
selectedRadioButton variable, etc, is conditioned on us not being in capture
and not being in the system event group, except this little chunk of code
(which happens to be where we fire onchange).  The patch fixes the testcase,
but I'm not completely sure how correct it is, unfortunately...
Attachment #170392 - Flags: superreview?(jst)
Attachment #170392 - Flags: review?(bryner)
Comment on attachment 170392 [details] [diff] [review]
Possible patch

Seems right to me. sr=jst
Attachment #170392 - Flags: superreview?(jst) → superreview+
No longer blocks: 275413
*** Bug 275413 has been marked as a duplicate of this bug. ***
Attached patch alternate fixSplinter Review
I like this way better... makes us completely consistent.
Attachment #170685 - Flags: superreview?(jst)
Attachment #170685 - Flags: review?(bzbarsky)
Comment on attachment 170685 [details] [diff] [review]
alternate fix

I'm not sure "toggle" is a good word, since this is the event that causes
inputs to submit forms too, and all.  Maybe "outerActivateEvent", with a
comment that this is the event that should cause the input's "default action",
whatever that is, to be triggered?

r=bzbarsky for the code. anyway, no matter how we resolve this variable naming
issue.
Attachment #170685 - Flags: review?(bzbarsky) → review+
Comment on attachment 170685 [details] [diff] [review]
alternate fix

sr=jst
Attachment #170685 - Flags: superreview?(jst) → superreview+
Comment on attachment 170685 [details] [diff] [review]
alternate fix

a=asa (on behalf of drivers) for checkin to 1.8a6
Attachment #170685 - Flags: approval1.8a6+
checked in.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Attachment #170392 - Flags: review?(bryner)
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: