Skip to content
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: <form>'s invalid event is not to be supported #23380

Merged
merged 2 commits into from
May 4, 2020
Merged

Conversation

annevk
Copy link
Member

@annevk annevk commented May 4, 2020

@wpt-pr-bot wpt-pr-bot added the html label May 4, 2020
@wpt-pr-bot wpt-pr-bot temporarily deployed to wpt-preview-23380 May 4, 2020 07:40 Inactive
invalid.addEventListener("invalid", t.step_func(() => counter++));
invalid.oninvalid = t.step_func(() => counter++);
submitter.click();
assert_equals(counter, 2);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A browser could theoretically pass this if it fired invalid at both the form and the control, but did not support the oninvalid property on either.

I think this would be better if each function pushed a unique value into an array, and then you did assert_array_equals. Or at least two separate counters, one for the form and one for the control.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, pushed something better.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely

annevk added a commit to whatwg/html that referenced this pull request May 4, 2020
Also tidy up some formatting.

Tests: web-platform-tests/wpt#23380.

Closes #4626.
@annevk annevk merged commit 83f157c into master May 4, 2020
@annevk annevk deleted the annevk/form-invalid branch May 4, 2020 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants