File tree 1 file changed +13
-0
lines changed
1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -1649,6 +1649,19 @@ void HTMLInputElement::clear_algorithm()
1649
1649
void HTMLInputElement::form_associated_element_was_inserted ()
1650
1650
{
1651
1651
create_shadow_tree_if_needed ();
1652
+
1653
+ // https://html.spec.whatwg.org/multipage/input.html#radio-button-state-(type=radio)
1654
+ // When any of the following phenomena occur, if the element's checkedness state is true after the occurrence,
1655
+ // the checkedness state of all the other elements in the same radio button group must be set to false:
1656
+ // ...
1657
+ // - The element becomes connected.
1658
+ if (type_state () == TypeAttributeState::RadioButton && checked ()) {
1659
+ root ().for_each_in_inclusive_subtree_of_type <HTMLInputElement>([&](auto & element) {
1660
+ if (element.checked () && &element != this && is_in_same_radio_button_group (*this , element))
1661
+ element.set_checked (false );
1662
+ return TraversalDecision::Continue;
1663
+ });
1664
+ }
1652
1665
}
1653
1666
1654
1667
void HTMLInputElement::form_associated_element_was_removed (DOM::Node*)
You can’t perform that action at this time.
0 commit comments