[Web GPU] GPURenderPassEncoder updates: setBlendColor, setViewport, setScissorRect
[WebKit-https.git] / LayoutTests / accessibility / press-targets-center-point.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../resources/js-test-pre.js"></script>
5 <style>
6     .result {
7         font-family:monospace;
8     }
9     .target {
10         background-color:silver;
11         border:1px solid;
12         cursor:default;
13     }
14 </style>
15 <title>Press Targets Center Point</title>
16 </head>
17 <body>
18
19 <div class="target" id="t0" style="height: 18px; width:160px;">target</div>
20 <p>Actual: <span class="result" id="a0">waiting</span><br>Expected: <span class="result" id="e0">waiting</span></p>
21
22 <div class="target" id="t1" style="-webkit-transform:translate(160px, 160px); height: 18px; width:240px;">translate transform target</div>
23 <p>Actual: <span class="result" id="a1">waiting</span><br>Expected: <span class="result" id="e1">waiting</span></p>
24
25 <div class="target" id="t2" style="-webkit-writing-mode:vertical-lr; width: 18px;">vertical left-to-right writing mode target</div>
26 <p>Actual: <span class="result" id="a2">waiting</span><br>Expected: <span class="result" id="e2">waiting</span></p>
27
28 <div class="target" id="t3" style="direction:rtl; height: 18px; width:240px;">right-to-left direction target</div>
29 <p>Actual: <span class="result" id="a3">waiting</span><br>Expected: <span class="result" id="e3">waiting</span></p>
30
31 <p id="description"></p>
32 <div id="console"></div>
33
34 <script>
35     description("This tests that press targets the receiving elements center point.");
36     
37     var targetCount = document.getElementsByClassName("target").length;
38     
39     for (var i = 0; i < targetCount; ++i) {
40         (function(i) {
41             document.getElementById("t" + i).addEventListener("click", function(e) {
42                 document.getElementById("a" + i).innerHTML = "(" + e.clientX + ", " + e.clientY + ")";
43             });
44         })(i);
45         
46         var targetClientRect = document.getElementById("t" + i).getBoundingClientRect();
47         var targetClientX = Math.round(targetClientRect.left + targetClientRect.width / 2);
48         var targetClientY = Math.round(targetClientRect.top + targetClientRect.height / 2);
49         document.getElementById("e" + i).innerHTML = "(" + targetClientX + ", " + targetClientY + ")";
50     }
51     
52     if (window.accessibilityController) {
53         window.jsTestIsAsync = true;
54         
55         // Press all targets.
56         accessibilityPress(0);
57     }
58     
59     function accessibilityPress(i) {
60         if (i == targetCount)
61             finishJSTest();
62         
63         accessibilityController.accessibleElementById("t" + i).press();
64         setTimeout(function() {
65             accessibilityPress(i+1);
66         }, 10);
67     }
68 </script>
69
70 <script src="../resources/js-test-post.js"></script>
71 </body>
72 </html>