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