Changeset 289615 in webkit
- Timestamp:
- Feb 11, 2022 2:52:38 AM (5 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/ImageInputType.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r289612 r289615 1 2022-02-11 Andreu Botella <andreu@andreubotella.com> 2 3 Clicking on an <input type="image"> will submit the form with null submitter 4 https://bugs.webkit.org/show_bug.cgi?id=236324 5 6 Add a test to make sure that when the form is submitted through an <input type="image"> 7 control, the `submitter` field of the submit event is that control. 8 9 Reviewed by Carlos Garcia Campos. 10 11 * web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt: 12 * web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html: 13 1 14 2022-02-11 Youenn Fablet <youenn@apple.com> 2 15 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm-expected.txt
r284818 r289615 1 1 2 2 3 … … 15 16 PASS If form's firing submission events is true, then return; 'submit' event 16 17 PASS firing an event named submit; clicking a submit button 18 PASS firing an event named submit; clicking an image button 17 19 PASS firing an event named submit; form.requestSubmit() 18 20 PASS firing an event named submit; form.requestSubmit(null) -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html
r263987 r289615 85 85 86 86 promise_test(async () => { 87 let form = populateForm('<input type=image name=n1>'); 88 let iframe = form.previousSibling; 89 let submitter = form.querySelector('input[type=image]'); 90 let event; 91 form.addEventListener('submit', e => { event = e; }); 92 submitter.click(); 93 await loadPromise(iframe); 94 assert_true(event.bubbles); 95 assert_true(event.cancelable); 96 assert_equals(event.submitter, submitter); 97 assert_true(event instanceof SubmitEvent); 98 }, 'firing an event named submit; clicking an image button'); 99 100 promise_test(async () => { 87 101 let form = populateForm(''); 88 102 let iframe = form.previousSibling; -
trunk/Source/WebCore/ChangeLog
r289612 r289615 1 2022-02-11 Andreu Botella <andreu@andreubotella.com> 2 3 Clicking on an <input type="image"> will submit the form with null submitter 4 https://bugs.webkit.org/show_bug.cgi?id=236324 5 6 Reviewed by Carlos Garcia Campos. 7 8 If you submit a form by clicking on an <input type="image"> control, the control will be in 9 the form's entry list, but the submitter field in the submit event will be null. This is 10 wrong per the spec, and caused because the call to `HTMLFormElement::submitIfPossible()` in 11 `ImageInputType::handleDOMActivateEvent()` calls it with one argument, rather than passing 12 the element as the submitter. 13 14 Tests: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/form-submission-algorithm.html 15 16 * html/ImageInputType.cpp: 17 (WebCore::ImageInputType::handleDOMActivateEvent): 18 1 19 2022-02-11 Youenn Fablet <youenn@apple.com> 2 20 -
trunk/Source/WebCore/html/ImageInputType.cpp
r288955 r289615 105 105 106 106 if (auto currentForm = protectedElement->form()) 107 currentForm->submitIfPossible(&event ); // Event handlers can run.107 currentForm->submitIfPossible(&event, element()); // Event handlers can run. 108 108 109 109 protectedElement->setActivatedSubmit(false);
Note: See TracChangeset
for help on using the changeset viewer.