svg-root-border-radius.html (855B)
1 <!DOCTYPE html> 2 <title>SVG root with border-radius hit test</title> 3 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharnessreport.js"></script> 5 <style> 6 html, body { 7 padding: 0; 8 margin: 0; 9 } 10 svg { 11 border-radius: 50%; 12 background-color: blue; 13 } 14 </style> 15 <svg width="200" height="200"></svg> 16 <script> 17 test(t => { 18 const svgRoot = document.querySelector('svg'); 19 const body = document.body; 20 assert_equals(document.elementFromPoint(10, 10), body, 'outside top-left'); 21 assert_equals(document.elementFromPoint(190, 10), body, 'outside top-right'); 22 assert_equals(document.elementFromPoint(10, 190), body, 'outside bottom-left'); 23 assert_equals(document.elementFromPoint(190, 190), body, 'outside bottom-right'); 24 assert_equals(document.elementFromPoint(100, 100), svgRoot, 'inside'); 25 }); 26 </script>