Title: [288955] trunk
Revision
288955
Author
[email protected]
Date
2022-02-02 09:19:22 -0800 (Wed, 02 Feb 2022)

Log Message

Unreviewed, reverting r286988.
https://bugs.webkit.org/show_bug.cgi?id=236006

Broke form submission for multiple <input type='image'>

Reverted changeset:

"A FormData constructed in the form's submit event listener
shouldn't include the submitter"
https://bugs.webkit.org/show_bug.cgi?id=234069
https://commits.webkit.org/r286988

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (288954 => 288955)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-02 17:19:22 UTC (rev 288955)
@@ -1,3 +1,17 @@
+2022-02-02  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r286988.
+        https://bugs.webkit.org/show_bug.cgi?id=236006
+
+        Broke form submission for multiple <input type='image'>
+
+        Reverted changeset:
+
+        "A FormData constructed in the form's submit event listener
+        shouldn't include the submitter"
+        https://bugs.webkit.org/show_bug.cgi?id=234069
+        https://commits.webkit.org/r286988
+
 2022-02-02  Martin Robinson  <[email protected]>
 
         scroll-margin-top doesn't work on inline elements

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt (288954 => 288955)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt	2022-02-02 17:19:22 UTC (rev 288955)
@@ -21,5 +21,5 @@
 PASS "formData" IDL attribute should have entries for form-associated elements in the first event handler, and the second handler can read entries set by the first handler.
 PASS Entries added to "formData" IDL attribute should be submitted.
 PASS Entries added to the "formdata" IDL attribute shouldn't be newline normalized in the resulting FormData
-PASS The constructed FormData object should not contain an entry for the submit button that was used to submit the form.
+FAIL The constructed FormData object should not contain an entry for the submit button that was used to submit the form. assert_false: expected false got true
 

Modified: trunk/Source/WebCore/ChangeLog (288954 => 288955)


--- trunk/Source/WebCore/ChangeLog	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/Source/WebCore/ChangeLog	2022-02-02 17:19:22 UTC (rev 288955)
@@ -1,3 +1,17 @@
+2022-02-02  Commit Queue  <[email protected]>
+
+        Unreviewed, reverting r286988.
+        https://bugs.webkit.org/show_bug.cgi?id=236006
+
+        Broke form submission for multiple <input type='image'>
+
+        Reverted changeset:
+
+        "A FormData constructed in the form's submit event listener
+        shouldn't include the submitter"
+        https://bugs.webkit.org/show_bug.cgi?id=234069
+        https://commits.webkit.org/r286988
+
 2022-02-02  Youenn Fablet  <[email protected]>
 
         RealtimeVideoSource::adaptVideoSample should not create IOSurfaces when running in WebProcess

Modified: trunk/Source/WebCore/html/HTMLButtonElement.cpp (288954 => 288955)


--- trunk/Source/WebCore/html/HTMLButtonElement.cpp	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/Source/WebCore/html/HTMLButtonElement.cpp	2022-02-02 17:19:22 UTC (rev 288955)
@@ -146,6 +146,7 @@
 
             if (auto currentForm = form()) {
                 if (m_type == SUBMIT) {
+                    SetForScope<bool> activatedSubmitState(m_isActivatedSubmit, true);
                     currentForm->submitIfPossible(&event, this);
                 }
 

Modified: trunk/Source/WebCore/html/ImageInputType.cpp (288954 => 288955)


--- trunk/Source/WebCore/html/ImageInputType.cpp	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/Source/WebCore/html/ImageInputType.cpp	2022-02-02 17:19:22 UTC (rev 288955)
@@ -87,6 +87,8 @@
 
     Ref<HTMLFormElement> protectedForm(*protectedElement->form());
 
+    protectedElement->setActivatedSubmit(true);
+
     m_clickLocation = IntPoint();
     if (event.underlyingEvent()) {
         Event& underlyingEvent = *event.underlyingEvent();
@@ -104,6 +106,7 @@
     if (auto currentForm = protectedElement->form())
         currentForm->submitIfPossible(&event); // Event handlers can run.
 
+    protectedElement->setActivatedSubmit(false);
     event.setDefaultHandled();
 }
 

Modified: trunk/Source/WebCore/html/SubmitInputType.cpp (288954 => 288955)


--- trunk/Source/WebCore/html/SubmitInputType.cpp	2022-02-02 16:57:05 UTC (rev 288954)
+++ trunk/Source/WebCore/html/SubmitInputType.cpp	2022-02-02 17:19:22 UTC (rev 288955)
@@ -74,8 +74,10 @@
     // the Form or button relationships.
     protectedElement->document().updateLayoutIgnorePendingStylesheets();
 
+    protectedElement->setActivatedSubmit(true);
     if (RefPtr currentForm = protectedElement->form())
         currentForm->submitIfPossible(&event, element()); // Event handlers can run.
+    protectedElement->setActivatedSubmit(false);
     event.setDefaultHandled();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to