Synthetic submit event should not trigger form submitting
Categories
(Core :: DOM: Core & HTML, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | affected |
People
(Reporter: xidorn, Assigned: smaug)
References
Details
Attachments
(2 files)
Steps to reproduce:
- open the attached testcase
- click the "submit" button
Expected result:
The button becomes disabled, and the page doesn't refresh.
Actual result:
The page refreshes.
Explanation:
When the button is clicked, it disables itself and dispatch a submit
event to a <form>
. This submit
event makes the form submit while it shouldn't.
In the HTML spec, firing submit
event is one step of form submit algorithm, and its return value is checked for whether the algorithm should continue. Given that, I don't think dispatching a synthetic submit
event should trigger the form submitting again. (Unless I'm missing something?)
Chrome doesn't have this behavior, i.e. this synthetic submit
event doesn't trigger form submitting.
This cause webcompat issue for login page of https://www.canva.com/ on Android (because it dispatches a submit
event manually in some touch event handler, which doesn't affect desktop).
In addition to that, invoking preventDefault()
in handler of submit
doesn't stop the form submitting when it's triggered by a synthetic submit
event.
Reporter | ||
Comment 1•5 years ago
|
||
This cause webcompat issue for login page of https://www.canva.com/ on Android (because it dispatches a submit event manually in some touch event handler, which doesn't affect desktop).
To make it clearer, Firefox users on Android cannot login to Canva because of this issue.
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Updated•5 years ago
|
Assignee | ||
Comment 2•5 years ago
|
||
Assignee | ||
Comment 3•5 years ago
|
||
remote: Follow the progress of your build on Treeherder:
remote: https://treeherder.mozilla.org/#/jobs?repo=try&revision=7d168fa74e5663d7ddcb99128ebc26247b66ab1d
remote: recorded changegroup in replication log in 0.047s
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c8c4ac7eacee Synthetic submit event should not trigger form submitting, r=baku
Comment 5•5 years ago
|
||
bugherder |
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/16001 for changes under testing/web-platform/tests
Pushed by opettay@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e6e1347abf34 backout because bug 1537555, r=backout
Assignee | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 8•5 years ago
|
||
bugherder |
Reporter | ||
Updated•5 years ago
|
Updated•5 years ago
|
Comment 9•5 years ago
|
||
See bug 1547409. Moving webcompat whiteboard tags to project flags.
Comment 10•5 years ago
|
||
Should this be closed as a dupe of Bug 1370630?
Reporter | ||
Comment 11•5 years ago
|
||
Probably. The description of bug is quite different bug as far as the patch is effectively the same, I guess we can mark them duplicate.
If that bug ends up doing something different, then maybe we should reopen this one.
Updated•5 years ago
|
Updated•5 years ago
|
Description
•