Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / svg / custom / pointer-events-text-css-transform.svg
blob0a18d656f40102a2af61bf8d73f74fa6defa3827
1 <?xml version="1.0"?>
2 <!-- This a 1-1 copy of pointer-events-text.svg tests with the addition of -webkit-transform -->
3 <svg xmlns="http://www.w3.org/2000/svg" onload="fillTestContent()">
4 <script type="text/javascript">
5 <![CDATA[
7 if (window.testRunner)
8 testRunner.waitUntilDone();
10 var visibleValues = [ 'visible', 'hidden' ];
11 var fillValues = ['none', 'orange' ];
12 var strokeValues = ['none', 'blue' ];
14 var pointerEventsValues = ['auto', 'visiblePainted', 'visibleFill', 'visibleStroke', 'visible', 'painted', 'fill', 'stroke', 'all', 'none'];
16 var leftEdge = 100;
17 var topEdge = 30;
19 var rectSpacing = 57;
21 var svgNS = "http://www.w3.org/2000/svg";
23 function clickHit(event, identifierString) {
24 var fillText = document.getElementById('fill-text' + identifierString);
25 fillText.textContent = 'HIT';
28 function fillTestContent() {
29 var xOffset = leftEdge;
30 var yOffset = topEdge;
32 var testContent = document.getElementById("test-content");
34 for (var pi = 0; pi < pointerEventsValues.length; pi++) {
35 var eventLabel = document.createElementNS(svgNS, 'text');
36 eventLabel.setAttribute('x', 0);
37 eventLabel.setAttribute('y', yOffset + 30);
38 eventLabel.textContent = pointerEventsValues[pi];
39 testContent.appendChild(eventLabel);
41 for (var vi = 0; vi < visibleValues.length; vi++) {
42 for (var fi = 0; fi < fillValues.length; fi++) {
43 for (var si = 0; si < strokeValues.length; si++) {
45 var identString = "_" + pi + "_" + vi + "_" + fi + "_" + si;
47 var txt = document.createElementNS(svgNS, 'text');
48 txt.setAttribute('x', xOffset/2);
49 txt.setAttribute('y', yOffset/2 + 15);
50 txt.setAttribute('font-size', 20);
51 txt.setAttribute('visibility', visibleValues[vi]);
52 txt.setAttribute('fill', fillValues[fi]);
53 txt.setAttribute('stroke', strokeValues[si]);
54 txt.setAttribute('pointer-events', pointerEventsValues[pi]);
55 txt.setAttribute('style', "transform: scale(2)");
56 txt.setAttribute('onclick', 'clickHit(evt, "' + identString + '")');
57 txt.appendChild(document.createTextNode("#"));
59 testContent.appendChild(txt);
61 var fillText = document.createElementNS(svgNS, 'text');
62 fillText.setAttribute('x', xOffset + 5);
63 fillText.setAttribute('y', yOffset + 20);
64 fillText.textContent = "miss";
65 fillText.setAttribute('id', 'fill-text' + identString);
66 fillText.setAttribute('pointer-events', 'none');
67 testContent.appendChild(fillText);
69 if (window.eventSender) {
70 // Cell click
71 eventSender.mouseMoveTo(xOffset + 5, yOffset);
72 eventSender.mouseDown();
73 eventSender.mouseUp();
75 xOffset += rectSpacing;
79 xOffset = leftEdge;
80 yOffset += rectSpacing;
83 if (window.testRunner)
84 testRunner.notifyDone();
86 ]]>
87 </script>
89 <text x="110" y="20">Visibility: visible</text>
90 <text x="340" y="20">Visibility: hidden</text>
91 <g id="test-content"/>
92 </svg>