diff options
Diffstat (limited to 'testing/web-platform/tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative.html')
-rw-r--r-- | testing/web-platform/tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative.html | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative.html b/testing/web-platform/tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative.html new file mode 100644 index 0000000000..11822e4dd4 --- /dev/null +++ b/testing/web-platform/tests/html/semantics/disabled-elements/fieldset-event-propagation.tentative.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<link rel=author href="mailto:jarhar@chromium.org"> +<link rel=help href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#concept-fe-disabled"> +<link rel=help href="https://github.com/whatwg/html/issues/5886#issuecomment-1460425364"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> + +<div id=target1parent> + <fieldset disabled id=target1fieldset> + <div id=target1child>hello world</div> + </fieldset> +</div> + +<div id=target2parent> + <fieldset disabled id=target2fieldset>hello world</div> +</div> + +<script> +promise_test(async () => { + let target1parentClicked = false; + let target1childClicked = false; + let target1fieldsetClicked = false; + target1parent.onclick = () => target1parentClicked = true; + target1child.onclick = () => target1childClicked = true; + target1fieldset.onclick = () => target1fieldsetClicked = true; + + await test_driver.click(target1child); + + assert_true(target1parentClicked, 'The parent of the fieldset should receive a click event.'); + assert_true(target1childClicked, 'The child of the fieldset should receive a click event.'); + assert_true(target1fieldsetClicked, 'The fieldset element should receive a click event.'); +}, 'Disabled fieldset elements should not prevent click event propagation.'); + +promise_test(async () => { + let target2parentClicked = false; + let target2fieldsetClicked = false; + target2parent.onclick = () => target2parentClicked = true; + target2fieldset.onclick = () => target2fieldsetClicked = true; + + await test_driver.click(target2fieldset); + + assert_true(target2parentClicked, 'The parent of the fieldset should receive a click event.'); + assert_true(target2fieldsetClicked, 'The fieldset element should receive a click event.'); +}, 'Disabled fieldset elements should not block click events.'); +</script> |