block-in-inline-hittest-float-001.html (826B)
1 <!DOCTYPE html> 2 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level"> 3 <link rel="help" href="https://drafts.csswg.org/cssom-view/#dom-document-elementfrompoint"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <style> 7 .float { 8 float: left; 9 width: 200px; 10 height: 200px; 11 background: orange; 12 } 13 </style> 14 <body> 15 <a id="a" href="#"> 16 <div> 17 <div id="target" class="float"></div> 18 </div> 19 </a> 20 <script> 21 test(() => { 22 const target_bounds = target.getBoundingClientRect(); 23 const target_x = target_bounds.x + (target_bounds.width / 2); 24 const target_y = target_bounds.y + (target_bounds.height / 2); 25 const result = document.elementFromPoint(target_x, target_y); 26 assert_equals(result, target); 27 }); 28 </script> 29 </body>