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)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED FIXED

People

(Reporter: jruderman, Assigned: bzbarsky)

References

Details

(Keywords: testcase)

Attachments

(1 file, 2 obsolete files)

Attached file testcase (obsolete) —
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.
Radios do radio group stuff, unlike checkboxes. So their checked behavior is quite radically different.
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...
Attached patch Patch to that effect (obsolete) — Splinter Review
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)
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
I don't think I understand this well enough to make an exhaustive set of tests.
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+
In June, yes. I figure this is post-1.9 stuff at this point.
Attached patch Now with testsSplinter Review
Attachment #304647 - Attachment is obsolete: true
Attachment #304658 - Attachment is obsolete: true
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.

Attachment

General

Creator:
Created:
Updated:
Size: