Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / getscreenctm-in-scrollable-svg-area.xhtml
blob53a519c145edaf851d2226fa59dfa585434164f3
1 <html xmlns="http://www.w3.org/1999/xhtml">
2 <head>
3 </head>
4 <body style="margin: 0px; padding: 0px">
6 <svg xmlns="http://www.w3.org/2000/svg" width="100%" height="4000">
7 <rect x="350" y="1950" width="100" height="100" fill="navy" fill-opacity="0.5"/>
8 <circle r="50" fill="lightcoral"/>
9 <text text-anchor="middle" x="400" y="2100">The test passes if the circle sits in the rect</text>
10 </svg>
12 <script type="text/javascript">
13 var svg = document.getElementsByTagName("svg")[0];
14 var dot = document.getElementsByTagName("circle")[0];
16 window.addEventListener("mousemove", mousemove, false);
17 window.scrollTo(0, 1700);
19 if (window.eventSender)
20 eventSender.mouseMoveTo(400, 300);
22 function mousemove(evt) {
23 var point = svg.createSVGPoint();
24 point.x = evt.clientX;
25 point.y = evt.clientY;
26 point = point.matrixTransform(svg.getScreenCTM().inverse());
27 dot.setAttribute("cx", point.x);
28 dot.setAttribute("cy", point.y);
30 </script>
31 </body>
32 </html>