Bug 1592137 [wpt PR 19960] - Remove inDocument check for emitting change events, a=testonly
authorJoey Arhar <jarhar@chromium.org>
Mon, 04 Nov 2019 11:12:41 +0000
changeset 564762 2e965792fc82b6729811b28cc8041243cf2e2b19
parent 564761 6f5cc4b1c09a9a21b7f149546eeec6730288dfb7
child 564763 ba9a25564533962318bba8bda7f5f5bd8d8c659a
push id12351
push userffxbld-merge
push dateMon, 02 Dec 2019 11:32:26 +0000
treeherdermozilla-beta@dba4410526a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1592137, 19960, 773680, 1885093, 710642
milestone72.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 1592137 [wpt PR 19960] - Remove inDocument check for emitting change events, a=testonly Automatic update from web-platform-tests Remove inDocument check for emitting change events The html spec does not seem to say anything against emitting change events for input elements which are detached from the DOM. It does say that immutable input elements should not have change events emitted for them, but I don't think that having it detached from the DOM means that it is immutable, especially since we can successfully change the .checked value while detached from the dom. Bug: 773680 Change-Id: Ie579ed1f3c34fc03f74554a5685f40c510805f2a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1885093 Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/master@{#710642} -- wpt-commits: f2f0130e56d6893099b8e0c51fc82bc2ab4b1ce2 wpt-pr: 19960 Differential Revision: https://phabricator.services.mozilla.com/D53552
testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox-detached-change-event.html
testing/web-platform/tests/html/semantics/forms/the-input-element/radio-detached-change-event.html
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/checkbox-detached-change-event.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+async_test(t => {
+  const input = document.createElement('input');
+  input.type = 'checkbox';
+  input.addEventListener('change', t.step_func_done(() => {}));
+  input.dispatchEvent(new MouseEvent('click'));
+}, 'This test will pass if <input type=checkbox> emits change events while detached from document.body');
+</script>
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-input-element/radio-detached-change-event.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script>
+async_test(t => {
+  const input = document.createElement('input');
+  input.type = 'radio';
+  input.addEventListener('change', t.step_func_done(() => {}));
+  input.dispatchEvent(new MouseEvent('click'));
+}, 'This test will pass if <input type=radio> emits change events while detached from document.body');
+</script>