Closed Bug 112218 Opened 23 years ago Closed 23 years ago

"checked" on a radio button or checkbox causes "onchange" to fire

Categories

(SeaMonkey :: General, defect, P1)

x86
Linux

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: bart, Assigned: john)

References

()

Details

Attachments

(2 files, 2 obsolete files)

<input type="radio" name="a" onchange="form.submit()" checked="on"/>

spontaneously submits the form.
Build ID: 2001 11 27 03. Windows 2000.

I sugggest severity CRITICAL for this one. Simply clicking on the URL link above,
caused my Mozilla to suck 100% CPU for a while and finally crash.

Incident ID: TB38579371W
baaad...
Assignee: asa → jkeiser
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #59485 - Attachment is patch: false
Attachment #59485 - Attachment mime type: text/plain → text/html
Stack Signature  nsDSURIContentListener::IsPreferred 8bc9802d
Bug ID
Trigger Time 2001-11-27 13:12:18
Email Address svante@nemesis.se
URL visited http://www.aftonbladet.se/
User Comments
Build ID 2001112706
Product ID MozillaTrunk
Platform
Operating System Win32
Module
Trigger Reason Access violation
Stack Trace
nsDSURIContentListener::IsPreferred
[d:\builds\seamonkey\mozilla\docshell\base\nsDSURIContentListener.cpp, line 150]
nsURILoader::ShouldHandleContent
[d:\builds\seamonkey\mozilla\uriloader\base\nsURILoader.cpp, line 672]
nsURILoader::DispatchContent
[d:\builds\seamonkey\mozilla\uriloader\base\nsURILoader.cpp, line 720]
nsDocumentOpenInfo::DispatchContent
[d:\builds\seamonkey\mozilla\uriloader\base\nsURILoader.cpp, line 300]
nsDocumentOpenInfo::OnStartRequest
[d:\builds\seamonkey\mozilla\uriloader\base\nsURILoader.cpp, line 226]
nsHttpChannel::OnStartRequest
[d:\builds\seamonkey\mozilla\netwerk\protocol\http\src\nsHttpChannel.cpp, line 2271]
nsOnStartRequestEvent::HandleEvent
[d:\builds\seamonkey\mozilla\netwerk\base\src\nsRequestObserverProxy.cpp, line 126]
PL_HandleEvent [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c, line 591]
PL_ProcessPendingEvents [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c,
line 524]
_md_EventReceiverProc [d:\builds\seamonkey\mozilla\xpcom\threads\plevent.c, line
1072]
nsAppShellService::Run
[d:\builds\seamonkey\mozilla\xpfe\appshell\src\nsAppShellService.cpp, line 303]
main1 [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp, line 1318]
main [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp, line 1635]
WinMain [d:\builds\seamonkey\mozilla\xpfe\bootstrap\nsAppRunner.cpp, line 1653]
WinMainCRTStartup()
KERNEL32.DLL + 0x192a6 (0x77e992a6) 
*** Bug 115303 has been marked as a duplicate of this bug. ***
Taking.  The underlying problem is, we have always fired onChange when JS sets
the checked attribute.  This just got worse because now content sets the
attribute instead of the frame.
Status: NEW → ASSIGNED
Attached patch Fix (obsolete) — Splinter Review
This fix should tide the tree over until I get radio retooled and fix the JS
error.
Um... jkeiser, is that really the file you meant to upload?
Attached patch Real Fix (obsolete) — Splinter Review
Oopsy-daisy :)
Attachment #61864 - Attachment is obsolete: true
By the way, I was mistaken in my earlier comment.  radio does *not* yet set
default value from content.  That is one of the two controls that was not
converted.  The error stemmed from my calling content's Reset() instead of
setting it checked in the radio button frame itself.

The more general problem probably already has a bug and will definitely be in
the radio content/presentation fix.
r=rods
Summary: "checked" on a radio button causes "onchange" to fire → "checked" on a radio button or checkbox causes "onchange" to fire
*** Bug 115412 has been marked as a duplicate of this bug. ***
Checkbox has the same exact problem (presumable the same patch in CheckboxFrame)
Added checkbox (tested against most recent dup bug)
Attachment #61872 - Attachment is obsolete: true
Comment on attachment 61879 [details] [diff] [review]
Patch With Checkbox

sr=jst. Given that the changes to the checkbox code is the same as the changes
to the radio code I'd say go ahead and check this in.

Rods, please do a post checkin review if this gets checked in before you have a
chance to look at the additional changes.
Attachment #61879 - Flags: superreview+
Attachment #61879 - Flags: review+
still broken in 0.9.7.

i neglected to mention in my first report that this was a new behavior with 0.9.6.
Double drat!  Sorry, I didn't check this in.  I will get to it when I get back 
from vacation (3rd or 4th), or if someone else wants to check it in, you may 
always be my guest :)
Mozilla 0.9.7 (2001122106) still fires onChange event if default checkbox state
is "checked" !
Setting to P1 so I remember to check this in next Wed. when my Internet access 
(hopefully) arrives.  Again, anyone interested in checking in in the meantime 
may be my guest.
Priority: -- → P1
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 120279 has been marked as a duplicate of this bug. ***
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: