Skip to content

HTML: <form>'s invalid event is not to be supported#23380

Merged
annevk merged 2 commits intomasterfrom
annevk/form-invalid
May 4, 2020
Merged

HTML: <form>'s invalid event is not to be supported#23380
annevk merged 2 commits intomasterfrom
annevk/form-invalid

Conversation

@annevk
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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