Title: [288631] trunk
Revision
288631
Author
[email protected]
Date
2022-01-26 11:13:23 -0800 (Wed, 26 Jan 2022)

Log Message

Unreviewed, revert r286855 as it caused form submission issues
https://bugs.webkit.org/show_bug.cgi?id=235645
<rdar://88020080>


LayoutTests/imported/w3c:

* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
* web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
* web-platform-tests/html/semantics/forms/the-input-element/radio-expected.txt:

Source/WebCore:

* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::setChecked):
(WebCore::HTMLInputElement::didChangeForm):
(WebCore::HTMLInputElement::insertedIntoAncestor):
(WebCore::HTMLInputElement::removedFromAncestor):
(WebCore::HTMLInputElement::checkedRadioButtonForGroup const):
* html/InputType.h:
(WebCore::InputType::willUpdateCheckedness): Deleted.
* html/RadioInputType.cpp:
(WebCore::RadioInputType::valueMissing const):
(WebCore::RadioInputType::willUpdateCheckedness): Deleted.
* html/RadioInputType.h:

LayoutTests:

* fast/forms/radio/ValidityState-valueMissing-radio-expected.txt:
* fast/forms/radio/ValidityState-valueMissing-radio.html:
* fast/forms/radio/radio-live-validation-style-expected.txt:
* fast/forms/radio/radio-live-validation-style.html:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
* platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
* platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (288630 => 288631)


--- trunk/LayoutTests/ChangeLog	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/ChangeLog	2022-01-26 19:13:23 UTC (rev 288631)
@@ -1,3 +1,18 @@
+2022-01-26  Chris Dumez  <[email protected]>
+
+        Unreviewed, revert r286855 as it caused form submission issues
+        https://bugs.webkit.org/show_bug.cgi?id=235645
+        <rdar://88020080>
+
+        * fast/forms/radio/ValidityState-valueMissing-radio-expected.txt:
+        * fast/forms/radio/ValidityState-valueMissing-radio.html:
+        * fast/forms/radio/radio-live-validation-style-expected.txt:
+        * fast/forms/radio/radio-live-validation-style.html:
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
+        * platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
+        * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
+        * platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
+
 2022-01-26  Antti Koivisto  <[email protected]>
 
         [CSS Container Queries] container-type property should establish containment for 'size' and 'inline-size' values

Modified: trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio-expected.txt (288630 => 288631)


--- trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -40,11 +40,11 @@
 PASS inputs[2].validity.valueMissing is false
 
 Not in a radio button group
+PASS requiredButton.validity.valueMissing is false
 PASS requiredButton.validity.valueMissing is true
-PASS requiredButton.validity.valueMissing is true
 PASS button.validity.valueMissing is true
 PASS button.validity.valueMissing is false
-PASS requiredButton.validity.valueMissing is true
+PASS requiredButton.validity.valueMissing is false
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio.html (288630 => 288631)


--- trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio.html	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/fast/forms/radio/ValidityState-valueMissing-radio.html	2022-01-26 19:13:23 UTC (rev 288631)
@@ -71,7 +71,7 @@
 requiredButton.type = 'radio';
 requiredButton.name = 'victim';
 requiredButton.required = true;
-shouldBeTrue('requiredButton.validity.valueMissing');
+shouldBeFalse('requiredButton.validity.valueMissing');
 
 parent.innerHTML = '<input name=victim type=radio required><input name=victim type=radio>';
 requiredButton = document.getElementsByName('victim')[0];
@@ -81,7 +81,7 @@
 parent.removeChild(button);
 shouldBeFalse('button.validity.valueMissing');
 parent.removeChild(requiredButton);
-shouldBeTrue('requiredButton.validity.valueMissing');
+shouldBeFalse('requiredButton.validity.valueMissing');
 
 </script>
 <script src=""

Modified: trunk/LayoutTests/fast/forms/radio/radio-live-validation-style-expected.txt (288630 => 288631)


--- trunk/LayoutTests/fast/forms/radio/radio-live-validation-style-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/fast/forms/radio/radio-live-validation-style-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -7,7 +7,7 @@
 PASS backgroundOf($("radio1")) is validColor
 PASS parent.removeChild($("radio2")); backgroundOf($("radio1")) is invalidColor
 PASS $("radio1").remove(); radio2.matches(":valid") is false
-PASS radio2.remove(); radio2.matches(":valid") is false
+PASS radio2.remove(); radio2.matches(":valid") is true
 
 Removing a checked radio button from a required radio button group by name attribute change:
 PASS $("radio2").name = "group2"; backgroundOf($("radio1")) is invalidColor

Modified: trunk/LayoutTests/fast/forms/radio/radio-live-validation-style.html (288630 => 288631)


--- trunk/LayoutTests/fast/forms/radio/radio-live-validation-style.html	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/fast/forms/radio/radio-live-validation-style.html	2022-01-26 19:13:23 UTC (rev 288631)
@@ -35,7 +35,7 @@
     '<input type=radio name=group1 required id=radio3>';
 var radio2 = $('radio2');
 shouldBeFalse('$("radio1").remove(); radio2.matches(":valid")');
-shouldBeFalse('radio2.remove(); radio2.matches(":valid")');
+shouldBeTrue('radio2.remove(); radio2.matches(":valid")');
 debug('');
 
 debug('Removing a checked radio button from a required radio button group by name attribute change:');

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (288630 => 288631)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-01-26 19:13:23 UTC (rev 288631)
@@ -1,3 +1,13 @@
+2022-01-26  Chris Dumez  <[email protected]>
+
+        Unreviewed, revert r286855 as it caused form submission issues
+        https://bugs.webkit.org/show_bug.cgi?id=235645
+        <rdar://88020080>
+
+        * web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt:
+        * web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt:
+        * web-platform-tests/html/semantics/forms/the-input-element/radio-expected.txt:
+
 2022-01-26  Antti Koivisto  <[email protected]>
 
         [CSS Container Queries] container-type property should establish containment for 'size' and 'inline-size' values

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt (288630 => 288631)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -23,7 +23,7 @@
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.stepMismatch is true
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.valueMissing is true
 PASS [INPUT in CHECKBOX status] validity.valid must be false if validity.valueMissing is true
-PASS [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true
+FAIL [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true assert_false: The validity.valid should be false. expected false got true
 PASS [INPUT in FILE status] validity.valid must be false if validity.valueMissing is true
 PASS [select]  validity.valid must be false if validity.valueMissing is true
 PASS [textarea]  validity.valid must be false if validity.valueMissing is true

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt (288630 => 288631)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -38,7 +38,7 @@
 PASS [INPUT in CHECKBOX status] The checked attribute is false
 PASS [INPUT in RADIO status] The required attribute is not set
 PASS [INPUT in RADIO status] The checked attribute is true
-PASS [INPUT in RADIO status] The checked attribute is false
+FAIL [INPUT in RADIO status] The checked attribute is false assert_true: The validity.valueMissing should be true. expected true got false
 PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
 PASS [INPUT in FILE status] The required attribute is not set
 PASS [INPUT in FILE status] The Files attribute is null

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-expected.txt (288630 => 288631)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/the-input-element/radio-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -7,8 +7,8 @@
 PASS radio inputs with non-ASCII name attributes belong to the same radio button group
 PASS changing the name of a radio input element and setting its checkedness to true makes all the other elements' checkedness in the same radio button group be set to false
 PASS moving radio input element out of or into a form should still work as expected
-PASS Radio buttons in an orphan tree should make a group
-PASS Radio buttons in different groups (because they have different form owners or no form owner) do not affect each other's checkedness
+FAIL Radio buttons in an orphan tree should make a group assert_false: The second radio should be unchecked after setting checked expected false got true
+FAIL Radio buttons in different groups (because they have different form owners or no form owner) do not affect each other's checkedness assert_false: radio5 should be unchecked expected false got true
 PASS Radio buttons in different groups (because they are not in the same tree) do not affect each other's checkedness
 PASS Radio buttons in different groups (because they have different name attribute values, or no name attribute) do not affect each other's checkedness
 

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -38,7 +38,7 @@
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.stepMismatch is true
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.valueMissing is true
 PASS [INPUT in CHECKBOX status] validity.valid must be false if validity.valueMissing is true
-PASS [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true
+FAIL [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true assert_false: The validity.valid should be false. expected false got true
 PASS [INPUT in FILE status] validity.valid must be false if validity.valueMissing is true
 PASS [select]  validity.valid must be false if validity.valueMissing is true
 PASS [textarea]  validity.valid must be false if validity.valueMissing is true

Modified: trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -84,7 +84,7 @@
 PASS [INPUT in CHECKBOX status] The checked attribute is false
 PASS [INPUT in RADIO status] The required attribute is not set
 PASS [INPUT in RADIO status] The checked attribute is true
-PASS [INPUT in RADIO status] The checked attribute is false
+FAIL [INPUT in RADIO status] The checked attribute is false assert_true: The validity.valueMissing should be true. expected true got false
 PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
 PASS [INPUT in FILE status] The required attribute is not set
 PASS [INPUT in FILE status] The Files attribute is null

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -38,7 +38,7 @@
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.stepMismatch is true
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.valueMissing is true
 PASS [INPUT in CHECKBOX status] validity.valid must be false if validity.valueMissing is true
-PASS [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true
+FAIL [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true assert_false: The validity.valid should be false. expected false got true
 PASS [INPUT in FILE status] validity.valid must be false if validity.valueMissing is true
 PASS [select]  validity.valid must be false if validity.valueMissing is true
 PASS [textarea]  validity.valid must be false if validity.valueMissing is true

Modified: trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/ios-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -84,7 +84,7 @@
 PASS [INPUT in CHECKBOX status] The checked attribute is false
 PASS [INPUT in RADIO status] The required attribute is not set
 PASS [INPUT in RADIO status] The checked attribute is true
-PASS [INPUT in RADIO status] The checked attribute is false
+FAIL [INPUT in RADIO status] The checked attribute is false assert_true: The validity.valueMissing should be true. expected true got false
 PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
 PASS [INPUT in FILE status] The required attribute is not set
 PASS [INPUT in FILE status] The Files attribute is null

Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valid-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -38,7 +38,7 @@
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.stepMismatch is true
 PASS [INPUT in NUMBER status] validity.valid must be false if validity.valueMissing is true
 PASS [INPUT in CHECKBOX status] validity.valid must be false if validity.valueMissing is true
-PASS [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true
+FAIL [INPUT in RADIO status] validity.valid must be false if validity.valueMissing is true assert_false: The validity.valid should be false. expected false got true
 PASS [INPUT in FILE status] validity.valid must be false if validity.valueMissing is true
 PASS [select]  validity.valid must be false if validity.valueMissing is true
 PASS [textarea]  validity.valid must be false if validity.valueMissing is true

Modified: trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt (288630 => 288631)


--- trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/LayoutTests/platform/mac-wk2/imported/w3c/web-platform-tests/html/semantics/forms/constraints/form-validation-validity-valueMissing-expected.txt	2022-01-26 19:13:23 UTC (rev 288631)
@@ -84,7 +84,7 @@
 PASS [INPUT in CHECKBOX status] The checked attribute is false
 PASS [INPUT in RADIO status] The required attribute is not set
 PASS [INPUT in RADIO status] The checked attribute is true
-PASS [INPUT in RADIO status] The checked attribute is false
+FAIL [INPUT in RADIO status] The checked attribute is false assert_true: The validity.valueMissing should be true. expected true got false
 PASS [INPUT in RADIO status] The checked attribute is false and the name attribute is empty
 PASS [INPUT in FILE status] The required attribute is not set
 PASS [INPUT in FILE status] The Files attribute is null

Modified: trunk/Source/WebCore/ChangeLog (288630 => 288631)


--- trunk/Source/WebCore/ChangeLog	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/Source/WebCore/ChangeLog	2022-01-26 19:13:23 UTC (rev 288631)
@@ -1,3 +1,22 @@
+2022-01-26  Chris Dumez  <[email protected]>
+
+        Unreviewed, revert r286855 as it caused form submission issues
+        https://bugs.webkit.org/show_bug.cgi?id=235645
+        <rdar://88020080>
+
+        * html/HTMLInputElement.cpp:
+        (WebCore::HTMLInputElement::setChecked):
+        (WebCore::HTMLInputElement::didChangeForm):
+        (WebCore::HTMLInputElement::insertedIntoAncestor):
+        (WebCore::HTMLInputElement::removedFromAncestor):
+        (WebCore::HTMLInputElement::checkedRadioButtonForGroup const):
+        * html/InputType.h:
+        (WebCore::InputType::willUpdateCheckedness): Deleted.
+        * html/RadioInputType.cpp:
+        (WebCore::RadioInputType::valueMissing const):
+        (WebCore::RadioInputType::willUpdateCheckedness): Deleted.
+        * html/RadioInputType.h:
+
 2022-01-26  Antti Koivisto  <[email protected]>
 
         [CSS Container Queries] container-type property should establish containment for 'size' and 'inline-size' values

Modified: trunk/Source/WebCore/html/HTMLInputElement.cpp (288630 => 288631)


--- trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/Source/WebCore/html/HTMLInputElement.cpp	2022-01-26 19:13:23 UTC (rev 288631)
@@ -980,8 +980,6 @@
     if (checked() == isChecked)
         return;
 
-    m_inputType->willUpdateCheckedness(isChecked);
-
     Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked, isChecked);
 
     m_dirtyCheckednessFlag = true;
@@ -1578,14 +1576,12 @@
 
 void HTMLInputElement::didChangeForm()
 {
+    HTMLTextFormControlElement::didChangeForm();
     addToRadioButtonGroup();
-    HTMLTextFormControlElement::didChangeForm();
 }
 
 Node::InsertedIntoAncestorResult HTMLInputElement::insertedIntoAncestor(InsertionType insertionType, ContainerNode& parentOfInsertedTree)
 {
-    if (isRadioButton())
-        updateValidity();
     HTMLTextFormControlElement::insertedIntoAncestor(insertionType, parentOfInsertedTree);
 #if ENABLE(DATALIST_ELEMENT)
     resetListAttributeTargetObserver();
@@ -1612,8 +1608,6 @@
         removeFromRadioButtonGroup();
     HTMLTextFormControlElement::removedFromAncestor(removalType, oldParentOfRemovedTree);
     ASSERT(!isConnected());
-    if (removalType.disconnectedFromDocument && !form() && isRadioButton())
-        updateValidity();
 #if ENABLE(DATALIST_ELEMENT)
     resetListAttributeTargetObserver();
 #endif
@@ -1962,21 +1956,8 @@
 
 RefPtr<HTMLInputElement> HTMLInputElement::checkedRadioButtonForGroup() const
 {
-    if (checked())
-        return const_cast<HTMLInputElement*>(this);
-
-    auto& name = this->name();
     if (RadioButtonGroups* buttons = radioButtonGroups())
-        return buttons->checkedButtonForGroup(name);
-
-    if (name.isEmpty())
-        return nullptr;
-
-    // The input is not managed by a RadioButtonGroups, we'll need to traverse the tree.
-    for (auto& descendant : descendantsOfType<HTMLInputElement>(rootNode())) {
-        if (descendant.checked() && descendant.isRadioButton() && !descendant.form() && name == descendant.name())
-            return &descendant;
-    }
+        return buttons->checkedButtonForGroup(name());
     return nullptr;
 }
 

Modified: trunk/Source/WebCore/html/InputType.h (288630 => 288631)


--- trunk/Source/WebCore/html/InputType.h	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/Source/WebCore/html/InputType.h	2022-01-26 19:13:23 UTC (rev 288631)
@@ -363,7 +363,6 @@
 #if ENABLE(DATALIST_ELEMENT)
     virtual bool isFocusingWithDataListDropdown() const { return false; };
 #endif
-    virtual void willUpdateCheckedness(bool /*nowChecked*/) { }
 
     // Parses the specified string for the type, and return
     // the Decimal value for the parsing result if the parsing

Modified: trunk/Source/WebCore/html/RadioInputType.cpp (288630 => 288631)


--- trunk/Source/WebCore/html/RadioInputType.cpp	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/Source/WebCore/html/RadioInputType.cpp	2022-01-26 19:13:23 UTC (rev 288631)
@@ -46,37 +46,9 @@
 bool RadioInputType::valueMissing(const String&) const
 {
     ASSERT(element());
-    auto& name = element()->name();
-    if (auto* buttons = element()->radioButtonGroups())
-        return !buttons->checkedButtonForGroup(name) && buttons->isInRequiredGroup(*element());
-
-    if (name.isEmpty())
-        return false;
-
-    bool isRequired = false;
-    for (auto& input : inclusiveDescendantsOfType<HTMLInputElement>(element()->rootNode())) {
-        if (!input.isRadioButton() || input.form() || input.name() != name)
-            continue;
-        if (input.checked())
-            return false;
-        if (input.isRequired())
-            isRequired = true;
-    }
-    return isRequired;
+    return element()->isInRequiredRadioButtonGroup() && !element()->checkedRadioButtonForGroup();
 }
 
-void RadioInputType::willUpdateCheckedness(bool nowChecked)
-{
-    if (!nowChecked)
-        return;
-    if (element()->radioButtonGroups()) {
-        // Buttons in RadioButtonGroups are handled in HTMLInputElement::setChecked().
-        return;
-    }
-    if (auto input = element()->checkedRadioButtonForGroup())
-        input->setChecked(false);
-}
-
 String RadioInputType::valueMissingText() const
 {
     return validationMessageValueMissingForRadioText();

Modified: trunk/Source/WebCore/html/RadioInputType.h (288630 => 288631)


--- trunk/Source/WebCore/html/RadioInputType.h	2022-01-26 18:59:44 UTC (rev 288630)
+++ trunk/Source/WebCore/html/RadioInputType.h	2022-01-26 19:13:23 UTC (rev 288631)
@@ -52,7 +52,6 @@
     void willDispatchClick(InputElementClickState&) final;
     void didDispatchClick(Event&, const InputElementClickState&) final;
     bool matchesIndeterminatePseudoClass() const final;
-    void willUpdateCheckedness(bool nowChecked) final;
 };
 
 } // namespace WebCore
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to