diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /dom/events/test/test_focus_abspos.html | |
parent | Initial commit. (diff) | |
download | firefox-upstream/124.0.1.tar.xz firefox-upstream/124.0.1.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/events/test/test_focus_abspos.html')
-rw-r--r-- | dom/events/test/test_focus_abspos.html | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/dom/events/test/test_focus_abspos.html b/dom/events/test/test_focus_abspos.html new file mode 100644 index 0000000000..8798c4ed11 --- /dev/null +++ b/dom/events/test/test_focus_abspos.html @@ -0,0 +1,32 @@ +<!doctype html> +<title>Test for bug 1424633: clicking on an oof descendant focus its focusable ancestor</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/tests/SimpleTest/EventUtils.js"></script> +<style> + #focusable { + width: 100px; + height: 100px; + background-color: blue; + } + #oof { + background-color: green; + position: absolute; + top: 25px; + } +</style> +<div tabindex="0" id="focusable"> + <span id="oof">Absolute</span> +</div> +<script> +window.onload = function() { + async_test(function(t) { + document.body.offsetTop; + setTimeout(t.step_func_done(function() { + let span = document.querySelector("#oof"); + synthesizeMouseAtCenter(span, {type: "mousedown"}); + assert_equals(document.activeElement, document.querySelector("#focusable")); + }), 0); + }, "Clicking on an abspos descendant focus its focusable ancestor"); +} +</script> |