Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / use-clipped-hit.svg
blob1585524111f68391b1732015285e3f7ec9e73311
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
3 <svg version="1.1" baseProfile="basic" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="svg-root" width="100%" height="100%" onload="runRepaintAndPixelTest()">
4 <script xlink:href="../../fast/repaint/resources/text-based-repaint.js"/>
5 <script type="text/ecmascript"><![CDATA[
6 var states = [];
7 var clicked;
8 function testClickAt(x, y) {
9 eventSender.mouseMoveTo(x, y);
10 eventSender.mouseDown();
11 eventSender.mouseUp();
12 states.push(clicked);
13 clicked = false;
15 function checkResults() {
16 var testAgainst = [true, false];
17 for (var i = 0; i < testAgainst.length; i++) {
18 if (testAgainst[i] != states[i]) {
19 alert("was: " + states);
20 alert("shouldBe: " + testAgainst);
21 return false;
24 return true;
27 function repaintTest() {
28 if (window.eventSender) {
29 testClickAt(105, 55);
30 testClickAt(95, 55);
31 document.getElementById("status").textContent = "Failed";
32 if (checkResults())
33 document.getElementById("status").textContent = "Passed";
34 } else {
35 // in manual mode
36 alert("Please use run-webkit-tests.");
39 ]]></script>
40 <defs>
41 <symbol id="buttonRect" overflow="hidden">
42 <rect x="-70" y="-10" width="140" height="20" fill="gainsboro" stroke="dimgray" stroke-width="1" />
43 </symbol>
44 </defs>
45 <use x="100" y="50" onmousedown="clicked=true;" xlink:href="#buttonRect"/>
46 <text id="status" x="90" y="130">Unknown</text>
47 </svg>