WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 239070
234069
A FormData constructed in the form's submit event listener shouldn't include the submitter
https://bugs.webkit.org/show_bug.cgi?id=234069
Summary
A FormData constructed in the form's submit event listener shouldn't include ...
Andreu Botella
Reported
2021-12-08 23:37:48 PST
WPT test:
https://wpt.fyi/results/html/semantics/forms/form-submission-0/constructing-form-data-set.html?label=experimental&label=master&aligned
In the spec, the "construct the entry list" algorithm is passed an optional "submitter" argument, which it uses to determine whether to include a button in the entry list. And the FormData constructor calls "construct the entry list" with no optional parameters. But in WebKit, a FormData object constructed in the form's submit event listener will contain the submitter in its entry list. This happens because in WebKit, the submitter is tracked by setting an input's m_isActivatedSubmit state, and when submit buttons are activated, the state is set, the form is submitted, and the state is then unset (in HTMLButtonElement::defaultEventHandler, ImageInputType::handleDOMActivateEvent, SubmitInputType::handleDOMActivateEvent). So the submitter state stays on during the entire form submission algorithm, including when firing the submit event. However, it seems like HTMLFormElement::submit also sets the submitter's m_isActivatedSubmit state, since otherwise no submitter would show up for implicit submission and form.requestSubmit() with no arguments. So it seems like setting the state in the activation handlers would be unnecessary.
Attachments
Patch
(6.28 KB, patch)
2021-12-13 11:57 PST
,
Andreu Botella
no flags
Details
Formatted Diff
Diff
Patch
(8.77 KB, patch)
2022-02-13 10:12 PST
,
Andreu Botella
no flags
Details
Formatted Diff
Diff
Patch
(14.38 KB, patch)
2022-02-20 06:23 PST
,
Andreu Botella
ews-feeder
: commit-queue-
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Andreu Botella
Comment 1
2021-12-13 11:57:06 PST
Created
attachment 447040
[details]
Patch
EWS
Comment 2
2021-12-13 15:32:30 PST
Committed
r286988
(?): <
https://commits.webkit.org/r286988
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 447040
[details]
.
Radar WebKit Bug Importer
Comment 3
2021-12-13 15:33:21 PST
<
rdar://problem/86437179
>
WebKit Commit Bot
Comment 4
2022-02-01 23:29:24 PST
Re-opened since this is blocked by
bug 236006
Aditya Keerthi
Comment 5
2022-02-01 23:36:59 PST
This change is being reverted in
https://bugs.webkit.org/show_bug.cgi?id=236006
as it broke form submission for forms containing multiple <input type="image">. This is the failure scenario: ``` <form enctype="multipart/form-data" method="post"> <input name="foo" type="image" alt="foo"> <input name="bar" type="image" alt="bar"> </form> ``` Before this change, the following (correct) request was generated: ``` ------WebKitFormBoundaryPAHF32AEjrF9R0YH Content-Disposition: form-data; name="bar.x" 10 ------WebKitFormBoundaryPAHF32AEjrF9R0YH Content-Disposition: form-data; name="bar.y" 4 ------WebKitFormBoundaryPAHF32AEjrF9R0YH-- ``` After the change, the following (incorrect) request was generated: ``` ------WebKitFormBoundaryRa2do7IyOliqOhG6 Content-Disposition: form-data; name="foo.x" 0 ------WebKitFormBoundaryRa2do7IyOliqOhG6 Content-Disposition: form-data; name="foo.y" 0 ------WebKitFormBoundaryRa2do7IyOliqOhG6-- ```
Andreu Botella
Comment 6
2022-02-08 13:08:07 PST
Blocked by
bug 236324
.
Andreu Botella
Comment 7
2022-02-13 10:12:00 PST
Created
attachment 451822
[details]
Patch
Darin Adler
Comment 8
2022-02-13 11:06:00 PST
Comment on
attachment 451822
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=451822&action=review
r=me except we need a patch with a corrected ChangeLog. So please don’t commit this without fixing that. Also please consider my comment about the new test.
> LayoutTests/fast/forms/image/multiple-image-inputs.html:6 > + description("Multiple image inputs should work correctly.");
We’re missing a change log entry for this test and its expected result. That would be in LayoutTests/ChangeLog. Also wondering why we need our own WebKit-specific test for this. Could we have added this testing to WPT?
Andreu Botella
Comment 9
2022-02-16 10:59:55 PST
> Also wondering why we need our own WebKit-specific test for this. Could we > have added this testing to WPT?
I didn't add this test to WPT because Firefox doesn't seem to use the position of mouse events when determining the selected coordinate. The spec doesn't say anything about mouse events in that regard, so WebKit and Blink might be wrong here, but that's not what I meant to test. In any case, I'll rewrite it as a WebDriver WPT test.
Andreu Botella
Comment 10
2022-02-20 06:23:41 PST
Created
attachment 452693
[details]
Patch
EWS Watchlist
Comment 11
2022-02-20 06:26:16 PST
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see
https://trac.webkit.org/wiki/WPTExportProcess
Darin Adler
Comment 12
2022-02-21 12:23:14 PST
Looks like the test is not working yet on the ios-wk2 EWS, which runs tests on the iOS simulator.
Tim Nguyen (:ntim)
Comment 13
2022-03-01 10:50:21 PST
(In reply to Darin Adler from
comment #12
)
> Looks like the test is not working yet on the ios-wk2 EWS, which runs tests > on the iOS simulator.
iOS doesn't support test_driver.Actions, so in this case having a special iOS baseline is fine.
Tim Nguyen (:ntim)
Comment 14
2022-06-01 13:33:39 PDT
*** This bug has been marked as a duplicate of
bug 239070
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug