File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1680,6 +1680,21 @@ void HTMLInputElement::clear_algorithm()
1680
1680
void HTMLInputElement::form_associated_element_was_inserted ()
1681
1681
{
1682
1682
create_shadow_tree_if_needed ();
1683
+
1684
+ if (is_connected ()) {
1685
+ // https://html.spec.whatwg.org/multipage/input.html#radio-button-state-(type=radio)
1686
+ // When any of the following phenomena occur, if the element's checkedness state is true after the occurrence,
1687
+ // the checkedness state of all the other elements in the same radio button group must be set to false:
1688
+ // ...
1689
+ // - The element becomes connected.
1690
+ if (type_state () == TypeAttributeState::RadioButton && checked ()) {
1691
+ root ().for_each_in_inclusive_subtree_of_type <HTMLInputElement>([&](auto & element) {
1692
+ if (element.checked () && &element != this && is_in_same_radio_button_group (*this , element))
1693
+ element.set_checked (false );
1694
+ return TraversalDecision::Continue;
1695
+ });
1696
+ }
1697
+ }
1683
1698
}
1684
1699
1685
1700
void HTMLInputElement::form_associated_element_was_removed (DOM::Node*)
You can’t perform that action at this time.
0 commit comments