2 <svg xmlns=
"http://www.w3.org/2000/svg" onload=
"fillTestContent()">
3 <script type=
"text/javascript">
7 testRunner.waitUntilDone();
9 var visibleValues = [ 'visible', 'hidden' ];
10 var fillValues = ['none', 'orange' ];
11 var strokeValues = ['none', 'blue' ];
13 var pointerEventsValues = ['auto', 'visiblePainted', 'visibleFill', 'visibleStroke', 'visible', 'painted', 'fill', 'stroke', 'all', 'none'];
20 var svgNS =
"http://www.w3.org/2000/svg";
22 function clickHit(event, identifierString) {
23 var fillText = document.getElementById('fill-text' + identifierString);
24 fillText.textContent = 'HIT';
27 function fillTestContent() {
28 var xOffset = leftEdge;
29 var yOffset = topEdge;
31 var testContent = document.getElementById(
"test-content");
33 for (var pi =
0; pi < pointerEventsValues.length; pi++) {
34 var eventLabel = document.createElementNS(svgNS, 'text');
35 eventLabel.setAttribute('x',
0);
36 eventLabel.setAttribute('y', yOffset +
30);
37 eventLabel.textContent = pointerEventsValues[pi];
38 testContent.appendChild(eventLabel);
40 for (var vi =
0; vi < visibleValues.length; vi++) {
41 for (var fi =
0; fi < fillValues.length; fi++) {
42 for (var si =
0; si < strokeValues.length; si++) {
44 var identString =
"_" + pi +
"_" + vi +
"_" + fi +
"_" + si;
46 var txt = document.createElementNS(svgNS, 'text');
47 txt.setAttribute('x', xOffset);
48 txt.setAttribute('y', yOffset +
30);
49 txt.setAttribute('font-size',
40);
50 txt.setAttribute('visibility', visibleValues[vi]);
51 txt.setAttribute('fill', fillValues[fi]);
52 txt.setAttribute('stroke', strokeValues[si]);
53 txt.setAttribute('pointer-events', pointerEventsValues[pi]);
54 txt.setAttribute('onclick', 'clickHit(evt,
"' + identString + '")');
55 txt.appendChild(document.createTextNode(
"#"));
57 testContent.appendChild(txt);
59 var fillText = document.createElementNS(svgNS, 'text');
60 fillText.setAttribute('x', xOffset +
5);
61 fillText.setAttribute('y', yOffset +
20);
62 fillText.textContent =
"miss";
63 fillText.setAttribute('id', 'fill-text' + identString);
64 fillText.setAttribute('pointer-events', 'none');
65 testContent.appendChild(fillText);
67 if (window.eventSender) {
69 eventSender.mouseMoveTo(xOffset +
5, yOffset);
70 eventSender.mouseDown();
71 eventSender.mouseUp();
73 xOffset += rectSpacing;
78 yOffset += rectSpacing;
81 if (window.testRunner)
82 testRunner.notifyDone();
87 <text x=
"110" y=
"20">Visibility: visible
</text>
88 <text x=
"340" y=
"20">Visibility: hidden
</text>
89 <g id=
"test-content"/>