summaryrefslogtreecommitdiffstats
path: root/dom/events/test/test_focus_abspos.html
diff options
context:
space:
mode:
Diffstat (limited to 'dom/events/test/test_focus_abspos.html')
-rw-r--r--dom/events/test/test_focus_abspos.html32
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>