Closed
Bug 418756
Opened 17 years ago
Closed 16 years ago
[FIX]Radios and checkboxes differ in how .checked and the "checked" attribute interact
Categories
(Core :: Layout: Form Controls, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: bzbarsky)
References
Details
(Keywords: testcase)
Attachments
(1 file, 2 obsolete files)
11.14 KB,
patch
|
Details | Diff | Splinter Review |
The radio button ends up being checked but the checkbox does not. This seems inconsistent, but I'm not sure it's a bug. I think refdyn would be happier if they both ended up unchecked, fwiw.
Noticed by refdyn + layout/reftests/bugs/120834-2h.html.
Assignee | ||
Comment 1•17 years ago
|
||
Radios do radio group stuff, unlike checkboxes. So their checked behavior is quite radically different.
Assignee | ||
Comment 2•17 years ago
|
||
In particular, when a radio is added to the DOM, its "checked has been set" value is set to the value of the other radios in the group by nsHTMLInputElement::AddedToRadioGroup. If there are no others, it's reset to false.
It would probably makes sense to not reset it if there are no other radios in the group...
Assignee | ||
Comment 3•17 years ago
|
||
Jesse, would you be willing to write up some tests for this behavior, including when there are multiple radios, etc?
In fact, it would be good to have a reasonably exhaustive test suite for radio behavior...
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #304658 -
Flags: superreview?(jonas)
Attachment #304658 -
Flags: review?(jonas)
Assignee | ||
Updated•17 years ago
|
Summary: Radios and checkboxes differ in how .checked and the "checked" attribute interact → [FIX]Radios and checkboxes differ in how .checked and the "checked" attribute interact
Reporter | ||
Comment 4•17 years ago
|
||
I don't think I understand this well enough to make an exhaustive set of tests.
Assignee | ||
Comment 5•17 years ago
|
||
Well, I dunno that anyone does, to be honest. I guess I can try to write tests based on what the code is doing...
Comment on attachment 304658 [details] [diff] [review]
Patch to that effect
Could we get some mochitests here too?
Attachment #304658 -
Flags: superreview?(jonas)
Attachment #304658 -
Flags: superreview+
Attachment #304658 -
Flags: review?(jonas)
Attachment #304658 -
Flags: review+
Assignee | ||
Comment 7•17 years ago
|
||
In June, yes.
I figure this is post-1.9 stuff at this point.
Assignee | ||
Comment 8•16 years ago
|
||
Attachment #304647 -
Attachment is obsolete: true
Attachment #304658 -
Attachment is obsolete: true
Assignee | ||
Comment 9•16 years ago
|
||
Fixed, with a few more tweaks to the tests.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•