test_non-scaling-stroke.html (1544B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=829085 5 --> 6 <head> 7 <title>Test for Bug 829085 - non-scaling-stroke hit testing</title> 8 <meta charset="utf-8"></meta> 9 <script src="/tests/SimpleTest/SimpleTest.js"></script> 10 <script src="/tests/SimpleTest/EventUtils.js"></script> 11 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 12 </head> 13 <body> 14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=829085">Mozilla Bug 829085 - non-scaling-stroke hit testing</a> 15 <p id="display"></p> 16 <div id="content"> 17 18 <svg id="svg" xmlns="http://www.w3.org/2000/svg" width="300" height="250"> 19 <rect width="100%" height="100%" fill="none" stroke-width="4" stroke="blue"/> 20 <style> 21 line:hover { stroke: lime; } 22 </style> 23 <g transform="scale(1.3) translate(100, -80) rotate(45)"> 24 <line id="line" stroke="teal" stroke-width="120px" 25 x1="50" y1="130" x2="200" y2="130" 26 vector-effect="non-scaling-stroke"></line> 27 </g> 28 </svg> 29 30 </div> 31 <pre id="test"> 32 <script type="application/javascript"> 33 34 function startTest() { 35 disableNonTestMouseEvents(true); 36 // Send a click 37 synthesizeMouseExpectEvent($("svg"), 170, 100, { }, 38 $("line"), "click", 39 "Testing mouse event on non-scaling-stroke"); 40 disableNonTestMouseEvents(false); 41 SimpleTest.finish(); 42 } 43 44 SimpleTest.waitForExplicitFinish(); 45 SimpleTest.waitForFocus(startTest); 46 47 </script> 48 </pre> 49 </body> 50 </html>