Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Issue 2340213002: submit() in submit event handler should not contains a value of a submit button. (Closed)

Created:
4 years, 3 months ago by tkent
Modified:
4 years, 3 months ago
Reviewers:
keishi
CC:
blink-reviews, blink-reviews-html_chromium.org, chromium-reviews, dglazkov+blink, gavinp+loader_chromium.org, Nate Chapin, loading-reviews_chromium.org, tyoshino+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

submit() in submit event handler should not contains a value of a submit button. The value of a submit button is appended to a FormData if its activatedSubmit flag is set. In a case of form.submit() is called in submit event handler, we did: 1. Set activatedSubmit flag of the submit button 2. Dispatch submit event 2.1. form.submit() builds FormData 3. Build FormData if the submit event was not prevented 4. Clear activatedSubmit flag of the submit button In step 2.1, we should not include the submit button. So, this CL changes the process as follows: 1. Dispatch submit event 1.1 form.submit() builds FormData 2. If the submit event was not prevented, 2.1. Set activatedSubmit flag of the submit button 2.2. Build FormData 2.3. Clear activatedSubmit flag of the submit button Implementation: We called setActivatedSubmit() before/after prepareForSubmission(). Instead, we pass a submit button element to prepareForSubmission(), and call setActivatedSubmit() just before/after building FormData. BUG=646790 Committed: https://crrev.com/864df709bb6b675152537a276723c2d0a8757e48 Cr-Commit-Position: refs/heads/master@{#419073}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -60 lines) Patch
A third_party/WebKit/LayoutTests/fast/forms/form-submit-in-submit-event.html View 1 chunk +22 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLButtonElement.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormElement.h View 2 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/html/HTMLFormElement.cpp View 8 chunks +20 lines, -37 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/ImageInputType.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/html/forms/SubmitInputType.cpp View 1 chunk +1 line, -3 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FormSubmission.h View 2 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/loader/FormSubmission.cpp View 3 chunks +5 lines, -11 lines 0 comments Download

Messages

Total messages: 13 (8 generated)
tkent
keishi@, would you review this please?
4 years, 3 months ago (2016-09-15 02:10:43 UTC) #5
keishi
LGTM
4 years, 3 months ago (2016-09-16 01:32:41 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2340213002/1
4 years, 3 months ago (2016-09-16 01:34:32 UTC) #10
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 3 months ago (2016-09-16 01:40:52 UTC) #11
commit-bot: I haz the power
4 years, 3 months ago (2016-09-16 01:43:25 UTC) #13
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/864df709bb6b675152537a276723c2d0a8757e48
Cr-Commit-Position: refs/heads/master@{#419073}

Powered by Google App Engine
This is Rietveld 408576698