-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
html: Add tests for SubmitEvent interface #19562
Conversation
Specification PR: whatwg/html#4984
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look great, ideally we also have a manual test (maybe they can be automated now) where we hit enter inside a text input which causes the browser to select the submitter.
A way to trigger implicit submission is not standardized. https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission I remember we had a discussion about how to handle tests for such de-facto behavior in WPT, but I don't remember the result. |
I guess we can add a manual test for now? Both scenarios of having a submit button and not having one are interesting, as in the latter case the submitter would be the |
My memory is that we put them in separate files with a suffix like .optional and a HTML comment explaining how it is testing a common or "should" behavior, but that failures can be OK because it is not testing a fully-standardized behavior. |
https://web-platform-tests.org/writing-tests/file-names.html |
Thanks! I added implicit-submission.optional.html. |
html/semantics/forms/form-submission-0/implicit-submission.optional.html
Outdated
Show resolved
Hide resolved
html/semantics/forms/form-submission-0/form-submission-algorithm.html
Outdated
Show resolved
Hide resolved
It has a submitter attribute, so this fixes #3195. As part of this, update requestSubmit() to accept null, so that requestSubmit(e.submitter) always works. (e.submitter is null for implicit submission, per the discussion in #3195 (comment).) Tests: web-platform-tests/wpt#19562
html/semantics/forms/form-submission-0/resources/targetted-form.js
Outdated
Show resolved
Hide resolved
It has a submitter attribute, so this fixes #3195. As part of this, update requestSubmit() to accept null, so that requestSubmit(e.submitter) always works. (e.submitter is null for implicit submission, per the discussion in #3195 (comment).) Tests: web-platform-tests/wpt#19562
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nothing wrong
Specification PR: whatwg/html#4984