Bug 1635049 [wpt PR 23380] - HTML: <form>'s invalid event is not to be supported, a=testonly
authorAnne van Kesteren <annevk@annevk.nl>
Wed, 13 May 2020 04:00:28 +0000
changeset 531041 0b99e6631600b7ebb7392a0a93dc7f2744094404
parent 531040 fab19539112dbaee2e26c7acb96bd4b68a24c3eb
child 531042 44b819d83fc8d23ef6521e7f9dcd7e0197faed23
push id37435
push userapavel@mozilla.com
push dateWed, 20 May 2020 15:28:23 +0000
treeherdermozilla-central@5415da14ec9a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1635049, 23380
milestone78.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1635049 [wpt PR 23380] - HTML: <form>'s invalid event is not to be supported, a=testonly Automatic update from web-platform-tests HTML: <form>'s invalid event is not to be supported For https://github.com/whatwg/html/pull/5507. -- wpt-commits: 83f157c2f450ede737c0a76c32df701159b38d20 wpt-pr: 23380
testing/web-platform/tests/html/semantics/forms/form-submission-0/historical.window.js
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/form-submission-0/historical.window.js
@@ -0,0 +1,19 @@
+// META: script=./resources/targetted-form.js
+
+test(t => {
+  const form = populateForm('<input required><input type=submit>');
+  t.add_cleanup(() => {
+    form.previousElementSibling.remove();
+    form.remove();
+  });
+  const submitter = form.querySelector('input[type=submit]');
+  let invalid = form.querySelector('[required]');
+  let targets = [];
+  const listener = e => targets.push(e.target.localName);
+  form.addEventListener("invalid", t.step_func(listener));
+  form.oninvalid = t.step_func(listener);
+  invalid.addEventListener("invalid", t.step_func(listener));
+  invalid.oninvalid = t.step_func(listener);
+  submitter.click();
+  assert_array_equals(targets, ["input", "input"]);
+}, "invalid event is only supported for form controls");