Changeset 286988 in webkit
- Timestamp:
- Dec 13, 2021 3:31:19 PM (7 months ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLButtonElement.cpp (modified) (1 diff)
-
Source/WebCore/html/ImageInputType.cpp (modified) (2 diffs)
-
Source/WebCore/html/SubmitInputType.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r286972 r286988 1 2021-12-13 Andreu Botella <andreu@andreubotella.com> 2 3 A FormData constructed in the form's submit event listener shouldn't include the submitter 4 https://bugs.webkit.org/show_bug.cgi?id=234069 5 6 Reviewed by Chris Dumez. 7 8 * web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt: 9 1 10 2021-12-13 Antti Koivisto <antti@apple.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set-expected.txt
r286427 r286988 22 22 PASS Entries added to "formData" IDL attribute should be submitted. 23 23 PASS Entries added to the "formdata" IDL attribute shouldn't be newline normalized in the resulting FormData 24 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 24 PASS The constructed FormData object should not contain an entry for the submit button that was used to submit the form. 25 25 -
trunk/Source/WebCore/ChangeLog
r286983 r286988 1 2021-12-13 Andreu Botella <andreu@andreubotella.com> 2 3 A FormData constructed in the form's submit event listener shouldn't include the submitter 4 https://bugs.webkit.org/show_bug.cgi?id=234069 5 6 Reviewed by Chris Dumez. 7 8 In the HTML spec, the "construct the entry list" algorithm takes an optional `submitter` 9 argument which it uses to determine whether a button should be included in the entry list. 10 The FormData constructor calls it with no optional arguments, so `new FormData(form)` should 11 never contain any buttons. 12 13 In WebKit, however, if a `FormData` object is constructed in the form's `submit` event 14 listener, it will contain the submitter button, if the form submission wasn't implicit. This 15 is because whether a form control is the submitter is tracked on the control, and activating 16 it sets that state for the duration of the form submission algorithm. 17 18 However, the form submission algorithm also sets a submitter's state, to deal with implicit 19 submissions. This is set only for the duration of the "construct the entry list" call, and 20 so there is no need to set the state when activating the button. 21 22 Tests: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/constructing-form-data-set.html 23 24 * html/HTMLButtonElement.cpp: 25 (WebCore::HTMLButtonElement::defaultEventHandler): 26 * html/ImageInputType.cpp: 27 (WebCore::ImageInputType::handleDOMActivateEvent): 28 * html/SubmitInputType.cpp: 29 (WebCore::SubmitInputType::handleDOMActivateEvent): 30 1 31 2021-12-13 Jean-Yves Avenard <jya@apple.com> 2 32 -
trunk/Source/WebCore/html/HTMLButtonElement.cpp
r286762 r286988 147 147 if (auto currentForm = form()) { 148 148 if (m_type == SUBMIT) { 149 SetForScope<bool> activatedSubmitState(m_isActivatedSubmit, true);150 149 currentForm->submitIfPossible(&event, this); 151 150 } -
trunk/Source/WebCore/html/ImageInputType.cpp
r286447 r286988 88 88 Ref<HTMLFormElement> protectedForm(*protectedElement->form()); 89 89 90 protectedElement->setActivatedSubmit(true);91 92 90 m_clickLocation = IntPoint(); 93 91 if (event.underlyingEvent()) { … … 107 105 currentForm->submitIfPossible(&event); // Event handlers can run. 108 106 109 protectedElement->setActivatedSubmit(false);110 107 event.setDefaultHandled(); 111 108 } -
trunk/Source/WebCore/html/SubmitInputType.cpp
r286447 r286988 75 75 protectedElement->document().updateLayoutIgnorePendingStylesheets(); 76 76 77 protectedElement->setActivatedSubmit(true);78 77 if (RefPtr currentForm = protectedElement->form()) 79 78 currentForm->submitIfPossible(&event, element()); // Event handlers can run. 80 protectedElement->setActivatedSubmit(false);81 79 event.setDefaultHandled(); 82 80 }
Note: See TracChangeset
for help on using the changeset viewer.