[iOS] Add iOS-specific tests and consolidate iOS-specific accessibility tests
[WebKit-https.git] / LayoutTests / platform / ios-simulator / ios / fast / events / touch / ontouchstart-active-selector.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../../../../resources/js-test-pre.js"></script>
5 <style>
6     #touchMe {
7         background-color: blue;
8         width: 200px;
9         height: 200px;
10         top: 0;
11         left: 0;
12     }
13     #touchMe:active {
14         background-color: red;
15     }
16 </style>
17 </head>
18 <body>
19 <div id="touchMe" ontouchstart=""></div>
20 <script>
21
22 description("This tests the :active selector on touchable elements");
23
24 if (!window.eventSender)
25     debug("This test will FAIL outside of DRT, but you can test it manually by touching the blue square below. If it turns red when touched, the test is a PASS.");
26
27 touchMe = document.getElementById("touchMe");
28
29 shouldBe("getComputedStyle(touchMe).backgroundColor", "'rgb(0, 0, 255)'");
30
31 if (window.eventSender) {
32     eventSender.clearTouchPoints();
33     eventSender.addTouchPoint(touchMe.offsetLeft + 10, touchMe.offsetTop + 10);
34     eventSender.touchStart();
35 }
36
37 shouldBe("getComputedStyle(touchMe).backgroundColor", "'rgb(255, 0, 0)'");
38
39 if (window.eventSender) {
40     eventSender.clearTouchPoints();
41     eventSender.touchEnd();
42 }
43
44 shouldBe("getComputedStyle(touchMe).backgroundColor", "'rgb(0, 0, 255)'");
45
46 </script>    
47 <script src="../../../../../../resources/js-test-post.js"></script>
48 </body>
49 </html>