test_focus_abspos.html (954B)
1 <!doctype html> 2 <title>Test for bug 1424633: clicking on an oof descendant focus its focusable ancestor</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <script src="/tests/SimpleTest/EventUtils.js"></script> 6 <style> 7 #focusable { 8 width: 100px; 9 height: 100px; 10 background-color: blue; 11 } 12 #oof { 13 background-color: green; 14 position: absolute; 15 top: 25px; 16 } 17 </style> 18 <div tabindex="0" id="focusable"> 19 <span id="oof">Absolute</span> 20 </div> 21 <script> 22 window.onload = function() { 23 async_test(function(t) { 24 document.body.offsetTop; 25 setTimeout(t.step_func_done(function() { 26 let span = document.querySelector("#oof"); 27 synthesizeMouseAtCenter(span, {type: "mousedown"}); 28 assert_equals(document.activeElement, document.querySelector("#focusable")); 29 }), 0); 30 }, "Clicking on an abspos descendant focus its focusable ancestor"); 31 } 32 </script>